[EXTERNAL] Re: [PATCH v5 1/1] net/mana: add device reset support

Wei Hu weh at microsoft.com
Fri May 29 17:52:24 CEST 2026



> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Friday, May 29, 2026 11:35 PM
> To: Wei Hu <weh at linux.microsoft.com>
> Cc: dev at dpdk.org; Long Li <longli at microsoft.com>; Wei Hu
> <weh at microsoft.com>
> Subject: [EXTERNAL] Re: [PATCH v5 1/1] net/mana: add device reset support
> 
> On Fri, 29 May 2026 07:26:48 -0700
> Wei Hu <weh at 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.

Update in meson.build was included in the patch. 

I didn't create a thread per-queue. I just added a tid for each queue and use it
as an identifier in rte_rcu_qsbr_thread_register(). Calling 
rte_rcu_qsbr_thread_register() doesn't create any additional thread. It just let
the rcu_qsbr know how many tx and rx threads it should expect to be offline before
device resetting can proceed. 

Wei




More information about the dev mailing list