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 EBBEE41E9D for ; Wed, 15 Mar 2023 11:30:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E841B427F2; Wed, 15 Mar 2023 11:30:07 +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 7CD6940A7A 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=1678876205; 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=Z8FFwgKtf0oxLbTgKhQe0TB5SY+VS4JIVL50jIU5PFolwgdV5pbjM0HCzttg8gkHptNbT4 P5nubMFxdUErULP2Uyor3oEP4QfgvktLNytm37Atrbq47z6jYEKuNPIc/Vh0Rgl5Q89g4T s9LwUWnG4N3NZlQwO3ZIxEO97kJzb2g= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-152-Yqzao9EeO02RvhOdVlh5Zw-1; Wed, 15 Mar 2023 06:30:02 -0400 X-MC-Unique: Yqzao9EeO02RvhOdVlh5Zw-1 Received: by mail-pf1-f200.google.com with SMTP id p39-20020a056a0026e700b0062315c420d6so5758013pfw.21 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=xLNSNyiEfmtZZVv1MB85rPQHKh+6fOlKX6K0SvjuFn7udHZ5KwlvHeSzfMyGWL1Ulc WNjjVltHxTn4VF/5JwNtTAk6aEO26PlHGUsBoPmR3CocIEoKzhssmp6tNdX41myHgUUf tGT+b08ch1op3Y/Gc7mI9NwHUehbofQY6v2mRP1AkQ7fHHytlWAxVgYud8587osUO665 jqT4vncZyIxDOTX0PYhvcEOuKRoe74s6Tqfnqv8ZE8msi+8wUePrwB6SxCEFzMs8elYE QtA8j4zBvECRq2YI4NMkUMUOIeO0Jd+CLhwXuOfRylDnsgE8eg6g/Mn3iklF4UTOQ830 6Vig== X-Gm-Message-State: AO0yUKVog43o6da2/dMECNvv5Bb0p0Zno99KF1CxrRibMrNuKXoTKdJZ ZLc7FA5IVkfrhrdJHbri3vCs72dwGNujf7TH9kGMAUKFniV0ZA9/rUnyduIz0dfWBZpkAKH/lrX GifwDAtWwxy5A2mRFVm4wdoI= X-Received: by 2002:a17:902:db07:b0:19f:87b5:186d with SMTP id m7-20020a170902db0700b0019f87b5186dmr971380plx.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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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