From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1D74A04E7; Tue, 3 Nov 2020 22:02:23 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 38C4C72EE; Tue, 3 Nov 2020 22:02:22 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 8208D69A4 for ; Tue, 3 Nov 2020 22:02:20 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 29CFD5C0041; Tue, 3 Nov 2020 16:02:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 03 Nov 2020 16:02:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= j1ehX8MDYQm+9gw/VezuCP/BTKSFQS92jLGxfB8gstU=; b=cng2w4SxC36x+HJP cG5R+r8x5EHHpD4HEUg5n1OeqfzYd6VuELVagcHvJ1H7HomHYl+D9vcND5nOpDOs nq9bd143EXxnMUe+6220BpGIJdW/6LNyxU9TEbHCQLdj1ncmH/nlnXPWIoXNety7 jL9CHGLNy6fKTlKLq4s4dgUBfhffQsoEEitmmaFs4nAGKwYT2o7tO8iZipMfWzI2 rKQAFRHyetH9/vilxnv4BVPWCh46quhsJX3xtZZv6b+LlYypZwRTT+jb0noqYQRE ZRQKupXcfpunVdf99KqcTRw5e75mkBoZFECxTkPhuufoAGrEAksb4P38vlQ+F/gP 47QnMw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=j1ehX8MDYQm+9gw/VezuCP/BTKSFQS92jLGxfB8gs tU=; b=UCQ4qaTxsVg2RWvfJdxUHwhjWBIQCObZt+pLelSVUsR66wLVAwWs3mbxJ kp+c+Sqzpml98OkBSU4N89wpZXx9x0kyoS5OH8bH5QV6Q1xHcgw6SregdGaM7oRj gG29YLg4JYNyDl7o8T/hYIRdcL87A7XWpuhogSfmFf9WoXfekZLOoQVZy4qCqhbK jLwUqwW5MQO501I+J9yshunmoOqvAt3/UYPH1naO6VVxOMHlM+0XnT+4NleyQOrQ Eb/m/L3MTG+f+jlHPq+XEC8Rid8a5FPvTXJk8/QvrK57sFUcJRIRMzHg/a1FcyWq n06ybYPoCPwBIgVdeZg+oFYVe0+xQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtfedgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id DA482306467E; Tue, 3 Nov 2020 16:02:17 -0500 (EST) From: Thomas Monjalon To: Stephen Hemminger Cc: Olivier Matz , dev@dpdk.org, david.marchand@redhat.com Date: Tue, 03 Nov 2020 22:02:16 +0100 Message-ID: <4848376.HcBqXxLd5i@thomas> In-Reply-To: <20201026074907.6f7da565@hermes.local> References: <20201015172019.3181-1-stephen@networkplumber.org> <20201026103935.GL1898@platinum> <20201026074907.6f7da565@hermes.local> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v3] mbuf: fix dynamic flags lookup from secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Stephen, we are waiting for a v4 please. 26/10/2020 15:49, Stephen Hemminger: > On Mon, 26 Oct 2020 11:39:35 +0100 > Olivier Matz wrote: > > > Hi Stephen, > > > > On Fri, Oct 23, 2020 at 05:43:31PM -0700, Stephen Hemminger wrote: > > > The dynamic flag management is broken if rte_mbuf_dynflag_lookup() > > > is done in a secondary process because the local pointer to > > > the memzone is not ever initialized. > > > > > > Fix it by using the same checks as dynfield_register(). > > > I.e if shared memory zone has not been looked up already, > > > then discover it. > > > > > > Fixes: 4958ca3a443a ("mbuf: support dynamic fields and flags") > > > Cc: olivier.matz@6wind.com > > > Signed-off-by: Stephen Hemminger > > > --- > > > > > > v3 - change title, fix one extra whitespace > > > > > > lib/librte_mbuf/rte_mbuf_dyn.c | 20 ++++++++------------ > > > 1 file changed, 8 insertions(+), 12 deletions(-) > > > > > > diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c > > > index 538a43f6959f..554ec5a1ca4f 100644 > > > --- a/lib/librte_mbuf/rte_mbuf_dyn.c > > > +++ b/lib/librte_mbuf/rte_mbuf_dyn.c > > > @@ -185,13 +185,11 @@ rte_mbuf_dynfield_lookup(const char *name, struct rte_mbuf_dynfield *params) > > > { > > > struct mbuf_dynfield_elt *mbuf_dynfield; > > > > > > - if (shm == NULL) { > > > - rte_errno = ENOENT; > > > - return -1; > > > - } > > > - > > > rte_mcfg_tailq_read_lock(); > > > - mbuf_dynfield = __mbuf_dynfield_lookup(name); > > > + if (shm == NULL && init_shared_mem() < 0) > > > + mbuf_dynfield = NULL; > > > + else > > > + mbuf_dynfield = __mbuf_dynfield_lookup(name); > > > rte_mcfg_tailq_read_unlock(); > > > > > > if (mbuf_dynfield == NULL) { > > > rte_errno = ENOENT; > > > return -1; > > > > There is still a small corner case here: on a primary process, > > init_shared_mem() can return -1 in case rte_memzone_reserve_aligned() > > returns a NULL memzone. In this situation, rte_errno is set by the > > memzone layer by overriden to ENOENT. > > > > Maybe something like this is better, what do you think? > > Sure, for what I was using rte_errno was not important. And since it was > previously broken lets get it fixed. >