net/ixgbe: Restore vlan filter/extend for ixgbvef

Message ID 20190306152355.1697-1-dharton@cisco.com (mailing list archive)
State Changes Requested, archived
Delegated to: Qi Zhang
Headers
Series net/ixgbe: Restore vlan filter/extend for ixgbvef |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Performance-Testing fail build patch failure
ci/Intel-compilation success Compilation OK

Commit Message

David Harton March 6, 2019, 3:23 p.m. UTC
  ixgevf vlan strip and extend capabilities were removed when
migrating to the bit flags implementation.

Restoring the capbility to enable these offloads at
configuration time.

Fixes: ec3b1124d14d (\"net/ixgbe: convert to new Rx offloads API\")
Signed-off-by: David Harton <dharton@cisco.com>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Comments

Qi Zhang March 7, 2019, 1:11 p.m. UTC | #1
Hi

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> Sent: Wednesday, March 6, 2019 11:24 PM
> To: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev, Konstantin
> <konstantin.ananyev@intel.com>
> Cc: David Harton <dharton@cisco.com>
> Subject: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend for ixgbvef
> 
> ixgevf vlan strip and extend capabilities were removed when migrating to the bit
> flags implementation.
> 
> Restoring the capbility to enable these offloads at configuration time.
> 
> Fixes: ec3b1124d14d (\"net/ixgbe: convert to new Rx offloads API\")
> Signed-off-by: David Harton <dharton@cisco.com>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index e92a70fb3..95c32257c 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -2853,15 +2853,13 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev
> *dev)
>  		   DEV_RX_OFFLOAD_TCP_CKSUM   |
>  		   DEV_RX_OFFLOAD_KEEP_CRC    |
>  		   DEV_RX_OFFLOAD_JUMBO_FRAME |
> +		   DEV_RX_OFFLOAD_VLAN_FILTER |
> +		   DEV_RX_OFFLOAD_VLAN_EXTEND |
>  		   DEV_RX_OFFLOAD_SCATTER;
> 
>  	if (hw->mac.type == ixgbe_mac_82598EB)
>  		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
> 
> -	if (ixgbe_is_vf(dev) == 0)

Patchwork shows "build patch error" for ci/Performance-Testing.
Seems this is the only place ixgbe_is_vf is used, so it can also be removed

> -		offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |
> -			     DEV_RX_OFFLOAD_VLAN_EXTEND);
> -
>  	/*
>  	 * RSC is only supported by 82599 and x540 PF devices in a non-SR-IOV
>  	 * mode.
> --
> 2.19.1
  
David Harton March 7, 2019, 2:01 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: Zhang, Qi Z <qi.z.zhang@intel.com>
> Sent: Thursday, March 07, 2019 8:11 AM
> To: David Harton (dharton) <dharton@cisco.com>; dev@dpdk.org; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend for
> ixgbvef
> 
> Hi
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Wednesday, March 6, 2019 11:24 PM
> > To: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev,
> > Konstantin <konstantin.ananyev@intel.com>
> > Cc: David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend for
> > ixgbvef
> >
> > ixgevf vlan strip and extend capabilities were removed when migrating
> > to the bit flags implementation.
> >
> > Restoring the capbility to enable these offloads at configuration time.
> >
> > Fixes: ec3b1124d14d (\"net/ixgbe: convert to new Rx offloads API\")
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c
> > b/drivers/net/ixgbe/ixgbe_rxtx.c index e92a70fb3..95c32257c 100644
> > --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> > @@ -2853,15 +2853,13 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev
> > *dev)
> >  		   DEV_RX_OFFLOAD_TCP_CKSUM   |
> >  		   DEV_RX_OFFLOAD_KEEP_CRC    |
> >  		   DEV_RX_OFFLOAD_JUMBO_FRAME |
> > +		   DEV_RX_OFFLOAD_VLAN_FILTER |
> > +		   DEV_RX_OFFLOAD_VLAN_EXTEND |
> >  		   DEV_RX_OFFLOAD_SCATTER;
> >
> >  	if (hw->mac.type == ixgbe_mac_82598EB)
> >  		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
> >
> > -	if (ixgbe_is_vf(dev) == 0)
> 
> Patchwork shows "build patch error" for ci/Performance-Testing.
> Seems this is the only place ixgbe_is_vf is used, so it can also be
> removed

Yes, I didn't notice that.  Assuming people are good with the fundamental change I'll post a new patch with ixgbe_is_vf removed.

Thanks,
Dave

> 
> > -		offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |
> > -			     DEV_RX_OFFLOAD_VLAN_EXTEND);
> > -
> >  	/*
> >  	 * RSC is only supported by 82599 and x540 PF devices in a non-SR-
> IOV
> >  	 * mode.
> > --
> > 2.19.1
  
Zhao1, Wei March 8, 2019, 6:35 a.m. UTC | #3
Hi,  David Harton

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> Sent: Wednesday, March 6, 2019 11:24 PM
> To: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev,
> Konstantin <konstantin.ananyev@intel.com>
> Cc: David Harton <dharton@cisco.com>
> Subject: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend for
> ixgbvef
> 
> ixgevf vlan strip and extend capabilities were removed when migrating to the
> bit flags implementation.
> 
> Restoring the capbility to enable these offloads at configuration time.
> 
> Fixes: ec3b1124d14d (\"net/ixgbe: convert to new Rx offloads API\")
> Signed-off-by: David Harton <dharton@cisco.com>
> ---
>  drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
> index e92a70fb3..95c32257c 100644
> --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> @@ -2853,15 +2853,13 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev
> *dev)
>  		   DEV_RX_OFFLOAD_TCP_CKSUM   |
>  		   DEV_RX_OFFLOAD_KEEP_CRC    |
>  		   DEV_RX_OFFLOAD_JUMBO_FRAME |
> +		   DEV_RX_OFFLOAD_VLAN_FILTER |
> +		   DEV_RX_OFFLOAD_VLAN_EXTEND |
>  		   DEV_RX_OFFLOAD_SCATTER;
> 

Why do we  set   DEV_RX_OFFLOAD_VLAN_EXTEND for ixgbevf ?  
It seems Ixgbevf do not support this configuration. Only pf does.
But this ixgbe_get_rx_port_offloads () is used by both vf and pf. 


>  	if (hw->mac.type == ixgbe_mac_82598EB)
>  		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
> 
> -	if (ixgbe_is_vf(dev) == 0)
> -		offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |
> -			     DEV_RX_OFFLOAD_VLAN_EXTEND);
> -
>  	/*
>  	 * RSC is only supported by 82599 and x540 PF devices in a non-SR-
> IOV
>  	 * mode.
> --
> 2.19.1
  
David Harton March 8, 2019, 12:38 p.m. UTC | #4
Hi

> -----Original Message-----
> From: Zhao1, Wei <wei.zhao1@intel.com>
> Sent: Friday, March 08, 2019 1:35 AM
> To: David Harton (dharton) <dharton@cisco.com>; dev@dpdk.org; Lu, Wenzhuo
> <wenzhuo.lu@intel.com>; Ananyev, Konstantin <konstantin.ananyev@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend for
> ixgbvef
> 
> Hi,  David Harton
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton
> > Sent: Wednesday, March 6, 2019 11:24 PM
> > To: dev@dpdk.org; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Ananyev,
> > Konstantin <konstantin.ananyev@intel.com>
> > Cc: David Harton <dharton@cisco.com>
> > Subject: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend for
> > ixgbvef
> >
> > ixgevf vlan strip and extend capabilities were removed when migrating
> > to the bit flags implementation.
> >
> > Restoring the capbility to enable these offloads at configuration time.
> >
> > Fixes: ec3b1124d14d (\"net/ixgbe: convert to new Rx offloads API\")
> > Signed-off-by: David Harton <dharton@cisco.com>
> > ---
> >  drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c
> > b/drivers/net/ixgbe/ixgbe_rxtx.c index e92a70fb3..95c32257c 100644
> > --- a/drivers/net/ixgbe/ixgbe_rxtx.c
> > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c
> > @@ -2853,15 +2853,13 @@ ixgbe_get_rx_port_offloads(struct rte_eth_dev
> > *dev)
> >  		   DEV_RX_OFFLOAD_TCP_CKSUM   |
> >  		   DEV_RX_OFFLOAD_KEEP_CRC    |
> >  		   DEV_RX_OFFLOAD_JUMBO_FRAME |
> > +		   DEV_RX_OFFLOAD_VLAN_FILTER |
> > +		   DEV_RX_OFFLOAD_VLAN_EXTEND |
> >  		   DEV_RX_OFFLOAD_SCATTER;
> >
> 
> Why do we  set   DEV_RX_OFFLOAD_VLAN_EXTEND for ixgbevf ?
> It seems Ixgbevf do not support this configuration. Only pf does.
> But this ixgbe_get_rx_port_offloads () is used by both vf and pf.

I'm personally happy only to move FILTER but I noticed that EXTEND used to be 'supported' and I see references to it elsewhere in ixgbevf code:

ixgbevf_dev_start()
    /* Set HW strip */
    mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |
        ETH_VLAN_EXTEND_MASK;

ixgbe_vlan_offload_config()
    if (mask & ETH_VLAN_EXTEND_MASK) {
        if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)
            ixgbe_vlan_hw_extend_enable(dev);
        else
            ixgbe_vlan_hw_extend_disable(dev);
    }

These uses imply that EXTEND should be supported, correct?

Thanks,
Dave

> 
> 
> >  	if (hw->mac.type == ixgbe_mac_82598EB)
> >  		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
> >
> > -	if (ixgbe_is_vf(dev) == 0)
> > -		offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |
> > -			     DEV_RX_OFFLOAD_VLAN_EXTEND);
> > -
> >  	/*
> >  	 * RSC is only supported by 82599 and x540 PF devices in a non-SR-
> > IOV
> >  	 * mode.
> > --
> > 2.19.1
  
Zhao1, Wei March 11, 2019, 2:02 a.m. UTC | #5
Hi,



> -----Original Message-----

> From: David Harton (dharton) [mailto:dharton@cisco.com]

> Sent: Friday, March 8, 2019 8:39 PM

> To: Zhao1, Wei <wei.zhao1@intel.com>; dev@dpdk.org; Lu, Wenzhuo

> <wenzhuo.lu@intel.com>; Ananyev, Konstantin

> <konstantin.ananyev@intel.com>

> Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend for

> ixgbvef

>

> Hi

>

> > -----Original Message-----

> > From: Zhao1, Wei <wei.zhao1@intel.com<mailto:wei.zhao1@intel.com>>

> > Sent: Friday, March 08, 2019 1:35 AM

> > To: David Harton (dharton) <dharton@cisco.com<mailto:dharton@cisco.com>>; dev@dpdk.org<mailto:dev@dpdk.org>; Lu,

> > Wenzhuo <wenzhuo.lu@intel.com<mailto:wenzhuo.lu@intel.com>>; Ananyev, Konstantin

> > <konstantin.ananyev@intel.com<mailto:konstantin.ananyev@intel.com>>

> > Subject: RE: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend

> > for ixgbvef

> >

> > Hi,  David Harton

> >

> > > -----Original Message-----

> > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Harton

> > > Sent: Wednesday, March 6, 2019 11:24 PM

> > > To: dev@dpdk.org<mailto:dev@dpdk.org>; Lu, Wenzhuo <wenzhuo.lu@intel.com<mailto:wenzhuo.lu@intel.com>>; Ananyev,

> > > Konstantin <konstantin.ananyev@intel.com<mailto:konstantin.ananyev@intel.com>>

> > > Cc: David Harton <dharton@cisco.com<mailto:dharton@cisco.com>>

> > > Subject: [dpdk-dev] [PATCH] net/ixgbe: Restore vlan filter/extend

> > > for ixgbvef

> > >

> > > ixgevf vlan strip and extend capabilities were removed when

> > > migrating to the bit flags implementation.

> > >

> > > Restoring the capbility to enable these offloads at configuration time.

> > >

> > > Fixes: ec3b1124d14d (\"net/ixgbe: convert to new Rx offloads API\")

> > > Signed-off-by: David Harton <dharton@cisco.com<mailto:dharton@cisco.com>>

> > > ---

> > >  drivers/net/ixgbe/ixgbe_rxtx.c | 6 ++----

> > >  1 file changed, 2 insertions(+), 4 deletions(-)

> > >

> > > diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c

> > > b/drivers/net/ixgbe/ixgbe_rxtx.c index e92a70fb3..95c32257c 100644

> > > --- a/drivers/net/ixgbe/ixgbe_rxtx.c

> > > +++ b/drivers/net/ixgbe/ixgbe_rxtx.c

> > > @@ -2853,15 +2853,13 @@ ixgbe_get_rx_port_offloads(struct

> > > rte_eth_dev

> > > *dev)

> > >                         DEV_RX_OFFLOAD_TCP_CKSUM   |

> > >                         DEV_RX_OFFLOAD_KEEP_CRC    |

> > >                         DEV_RX_OFFLOAD_JUMBO_FRAME |

> > > +                     DEV_RX_OFFLOAD_VLAN_FILTER |

> > > +                     DEV_RX_OFFLOAD_VLAN_EXTEND |

> > >                         DEV_RX_OFFLOAD_SCATTER;

> > >

> >

> > Why do we  set   DEV_RX_OFFLOAD_VLAN_EXTEND for ixgbevf ?

> > It seems Ixgbevf do not support this configuration. Only pf does.

> > But this ixgbe_get_rx_port_offloads () is used by both vf and pf.

>

> I'm personally happy only to move FILTER but I noticed that EXTEND used to

> be 'supported' and I see references to it elsewhere in ixgbevf code:

>

> ixgbevf_dev_start()

>     /* Set HW strip */

>     mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |

>         ETH_VLAN_EXTEND_MASK;

>

> ixgbe_vlan_offload_config()

>     if (mask & ETH_VLAN_EXTEND_MASK) {

>         if (rxmode->offloads & DEV_RX_OFFLOAD_VLAN_EXTEND)

>             ixgbe_vlan_hw_extend_enable(dev);

>         else

>             ixgbe_vlan_hw_extend_disable(dev);

>     }

>

> These uses imply that EXTEND should be supported, correct?



No, not ixgbe_vlan_offload_config, but ixgbevf_vlan_offload_config,

ixgbevf_dev_start() is below:



                /* Set HW strip */

                mask = ETH_VLAN_STRIP_MASK | ETH_VLAN_FILTER_MASK |

                                ETH_VLAN_EXTEND_MASK;

                err = ixgbevf_vlan_offload_config(dev, mask);







static int

ixgbevf_vlan_offload_config(struct rte_eth_dev *dev, int mask)

{

                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 < 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);

                                }

                }



                return 0;

}







>

> Thanks,

> Dave

>

> >

> >

> > >      if (hw->mac.type == ixgbe_mac_82598EB)

> > >                      offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;

> > >

> > > -   if (ixgbe_is_vf(dev) == 0)

> > > -                   offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |

> > > -                                        DEV_RX_OFFLOAD_VLAN_EXTEND);

> > > -

> > >      /*

> > >       * RSC is only supported by 82599 and x540 PF devices in a non-SR-

> > > IOV

> > >       * mode.

> > > --

> > > 2.19.1
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index e92a70fb3..95c32257c 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2853,15 +2853,13 @@  ixgbe_get_rx_port_offloads(struct rte_eth_dev *dev)
 		   DEV_RX_OFFLOAD_TCP_CKSUM   |
 		   DEV_RX_OFFLOAD_KEEP_CRC    |
 		   DEV_RX_OFFLOAD_JUMBO_FRAME |
+		   DEV_RX_OFFLOAD_VLAN_FILTER |
+		   DEV_RX_OFFLOAD_VLAN_EXTEND |
 		   DEV_RX_OFFLOAD_SCATTER;
 
 	if (hw->mac.type == ixgbe_mac_82598EB)
 		offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
 
-	if (ixgbe_is_vf(dev) == 0)
-		offloads |= (DEV_RX_OFFLOAD_VLAN_FILTER |
-			     DEV_RX_OFFLOAD_VLAN_EXTEND);
-
 	/*
 	 * RSC is only supported by 82599 and x540 PF devices in a non-SR-IOV
 	 * mode.