This patch fixes a segment fault in ixgbevf_vlan_offload_set( )
when a Rx queue with index < max_rx_queues is not setup.
For such queue, rxq = dev->data->rx_queues[i] is null pointer.
Fixes:
860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading in VF")
Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Xueqin Lin <xueqin.lin@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
static int
ixgbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask)
{
- struct ixgbe_hw *hw =
- IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct ixgbe_rx_queue *rxq;
uint16_t i;
int on = 0;
/* VF function only support hw strip feature, others are not support */
if (mask & ETH_VLAN_STRIP_MASK) {
- for (i = 0; i < hw->mac.max_rx_queues; i++) {
+ for (i = 0; i < dev->data->nb_rx_queues; i++) {
rxq = dev->data->rx_queues[i];
on = !!(rxq->offloads & DEV_RX_OFFLOAD_VLAN_STRIP);
ixgbevf_vlan_strip_queue_set(dev, i, on);