aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox/mlx4/en_rx.c
diff options
context:
space:
mode:
authorYan Burman <yanb@mellanox.com>2013-02-07 02:25:20 +0000
committerDavid S. Miller <davem@davemloft.net>2013-02-07 23:26:12 -0500
commit6bbb6d99f3d2653e634657ea0d85ef4c0fc49463 (patch)
tree8edfb6633a11ebb647273271e21f4b310a5c1789 /drivers/net/ethernet/mellanox/mlx4/en_rx.c
parent79aeaccd915c527a75f2cb01682eab160bed4f48 (diff)
net/mlx4_en: Optimize Rx fast path filter checks
Currently, RX path code that does RX filtering is not optimized and does an expensive conversion. In order to use ether_addr_equal_64bits which is optimized for such cases, we need the MAC address kept by the device to be in the form of unsigned char array instead of u64. Store the MAC address as unsigned char array and convert to/from u64 out of the fast path when needed. Side effect of this is that we no longer need priv->mac, since it's the same as dev->dev_addr. This optimization was suggested by Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Yan Burman <yanb@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/en_rx.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/en_rx.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index ed214d05dd71..2e7f5bb94e1f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -606,7 +606,6 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
if (priv->flags & MLX4_EN_FLAG_RX_FILTER_NEEDED) {
struct ethhdr *ethh;
dma_addr_t dma;
- u64 s_mac;
/* Get pointer to first fragment since we haven't
* skb yet and cast it to ethhdr struct
*/
@@ -617,8 +616,8 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
frags[0].offset);
/* Drop the packet, since HW loopback-ed it */
- s_mac = mlx4_en_mac_to_u64(ethh->h_source);
- if (s_mac == priv->mac)
+ if (ether_addr_equal_64bits(dev->dev_addr,
+ ethh->h_source))
goto next;
}