On 3/20/2026 12:42 AM, Sebastian Andrzej Siewior wrote:
On 2026-03-19 14:13:34 [-0700], Emil Tantilov wrote:
  drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c 
b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 582e0c8e9dc0..fbd5a15b015c 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -402,7 +402,9 @@ static void idpf_vc_xn_push_free(struct idpf_vc_xn_manager 
*vcxn_mngr,
                                 struct idpf_vc_xn *xn)
  {
        idpf_vc_xn_release_bufs(xn);
+       spin_lock_bh(&vcxn_mngr->xn_bm_lock);
        set_bit(xn->idx, vcxn_mngr->free_xn_bm);

If all of your bit manipulations happen under the same lock you could
replace atomic set_bit()/ clear_bit() with their non-atomic counter
parts __set_bit()/ __clear_bit().

We have taken similar approach in the refactor/move to libie:
https://lore.kernel.org/netdev/[email protected]/

Thanks,
Emil


The lockless alternative would be find_first_bit() +
test_and_set_bit() loop. Probably another atomic op for salt. Using the
__ is free with this change.

+       spin_unlock_bh(&vcxn_mngr->xn_bm_lock);
  }

Sebastian

Reply via email to