From: David Marchand <david.marchand@redhat.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>
Cc: dev@dpdk.org, chenbox@nvidia.com, bnemeth@redhat.com,
echaudro@redhat.com
Subject: Re: [PATCH v2 2/2] vhost: add new mbuf allocation failure statistic
Date: Thu, 1 Feb 2024 09:10:48 +0100 [thread overview]
Message-ID: <CAJFAV8zN3NBXjk2D7coQ29HxtL--aGdYe+ynqZ47PUaHYXL1dw@mail.gmail.com> (raw)
In-Reply-To: <20240131195309.2808015-2-maxime.coquelin@redhat.com>
On Wed, Jan 31, 2024 at 8:53 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> This patch introduces a new, per virtqueue, mbuf allocation
> failure statistic. It can be useful to troubleshoot packets
> drops due to insufficient mempool size or memory leaks.
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Having a stat for such situation will be useful.
I just have one comment, though it is not really related to this change itself.
[snip]
> diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c
> index 9951842b9f..1359c5fb1f 100644
> --- a/lib/vhost/virtio_net.c
> +++ b/lib/vhost/virtio_net.c
> @@ -2996,6 +2996,7 @@ desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq,
> if (mbuf_avail == 0) {
> cur = rte_pktmbuf_alloc(mbuf_pool);
> if (unlikely(cur == NULL)) {
> + vq->stats.mbuf_alloc_failed++;
> VHOST_DATA_LOG(dev->ifname, ERR,
> "failed to allocate memory for mbuf.");
This error log here is scary as it means the datapath can be slowed
down for each multisegment mbuf in the event of a mbuf (maybe
temporary) shortage.
Besides no other mbuf allocation in the vhost library datapath
generates such log.
I would remove it, probably in a separate patch.
WDYT?
> goto error;
--
David Marchand
next prev parent reply other threads:[~2024-02-01 8:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 19:53 [PATCH v2 1/2] vhost: fix memory leak in Virtio Tx split path Maxime Coquelin
2024-01-31 19:53 ` [PATCH v2 2/2] vhost: add new mbuf allocation failure statistic Maxime Coquelin
2024-02-01 8:10 ` David Marchand [this message]
2024-02-01 8:29 ` Maxime Coquelin
2024-02-06 10:31 ` David Marchand
2024-02-06 14:59 ` Maxime Coquelin
2024-02-06 10:29 ` [PATCH v2 1/2] vhost: fix memory leak in Virtio Tx split path David Marchand
2024-02-06 13:57 ` Maxime Coquelin
2024-02-06 14:59 ` Maxime Coquelin
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=CAJFAV8zN3NBXjk2D7coQ29HxtL--aGdYe+ynqZ47PUaHYXL1dw@mail.gmail.com \
--to=david.marchand@redhat.com \
--cc=bnemeth@redhat.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=echaudro@redhat.com \
--cc=maxime.coquelin@redhat.com \
/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).