From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E86B43A99; Tue, 6 Feb 2024 11:31:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3ED44402C8; Tue, 6 Feb 2024 11:31:23 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9BB8D4025E for ; Tue, 6 Feb 2024 11:31:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707215482; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E3gx40COqxgfTFWuYV+nzyUwuYZPxq/d6eIRz7OEL0Q=; b=Yak276YnMgGpShS4ASZc0B2IP1NWwrYj3eyIpVfwuk01SS4FDHJxYmAQiFem+JSx75jsny ESnBJ4xZznCcFGq3+qGpeS4m/MCHE5Dhm7yf27/nKKhLoewR51ijGRHD0Loq43ynZC/B2r VyRyCSeBmsWCPq2ovzStSXI5VfotTj8= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-139-7ktMk4StM8izRax0-V1PUw-1; Tue, 06 Feb 2024 05:31:20 -0500 X-MC-Unique: 7ktMk4StM8izRax0-V1PUw-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2d0a329e86cso5648881fa.3 for ; Tue, 06 Feb 2024 02:31:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707215479; x=1707820279; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E3gx40COqxgfTFWuYV+nzyUwuYZPxq/d6eIRz7OEL0Q=; b=sKsCy6jKPjBUWWGkZJl6aAI+SINnYmq0jTjzBDkEfUQ+CyemIhegXK8eo2tZrkh5R0 2bTBGCJ5bP3C9peQCHK0tI5q9ngOu0ICFKLbWdZ+zt6OlCY3+nOuEmcXCH7Mf9c7G8MA o52bQQ3Tcy3MFC/ANzfDte9ZhxVtv5ovOq2gmUZAGjesuPoWpdeIlF5b5TzHSy8zV+Zo I+23drhhznyLcg/M37HzaPuRkiZiB1PFDJ1xSuSDVPENPt+aizsRGvqBRZ3fpSf9sduf +9CK5FrtCPAORJb7HiOP6pRWaGLJ1a21O8fAfd3Rl3c2KPMumLACNoN6tQwOwYPSioUk 04og== X-Gm-Message-State: AOJu0YxjBa1+wkNBBXwLRWo4yABSlBFwKG9AzlM/hwhUGWH1xnAvlmp7 2K9gwMukreNBRsoAuNUJBzcShBp2kBv+akayZC4j/3H/8ul1gNQMWV16d+7aI64X7MFcPSa7D8Q lTDC9jXEMb0qHOlaCyUukxIz2eWAUWbEZ2AE9vNvA5DLYVwwU86Z5bxlo6YEPmmRMQAapwMTYmk jSOpGXN2EhSDgrTY0= X-Received: by 2002:a2e:240f:0:b0:2d0:41d1:8124 with SMTP id k15-20020a2e240f000000b002d041d18124mr1711812ljk.1.1707215479623; Tue, 06 Feb 2024 02:31:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IE8wmkNZo/5dE2vTVs3X73Metkfutt25TtAxJwHLv8FSEPxI8Yh74J7rnFInW3DdzbXP0sxZV7VSL416SheKo0= X-Received: by 2002:a2e:240f:0:b0:2d0:41d1:8124 with SMTP id k15-20020a2e240f000000b002d041d18124mr1711802ljk.1.1707215479355; Tue, 06 Feb 2024 02:31:19 -0800 (PST) MIME-Version: 1.0 References: <20240131195309.2808015-1-maxime.coquelin@redhat.com> <20240131195309.2808015-2-maxime.coquelin@redhat.com> <52fe2923-fd75-45c2-9671-e1a73ecc5834@redhat.com> In-Reply-To: <52fe2923-fd75-45c2-9671-e1a73ecc5834@redhat.com> From: David Marchand Date: Tue, 6 Feb 2024 11:31:08 +0100 Message-ID: Subject: Re: [PATCH v2 2/2] vhost: add new mbuf allocation failure statistic To: Maxime Coquelin Cc: dev@dpdk.org, chenbox@nvidia.com, bnemeth@redhat.com, echaudro@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Feb 1, 2024 at 9:29=E2=80=AFAM Maxime Coquelin wrote: > On 2/1/24 09:10, David Marchand wrote: > > On Wed, Jan 31, 2024 at 8:53=E2=80=AFPM Maxime Coquelin > > 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 > > > > 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 vhos= t_virtqueue *vq, > >> if (mbuf_avail =3D=3D 0) { > >> cur =3D rte_pktmbuf_alloc(mbuf_pool); > >> if (unlikely(cur =3D=3D NULL)) { > >> + vq->stats.mbuf_alloc_failed++; > >> VHOST_DATA_LOG(dev->ifname, ERR, > >> "failed to allocate memory fo= r 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? > > Agree, we should not have such log in the datapath. > And now that we have the stat, it is even less useful. Ok, nevertheless, you can add my: Reviewed-by: David Marchand --=20 David Marchand