net/ixgbe: fix segfault in configuring VF VLAN strip
PATCH 1/1 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.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -3
@@ -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 Ð_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);
Signature · 1 line
2.7.5
1. Branch: master
2. NIC: Niantic
Steps:
1. Pull branch code to newest and apply the patch
2. Create one VF port using kernel PF
echo 1 > /sys/bus/pci/devices/0000\:81\:00.0/sriov_numvfs
3. Bind VF to igb_uio
4. Start testpmd, find VF testpmd could startup successfully. ./x86_64-native-linuxapp-gcc/app/testpmd -c 0x6 -n 4 -- -i
Result: This patch could fix VF can't setup successfully in Niantic NIC.
Best regards,
Xueqin
-----Original Message-----
From: Dai, Wei
Sent: Monday, April 16, 2018 4:14 PM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Zhang, Qi Z <[email protected]>; Lin, Xueqin <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
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.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +1 -4
@@ -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 Ð_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
Quoted 13 lines
-----Original Message-----
From: Dai, Wei
Sent: Monday, April 16, 2018 4:14 PM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Zhang, Qi Z <[email protected]>; Lin, Xueqin <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN stripThis patch fixes a segment fault in
ixgbevf_vlan_offload_set( )when a Rx queue with index <max_rx_queuesis not setup.
For such queue, rxq = dev->data->rx_queues[i] is null pointer.
Quoted 5 lines
Fixes 860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading inVF")
Cc: [email protected]Signed-off-by Wei Dai <[email protected]>
Quoted 28 lines
--- drivers/net/ixgbe/ixgbe_ethdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/net/ixgbe/ixgbe_ethdev.c +1
-4@@ -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(structrte_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 Ð_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
Quoted 15 lines
-----Original Message-----
From: Dai, Wei
Sent: Monday, April 16, 2018 4:14 PM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Zhang, Qi Z <[email protected]>; Lin, Xueqin <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN stripThis patch fixes a segment fault in
ixgbevf_vlan_offload_set( )when a Rx queue with index <max_rx_queuesis not setup.
For such queue, rxq = dev->data->rx_queues[i] is null pointer.
Quoted 5 lines
Fixes 860a94d3c692 ("net/ixgbe: support VLAN strip per queue offloading inVF")
Cc: [email protected]Signed-off-by Wei Dai <[email protected]>
(Wrong "Fixes" reference, will be correct during apply)
Quoted 27 lines
--- drivers/net/ixgbe/ixgbe_ethdev.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/net/ixgbe/ixgbe_ethdev.c +0
-0@@ -5184,15 +5184,13 @@ ixgbevf_vlan_strip_queue_set(struct
rte_eth_dev*dev,uint16_tqueue, int on) static intixgbevf_vlan_offload_set(struct rte_eth_dev *dev, int mask){drivers/net/ixgbe/ixgbe_ethdev.c +1
-4-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 Ð_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
Zhang, Helin
AppliedQuoted 25 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Zhang, Qi Z
Sent: Tuesday, April 17, 2018 9:49 PM
To: Dai, Wei; Lu, Wenzhuo; Ananyev, Konstantin; Lin, Xueqin
Cc: [email protected]; [email protected]
Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix segfault in configuring VF VLAN stripQuoted 13 lines
-----Original Message-----
From: Dai, Wei
Sent: Monday, April 16, 2018 4:14 PM
To: Lu, Wenzhuo <[email protected]>; Ananyev, Konstantin <[email protected]>; Zhang, Qi Z <[email protected]>; Lin, Xueqin <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; [email protected]
Subject: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN stripThis patch fixes a segment fault in
ixgbevf_vlan_offload_set( )when a Rx queue with index <max_rx_queuesis not setup.
For such queue, rxq = dev->data->rx_queues[i] is null pointer.
Quoted 8 lines
Quoted 6 lines
Fixes 860a94d3c692 ("net/ixgbe: support VLAN strip per queueoffloading in
VF")
Cc: [email protected]Signed-off-by Wei Dai <[email protected]>Acked-by Qi Zhang <[email protected]>
Applied to dpdk-next-net-intel, thanks!
/Helin