From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= Subject: [PATCH v3] i40evf: Report error if HW CRC strip is disabled for non-DPDK PF hosts Date: Fri, 22 Apr 2016 07:39:22 +0200 Message-ID: <1461303562-8103-1-git-send-email-bjorn.topel@intel.com> References: <1461250975-14437-1-git-send-email-bjorn.topel@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: helin.zhang@intel.com, jingjing.wu@intel.com, =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= To: dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 8675CFFA for ; Fri, 22 Apr 2016 07:39:46 +0200 (CEST) In-Reply-To: <1461250975-14437-1-git-send-email-bjorn.topel@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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=C3=B6rn T=C3=B6pel --- 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_et= hdev_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 =3D I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); + struct rte_eth_conf *conf =3D &dev->data->dev_conf; + struct i40e_vf *vf; =20 /* 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 =3D true; ad->tx_vec_allowed =3D true; =20 + /* 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 =3D I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); + if ((vf->version_major =3D=3D I40E_VIRTCHNL_VERSION_MAJOR) && + (vf->version_minor <=3D 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); } =20 --=20 2.7.4