Hi Stephe, The spinlock of rxq_reset_lock, and txq_reset than I need it to make sure one time just one user can call queue_stop operate a queue reset, hardware only support reset queue head to zero only one user operate. When queue_stop 0 and queue_stop 1 operate at the same time, the hardware queue reset will be fault. Even port0 and port1 of one pf, operate queue reset will be also fault. For rx_burst and tx_burst that I don't used the spinlock
Regards Wenbo > -----Original Message----- > From: Stephen Hemminger <step...@networkplumber.org> > Sent: 2025年2月12日 0:02 > To: Wenbo Cao <caowe...@mucse.com> > Cc: tho...@monjalon.net; dev@dpdk.org; ferruh.yi...@amd.com; > andrew.rybche...@oktetlabs.ru; yao...@mucse.com > Subject: Re: [PATCH v9 08/28] net/rnp: add queue setup and release operations > > On Tue, 11 Feb 2025 16:49:58 +0800 > Wenbo Cao <caowe...@mucse.com> wrote: > > > diff --git a/drivers/net/rnp/base/rnp_hw.h > > b/drivers/net/rnp/base/rnp_hw.h index da2c1d3b0e..ea4e1b8d83 100644 > > --- a/drivers/net/rnp/base/rnp_hw.h > > +++ b/drivers/net/rnp/base/rnp_hw.h > > @@ -120,6 +120,9 @@ struct rnp_hw { > > bool lane_is_sgmii[RNP_MAX_PORT_OF_PF]; > > struct rnp_mbx_info mbx; > > struct rnp_fw_info fw_info; > > + > > + spinlock_t rxq_reset_lock; /* reset op isn't thread safe */ > > + spinlock_t txq_reset_lock; /* reset op isn't thread safe */ > > }; > > > > In DPDK control operations do not need to be thread safe. > Many other drivers do not allow start/stop in one thread while tx/rx are > happening etc. > This is because rx/tx should not have overhead of any locks. > The cost of one spinlock at 10G will drop performance a lot