From: Stephen Hemminger <stephen@networkplumber.org>
To: Wei Hu <weh@linux.microsoft.com>
Cc: dev@dpdk.org, longli@microsoft.com, weh@microsoft.com
Subject: Re: [PATCH v5 1/1] net/mana: add device reset support
Date: Fri, 29 May 2026 08:34:46 -0700 [thread overview]
Message-ID: <20260529083446.4082ab23@phoenix.local> (raw)
In-Reply-To: <20260529142648.148407-2-weh@linux.microsoft.com>
On Fri, 29 May 2026 07:26:48 -0700
Wei Hu <weh@linux.microsoft.com> wrote:
> diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
> index 67396cda1f..89e45c53c1 100644
> --- a/drivers/net/mana/mana.c
> +++ b/drivers/net/mana/mana.c
> @@ -13,7 +13,10 @@
> #include <ethdev_pci.h>
> #include <rte_kvargs.h>
> #include <rte_eal_paging.h>
> +#include <rte_alarm.h>
> #include <rte_pci.h>
> +#include <rte_rcu_qsbr.h>
> +#include <rte_lock_annotations.h>
>
> #include <infiniband/verbs.h>
> #include <infiniband/manadv.h>
> @@ -103,6 +106,23 @@ mana_dev_configure(struct rte_eth_dev *dev)
> RTE_ETH_RX_OFFLOAD_VLAN_STRIP);
>
> priv->num_queues = dev->data->nb_rx_queues;
> + DRV_LOG(DEBUG, "priv %p, port %u, dev port %u, num_queues: %u",
> + priv, priv->port_id, priv->dev_port, priv->num_queues);
> +
> + /*
> + * Register data path thread IDs (rx and tx) with the RCU
> + * quiescent state variable for device state synchronization.
> + */
> + for (int i = 0; i < 2 * priv->num_queues; i++) {
> + if (rte_rcu_qsbr_thread_register(priv->dev_state_qsv, i) != 0) {
> + DRV_LOG(ERR, "Failed to register rcu qsv thread %d of total %d",
> + i, 2 * priv->num_queues - 1);
> + return -EINVAL;
> + }
> + DRV_LOG(DEBUG,
> + "Register thread 0x%x for priv %p, port %u",
> + i, priv, priv->port_id);
> + }
>
If device driver now has dependency on RCU you need to update meson.build
to show that. No other driver does this. Creating threads in driver is
discouraged because it can lead to other problems in applications.
If possible, I would figure out how to manage reset without creating a thread
per-queue. Or at least one control thread and use epoll() and eventfd's.
next prev parent reply other threads:[~2026-05-29 15:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 14:26 [PATCH v5 0/1] net/mana: add device reset support Wei Hu
2026-05-29 14:26 ` [PATCH v5 1/1] " Wei Hu
2026-05-29 15:34 ` Stephen Hemminger [this message]
2026-05-29 15:52 ` [EXTERNAL] " Wei Hu
2026-06-01 16:31 ` Stephen Hemminger
2026-06-01 16:58 ` Stephen Hemminger
2026-06-03 15:27 ` [EXTERNAL] " Wei Hu
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=20260529083446.4082ab23@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=longli@microsoft.com \
--cc=weh@linux.microsoft.com \
--cc=weh@microsoft.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