DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Björn Töpel" <bjorn.topel@intel.com>
To: dev@dpdk.org
Cc: david.marchand@6wind.com, helin.zhang@intel.com,
	jingjing.wu@intel.com, "Björn Töpel" <bjorn.topel@intel.com>
Subject: [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled for Linux PF hosts
Date: Thu, 21 Apr 2016 17:02:55 +0200	[thread overview]
Message-ID: <1461250975-14437-1-git-send-email-bjorn.topel@intel.com> (raw)
In-Reply-To: <1460645904-19565-1-git-send-email-bjorn.topel@intel.com>

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

  parent reply	other threads:[~2016-04-21 15:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14 14:58 [dpdk-dev] [PATCH] i40evf: Ignore disabled HW CRC strip " 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 ` Björn Töpel [this message]
2016-04-22  1:52   ` [dpdk-dev] [PATCH v2] i40evf: Report error if HW CRC strip is disabled " 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

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=1461250975-14437-1-git-send-email-bjorn.topel@intel.com \
    --to=bjorn.topel@intel.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jingjing.wu@intel.com \
    /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).