bonding: Convert memcpy(foo, bar, ETH_ALEN) to ether_addr_copy(foo, bar)
ether_addr_copy is smaller and faster for some architectures. This relies on a stack frame being at least __aligned(2) for one use of an Ethernet address on the stack. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
2ea24f2ecf
commit
ada0f8633c
@@ -768,11 +768,11 @@ static int ad_lacpdu_send(struct port *port)
|
||||
|
||||
lacpdu_header = (struct lacpdu_header *)skb_put(skb, length);
|
||||
|
||||
memcpy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr, ETH_ALEN);
|
||||
ether_addr_copy(lacpdu_header->hdr.h_dest, lacpdu_mcast_addr);
|
||||
/* Note: source address is set to be the member's PERMANENT address,
|
||||
* because we use it to identify loopback lacpdus in receive.
|
||||
*/
|
||||
memcpy(lacpdu_header->hdr.h_source, slave->perm_hwaddr, ETH_ALEN);
|
||||
ether_addr_copy(lacpdu_header->hdr.h_source, slave->perm_hwaddr);
|
||||
lacpdu_header->hdr.h_proto = PKT_TYPE_LACPDU;
|
||||
|
||||
lacpdu_header->lacpdu = port->lacpdu;
|
||||
@@ -810,11 +810,11 @@ static int ad_marker_send(struct port *port, struct bond_marker *marker)
|
||||
|
||||
marker_header = (struct bond_marker_header *)skb_put(skb, length);
|
||||
|
||||
memcpy(marker_header->hdr.h_dest, lacpdu_mcast_addr, ETH_ALEN);
|
||||
ether_addr_copy(marker_header->hdr.h_dest, lacpdu_mcast_addr);
|
||||
/* Note: source address is set to be the member's PERMANENT address,
|
||||
* because we use it to identify loopback MARKERs in receive.
|
||||
*/
|
||||
memcpy(marker_header->hdr.h_source, slave->perm_hwaddr, ETH_ALEN);
|
||||
ether_addr_copy(marker_header->hdr.h_source, slave->perm_hwaddr);
|
||||
marker_header->hdr.h_proto = PKT_TYPE_LACPDU;
|
||||
|
||||
marker_header->marker = *marker;
|
||||
|
Reference in New Issue
Block a user