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 at 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.

Reply via email to