提交 8981f010 编写于 作者: H Herbert Xu 提交者: David S. Miller

virtio_net: Fix IP alignment on non-mergeable RX path

We need to enforce the IP alignment on the non-mergeable RX path just
like the other RX path.  Not doing so results in misaligned IP
headers.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 adf76cfe
...@@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi) ...@@ -283,10 +283,11 @@ static void try_fill_recv_maxbufs(struct virtnet_info *vi)
for (;;) { for (;;) {
struct virtio_net_hdr *hdr; struct virtio_net_hdr *hdr;
skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN); skb = netdev_alloc_skb(vi->dev, MAX_PACKET_LEN + NET_IP_ALIGN);
if (unlikely(!skb)) if (unlikely(!skb))
break; break;
skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, MAX_PACKET_LEN); skb_put(skb, MAX_PACKET_LEN);
hdr = skb_vnet_hdr(skb); hdr = skb_vnet_hdr(skb);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册