From: Ruifeng Wang <Ruifeng.Wang@arm.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, nd <nd@arm.com>
Subject: RE: Unsafe memory access in testpmd
Date: Mon, 17 Oct 2022 08:03:13 +0000 [thread overview]
Message-ID: <AS8PR08MB708089C7382DBDBD76A5AEB79E299@AS8PR08MB7080.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <20221013163928.49930348@hermes.local>
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Friday, October 14, 2022 7:39 AM
> To: Ruifeng Wang <Ruifeng.Wang@arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli@arm.com>
> Cc: dev@dpdk.org
> Subject: Unsafe memory access in testpmd
>
> Noticed that test-pmd is using a signal handler to exit.
> And that signal handle clears a flag "f_quit".
> But that variable is updated without atomic and is not volatile.
>
> Simple fix to use atomic, would fix that part.
> But the signal_handler is calling a bunch of functions that are not safe in a signal
> handler.
>
> The signal handler in testpmd should only be doing atomic update of f_quit. All the
> cleanup logic needs to be moved to a place where thread is an safe state, like after
> exiting the forwarding loop in main thread.
Agree.
>
> The problem is that testpmd has grown in complexity and not sure if this won't break other
> things.
We can propose patches. Review and testing from the community are expected to cover as many cases as possible.
prev parent reply other threads:[~2022-10-17 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 23:39 Stephen Hemminger
2022-10-17 8:03 ` Ruifeng Wang [this message]
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=AS8PR08MB708089C7382DBDBD76A5AEB79E299@AS8PR08MB7080.eurprd08.prod.outlook.com \
--to=ruifeng.wang@arm.com \
--cc=Honnappa.Nagarahalli@arm.com \
--cc=dev@dpdk.org \
--cc=nd@arm.com \
--cc=stephen@networkplumber.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).