Commit ea29bd30 authored by Eugenia Emantayev's avatar Eugenia Emantayev Committed by David S. Miller

net/mlx5e: Fix loopback selftest

Change packet type handler to ETH_P_IP instead of ETH_P_ALL
since we are already expecting an IP packet.

Also, using ETH_P_ALL will cause the loopback test packet type handler
to be called on all outgoing packets, especially our own self loopback
test SKB, which will be validated on xmit as well, and we don't want that.

Tested with:
ethtool -t ethX
validated that the loopback test passes.

Fixes: 0952da79 ('net/mlx5e: Add support for loopback selftest')
Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 65ba8fb7
...@@ -204,9 +204,6 @@ mlx5e_test_loopback_validate(struct sk_buff *skb, ...@@ -204,9 +204,6 @@ mlx5e_test_loopback_validate(struct sk_buff *skb,
struct iphdr *iph; struct iphdr *iph;
/* We are only going to peek, no need to clone the SKB */ /* We are only going to peek, no need to clone the SKB */
if (skb->protocol != htons(ETH_P_IP))
goto out;
if (MLX5E_TEST_PKT_SIZE - ETH_HLEN > skb_headlen(skb)) if (MLX5E_TEST_PKT_SIZE - ETH_HLEN > skb_headlen(skb))
goto out; goto out;
...@@ -249,7 +246,7 @@ static int mlx5e_test_loopback_setup(struct mlx5e_priv *priv, ...@@ -249,7 +246,7 @@ static int mlx5e_test_loopback_setup(struct mlx5e_priv *priv,
lbtp->loopback_ok = false; lbtp->loopback_ok = false;
init_completion(&lbtp->comp); init_completion(&lbtp->comp);
lbtp->pt.type = htons(ETH_P_ALL); lbtp->pt.type = htons(ETH_P_IP);
lbtp->pt.func = mlx5e_test_loopback_validate; lbtp->pt.func = mlx5e_test_loopback_validate;
lbtp->pt.dev = priv->netdev; lbtp->pt.dev = priv->netdev;
lbtp->pt.af_packet_priv = lbtp; lbtp->pt.af_packet_priv = lbtp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment