DPDK usage discussions
 help / color / mirror / Atom feed
From: Changchun Zhang <changchun.zhang@oracle.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "Van Haaren, Harry" <harry.van.haaren@intel.com>,
	NAGENDRA BALAGANI <nagendra.balagani@oracle.com>,
	"users@dpdk.org" <users@dpdk.org>
Subject: Re: [External] : Re: Query Regarding Race Condition Between Packet Reception and Device Stop in DPDK
Date: Mon, 17 Feb 2025 19:20:10 +0000	[thread overview]
Message-ID: <CO1PR10MB475683581053E55C686B9B9384FB2@CO1PR10MB4756.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CO1PR10MB4756D4AEFBCCFB8F1DE84F8F84FB2@CO1PR10MB4756.namprd10.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2060 bytes --]

I assume this answer is No, but just wanted to be confirmed.





Thanks,

Changchun



________________________________
From: Changchun Zhang <changchun.zhang@oracle.com>
Sent: Monday, February 17, 2025 2:14 PM
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Van Haaren, Harry <harry.van.haaren@intel.com>; NAGENDRA BALAGANI <nagendra.balagani@oracle.com>; users@dpdk.org <users@dpdk.org>
Subject: Re: [External] : Re: Query Regarding Race Condition Between Packet Reception and Device Stop in DPDK

Okay, so here the issue is still rte_eth_dev_stop(), but not rte_eth_dev_rx_queue_stop(), right? I mean, as long as not calling rte_eth_dev_stop() on control path, is it safe to call rte_eth_dev_rx_queue_stop/rte_eth_dev_rx_queue_start on control path while fast path keeps calling rte_eth_rx_burst()?





Thanks,

Changchun



________________________________
From: Stephen Hemminger <stephen@networkplumber.org>
Sent: Monday, February 17, 2025 2:06 PM
To: Changchun Zhang <changchun.zhang@oracle.com>
Cc: Van Haaren, Harry <harry.van.haaren@intel.com>; NAGENDRA BALAGANI <nagendra.balagani@oracle.com>; users@dpdk.org <users@dpdk.org>
Subject: Re: [External] : Re: Query Regarding Race Condition Between Packet Reception and Device Stop in DPDK

On Mon, 17 Feb 2025 18:57:00 +0000
Changchun Zhang <changchun.zhang@oracle.com> wrote:

> Hi Harry,
>
> Can we call rte_eth_dev_rx_queue_stop() on a rx queue when a fast path is still polling the queue? The sequence on control and fast path cores would like:
> Control path:
> rte_eth_dev_rx_queue_stop(rx_queue_id);
> ...waiting for draining of rx_queue...
> rte_eth_dev_stop()
> ....
>
> Fast path:
> Keep calling rte_eth_rx_burst()
> (I am expecting it will return 0 if queue is already drained and stopped)
>

No.
The application needs to not call rx_burst when stop is being done.
There rx_burst is a fast path with no additional checks and is intentionally not thread safe.
You need to coordinate queue management inside the application.

[-- Attachment #2: Type: text/html, Size: 4741 bytes --]

  reply	other threads:[~2025-02-17 19:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14  8:43 NAGENDRA BALAGANI
2025-02-14  9:22 ` Van Haaren, Harry
2025-02-14 16:31   ` Stephen Hemminger
2025-02-17  9:32     ` [External] : " NAGENDRA BALAGANI
2025-02-17 18:57   ` Changchun Zhang
2025-02-17 19:06     ` Stephen Hemminger
2025-02-17 19:14       ` Changchun Zhang
2025-02-17 19:20         ` Changchun Zhang [this message]
2025-02-17 20:56           ` Stephen Hemminger
2025-02-18  9:32         ` Van Haaren, Harry

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=CO1PR10MB475683581053E55C686B9B9384FB2@CO1PR10MB4756.namprd10.prod.outlook.com \
    --to=changchun.zhang@oracle.com \
    --cc=harry.van.haaren@intel.com \
    --cc=nagendra.balagani@oracle.com \
    --cc=stephen@networkplumber.org \
    --cc=users@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).