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 F1F7CA0032; Fri, 29 Oct 2021 09:31:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C01ED40688; Fri, 29 Oct 2021 09:31:51 +0200 (CEST) Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mails.dpdk.org (Postfix) with ESMTP id 8D82340395 for ; Fri, 29 Oct 2021 09:31:49 +0200 (CEST) Received: by mail-wr1-f50.google.com with SMTP id r8so1948268wra.7 for ; Fri, 29 Oct 2021 00:31:49 -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:in-reply-to; bh=Y425jsvVMMglUiX5Vj5y3JUymD5mF+HS7cB6XIU/AQ0=; b=aAzP4hTDSdhWiXSVJ8NpcxAX6SqX63DEhST0Oz2kjrdcYdHJ/31R4Aq4vmLwDN6nWL d2Mqc9jcWphOyD88+YDVWXwG8iJwH4lN6y9X+L93JqUKW7akvgmRC6mhD5jVGyZ5ALNQ oU+FEZAGtHAxsm53hUnmqbcE2RNsbdjg/QJBzu+Upa74XK/gRacfRavf8Fe4j/dqQxJO uK7VHv/ByGzjapaXPHidVMeJESZnEBruQqcMUPfRBfTU5VFnhWkk4i+oc4bVc62SS1pe E73k+a41mnOVnPyPgVa3+lx7t5fxA2eIns7JyqV1kzyv59FZ6sAqoWTktJo8IVGtcgcr OdHg== 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:in-reply-to; bh=Y425jsvVMMglUiX5Vj5y3JUymD5mF+HS7cB6XIU/AQ0=; b=wqy1kFx6rkxKNgi6hwh01a27vvHt5MAKnmKM3v7m3sfD9IgonY/KCfleTsrL13MU5G DuRgkvM3fUOjoSs/am0YN0leOTPR47OLgaXiRUNnRq217JJjbTj12p6oRTCHdjANaHPo tag8CxeRsnveqSxzV80OV1YFaipKrXhZX5A2OLGoz/VW8Vr3mAoc8AA/33z+oBuJrEhC GlEDEFnVHr9v7YBhrwyfH4RWZXqlMXYWy2HKt968UP2GrpJ0978YDQNeIOSNth1Z1u3N Jomuc9NmdV+GlqRglj0p+OUGZrQD6AH8NdrfCmWGkuSW652X3MzUcJE6qIWV0hWwGIoC qUqw== X-Gm-Message-State: AOAM5302rgw9Bf2M6PkWel9dFoR6IYyYCdRfvHAkxLxCxnBsUIfrYQ0t AhZ8IOOxK9AjkuTLKnGyT2MBqw== X-Google-Smtp-Source: ABdhPJzyUJd/TbUuZuuBLQDiKZjpQYiCWYf9L6l+7vpP6VHYzF9wFAyU/aL0YuKWxworpwi1zdq9VA== X-Received: by 2002:a5d:4443:: with SMTP id x3mr3732125wrr.189.1635492709325; Fri, 29 Oct 2021 00:31:49 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id l11sm4867829wrt.49.2021.10.29.00.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 00:31:48 -0700 (PDT) Date: Fri, 29 Oct 2021 09:31:47 +0200 From: Olivier Matz To: Alexander Bechikov Cc: dev@dpdk.org Message-ID: References: <20211027111118.395928-1-asb.tyum@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211027111118.395928-1-asb.tyum@gmail.com> Subject: Re: [dpdk-dev] [PATCH] mbuf: Improved error message. Added check if shared memory already allocated 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 Alexander, Thanks for submitting this patch. Few comments below. On Wed, Oct 27, 2021 at 07:11:18AM -0400, Alexander Bechikov wrote: > mbuf: Improved error message. Added check if shared memory already allocated I suggest another title: mbuf: fix dump of dynamic fields and flags Indeed, it appears that the dump is currently broken. We can see it in the unit tests: RTE>>mbuf_autotest ... MBUF: Failed to get mbuf dyn shared memory As the function returns void, we failure is not detected by the test. Can you add a small commit log? I suppose this issue is introduced by d4902ed31c63 ("mbuf: check shared memory before dumping dynamic space"). Do you confirm? Can you please also add: Cc: stable@dpdk.org Fixes: d4902ed31c63 ("mbuf: check shared memory before dumping dynamic space") > Signed-off-by: Alexander Bechikov > --- > lib/mbuf/rte_mbuf_dyn.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c > index db8e020665..a3bc9b66d2 100644 > --- a/lib/mbuf/rte_mbuf_dyn.c > +++ b/lib/mbuf/rte_mbuf_dyn.c > @@ -116,7 +116,8 @@ init_shared_mem(void) > mz = rte_memzone_lookup(RTE_MBUF_DYN_MZNAME); > } > if (mz == NULL) { > - RTE_LOG(ERR, MBUF, "Failed to get mbuf dyn shared memory\n"); > + RTE_LOG(ERR, MBUF, "Failed to get mbuf dyn shared memory: %s (%d)\n", > + rte_strerror(rte_errno), rte_errno); > return -1; > } > I think rte_errno is not set when rte_memzone_lookup() returns NULL (this happens when init_shared_mem() is called from a secondary process). You can set it in this function to ENOENT, or just drop this change. > @@ -531,7 +532,7 @@ void rte_mbuf_dyn_dump(FILE *out) > size_t i; > > rte_mcfg_tailq_write_lock(); > - if (init_shared_mem() < 0) { > + if (shm == NULL && init_shared_mem() < 0) { > rte_mcfg_tailq_write_unlock(); > return; > } > -- > 2.30.2 > Thanks, Olivier