netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] nfp: ensure skb network header is set for packet redirect
@ 2019-06-09  0:48 Jakub Kicinski
  2019-06-10  3:08 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2019-06-09  0:48 UTC (permalink / raw)
  To: davem; +Cc: netdev, oss-drivers, John Hurley, Jakub Kicinski

From: John Hurley <john.hurley@netronome.com>

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>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index b82b684f52ce..36a3bd30cfd9 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -1867,6 +1867,7 @@ static int nfp_net_rx(struct nfp_net_rx_ring *rx_ring, int budget)
 			napi_gro_receive(&rx_ring->r_vec->napi, skb);
 		} else {
 			skb->dev = netdev;
+			skb_reset_network_header(skb);
 			__skb_push(skb, ETH_HLEN);
 			dev_queue_xmit(skb);
 		}
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] nfp: ensure skb network header is set for packet redirect
  2019-06-09  0:48 [PATCH net] nfp: ensure skb network header is set for packet redirect Jakub Kicinski
@ 2019-06-10  3:08 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-06-10  3:08 UTC (permalink / raw)
  To: jakub.kicinski; +Cc: netdev, oss-drivers, john.hurley

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Sat,  8 Jun 2019 17:48:03 -0700

> From: John Hurley <john.hurley@netronome.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-10  3:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-09  0:48 [PATCH net] nfp: ensure skb network header is set for packet redirect Jakub Kicinski
2019-06-10  3:08 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).