patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Cc: Alexander Bechikov <asb.tyum@gmail.com>, stable@dpdk.org
Subject: [PATCH v3] mbuf: fix dump of dynamic fields and flags
Date: Wed, 24 Nov 2021 13:57:04 +0100	[thread overview]
Message-ID: <20211124125704.26054-1-olivier.matz@6wind.com> (raw)
In-Reply-To: <20211027111118.395928-1-asb.tyum@gmail.com>

From: Alexander Bechikov <asb.tyum@gmail.com>

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 <asb.tyum@gmail.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
---
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


  parent reply	other threads:[~2021-11-24 12:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211027111118.395928-1-asb.tyum@gmail.com>
     [not found] ` <20211029193519.498658-1-asb.tyum@gmail.com>
2021-10-29 19:35   ` [dpdk-stable] [PATCH v2 2/2] " Alexander Bechikov
2021-11-24 12:57 ` Olivier Matz [this message]
2021-11-24 14:08   ` [PATCH v3] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211124125704.26054-1-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=asb.tyum@gmail.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).