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 B4AADA0032; Wed, 29 Sep 2021 23:39:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9A3CA410EB; Wed, 29 Sep 2021 23:39:29 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id F35CE410EA for ; Wed, 29 Sep 2021 23:39:27 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id d6so6506818wrc.11 for ; Wed, 29 Sep 2021 14:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ssmHM6duC068OLaCGutMn8kj2+/R9ox4G52E7SrEJR4=; b=R9yVy5J25Or64GCVPFIjaTCLhe7azElySkJzxsH/loDAQuk6/tQ3IUMPSzqxgyLurS 7DJBJs1uodAAM1r+gnESCcFEpt4jemlS3Yl2Llw6A0qvfDNksRm8nkdPBPmp5xU7SLXu xfOaU7Eo4lUIO69rs2bwTkKdAdNenj6PnCV24Lw2mLLmogPBaA11TkqCwqBx9nIGxEpU UQ6zLTR4h7FksSB/KqbgeYn+YX3F7y8AVderMwhuGt5zMJ9SuArgMhdzUY+KZVuaV+4/ ZY0UyZS02txsyLKQQboPa1BX9PttQHag9Txn2s+JztbAu1oPbUtKP4+bzkgXXyNRigrj Xwvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ssmHM6duC068OLaCGutMn8kj2+/R9ox4G52E7SrEJR4=; b=uJzmerhUzHFqfndv7bi97odltQgBH0lSRjLwWOtcKWZqLutcThCEUf95Z0WINpNLsL 2y/gwHGy9vONOM6XD4sLLwf1DFxGiYDnIyxJrbllmU64iLHbsmka9lLurywD6gspTCfW atilnDb/8q4YDQz1hCk1Mt/9bxel1GaTKNgDRy0AMppQZjiqQlD31xieXSsD0+xKwgED DiuMZf6m7+h2+8hlYmnUGgd/jLvG3LbZ8Rooc4yiY/M5C3RXAeIddPPXkhfP3UOyDOtv 0zGYXLt4jYYnuMZ/XjcGpuG81wHz3Iivvw5FweBTmZ1UQERrOwFk1aJwMXjh3zp3aCLn k/mw== X-Gm-Message-State: AOAM5303+sF9Vf+x5F2HzDD0QlH+6lN9L9JJnTsdwdh1cLqyirdO48+W LZbcoC2f/pKRhpjAfmVV8ZTu3A== X-Google-Smtp-Source: ABdhPJwlK7ApkGTEf25vXk+J2iVCjfzgDxUNkRG411MGZGIfjfqqma2AgbulgPe0Uh+upOELIcEf6Q== X-Received: by 2002:adf:d1c8:: with SMTP id b8mr2515016wrd.104.1632951567748; Wed, 29 Sep 2021 14:39:27 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id w18sm1001153wrt.79.2021.09.29.14.39.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Sep 2021 14:39:27 -0700 (PDT) Date: Wed, 29 Sep 2021 23:39:26 +0200 From: Olivier Matz To: Ali Alnubani Cc: "dev@dpdk.org" , David Marchand , Alexander Kozyrev , NBU-Contact-Thomas Monjalon , Ferruh Yigit , Slava Ovsiienko , "zhaoyan.chen@intel.com" , Morten =?iso-8859-1?Q?Br=F8rup?= , Andrew Rybchenko , "Ananyev, Konstantin" , Ajit Khaparde , "jerinj@marvell.com" Message-ID: References: <20201104170007.8026-1-olivier.matz@6wind.com> <98CBD80474FA8B44BF855DF32C47DC35C61945@smartserver.smartshare.dk> <2065212.rItNS1eAF1@thomas> <3491197.H0bSahjnX1@thomas> <98CBD80474FA8B44BF855DF32C47DC35C61ACA@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v4] mbuf: fix reset on mbuf free 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 Sender: "dev" Hi Ali, On Wed, Sep 29, 2021 at 08:03:17AM +0000, Ali Alnubani wrote: > Hi Olivier, > > I wanted to retest the patch on latest main, but it no longer applies, could you please rebase it? I rebased the patch: https://patchwork.dpdk.org/project/dpdk/patch/20210929213707.17727-1-olivier.matz@6wind.com/ Thanks, Olivier > > Thanks, > Ali > > > -----Original Message----- > > From: Morten Brørup > > Sent: Tuesday, September 28, 2021 12:40 PM > > To: Slava Ovsiienko ; NBU-Contact-Thomas > > Monjalon ; Olivier Matz ; > > Ali Alnubani > > Cc: dev@dpdk.org; David Marchand ; Alexander > > Kozyrev ; Ferruh Yigit ; > > zhaoyan.chen@intel.com; Andrew Rybchenko > > ; Ananyev, Konstantin > > ; Ajit Khaparde > > ; jerinj@marvell.com > > Subject: RE: [dpdk-dev] [dpdk-stable] [PATCH v4] mbuf: fix reset on mbuf free > > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Slava Ovsiienko > > > Sent: Tuesday, 28 September 2021 11.01 > > > > > > Hi, > > > > > > I've re-read the entire thread. > > > If I understand correctly, the root problem was (in initial patch): > > > > > > > m1 = rte_pktmbuf_alloc(mp); > > > > rte_pktmbuf_append(m1, 500); > > > > m2 = rte_pktmbuf_alloc(mp); > > > > rte_pktmbuf_append(m2, 500); > > > > rte_pktmbuf_chain(m1, m2); > > > > m0 = rte_pktmbuf_alloc(mp); > > > > rte_pktmbuf_append(m0, 500); > > > > rte_pktmbuf_chain(m0, m1); > > > > > > > > As rte_pktmbuf_chain() does not reset nb_seg in the initial m1 > > > segment > > > > (this is not required), after this code the mbuf chain have 3 > > > > segments: > > > > - m0: next=m1, nb_seg=3 > > > > - m1: next=m2, nb_seg=2 > > > > - m2: next=NULL, nb_seg=1 > > > > > > > The proposed fix was to ALWAYS set next and nb_seg fields on > > > mbuf_free(), regardless next field content. That would perform > > > unconditional write to mbuf, and might affect the configurations, > > > where are no multi- segment packets at al. mbuf_free() is "backbone" > > > API, it is used by all cases, all scenaries are affected. > > > > > > As far as I know, the current approach for nb_seg field - it contains > > > other value than 1 only in the first mbuf , for the following > > > segments, it should not be considered at all (only the first segment > > > fields are valid), and it is supposed to contain 1, as it was > > > initially allocated from the pool. > > > > > > In the example above the problem was introduced by > > > rte_pktmbuf_chain(). Could we consider fixing the rte_pktmbuf_chain() > > > (used in potentially fewer common sceneries) instead of touching the > > > extremely common rte_mbuf_free() ? > > > > > > With best regards, > > > Slava > > > > Great idea, Slava! > > > > Changing the invariant for 'nb_segs', so it must be 1, except in the first segment > > of a segmented packet. > > > > Thinking further about it, perhaps we can achieve even higher performance by a > > minor additional modification: Use 0 instead of 1? Or offset 'nb_segs' by -1, so it > > reflects the number of additional segments? > > > > And perhaps combining the invariants for 'nb_segs' and 'next' could provide even > > more performance improvements. I don't know, just sharing a thought. > > > > Anyway, I vote for fixing the bug. One way or the other! > > > > -Morten > > > > > > > > > -----Original Message----- > > > > From: Thomas Monjalon > > > > Sent: Tuesday, September 28, 2021 11:29 > > > > > > > > Follow-up again: > > > > We have added a note in 21.08, we should fix it in 21.11. > > > > If there are no counter proposal, I suggest applying this patch, no > > > matter the > > > > performance regression. > > > > > > > > > > > > 30/07/2021 16:54, Thomas Monjalon: > > > > > 30/07/2021 16:35, Morten Brørup: > > > > > > > From: Olivier Matz [mailto:olivier.matz@6wind.com] > > > > > > > Sent: Friday, 30 July 2021 14.37 > > > > > > > > > > > > > > Hi Thomas, > > > > > > > > > > > > > > On Sat, Jul 24, 2021 at 10:47:34AM +0200, Thomas Monjalon > > > wrote: > > > > > > > > What's the follow-up for this patch? > > > > > > > > > > > > > > Unfortunatly, I still don't have the time to work on this > > > > > > > topic > > > yet. > > > > > > > > > > > > > > In my initial tests, in our lab, I didn't notice any > > > performance > > > > > > > regression, but Ali has seen an impact (0.5M PPS, but I don't > > > know > > > > > > > how much in percent). > > > > > > > > > > > > > > > > > > > > > > 19/01/2021 15:04, Slava Ovsiienko: > > > > > > > > > Hi, All > > > > > > > > > > > > > > > > > > Could we postpose this patch at least to rc2? We would > > > > > > > > > like > > > to > > > > > > > conduct more investigations? > > > > > > > > > > > > > > > > > > With best regards, Slava > > > > > > > > > > > > > > > > > > From: Olivier Matz > > > > > > > > > > On Mon, Jan 18, 2021 at 05:52:32PM +0000, Ali Alnubani > > > wrote: > > > > > > > > > > > Hi, > > > > > > > > > > > (Sorry had to resend this to some recipients due to > > > mail > > > > > > > > > > > server > > > > > > > problems). > > > > > > > > > > > > > > > > > > > > > > Just confirming that I can still reproduce the > > > regression > > > > > > > > > > > with > > > > > > > single core and > > > > > > > > > > 64B frames on other servers. > > > > > > > > > > > > > > > > > > > > Many thanks for the feedback. Can you please detail what > > > is > > > > > > > > > > the > > > > > > > amount of > > > > > > > > > > performance loss in percent, and confirm the test case? > > > (I > > > > > > > suppose it is > > > > > > > > > > testpmd io forward). > > > > > > > > > > > > > > > > > > > > Unfortunatly, I won't be able to spend a lot of time on > > > this > > > > > > > > > > soon > > > > > > > (sorry for > > > > > > > > > > that). So I see at least these 2 options: > > > > > > > > > > > > > > > > > > > > - postpone the patch again, until I can find more time > > > > > > > > > > to > > > analyze > > > > > > > > > > and optimize > > > > > > > > > > - apply the patch if the performance loss is acceptable > > > > > > > > > > compared > > > > > > > to > > > > > > > > > > the added value of fixing a bug > > > > > > > > > > > > > > > > > > [...] > > > > > > > > > > > > > > Statu quo... > > > > > > > > > > > > > > Olivier > > > > > > > > > > > > > > > > > > > The decision should be simple: > > > > > > > > > > > > Does the DPDK project support segmented packets? > > > > > > If yes, then apply the patch to fix the bug! > > > > > > > > > > > > If anyone seriously cares about the regression it introduces, > > > optimization > > > > patches are welcome later. We shouldn't wait for it. > > > > > > > > > > You're right, but the regression is flagged to a 4-years old > > > > > patch, that's why I don't consider it as urgent. > > > > > > > > > > > If the patch is not applied, the documentation must be updated > > > > > > to > > > > mention that we are releasing DPDK with a known bug: that segmented > > > > packets are handled incorrectly in the scenario described in this > > > patch. > > > > > > > > > > Yes, would be good to document the known issue, no matter how old > > > it > > > > > is. > > > > > > > > > > > Generally, there could be some performance to gain by not > > > supporting > > > > segmented packets at all, as a compile time option. But that is a > > > different > > > > discussion. > > > > > > > > > > > > > > > >