From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
To: Parav Pandit <parav@nvidia.com>
Cc: <edumazet@google.com>, <pabeni@redhat.com>,
<virtualization@lists.linux-foundation.org>,
Parav Pandit <parav@nvidia.com>, <mst@redhat.com>,
<jasowang@redhat.com>, <netdev@vger.kernel.org>,
<davem@davemloft.net>, <kuba@kernel.org>
Subject: Re: [PATCH net-next 2/2] virtio_net: Reuse buffer free function
Date: Mon, 16 Jan 2023 10:28:51 +0800 [thread overview]
Message-ID: <1673836131.7281802-2-xuanzhuo@linux.alibaba.com> (raw)
In-Reply-To: <20230113223619.162405-3-parav@nvidia.com>
On Sat, 14 Jan 2023 00:36:19 +0200, Parav Pandit <parav@nvidia.com> wrote:
> virtnet_rq_free_unused_buf() helper function to free the buffer
> already exists. Avoid code duplication by reusing existing function.
>
> Signed-off-by: Parav Pandit <parav@nvidia.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> ---
> drivers/net/virtio_net.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index d45e140b6852..c1faaf11fbcd 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -1251,13 +1251,7 @@ static void receive_buf(struct virtnet_info *vi, struct receive_queue *rq,
> if (unlikely(len < vi->hdr_len + ETH_ZLEN)) {
> pr_debug("%s: short packet %i\n", dev->name, len);
> dev->stats.rx_length_errors++;
> - if (vi->mergeable_rx_bufs) {
> - put_page(virt_to_head_page(buf));
> - } else if (vi->big_packets) {
> - give_pages(rq, buf);
> - } else {
> - put_page(virt_to_head_page(buf));
> - }
> + virtnet_rq_free_unused_buf(rq->vq, buf);
> return;
> }
>
> --
> 2.26.2
>
next prev parent reply other threads:[~2023-01-16 2:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-13 22:36 [PATCH net-next 0/2] Small packet processing handling changes Parav Pandit
2023-01-13 22:36 ` [PATCH net-next 1/2] virtio_net: Fix short frame length check Parav Pandit
2023-01-13 23:24 ` Alexander H Duyck
2023-01-13 23:37 ` Parav Pandit
2023-01-14 0:23 ` Alexander Duyck
2023-01-14 0:36 ` Alexander Duyck
2023-01-14 17:44 ` Parav Pandit
2023-01-13 22:36 ` [PATCH net-next 2/2] virtio_net: Reuse buffer free function Parav Pandit
2023-01-13 23:25 ` Alexander H Duyck
2023-01-16 2:28 ` Xuan Zhuo [this message]
2023-01-14 17:46 ` [PATCH net-next 0/2] Small packet processing handling changes Parav Pandit
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=1673836131.7281802-2-xuanzhuo@linux.alibaba.com \
--to=xuanzhuo@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jasowang@redhat.com \
--cc=kuba@kernel.org \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=parav@nvidia.com \
--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 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).