Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfp: ensure skb network header is set for packet redirect

Packets received at the NFP driver may be redirected to egress of another
netdev (e.g. in the case of OvS internal ports). On the egress path, some
processes, like TC egress hooks, may expect the network header offset
field in the skb to be correctly set. If this is not the case there is
potential for abnormal behaviour and even the triggering of BUG() calls.

Set the skb network header field before the mac header pull when doing a
packet redirect.

Fixes: 27f54b582567 ("nfp: allow fallback packets from non-reprs")
Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

John Hurley and committed by
David S. Miller
dce5cccc fcc2202a

+1
+1
drivers/net/ethernet/netronome/nfp/nfp_net_common.c
··· 1867 1867 napi_gro_receive(&rx_ring->r_vec->napi, skb); 1868 1868 } else { 1869 1869 skb->dev = netdev; 1870 + skb_reset_network_header(skb); 1870 1871 __skb_push(skb, ETH_HLEN); 1871 1872 dev_queue_xmit(skb); 1872 1873 }