Skip to content

cxgb4: Properly lock TX queue for the selftest.

John B. Wyatt IV requested to merge jwyatt-rh/centos-stream-9:rhel31990 into main

Detected by RHEL QE and reported to the real-time upstream. Was released in
v6.9-rc6-rt3.

JIRA: https://issues.redhat.com/browse/RHEL-31990

Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git

commit 6f55c07ec1bed9d3083bde1ab6d093d2d910743c
Author: Sebastian Andrzej Siewior bigeasy@linutronix.de
Date: Mon Apr 29 11:11:47 2024 +0200

cxgb4: Properly lock TX queue for the selftest.  

The selftest for the driver sends a dummy packet and checks if the  
packet will be received properly as it should be. The regular TX path  
and the selftest can use the same network queue so locking is required  
and was missing in the selftest path. This was addressed in the commit  
cited below.  
Unfortunately locking the TX queue requires BH to be disabled which is  
not the case in selftest path which is invoked in process context.  
Lockdep should be complaining about this.  

Use __netif_tx_lock_bh() for TX queue locking.  

Fixes: c650e04898072 ("cxgb4: Fix race between loopback and normal Tx path")  
Reported-by: John B. Wyatt IV <jwyatt@redhat.com>  
Closes: https://lore.kernel.org/all/Zic0ot5aGgR-V4Ks@thinkpad2021/  
Link: https://lore.kernel.org/r/20240429091147.YWAaal4v@linutronix.de  
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>  

Signed-off-by: John B. Wyatt IV jwyatt@redhat.com

Edited by John B. Wyatt IV

Merge request reports