DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"Thomas Monjalon" <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@amd.com>
Subject: Re: [PATCH v2 1/6] ethdev: check that device supports deferred start
Date: Mon, 17 Feb 2025 17:12:25 +0000	[thread overview]
Message-ID: <Z7Nt-ZatmKwrSS37@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20250214174224.79142-2-stephen@networkplumber.org>

On Fri, Feb 14, 2025 at 09:38:54AM -0800, Stephen Hemminger wrote:
> The check for supporting deferred start should be handled at
> the ethdev level for all devices.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> ---
>  lib/ethdev/rte_ethdev.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
> index c4079bb924..5493b3b9f8 100644
> --- a/lib/ethdev/rte_ethdev.c
> +++ b/lib/ethdev/rte_ethdev.c
> @@ -2274,6 +2274,13 @@ rte_eth_rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id,
>  	if (rx_conf != NULL)
>  		rx_offloads |= rx_conf->offloads;
>  
> +	/* Deferred start requires that device supports queue start */
> +	if (rx_conf && rx_conf->rx_deferred_start && *dev->dev_ops->rx_queue_start == NULL) {

I must admit to being a little confused by the initial "*" at the beginning
of the function pointer check, but Stephen has correctly pointed out that
this style seems to be used everywhere in DPDK. Can someone perhaps just
explain why we check for "*fn_ptr == NULL", rather than just "fn_ptr == NULL".
Testing with code in gdb shows that both work fine, though interestingly
gdb itself gives and error when you interactively request a dereference of
a null fn pointer, i.e. have the extra initial "*".

/Bruce


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

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13 21:48 [PATCH 0/5] centralize deferred start checks Stephen Hemminger
2024-12-13 21:48 ` [PATCH 1/5] ethdev: check that device supports deferred start Stephen Hemminger
2024-12-13 21:48 ` [PATCH 2/5] net/dpaa: remove unnecessary deferred start check Stephen Hemminger
2024-12-13 21:48 ` [PATCH 3/5] net/dpaa2: remove unneeded " Stephen Hemminger
2024-12-13 21:48 ` [PATCH 4/5] net/enetfec: " Stephen Hemminger
2024-12-13 21:48 ` [PATCH 5/5] net/virtio: " Stephen Hemminger
2024-12-14 18:07 ` [PATCH v2 0/5] add check for deferred start to ethdev Stephen Hemminger
2024-12-14 18:07   ` [PATCH v2 1/5] ethdev: check that device supports deferred start Stephen Hemminger
2024-12-15  8:56     ` Andrew Rybchenko
2024-12-16 18:58       ` Stephen Hemminger
2024-12-17  6:07         ` Andrew Rybchenko
2024-12-14 18:07   ` [PATCH v2 2/5] net/dpaa: remove unnecessary deferred start check Stephen Hemminger
2024-12-14 18:07   ` [PATCH v2 3/5] net/dpaa2: remove unneeded " Stephen Hemminger
2024-12-14 18:07   ` [PATCH v2 4/5] net/enetfec: " Stephen Hemminger
2024-12-14 18:07   ` [PATCH v2 5/5] net/virtio: " Stephen Hemminger
2024-12-16 19:11 ` [PATCH v3 0/6] queue start/stop and deferred checks Stephen Hemminger
2024-12-16 19:11   ` [PATCH v3 1/6] ethdev: check that device supports deferred start Stephen Hemminger
2024-12-16 19:11   ` [PATCH v3 2/6] doc: fix feature flags for queue start/stop Stephen Hemminger
2024-12-16 19:11   ` [PATCH v3 3/6] net/dpaa: remove unnecessary deferred start check Stephen Hemminger
2024-12-16 19:11   ` [PATCH v3 4/6] net/dpaa2: remove unneeded " Stephen Hemminger
2024-12-16 19:11   ` [PATCH v3 5/6] net/enetfec: " Stephen Hemminger
2024-12-16 19:11   ` [PATCH v3 6/6] net/virtio: " Stephen Hemminger
2025-01-28 21:03   ` [PATCH v3 0/6] queue start/stop and deferred checks Stephen Hemminger
2025-02-14 17:38 ` [PATCH v2 0/6] fix the handling of deferred start in ethdev Stephen Hemminger
2025-02-14 17:38   ` [PATCH v2 1/6] ethdev: check that device supports deferred start Stephen Hemminger
2025-02-17 17:12     ` Bruce Richardson [this message]
2025-02-14 17:38   ` [PATCH v2 2/6] doc: fix feature flags for queue start/stop Stephen Hemminger
2025-02-14 17:38   ` [PATCH v2 3/6] net/dpaa: remove unnecessary deferred start check Stephen Hemminger
2025-02-14 17:38   ` [PATCH v2 4/6] net/dpaa2: remove unneeded " Stephen Hemminger
2025-02-14 17:38   ` [PATCH v2 5/6] net/enetfec: " Stephen Hemminger
2025-02-14 17:38   ` [PATCH v2 6/6] net/virtio: " Stephen Hemminger
2025-02-17 17:13   ` [PATCH v2 0/6] fix the handling of deferred start in ethdev Bruce Richardson

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=Z7Nt-ZatmKwrSS37@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).