[PATCH v4] net/netvsc: fix number Tx queues > Rx queues

Stephen Hemminger stephen at networkplumber.org
Fri Oct 4 00:55:14 CEST 2024


On Mon, 15 Apr 2024 14:40:44 +0000
Alan Elder <alan.elder at microsoft.com> wrote:

> The previous code allowed the number of Tx queues to be set higher than the number of Rx queues.  If a packet was sent on a Tx queue with index
> >= number Rx queues there was a segfault due to accessing beyond the end of the dev->data->rx_queues[] array.  
> 
> #0 rte_spinlock_trylock (sl = invalid address) at /include/rte_spinlock.h L63
> #1  hn_process_events at /drivers/net/netvsc/hn_rxtx.c L 1129
> #2  hn_xmit_pkts at /drivers/net/netvsc/hn_rxtx.c L1553
> 
> This commit fixes the issue by creating an Rx queue for every Tx queue meaning that an event buffer is allocated to handle receiving Tx completion messages.
> 
> mbuf pool and Rx ring are not allocated for these additional Rx queues and RSS configuration ensures that no packets are received on them.
> 
> Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device")
> Cc: sthemmin at microsoft.com
> Cc: stable at dpdk.org
> 
> Signed-off-by: Alan Elder <alan.elder at microsoft.com>
> ---
> v4:
> * Include segfault core stack in commit message
> 
> v3:
> * Handle case of Rx queue creation failure in hn_dev_tx_queue_setup.
> * Re-use rx queue if it has already been allocated.
> * Don't allocate an mbuf if pool is NULL.  This avoids segfault if RSS
>   configuration is incorrect.
> 
> v2:
> * Remove function declaration for static non-member function
> 

This version of the patch is garbled in patchwork which means the CI test
never ran because patch would not apply.

You need cleanup and resubmit it.


More information about the dev mailing list