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 EF5FB41E9D; Wed, 15 Mar 2023 11:30:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C837540A7A; Wed, 15 Mar 2023 11:30:06 +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 661EE40141 for ; Wed, 15 Mar 2023 11:30:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678876204; 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=fmITeSogmScG/jCwB3NLOd43YcWFSlDKE/w6eHODlNc=; b=Fs2oo+A8W45HhJsrS7/ZKSKdo+VowQyP+bfV7UAHo+DMC3Ib102q2rOoqUafGaZEkI6M+N hreWj8irNj1F88T2xqpUgFIpxFH2abUCMVlPZEdIZUP2wYs1W5ZgUJeOveLrs3rNkIxzAT qfcjEbtKH7BDnCmKK7iFR4v5XRcSGlM= Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-142--6z-vWXiNk2Q-VkX83b1JQ-1; Wed, 15 Mar 2023 06:30:02 -0400 X-MC-Unique: -6z-vWXiNk2Q-VkX83b1JQ-1 Received: by mail-pf1-f199.google.com with SMTP id t30-20020a056a00139e00b006228307e71bso6093874pfg.0 for ; Wed, 15 Mar 2023 03:30:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678876201; 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=fmITeSogmScG/jCwB3NLOd43YcWFSlDKE/w6eHODlNc=; b=lX3prBNlP+MmPSKArEn6nXDe49nCoZ67w9sqOHBAlDU1yDKyf/Kh7ROjy1A9r+3219 SNNjO0GP+DfUE6TORqfh/DSASgSJ6F4hivNnNCmKPe/HhBwgYzvliJwuKnWNyqRW2Txk 0wAX3ZKBi2NsWgjNWBQ7lRuhRu9QukAfMIJzEKg6w+FaWga5l+fMFR+TsqZU/oIjKDX2 B70hI+BzZGN8e3ZScePXObQCgJvxJgqChpKVJ9tm+iCRaGiYCuNOPY5NmPb3qWgtaJa0 EIX28Te6YxuiH/rSEYzaoqiOwJS/1mdNaIwsyS2K4cFF1VHFwefNI7bKmGFRSP9PJRNk p9OQ== X-Gm-Message-State: AO0yUKU5749EPqK2c7VRcMZ7JkiIl1TImGIGR8glkiSVyjKa4TlSfbaZ Y0cQNV1qlDaJJtvVvHN53JgNT4LE14YJ+xLwVrfvRWImKhsWRphysT6JA6i/AFd/T0BVe3Ar3ZZ uYnGZCDM+m/oX6L0Lk6g= X-Received: by 2002:a17:902:db07:b0:19f:87b5:186d with SMTP id m7-20020a170902db0700b0019f87b5186dmr971378plx.9.1678876201562; Wed, 15 Mar 2023 03:30:01 -0700 (PDT) X-Google-Smtp-Source: AK7set/9hDsfYeeIerU0FBmpl8X97fVogc5bKjrGpSwhnawWVOZyYOFl3dCuKkX5zTvrCrwHL4O+LSt1DV3DSMkjNsI= X-Received: by 2002:a17:902:db07:b0:19f:87b5:186d with SMTP id m7-20020a170902db0700b0019f87b5186dmr971375plx.9.1678876201342; Wed, 15 Mar 2023 03:30:01 -0700 (PDT) MIME-Version: 1.0 References: <20230313165605.12325-1-pivashchenko@nfware.com> In-Reply-To: <20230313165605.12325-1-pivashchenko@nfware.com> From: David Marchand Date: Wed, 15 Mar 2023 11:29:50 +0100 Message-ID: Subject: Re: [PATCH] app: fix mbuf_autotest in case of defined RTE_LIBRTE_MBUF_DEBUG To: Pavel Ivashchenko , olivier.matz@6wind.com Cc: konstantin.ananyev@intel.com, mb@smartsharesystems.com, ajit.khaparde@broadcom.com, dev@dpdk.org, stable@dpdk.org 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 Hello, On Mon, Mar 13, 2023 at 5:57=E2=80=AFPM Pavel Ivashchenko wrote: > > How to reproduce: > > 1. Define RTE_LIBRTE_MBUF_DEBUG > 2. MALLOC_PERTURB_=3D178 DPDK_TEST=3Dmbuf_autotest gdb --args obj-x86_64-= linux-gnu/app/test/dpdk-test --file-prefix=3Dmbuf_autotest > > PANIC in rte_mbuf_sanity_check(): > bad pkt_len > > ... > #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=3Dm@entry=3D0x17f8c= 3400, is_header=3Dis_header@entry=3D1) at ../lib/mbuf/rte_mbuf.c:384 > #7 0x0000555555653d57 in rte_pktmbuf_free (m=3D0x17f8c3400) at ../lib= /mbuf/rte_mbuf.h:1385 > #8 0x000055555565c7a6 in test_nb_segs_and_next_reset () at ../app/tes= t/test_mbuf.c:2752 > #9 test_mbuf () at ../app/test/test_mbuf.c:2967 > ... > > (gdb) frame 6 > #6 0x00007ffff7d3d4cc in rte_mbuf_sanity_check (m=3Dm@entry=3D0x17f8c= 3400, is_header=3Dis_header@entry=3D1) at ../lib/mbuf/rte_mbuf.c:384 > 384 rte_panic("%s\n", reason); > (gdb) p/d m->pkt_len > $4 =3D 1500 > > Fixes: efc6f9104c80 ("mbuf: fix reset on mbuf free") > Cc: stable@dpdk.org > > Signed-off-by: Pavel Ivashchenko LGTM, thanks. Just a small comment. > --- > app/test/test_mbuf.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c > index 6cbb03b0af..d471a23805 100644 > --- a/app/test/test_mbuf.c > +++ b/app/test/test_mbuf.c > @@ -2744,6 +2744,7 @@ test_nb_segs_and_next_reset(void) > > /* split m0 chain in two, between m1 and m2 */ > m0->nb_segs =3D 2; > + m0->pkt_len -=3D 500; m0->pkt_len -=3D m2->data_len seems more readable and robust to me. Opinions? > m1->next =3D NULL; > m2->nb_segs =3D 1; > --=20 David Marchand