Skip to contentSkip to conversation

net: igbvf: slight optimization of addr compare

PATCH Superseded Ding Tianhong 3 participants 3 messages Dec 28, 2013 – Jan 11, 2014

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 6/20 net: igbvf: slight optimization of addr compare

Use possibly more efficient ether_addr_equal to instead of memcmp.

Cc Jeff Kirsher <[email protected]>
Cc Jesse Brandeburg <[email protected]>
Cc Carolyn Wyborny <[email protected]>
Cc Don Skidmore <[email protected]>
---
 drivers/net/ethernet/intel/igbvf/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igbvf/netdev.c +1 -1
index 04bf22e..675435f 100644
@@ -1745,7 +1745,7 @@ static int igbvf_set_mac(struct net_device *netdev, void *p)
 
 	hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
 
-	if (memcmp(addr->sa_data, hw->mac.addr, 6))
+	if (!ether_addr_equal(addr->sa_data, hw->mac.addr))
 		return -EADDRNOTAVAIL;
 
 	memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
Signature · 1 line
1.8.0
#1 lore raw
Quoted 11 lines · Ding Tianhong

Use possibly more efficient ether_addr_equal to instead of memcmp.

Cc Jeff Kirsher <[email protected]>
Cc Jesse Brandeburg <[email protected]>
Cc Carolyn Wyborny <[email protected]>
Cc Don Skidmore <[email protected]>
---
 drivers/net/ethernet/intel/igbvf/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks Ding, I will update the patch in my queue with this updated version.

#2 lore raw
In reply to Ding Tianhong
Quoted 8 lines

From: [email protected] [mailto:[email protected]] On Behalf Of Ding Tianhong
Sent: Friday, December 27, 2013 10:17 PM
To: Kirsher, Jeffrey T; Brandeburg, Jesse; Wyborny, Carolyn; Skidmore, Donald C; David S. Miller; Netdev; [email protected]
Subject: [PATCH net-next v2 06/20] net: igbvf: slight optimization of addr compare

Quoted 7 lines

Use possibly more efficient ether_addr_equal to instead of memcmp.

Cc Jeff Kirsher <[email protected]>
Cc Jesse Brandeburg <[email protected]>
Cc Carolyn Wyborny <[email protected]>
Cc Don Skidmore <[email protected]>

Tested by: Aaron Brown <[email protected]>

Quoted 27 lines
---
 drivers/net/ethernet/intel/igbvf/netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igbvf/netdev.c +1 -1
index 04bf22e..675435f 100644
@@ -1745,7 +1745,7 @@ static int igbvf_set_mac(struct net_device *netdev,
 void *p)
 
 	hw->mac.ops.rar_set(hw, hw->mac.addr, 0);
 
-	if (memcmp(addr->sa_data, hw->mac.addr, 6))
+	if (!ether_addr_equal(addr->sa_data, hw->mac.addr))
 		return -EADDRNOTAVAIL;
 

memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
--
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html