diff options
-rw-r--r-- | drivers/net/virtio_net.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 326e2476153d..032e1ac10a30 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -707,6 +707,13 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, | |||
707 | void *data; | 707 | void *data; |
708 | u32 act; | 708 | u32 act; |
709 | 709 | ||
710 | /* Transient failure which in theory could occur if | ||
711 | * in-flight packets from before XDP was enabled reach | ||
712 | * the receive path after XDP is loaded. | ||
713 | */ | ||
714 | if (unlikely(hdr->hdr.gso_type)) | ||
715 | goto err_xdp; | ||
716 | |||
710 | /* This happens when rx buffer size is underestimated | 717 | /* This happens when rx buffer size is underestimated |
711 | * or headroom is not enough because of the buffer | 718 | * or headroom is not enough because of the buffer |
712 | * was refilled before XDP is set. This should only | 719 | * was refilled before XDP is set. This should only |
@@ -727,14 +734,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, | |||
727 | xdp_page = page; | 734 | xdp_page = page; |
728 | } | 735 | } |
729 | 736 | ||
730 | /* Transient failure which in theory could occur if | ||
731 | * in-flight packets from before XDP was enabled reach | ||
732 | * the receive path after XDP is loaded. In practice I | ||
733 | * was not able to create this condition. | ||
734 | */ | ||
735 | if (unlikely(hdr->hdr.gso_type)) | ||
736 | goto err_xdp; | ||
737 | |||
738 | /* Allow consuming headroom but reserve enough space to push | 737 | /* Allow consuming headroom but reserve enough space to push |
739 | * the descriptor on if we get an XDP_TX return code. | 738 | * the descriptor on if we get an XDP_TX return code. |
740 | */ | 739 | */ |