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 3405E43A32; Thu, 1 Feb 2024 09:11:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 109BC40299; Thu, 1 Feb 2024 09:11:05 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E0B8140275 for ; Thu, 1 Feb 2024 09:11:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706775063; 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=Rhr69GpXYBZ7PXz/Lp2nUaPNWUTyPU98GNW4ZBhMlqU=; b=KNEkDz5tCD6X3UlGeiAl1KWhpdMGjl44yaFBIqGLAko4dNpA3I0aHHh87oAN7o8867L6Vp GtY1+V6HU+SopjjUr/1BgiZY3HR7h5BfmMzxYkH/uDvlReWyD80PRvd2MpRjmsQkjeEhSG jSTx+uImCf8KvbKngJiLKItHQzwDi44= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-348-U1LTcCt-Pa-Tr9KMadUO3A-1; Thu, 01 Feb 2024 03:11:02 -0500 X-MC-Unique: U1LTcCt-Pa-Tr9KMadUO3A-1 Received: by mail-lj1-f197.google.com with SMTP id 38308e7fff4ca-2cf57664fc2so5576321fa.0 for ; Thu, 01 Feb 2024 00:11:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706775061; x=1707379861; 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=Rhr69GpXYBZ7PXz/Lp2nUaPNWUTyPU98GNW4ZBhMlqU=; b=fLp5te4cJoAdRdQ5zeItzzPYrMMX12EGvDjkY6KWv6KkTsNBVs5kziN/40SEMzi/1l +l0L/FoG9PuAKtY6DqDW7nI155pbtqWDvjic7YfKp2JNa9RPFfvCXHuqVLnza9KsFFYv FTZ+8YxmEQbzgPvFlPrx4jWruLzungI1b7yuTo3DpjcZXhsHtklspENCBhlm23VbW6fS oS8CJTbKOJyqxwTOqupA0FLUZXig7C9e4R64DmYfqy1jpgmBbvsr5uBJxGmbdcTD/GnM T4TTOeVSDB6PdUzS1YG1ENZJH5nJ0vCp+zUaM2ovdMJBOJTXfaz+6GQsK+F9SJUI+8o7 vVeQ== X-Gm-Message-State: AOJu0Yxi5prZV4ENOiooLUl8qvQNXAvv/x8xA9RHHqaKxgM/gxgp8wJI 2oiqk3TAMYJ3NA6NFQ0g7zErTDAWjubqCmf+8bqh9iMRm0HXG9gcx1Dt0mscLpXlW5YTeGo0QcK JuSdUg5VMarGRAiMekOE1ONYltoBpUZHsZuW+M07LClAvwWxKiZ+zcn1iDDgk3dteCVC3V/NaQu sQXpyZY2gvTChtWbo= X-Received: by 2002:a2e:9e10:0:b0:2cd:4883:6e25 with SMTP id e16-20020a2e9e10000000b002cd48836e25mr2928547ljk.50.1706775060794; Thu, 01 Feb 2024 00:11:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2aWGDaAJg7aIcg8Zyo1ZUUSX35xk8zpnDH1TLHWtslyzT1w5EYL7skPyT+ISWt1hOgGDQoeVRyonwqr/nWg8= X-Received: by 2002:a2e:9e10:0:b0:2cd:4883:6e25 with SMTP id e16-20020a2e9e10000000b002cd48836e25mr2928530ljk.50.1706775060406; Thu, 01 Feb 2024 00:11:00 -0800 (PST) MIME-Version: 1.0 References: <20240131195309.2808015-1-maxime.coquelin@redhat.com> <20240131195309.2808015-2-maxime.coquelin@redhat.com> In-Reply-To: <20240131195309.2808015-2-maxime.coquelin@redhat.com> From: David Marchand Date: Thu, 1 Feb 2024 09:10:48 +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 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 its= elf. [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_v= irtqueue *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 for mb= uf."); 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; --=20 David Marchand