DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts
@ 2016-04-14 14:58 Björn Töpel
  2016-04-15  7:40 ` David Marchand
  2016-04-21 15:02 ` [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled " Björn Töpel
  0 siblings, 2 replies; 14+ messages in thread
From: Björn Töpel @ 2016-04-14 14:58 UTC (permalink / raw)
  To: dev; +Cc: Björn Töpel

On Linux PF hosts, the VF has no means of changing the HW CRC strip
setting for a RX queue. It's implicitly enabled.

This patch ignores, and warns, if HW CRC stripping was disabled.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2bce69b..f88eb79 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1567,6 +1567,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 {
 	struct i40e_adapter *ad =
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct rte_eth_conf *conf = &dev->data->dev_conf;
+	struct i40e_vf *vf;
 
 	/* Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
@@ -1576,6 +1578,19 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	/* For Linux PF hosts, VF has no ability to disable HW CRC strip,
+	 * and is implicitly enabled by the PF.
+	 */
+	if (!conf->rxmode.hw_strip_crc) {
+		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+		if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
+		    (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
+			/* Peer is Linux PF host. */
+			PMD_INIT_LOG(NOTICE, "VF can't disable HW CRC Strip.");
+			conf->rxmode.hw_strip_crc = 1;
+		}
+	}
+
 	return i40evf_init_vlan(dev);
 }
 
-- 
2.7.4

----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

* Re: [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts
  2016-04-14 14:58 [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts Björn Töpel
@ 2016-04-15  7:40 ` David Marchand
  2016-04-15  8:07   ` Zhang, Helin
  2016-04-21 15:02 ` [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled " Björn Töpel
  1 sibling, 1 reply; 14+ messages in thread
From: David Marchand @ 2016-04-15  7:40 UTC (permalink / raw)
  To: Björn Töpel; +Cc: dev, Zhang, Helin, Wu, Jingjing

CC maintainers.

On Thu, Apr 14, 2016 at 4:58 PM, Björn Töpel <bjorn.topel@intel.com> wrote:
> On Linux PF hosts, the VF has no means of changing the HW CRC strip
> setting for a RX queue. It's implicitly enabled.
>
> This patch ignores, and warns, if HW CRC stripping was disabled.
>
> Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 2bce69b..f88eb79 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1567,6 +1567,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
>  {
>         struct i40e_adapter *ad =
>                 I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +       struct rte_eth_conf *conf = &dev->data->dev_conf;
> +       struct i40e_vf *vf;
>
>         /* Initialize to TRUE. If any of Rx queues doesn't meet the bulk
>          * allocation or vector Rx preconditions we will reset it.
> @@ -1576,6 +1578,19 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
>         ad->tx_simple_allowed = true;
>         ad->tx_vec_allowed = true;
>
> +       /* For Linux PF hosts, VF has no ability to disable HW CRC strip,
> +        * and is implicitly enabled by the PF.
> +        */
> +       if (!conf->rxmode.hw_strip_crc) {
> +               vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> +               if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
> +                   (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
> +                       /* Peer is Linux PF host. */
> +                       PMD_INIT_LOG(NOTICE, "VF can't disable HW CRC Strip.");
> +                       conf->rxmode.hw_strip_crc = 1;
> +               }
> +       }
> +
>         return i40evf_init_vlan(dev);
>  }

Not sure this is the right way to handle it.
The driver should return an error rather than silently discard what
the application asked.

>
> --
> 2.7.4
>
> ----------------------------------------------------------------------
> Intel Sweden AB
> Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
> Registration Number: 556189-6027
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.

Please, remove this.


-- 
David Marchand

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

* Re: [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts
  2016-04-15  7:40 ` David Marchand
@ 2016-04-15  8:07   ` Zhang, Helin
  2016-04-18 18:47     ` Topel, Bjorn
  0 siblings, 1 reply; 14+ messages in thread
From: Zhang, Helin @ 2016-04-15  8:07 UTC (permalink / raw)
  To: David Marchand, Topel, Bjorn; +Cc: dev, Wu, Jingjing



> -----Original Message-----
> From: David Marchand [mailto:david.marchand@6wind.com]
> Sent: Friday, April 15, 2016 3:41 PM
> To: Topel, Bjorn <bjorn.topel@intel.com>
> Cc: dev@dpdk.org; Zhang, Helin <helin.zhang@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF
> hosts
> 
> CC maintainers.
> 
> On Thu, Apr 14, 2016 at 4:58 PM, Björn Töpel <bjorn.topel@intel.com> wrote:
> > On Linux PF hosts, the VF has no means of changing the HW CRC strip
> > setting for a RX queue. It's implicitly enabled.
> >
> > This patch ignores, and warns, if HW CRC stripping was disabled.
> >
> > Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
> > ---
> >  drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> > b/drivers/net/i40e/i40e_ethdev_vf.c
> > index 2bce69b..f88eb79 100644
> > --- a/drivers/net/i40e/i40e_ethdev_vf.c
> > +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> > @@ -1567,6 +1567,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev)  {
> >         struct i40e_adapter *ad =
> >
> I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> > +       struct rte_eth_conf *conf = &dev->data->dev_conf;
> > +       struct i40e_vf *vf;
> >
> >         /* Initialize to TRUE. If any of Rx queues doesn't meet the bulk
> >          * allocation or vector Rx preconditions we will reset it.
> > @@ -1576,6 +1578,19 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
> >         ad->tx_simple_allowed = true;
> >         ad->tx_vec_allowed = true;
> >
> > +       /* For Linux PF hosts, VF has no ability to disable HW CRC strip,
> > +        * and is implicitly enabled by the PF.
> > +        */
> > +       if (!conf->rxmode.hw_strip_crc) {
> > +               vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> > +               if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR)
> &&
> > +                   (vf->version_minor <=
> I40E_VIRTCHNL_VERSION_MINOR)) {
> > +                       /* Peer is Linux PF host. */
> > +                       PMD_INIT_LOG(NOTICE, "VF can't disable HW CRC
> Strip.");
> > +                       conf->rxmode.hw_strip_crc = 1;
> > +               }
> > +       }
> > +
> >         return i40evf_init_vlan(dev);
> >  }
> 
> Not sure this is the right way to handle it.
> The driver should return an error rather than silently discard what the application
> asked.
I also think it should return an error with checking if the host is kernel driver, and crc strip is disabled in VF.
Thank you David!

Regards,
Helin

> 
> >
> > --
> > 2.7.4
> >
> > ----------------------------------------------------------------------
> > Intel Sweden AB
> > Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
> > Registration Number: 556189-6027
> >
> > This e-mail and any attachments may contain confidential material for
> > the sole use of the intended recipient(s). Any review or distribution
> > by others is strictly prohibited. If you are not the intended
> > recipient, please contact the sender and delete all copies.
> 
> Please, remove this.
> 
> 
> --
> David Marchand

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

* Re: [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts
  2016-04-15  8:07   ` Zhang, Helin
@ 2016-04-18 18:47     ` Topel, Bjorn
  2016-04-19  2:31       ` Zhang, Helin
  0 siblings, 1 reply; 14+ messages in thread
From: Topel, Bjorn @ 2016-04-18 18:47 UTC (permalink / raw)
  To: Zhang, Helin, David Marchand; +Cc: dev, Wu, Jingjing

>> Not sure this is the right way to handle it.  The driver should
>> return an error rather than silently discard what the
>> application asked.
>
> I also think it should return an error with checking if the
> host is kernel driver, and crc strip is disabled in VF.  Thank
> you David!

Thanks for reviewing my patch, Helin and David.

I agree that it's subtle to ignore the error, and just log the
error. This is how ixgbevf behaves (refer to
ixgbevf_dev_configure), so I figured that i40evf should behave
analogous.

I'll submit a v2 of the patch that returns an EINVAL and logs the
failure.

Would it make sense to change the ixgbevf_dev_configure as well,
in a separate patch?


>> ----------------------------------------------------------------------
>> Intel Sweden AB
>> Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
>> Registration Number: 556189-6027
>>
>> This e-mail and any attachments may contain confidential material for
>> the sole use of the intended recipient(s). Any review or distribution
>> by others is strictly prohibited. If you are not the intended
>> recipient, please contact the sender and delete all copies.
>
> Please, remove this.

Noted. Will make sure to fix that for future revisions. Thanks!


Björn
----------------------------------------------------------------------
Intel Sweden AB
Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm, Sweden
Registration Number: 556189-6027

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

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

* Re: [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts
  2016-04-18 18:47     ` Topel, Bjorn
@ 2016-04-19  2:31       ` Zhang, Helin
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang, Helin @ 2016-04-19  2:31 UTC (permalink / raw)
  To: Topel, Bjorn, David Marchand; +Cc: dev, Wu, Jingjing



> -----Original Message-----
> From: Topel, Bjorn
> Sent: Tuesday, April 19, 2016 2:47 AM
> To: Zhang, Helin <helin.zhang@intel.com>; David Marchand
> <david.marchand@6wind.com>
> Cc: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>
> Subject: RE: [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF
> hosts
> 
> >> Not sure this is the right way to handle it.  The driver should
> >> return an error rather than silently discard what the application
> >> asked.
> >
> > I also think it should return an error with checking if the host is
> > kernel driver, and crc strip is disabled in VF.  Thank you David!
> 
> Thanks for reviewing my patch, Helin and David.
> 
> I agree that it's subtle to ignore the error, and just log the error. This is how
> ixgbevf behaves (refer to ixgbevf_dev_configure), so I figured that i40evf should
> behave analogous.
> 
> I'll submit a v2 of the patch that returns an EINVAL and logs the failure.
> 
> Would it make sense to change the ixgbevf_dev_configure as well, in a separate
> patch?
Yes, I agree with you that ixgbe and i40e should be consistent. Thank you!

/Helin

> 
> 
> >> ---------------------------------------------------------------------
> >> -
> >> Intel Sweden AB
> >> Registered Office: Isafjordsgatan 30B, 164 40 Kista, Stockholm,
> >> Sweden Registration Number: 556189-6027
> >>
> >> This e-mail and any attachments may contain confidential material for
> >> the sole use of the intended recipient(s). Any review or distribution
> >> by others is strictly prohibited. If you are not the intended
> >> recipient, please contact the sender and delete all copies.
> >
> > Please, remove this.
> 
> Noted. Will make sure to fix that for future revisions. Thanks!
> 
> 
> Björn

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

* [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF hosts
  2016-04-14 14:58 [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts Björn Töpel
  2016-04-15  7:40 ` David Marchand
@ 2016-04-21 15:02 ` Björn Töpel
  2016-04-22  1:52   ` Zhang, Helin
  2016-04-22  5:39   ` [dpdk-dev] [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK " Björn Töpel
  1 sibling, 2 replies; 14+ messages in thread
From: Björn Töpel @ 2016-04-21 15:02 UTC (permalink / raw)
  To: dev; +Cc: david.marchand, helin.zhang, jingjing.wu, Björn Töpel

On Linux PF hosts, the VF has no means of changing the HW CRC strip
setting for a RX queue. It's implicitly enabled.

This patch checks if the host is running a Linux PF kernel driver, and
returns an error, if HW CRC stripping was disabled.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2bce69b..0057ed6 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1567,6 +1567,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 {
 	struct i40e_adapter *ad =
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct rte_eth_conf *conf = &dev->data->dev_conf;
+	struct i40e_vf *vf;
 
 	/* Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
@@ -1576,6 +1578,19 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	/* For Linux PF hosts, VF has no ability to disable HW CRC strip,
+	 * and is implicitly enabled by the PF.
+	 */
+	if (!conf->rxmode.hw_strip_crc) {
+		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+		if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
+		    (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
+			/* Peer is Linux PF host. */
+			PMD_INIT_LOG(ERR, "VF can't disable HW CRC Strip");
+			return -EINVAL;
+		}
+	}
+
 	return i40evf_init_vlan(dev);
 }
 
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF hosts
  2016-04-21 15:02 ` [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled " Björn Töpel
@ 2016-04-22  1:52   ` Zhang, Helin
  2016-04-22  4:54     ` Topel, Bjorn
  2016-04-22  5:39   ` [dpdk-dev] [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK " Björn Töpel
  1 sibling, 1 reply; 14+ messages in thread
From: Zhang, Helin @ 2016-04-22  1:52 UTC (permalink / raw)
  To: Topel, Bjorn, dev; +Cc: david.marchand, Wu, Jingjing



> -----Original Message-----
> From: Topel, Bjorn
> Sent: Thursday, April 21, 2016 11:03 PM
> To: dev@dpdk.org
> Cc: david.marchand@6wind.com; Zhang, Helin <helin.zhang@intel.com>; Wu,
> Jingjing <jingjing.wu@intel.com>; Topel, Bjorn <bjorn.topel@intel.com>
> Subject: [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF
> hosts
> 
> On Linux PF hosts, the VF has no means of changing the HW CRC strip setting for
> a RX queue. It's implicitly enabled.
> 
> This patch checks if the host is running a Linux PF kernel driver, and returns an
> error, if HW CRC stripping was disabled.
> 
> Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
> b/drivers/net/i40e/i40e_ethdev_vf.c
> index 2bce69b..0057ed6 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -1567,6 +1567,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev)  {
>  	struct i40e_adapter *ad =
>  		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
> +	struct rte_eth_conf *conf = &dev->data->dev_conf;
> +	struct i40e_vf *vf;
> 
>  	/* Initialize to TRUE. If any of Rx queues doesn't meet the bulk
>  	 * allocation or vector Rx preconditions we will reset it.
> @@ -1576,6 +1578,19 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
>  	ad->tx_simple_allowed = true;
>  	ad->tx_vec_allowed = true;
> 
> +	/* For Linux PF hosts, VF has no ability to disable HW CRC strip,
> +	 * and is implicitly enabled by the PF.
> +	 */
> +	if (!conf->rxmode.hw_strip_crc) {
> +		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> +		if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
> +		    (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
> +			/* Peer is Linux PF host. */
Can you reword above comments?
It just means the host is not DPDK PF host driver, it could be Linux driver,
and possible others (e.g. FreeBSD, VMWARE?).

Thanks,
Helin

> +			PMD_INIT_LOG(ERR, "VF can't disable HW CRC Strip");
> +			return -EINVAL;
> +		}
> +	}
> +
>  	return i40evf_init_vlan(dev);
>  }
> 
> --
> 2.7.4


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

* Re: [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF hosts
  2016-04-22  1:52   ` Zhang, Helin
@ 2016-04-22  4:54     ` Topel, Bjorn
  2016-04-22  5:07       ` Zhang, Helin
  0 siblings, 1 reply; 14+ messages in thread
From: Topel, Bjorn @ 2016-04-22  4:54 UTC (permalink / raw)
  To: Zhang, Helin, dev; +Cc: david.marchand, Wu, Jingjing

>> +     /* For Linux PF hosts, VF has no ability to disable HW CRC strip,
>> +      * and is implicitly enabled by the PF.
>> +      */
>> +     if (!conf->rxmode.hw_strip_crc) {
>> +             vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
>> +             if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
>> +                 (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
>> +                     /* Peer is Linux PF host. */
> Can you reword above comments?
> It just means the host is not DPDK PF host driver, it could be Linux driver,
> and possible others (e.g. FreeBSD, VMWARE?).

Sure, I'll reword it! The broader question, however, is this correct for non-Linux/non-DPDK PF drivers? 
For FreeBSD I'll dig into the code, but for VMWARE (and I'd assume Microsoft Windows) it'll be harder.

Do you have any insights on the behavior for the non-open i40e PF drivers?

>From the documentation [1], it's unclear whether non-Linux/non-DPDK PF drivers are supported. My
interpretation was that only DPDK and Linux PF hosts are supported for Fortville NICs.


Björn


[1] http://dpdk.org/doc/guides/nics/intel_vf.html

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

* Re: [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF hosts
  2016-04-22  4:54     ` Topel, Bjorn
@ 2016-04-22  5:07       ` Zhang, Helin
  2016-04-22  5:17         ` Topel, Bjorn
  0 siblings, 1 reply; 14+ messages in thread
From: Zhang, Helin @ 2016-04-22  5:07 UTC (permalink / raw)
  To: Topel, Bjorn, dev; +Cc: david.marchand, Wu, Jingjing


> -----Original Message-----
> From: Topel, Bjorn
> Sent: Friday, April 22, 2016 12:55 PM
> To: Zhang, Helin; dev@dpdk.org
> Cc: david.marchand@6wind.com; Wu, Jingjing
> Subject: RE: [PATCH v2] i40evf: Report error if HW CRC strip is disabled for
> Linux PF hosts
> 
> >> +     /* For Linux PF hosts, VF has no ability to disable HW CRC strip,
> >> +      * and is implicitly enabled by the PF.
> >> +      */
> >> +     if (!conf->rxmode.hw_strip_crc) {
> >> +             vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> >> +             if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
> >> +                 (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
> >> +                     /* Peer is Linux PF host. */
> > Can you reword above comments?
> > It just means the host is not DPDK PF host driver, it could be Linux
> > driver, and possible others (e.g. FreeBSD, VMWARE?).
> 
> Sure, I'll reword it! The broader question, however, is this correct for non-
> Linux/non-DPDK PF drivers?
> For FreeBSD I'll dig into the code, but for VMWARE (and I'd assume Microsoft
> Windows) it'll be harder.
> 
> Do you have any insights on the behavior for the non-open i40e PF drivers?
> 
> From the documentation [1], it's unclear whether non-Linux/non-DPDK PF
> drivers are supported. My interpretation was that only DPDK and Linux PF
> hosts are supported for Fortville NICs.
I guess only DPDK is different, though I am not sure.
As all other NIC drivers were developped by the same organization.
Even assuming that FreeBSD supports both configuration, it will not be a problem,
as DPDK just doesn't support, and nothing wrong.

Thanks,
Helin

> 
> 
> Björn
> 
> 
> [1] http://dpdk.org/doc/guides/nics/intel_vf.html

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

* Re: [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF hosts
  2016-04-22  5:07       ` Zhang, Helin
@ 2016-04-22  5:17         ` Topel, Bjorn
  2016-04-22  5:18           ` Zhang, Helin
  0 siblings, 1 reply; 14+ messages in thread
From: Topel, Bjorn @ 2016-04-22  5:17 UTC (permalink / raw)
  To: Zhang, Helin, dev; +Cc: david.marchand, Wu, Jingjing

>> >> +     /* For Linux PF hosts, VF has no ability to disable HW CRC strip,
>> >> +      * and is implicitly enabled by the PF.
>> >> +      */
>> >> +     if (!conf->rxmode.hw_strip_crc) {
>> >> +             vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
>> >> +             if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
>> >> +                 (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
>> >> +                     /* Peer is Linux PF host. */
>> > Can you reword above comments?
>> > It just means the host is not DPDK PF host driver, it could be Linux
>> > driver, and possible others (e.g. FreeBSD, VMWARE?).
>>
>> Sure, I'll reword it! The broader question, however, is this correct for non-
>> Linux/non-DPDK PF drivers?
>> For FreeBSD I'll dig into the code, but for VMWARE (and I'd assume Microsoft
>> Windows) it'll be harder.
>>
>> Do you have any insights on the behavior for the non-open i40e PF drivers?
>>
>> From the documentation [1], it's unclear whether non-Linux/non-DPDK PF
>> drivers are supported. My interpretation was that only DPDK and Linux PF
>> hosts are supported for Fortville NICs.
> I guess only DPDK is different, though I am not sure.
> As all other NIC drivers were developped by the same organization.
> Even assuming that FreeBSD supports both configuration, it will not be a problem,
> as DPDK just doesn't support, and nothing wrong.

I verified against the FreeBSD ixl-1.4.27 driver, and it
behaves (in terms of rxq crcstrip) the same way.

It would be a problem if the non-Linux/non-DPDK drivers had
it (rx crcstrip) *disabled* by default. (Further, being able to
actually change the setting from a VF would be nice as well. :-))
This doesn't seem to be case, though.

So, I'll change the wording from "Linux PF hosts" to "non-DPDK PF
host". Would that be OK?


Björn

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

* Re: [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF hosts
  2016-04-22  5:17         ` Topel, Bjorn
@ 2016-04-22  5:18           ` Zhang, Helin
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang, Helin @ 2016-04-22  5:18 UTC (permalink / raw)
  To: Topel, Bjorn, dev; +Cc: david.marchand, Wu, Jingjing



> -----Original Message-----
> From: Topel, Bjorn
> Sent: Friday, April 22, 2016 1:17 PM
> To: Zhang, Helin <helin.zhang@intel.com>; dev@dpdk.org
> Cc: david.marchand@6wind.com; Wu, Jingjing <jingjing.wu@intel.com>
> Subject: RE: [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux
> PF hosts
> 
> >> >> +     /* For Linux PF hosts, VF has no ability to disable HW CRC strip,
> >> >> +      * and is implicitly enabled by the PF.
> >> >> +      */
> >> >> +     if (!conf->rxmode.hw_strip_crc) {
> >> >> +             vf =
> I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
> >> >> +             if ((vf->version_major ==
> I40E_VIRTCHNL_VERSION_MAJOR) &&
> >> >> +                 (vf->version_minor <=
> I40E_VIRTCHNL_VERSION_MINOR)) {
> >> >> +                     /* Peer is Linux PF host. */
> >> > Can you reword above comments?
> >> > It just means the host is not DPDK PF host driver, it could be
> >> > Linux driver, and possible others (e.g. FreeBSD, VMWARE?).
> >>
> >> Sure, I'll reword it! The broader question, however, is this correct
> >> for non- Linux/non-DPDK PF drivers?
> >> For FreeBSD I'll dig into the code, but for VMWARE (and I'd assume
> >> Microsoft
> >> Windows) it'll be harder.
> >>
> >> Do you have any insights on the behavior for the non-open i40e PF drivers?
> >>
> >> From the documentation [1], it's unclear whether non-Linux/non-DPDK
> >> PF drivers are supported. My interpretation was that only DPDK and
> >> Linux PF hosts are supported for Fortville NICs.
> > I guess only DPDK is different, though I am not sure.
> > As all other NIC drivers were developped by the same organization.
> > Even assuming that FreeBSD supports both configuration, it will not be
> > a problem, as DPDK just doesn't support, and nothing wrong.
> 
> I verified against the FreeBSD ixl-1.4.27 driver, and it behaves (in terms of rxq
> crcstrip) the same way.
> 
> It would be a problem if the non-Linux/non-DPDK drivers had it (rx crcstrip)
> *disabled* by default. (Further, being able to actually change the setting from a
> VF would be nice as well. :-)) This doesn't seem to be case, though.
> 
> So, I'll change the wording from "Linux PF hosts" to "non-DPDK PF host". Would
> that be OK?
I would agree with you. :)
Thank you!

Helin

> 
> 
> Björn

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

* [dpdk-dev] [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK PF hosts
  2016-04-21 15:02 ` [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled " Björn Töpel
  2016-04-22  1:52   ` Zhang, Helin
@ 2016-04-22  5:39   ` Björn Töpel
  2016-04-29 13:42     ` Zhang, Helin
  1 sibling, 1 reply; 14+ messages in thread
From: Björn Töpel @ 2016-04-22  5:39 UTC (permalink / raw)
  To: dev; +Cc: helin.zhang, jingjing.wu, Björn Töpel

On hosts running a non-DPDK PF driver, the VF has no means of changing
the HW CRC strip setting for a RX queue. It's implicitly enabled.

This patch checks if the host is running a non-DPDK PF kernel driver,
and returns an error, if HW CRC stripping was disabled.

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 2bce69b..25f1cea 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1567,6 +1567,8 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 {
 	struct i40e_adapter *ad =
 		I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
+	struct rte_eth_conf *conf = &dev->data->dev_conf;
+	struct i40e_vf *vf;
 
 	/* Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
@@ -1576,6 +1578,19 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 	ad->tx_simple_allowed = true;
 	ad->tx_vec_allowed = true;
 
+	/* For non-DPDK PF drivers, VF has no ability to disable HW
+	 * CRC strip, and is implicitly enabled by the PF.
+	 */
+	if (!conf->rxmode.hw_strip_crc) {
+		vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+		if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
+		    (vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
+			/* Peer is running non-DPDK PF driver. */
+			PMD_INIT_LOG(ERR, "VF can't disable HW CRC Strip");
+			return -EINVAL;
+		}
+	}
+
 	return i40evf_init_vlan(dev);
 }
 
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK PF hosts
  2016-04-22  5:39   ` [dpdk-dev] [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK " Björn Töpel
@ 2016-04-29 13:42     ` Zhang, Helin
  2016-05-03 10:55       ` Bruce Richardson
  0 siblings, 1 reply; 14+ messages in thread
From: Zhang, Helin @ 2016-04-29 13:42 UTC (permalink / raw)
  To: Topel, Bjorn, dev; +Cc: Wu, Jingjing



> -----Original Message-----
> From: Topel, Bjorn
> Sent: Friday, April 22, 2016 1:39 PM
> To: dev@dpdk.org
> Cc: Zhang, Helin; Wu, Jingjing; Topel, Bjorn
> Subject: [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-
> DPDK PF hosts
> 
> On hosts running a non-DPDK PF driver, the VF has no means of changing the
> HW CRC strip setting for a RX queue. It's implicitly enabled.
> 
> This patch checks if the host is running a non-DPDK PF kernel driver, and
> returns an error, if HW CRC stripping was disabled.
> 
> Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>

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

* Re: [dpdk-dev] [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK PF hosts
  2016-04-29 13:42     ` Zhang, Helin
@ 2016-05-03 10:55       ` Bruce Richardson
  0 siblings, 0 replies; 14+ messages in thread
From: Bruce Richardson @ 2016-05-03 10:55 UTC (permalink / raw)
  To: Zhang, Helin; +Cc: Topel, Bjorn, dev, Wu, Jingjing

On Fri, Apr 29, 2016 at 01:42:33PM +0000, Zhang, Helin wrote:
> 
> 
> > -----Original Message-----
> > From: Topel, Bjorn
> > Sent: Friday, April 22, 2016 1:39 PM
> > To: dev@dpdk.org
> > Cc: Zhang, Helin; Wu, Jingjing; Topel, Bjorn
> > Subject: [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-
> > DPDK PF hosts
> > 
> > On hosts running a non-DPDK PF driver, the VF has no means of changing the
> > HW CRC strip setting for a RX queue. It's implicitly enabled.
> > 
> > This patch checks if the host is running a non-DPDK PF kernel driver, and
> > returns an error, if HW CRC stripping was disabled.
> > 
> > Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
> Acked-by: Helin Zhang <helin.zhang@intel.com>

Applied to dpdk-next-net/rel_16_07

/Bruce

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

end of thread, other threads:[~2016-05-03 10:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 14:58 [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip for Linux PF hosts Björn Töpel
2016-04-15  7:40 ` David Marchand
2016-04-15  8:07   ` Zhang, Helin
2016-04-18 18:47     ` Topel, Bjorn
2016-04-19  2:31       ` Zhang, Helin
2016-04-21 15:02 ` [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled " Björn Töpel
2016-04-22  1:52   ` Zhang, Helin
2016-04-22  4:54     ` Topel, Bjorn
2016-04-22  5:07       ` Zhang, Helin
2016-04-22  5:17         ` Topel, Bjorn
2016-04-22  5:18           ` Zhang, Helin
2016-04-22  5:39   ` [dpdk-dev] [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK " Björn Töpel
2016-04-29 13:42     ` Zhang, Helin
2016-05-03 10:55       ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).