From: Andrew Vagin <avagin@parallels.com>
To: Michael Dalton <mwdalton@google.com>
Cc: "David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
Rusty Russell <rusty@rustcorp.com.au>,
"Michael S. Tsirkin" <mst@redhat.com>,
Jason Wang <jasowang@redhat.com>,
Andrey Vagin <avagin@openvz.org>,
<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH v2] virtio-net: free bufs correctly on invalid packet length
Date: Fri, 6 Dec 2013 09:09:57 +0400 [thread overview]
Message-ID: <20131206050956.GA17752@paralelels.com> (raw)
In-Reply-To: <1386278045-23542-1-git-send-email-mwdalton@google.com>
On Thu, Dec 05, 2013 at 01:14:05PM -0800, Michael Dalton wrote:
> When a packet with invalid length arrives, ensure that the packet
> is freed correctly if mergeable packet buffers and big packets
> (GUEST_TSO4) are both enabled.
>
> Signed-off-by: Michael Dalton <mwdalton@google.com>
Acked-by: Andrew Vagin <avagin@openvz.org>
> ---
> drivers/net/virtio_net.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 916241d..6a4665c 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -426,10 +426,10 @@ static void receive_buf(struct receive_queue *rq, void *buf, unsigned int len)
> if (unlikely(len < sizeof(struct virtio_net_hdr) + ETH_HLEN)) {
> pr_debug("%s: short packet %i\n", dev->name, len);
> dev->stats.rx_length_errors++;
> - if (vi->big_packets)
> - give_pages(rq, buf);
> - else if (vi->mergeable_rx_bufs)
> + if (vi->mergeable_rx_bufs)
> put_page(virt_to_head_page(buf));
> + else if (vi->big_packets)
> + give_pages(rq, buf);
> else
> dev_kfree_skb(buf);
> return;
> --
> 1.8.5.1
>
next prev parent reply other threads:[~2013-12-06 5:13 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-05 21:14 [PATCH v2] virtio-net: free bufs correctly on invalid packet length Michael Dalton
2013-12-06 0:09 ` Michael Dalton
2013-12-06 4:20 ` Jason Wang
2013-12-06 5:09 ` Andrew Vagin
2013-12-06 5:09 ` Andrew Vagin [this message]
2013-12-06 21:32 ` David Miller
2013-12-06 23:32 ` Michael Dalton
2013-12-06 21:32 ` David Miller
2013-12-07 0:36 ` Rusty Russell
2013-12-07 0:36 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131206050956.GA17752@paralelels.com \
--to=avagin@parallels.com \
--cc=avagin@openvz.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=mwdalton@google.com \
--cc=netdev@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.