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 E88BBA0C53 for ; Wed, 24 Nov 2021 13:57:19 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCA60426D5; Wed, 24 Nov 2021 13:57:19 +0100 (CET) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mails.dpdk.org (Postfix) with ESMTP id 45E3D41C3C for ; Wed, 24 Nov 2021 13:57:17 +0100 (CET) Received: by mail-wm1-f48.google.com with SMTP id az34-20020a05600c602200b0033bf8662572so2020713wmb.0 for ; Wed, 24 Nov 2021 04:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AAk9iboWgp/4hNA+ApDsbvbEBaDNjvArONPriwUfCYw=; b=InJ6IwbFP4dDIfDorRjkY8+M7ijivf2FIqKSoEimSPYzrY5xG92J4HoUG/uNJXbhFU 5LoOMIQCgw4Cz+yHT9uBQOUybnA+sqwUCEhOqI9r0kiWbx6A0sQWXMSvU/vck0qFPTZI 0lpPqu7YraPRwvNDkiInZeQ3wvJyvOo6kCClBQs1I7zZbYQJRhz8sLSpDhrnoCowq4yn ybU+Ve0fdWvc0NfQhfs5BKtc0lrAR3oZl/pYOwSgbrZt552K3FwEHgQKkPuiRjNAkEPN cvMeuL3ox+ugpCoPQJ/QGfN9ealOMQSGUskivom3lZXpXgGknzWOmf2I2e3YdpDYOFoX 9Kcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AAk9iboWgp/4hNA+ApDsbvbEBaDNjvArONPriwUfCYw=; b=CS45aO28xIspn7mdewrqwXXKenj8v8YJLdhPqHdM0JdMhoY2wA0rhxtIVfDZ2bSkkX PeXcWXU3W0BLbp02emg9Im1QwCnXC31914wrhVcf23aSiGWCmaiDz/Gv7L+Dd7hXkYcw FmaRBGDYS3K0A23zIy/A/kQ4j2EzpYxvyTm2AlNTfSTG+o04cRyXty55D0is4p+UMuAX VgdHGax2wbU13U1/1FfiOyVX7hj72pB4THfKVKPTynJH6A3YnunIHBJcWAmJrYUeU3Ad 8etb4HhlnnySr4epIrOyBFi7pxUmpFFpiUaDSuvA8PQEnNdtthpOyXzIOkLNDjslh40+ 3QBg== X-Gm-Message-State: AOAM530PT3Q0NJ9ley4Wk+gEB3Uurizn3Ml5gKPSl2iDuwqCJ9WfT88p H+aQZ/bR9lbuS81FzbpbmKtKgw== X-Google-Smtp-Source: ABdhPJxQ05DB9+of8KKwM6VYuTlvxa/X35triapB2Cx0ps5w59QdTHRTKYDX4D5i/6/y/8PH4kh78w== X-Received: by 2002:a1c:770e:: with SMTP id t14mr14013254wmi.173.1637758636964; Wed, 24 Nov 2021 04:57:16 -0800 (PST) Received: from gojira.dev.6wind.com ([185.13.181.2]) by smtp.gmail.com with ESMTPSA id m20sm5390189wmq.11.2021.11.24.04.57.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Nov 2021 04:57:16 -0800 (PST) From: Olivier Matz To: dev@dpdk.org Cc: Alexander Bechikov , stable@dpdk.org Subject: [PATCH v3] mbuf: fix dump of dynamic fields and flags Date: Wed, 24 Nov 2021 13:57:04 +0100 Message-Id: <20211124125704.26054-1-olivier.matz@6wind.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211027111118.395928-1-asb.tyum@gmail.com> References: <20211027111118.395928-1-asb.tyum@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Alexander Bechikov The dump of dynamic fields and flags fails if the shm is already allocated. Add a check to fix the issue. Cc: stable@dpdk.org Fixes: d4902ed31c63 ("mbuf: check shared memory before dumping dynamic space") Signed-off-by: Alexander Bechikov Acked-by: Olivier Matz --- Hi Alexander, Sorry for late feedback, I forgot to reply to your v2. I'm resending your fix with the 2 patches merged together, so it can be included in 21.11. Thanks, Olivier v3: * Merge the 2 patches from v2 and add a commit log v2: * Drop changes with log message from v1, because rte_errno is not always set --- lib/mbuf/rte_mbuf_dyn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c index db8e020665..4ae79383b5 100644 --- a/lib/mbuf/rte_mbuf_dyn.c +++ b/lib/mbuf/rte_mbuf_dyn.c @@ -531,7 +531,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