mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
net: cxgb3: slight optimization of addr compare
Use possibly more efficient ether_addr_equal to instead of memcmp. Cc: Santosh Raspatur <santosh@chelsio.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8fd90de800
commit
4c1120b623
2 changed files with 2 additions and 2 deletions
|
@ -182,7 +182,7 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,
|
||||||
for_each_port(adapter, i) {
|
for_each_port(adapter, i) {
|
||||||
struct net_device *dev = adapter->port[i];
|
struct net_device *dev = adapter->port[i];
|
||||||
|
|
||||||
if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) {
|
if (ether_addr_equal(dev->dev_addr, mac)) {
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
if (vlan && vlan != VLAN_VID_MASK) {
|
if (vlan && vlan != VLAN_VID_MASK) {
|
||||||
dev = __vlan_find_dev_deep(dev, htons(ETH_P_8021Q), vlan);
|
dev = __vlan_find_dev_deep(dev, htons(ETH_P_8021Q), vlan);
|
||||||
|
|
|
@ -429,7 +429,7 @@ void t3_l2t_update(struct t3cdev *dev, struct neighbour *neigh)
|
||||||
} else {
|
} else {
|
||||||
e->state = neigh->nud_state & NUD_CONNECTED ?
|
e->state = neigh->nud_state & NUD_CONNECTED ?
|
||||||
L2T_STATE_VALID : L2T_STATE_STALE;
|
L2T_STATE_VALID : L2T_STATE_STALE;
|
||||||
if (memcmp(e->dmac, neigh->ha, 6))
|
if (!ether_addr_equal(e->dmac, neigh->ha))
|
||||||
setup_l2e_send_pending(dev, NULL, e);
|
setup_l2e_send_pending(dev, NULL, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue