From: Björn Töpel Date: Fri, 22 Apr 2016 05:39:22 +0000 (+0200) Subject: i40evf: report error for unsupported CRC stripping config X-Git-Tag: spdx-start~6952 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=1bbcc5d21129168a212e7d755751b0d4742d20d9;p=dpdk.git i40evf: report error for unsupported CRC stripping config 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 not requested in the port configuration. Signed-off-by: Björn Töpel Acked-by: Helin Zhang --- diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 2d75b9633a..52a6ee6323 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); }