DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jeff Guo <jia.guo@intel.com>
To: helin.zhang@intel.com, jingjing.wu@intel.com
Cc: dev@dpdk.org, jia.guo@intel.com, stable@dpdk.org
Subject: [dpdk-dev] [dpdk-dev 4/4] net/i40evf: add notify to correct CRC strip config
Date: Thu, 16 Mar 2017 18:20:08 +0800	[thread overview]
Message-ID: <1489659608-47745-4-git-send-email-jia.guo@intel.com> (raw)
In-Reply-To: <1489659608-47745-1-git-send-email-jia.guo@intel.com>

Since VF has no ability to disable/enable HW CRC strip for non-DPDK PF
drivers in i40e, if HW CRC strip config in example app's rxmode is not
match with the kernel PF default config, VF driver will return fail.
The patch just add notify to let user know how to correctly re-config
it to let the VF successful to work.

Signed-off-by: Jeff Guo <jia.guo@intel.com>
Cc: stable@dpdk.org
---
 config/common_base                |  1 +
 drivers/net/i40e/i40e_ethdev_vf.c | 30 +++++++++++++++++++++---------
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/config/common_base b/config/common_base
index aeee13e..2b9fcfb 100644
--- a/config/common_base
+++ b/config/common_base
@@ -188,6 +188,7 @@ CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4
 CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM=4
 # interval up to 8160 us, aligned to 2 (or default value)
 CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1
+CONFIG_RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC=n
 
 #
 # Compile burst-oriented FM10K PMD
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 55fd344..f72bda3 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1567,7 +1567,7 @@ 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;
+	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
 
 	/* Initialize to TRUE. If any of Rx queues doesn't meet the bulk
 	 * allocation or vector Rx preconditions we will reset it.
@@ -1577,17 +1577,29 @@ 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.
+	/* For non-DPDK PF drivers, VF has no ability to disable/enable HW
+	 * CRC strip, and is implicitly enabled/disabled 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");
+	if ((vf->version_major == I40E_VIRTCHNL_VERSION_MAJOR) &&
+		(vf->version_minor <= I40E_VIRTCHNL_VERSION_MINOR)) {
+		/* Peer is running non-DPDK PF driver. */
+#ifndef RTE_LIBRTE_I40E_PF_DISABLE_STRIP_CRC
+		if (!conf->rxmode.hw_strip_crc) {
+			PMD_INIT_LOG(ERR, "VF can't disable HW CRC Strip"
+				" for non-DPDK PF drivers\n");
+			PMD_INIT_LOG(ERR, "hw_strip_crc should be set 1"
+				" by default for non-DPDK PF drivers!");
+			return -EINVAL;
+		}
+#else
+		if (conf->rxmode.hw_strip_crc) {
+			PMD_INIT_LOG(ERR, "VF can't enable HW CRC Strip"
+				" for non-DPDK PF drivers\n");
+			PMD_INIT_LOG(ERR, "hw_strip_crc should be set 0"
+				" by default for non-DPDK PF drivers!");
 			return -EINVAL;
 		}
+#endif
 	}
 
 	return i40evf_init_vlan(dev);
-- 
2.7.4

      parent reply	other threads:[~2017-03-16 10:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 10:20 [dpdk-dev] [dpdk-dev 1/4] examples: enable HW CRC strip by default Jeff Guo
2017-03-16 10:20 ` [dpdk-dev] [dpdk-dev 2/4] app: " Jeff Guo
2017-03-16 10:20 ` [dpdk-dev] [dpdk-dev 3/4] test: " Jeff Guo
2017-03-16 10:20 ` Jeff Guo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489659608-47745-4-git-send-email-jia.guo@intel.com \
    --to=jia.guo@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).