mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-05 08:48:53 +00:00
net: mlx4: slight optimization of addr compare
Use possibly more efficient ether_addr_equal to instead of memcmp. Cc: Amir Vadai <amirv@mellanox.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Acked-By: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4012dda3c1
commit
c0623e587d
@ -841,7 +841,7 @@ static void update_mclist_flags(struct mlx4_en_priv *priv,
|
||||
list_for_each_entry(dst_tmp, dst, list) {
|
||||
found = false;
|
||||
list_for_each_entry(src_tmp, src, list) {
|
||||
if (!memcmp(dst_tmp->addr, src_tmp->addr, ETH_ALEN)) {
|
||||
if (ether_addr_equal(dst_tmp->addr, src_tmp->addr)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
@ -856,7 +856,7 @@ static void update_mclist_flags(struct mlx4_en_priv *priv,
|
||||
list_for_each_entry(src_tmp, src, list) {
|
||||
found = false;
|
||||
list_for_each_entry(dst_tmp, dst, list) {
|
||||
if (!memcmp(dst_tmp->addr, src_tmp->addr, ETH_ALEN)) {
|
||||
if (ether_addr_equal(dst_tmp->addr, src_tmp->addr)) {
|
||||
dst_tmp->action = MCLIST_NONE;
|
||||
found = true;
|
||||
break;
|
||||
|
@ -3634,7 +3634,7 @@ static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header,
|
||||
!is_broadcast_ether_addr(eth_header->eth.dst_mac)) {
|
||||
list_for_each_entry_safe(res, tmp, rlist, list) {
|
||||
be_mac = cpu_to_be64(res->mac << 16);
|
||||
if (!memcmp(&be_mac, eth_header->eth.dst_mac, ETH_ALEN))
|
||||
if (ether_addr_equal((u8 *)&be_mac, eth_header->eth.dst_mac))
|
||||
return 0;
|
||||
}
|
||||
pr_err("MAC %pM doesn't belong to VF %d, Steering rule rejected\n",
|
||||
|
Loading…
Reference in New Issue
Block a user