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.
Unified · Split
| @@ -1867,6 +1867,7 @@ static int nfp_net_rx(struct nfp_net_rx_ring *rx_ring, int budget) · 1866 unmodified lines | |||
| 1867 | napi_gro_receive(&rx_ring->r_vec->napi, skb); | 1867 | napi_gro_receive(&rx_ring->r_vec->napi, skb); |
| 1868 | } else { | 1868 | } else { |
| 1869 | skb->dev = netdev; | 1869 | skb->dev = netdev; |
| 1870 | skb_reset_network_header(skb); | ||
| 1870 | __skb_push(skb, ETH_HLEN); | 1871 | __skb_push(skb, ETH_HLEN); |
| 1871 | dev_queue_xmit(skb); | 1872 | dev_queue_xmit(skb); |
| 1872 | } | 1873 | } |