From: "Singh, Aman Deep" <aman.deep.singh@intel.com>
To: David Marchand <david.marchand@redhat.com>, <dev@dpdk.org>
Cc: <stable@dpdk.org>, Yuying Zhang <yuying.zhang@intel.com>,
Ferruh Yigit <ferruh.yigit@intel.com>,
Stephen Hemminger <stephen@networkplumber.org>,
Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [PATCH] app/testpmd: fix crash on cleanup
Date: Fri, 17 Feb 2023 12:44:48 +0530 [thread overview]
Message-ID: <b509a19c-f5be-b375-0add-6e1e03585c60@intel.com> (raw)
In-Reply-To: <20230206154946.750829-1-david.marchand@redhat.com>
On 2/6/2023 9:19 PM, David Marchand wrote:
> If allocating the ports[] array fails, a crash will occur when shutting
> down testpmd since ethdev emits RTE_ETH_EVENT_DESTROY events.
> Move init_port() before registering ethdev event handler.
Looks ok to me. Avoids seg_fault, due to Null pointer access.
>
> Fixes: 85c6571c9103 ("app/testpmd: reset port status on close notification")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
> ---
> app/test-pmd/testpmd.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index e366f81a0f..de3017fd62 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -4385,6 +4385,9 @@ main(int argc, char** argv)
> rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
> rte_strerror(rte_errno));
>
> + /* allocate port structures, and init them */
> + init_port();
> +
> ret = register_eth_event_callback();
> if (ret != 0)
> rte_exit(EXIT_FAILURE, "Cannot register for ethdev events");
> @@ -4403,9 +4406,6 @@ main(int argc, char** argv)
> if (nb_ports == 0)
> TESTPMD_LOG(WARNING, "No probed ethernet devices\n");
>
> - /* allocate port structures, and init them */
> - init_port();
> -
> set_def_fwd_config();
> if (nb_lcores == 0)
> rte_exit(EXIT_FAILURE, "No cores defined for forwarding\n"
next prev parent reply other threads:[~2023-02-17 7:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-06 15:49 David Marchand
2023-02-17 7:14 ` Singh, Aman Deep [this message]
2023-02-17 16:18 ` Ferruh Yigit
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=b509a19c-f5be-b375-0add-6e1e03585c60@intel.com \
--to=aman.deep.singh@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
--cc=yuying.zhang@intel.com \
/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).