[dpdk-dev] [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip

Zhang, Qi Z qi.z.zhang at intel.com
Tue Apr 17 15:48:58 CEST 2018



> -----Original Message-----
> From: Dai, Wei
> Sent: Monday, April 16, 2018 4:14 PM
> To: Lu, Wenzhuo <wenzhuo.lu at intel.com>; Ananyev, Konstantin
> <konstantin.ananyev at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>; Lin,
> Xueqin <xueqin.lin at intel.com>
> Cc: dev at dpdk.org; Dai, Wei <wei.dai at intel.com>; stable at dpdk.org
> Subject: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip
> 
> 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")
> Cc: stable at dpdk.org
> 
> Signed-off-by: Wei Dai <wei.dai at intel.com>

Acked-by: Qi Zhang <qi.z.zhang at intel.com>

(Wrong "Fixes" reference, will be correct during apply)

> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
> b/drivers/net/ixgbe/ixgbe_ethdev.c
> index a5e2fc0..33ee52e 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -5184,15 +5184,13 @@ ixgbevf_vlan_strip_queue_set(struct
> rte_eth_dev *dev, uint16_t queue, int on)  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);
> --
> 2.7.5



More information about the dev mailing list