All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip
@ 2018-04-16  8:14 Wei Dai
  2018-04-16  8:38 ` Lin, Xueqin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Wei Dai @ 2018-04-16  8:14 UTC (permalink / raw)
  To: wenzhuo.lu, konstantin.ananyev, qi.z.zhang, xueqin.lin
  Cc: dev, Wei Dai, stable

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@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip
  2018-04-16  8:14 [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip Wei Dai
@ 2018-04-16  8:38 ` Lin, Xueqin
  2018-04-16  8:57 ` Lin, Xueqin
  2018-04-17 13:48 ` Zhang, Qi Z
  2 siblings, 0 replies; 5+ messages in thread
From: Lin, Xueqin @ 2018-04-16  8:38 UTC (permalink / raw)
  To: Dai, Wei, Lu, Wenzhuo, Ananyev, Konstantin, Zhang, Qi Z; +Cc: dev, stable

Tested-by:  Xueqin Lin

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 <wenzhuo.lu@intel.com>; Ananyev, Konstantin <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Lin, Xueqin <xueqin.lin@intel.com>
Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@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@dpdk.org

Signed-off-by: Wei Dai <wei.dai@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip
  2018-04-16  8:14 [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip Wei Dai
  2018-04-16  8:38 ` Lin, Xueqin
@ 2018-04-16  8:57 ` Lin, Xueqin
  2018-04-17 13:48 ` Zhang, Qi Z
  2 siblings, 0 replies; 5+ messages in thread
From: Lin, Xueqin @ 2018-04-16  8:57 UTC (permalink / raw)
  To: Dai, Wei, Lu, Wenzhuo, Ananyev, Konstantin, Zhang, Qi Z; +Cc: dev, stable

> -----Original Message-----
> From: Dai, Wei
> Sent: Monday, April 16, 2018 4:14 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Lin,
> Xueqin <xueqin.lin@intel.com>
> Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@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@dpdk.org
> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>
Tested-by: Xueqin Lin <xueqin.lin@intel.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip
  2018-04-16  8:14 [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip Wei Dai
  2018-04-16  8:38 ` Lin, Xueqin
  2018-04-16  8:57 ` Lin, Xueqin
@ 2018-04-17 13:48 ` Zhang, Qi Z
  2018-04-17 16:18   ` Zhang, Helin
  2 siblings, 1 reply; 5+ messages in thread
From: Zhang, Qi Z @ 2018-04-17 13:48 UTC (permalink / raw)
  To: Dai, Wei, Lu, Wenzhuo, Ananyev, Konstantin, Lin, Xueqin; +Cc: dev, stable



> -----Original Message-----
> From: Dai, Wei
> Sent: Monday, April 16, 2018 4:14 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>; Lin,
> Xueqin <xueqin.lin@intel.com>
> Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@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@dpdk.org
> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip
  2018-04-17 13:48 ` Zhang, Qi Z
@ 2018-04-17 16:18   ` Zhang, Helin
  0 siblings, 0 replies; 5+ messages in thread
From: Zhang, Helin @ 2018-04-17 16:18 UTC (permalink / raw)
  To: Zhang, Qi Z, Dai, Wei, Lu, Wenzhuo, Ananyev, Konstantin, Lin, Xueqin
  Cc: dev, stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Tuesday, April 17, 2018 9:49 PM
> To: Dai, Wei; Lu, Wenzhuo; Ananyev, Konstantin; Lin, Xueqin
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix segfault in configuring VF VLAN
> strip
> 
> 
> 
> > -----Original Message-----
> > From: Dai, Wei
> > Sent: Monday, April 16, 2018 4:14 PM
> > To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> > <konstantin.ananyev@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> > Lin, Xueqin <xueqin.lin@intel.com>
> > Cc: dev@dpdk.org; Dai, Wei <wei.dai@intel.com>; stable@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@dpdk.org
> >
> > Signed-off-by: Wei Dai <wei.dai@intel.com>
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
Applied to dpdk-next-net-intel, thanks!

/Helin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-17 16:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16  8:14 [PATCH] net/ixgbe: fix segfault in configuring VF VLAN strip Wei Dai
2018-04-16  8:38 ` Lin, Xueqin
2018-04-16  8:57 ` Lin, Xueqin
2018-04-17 13:48 ` Zhang, Qi Z
2018-04-17 16:18   ` Zhang, Helin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.