All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org, jasowang@redhat.com, chenbo.xia@intel.com,
	david.marchand@redhat.com, olivier.matz@6wind.com,
	wenwux.ma@intel.com, yuying.zhang@intel.com,
	aman.deep.singh@intel.com
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [PATCH v2 3/6] net/vhost: enable compliant offloading mode
Date: Wed,  8 Jun 2022 14:49:43 +0200	[thread overview]
Message-ID: <20220608124946.102623-4-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20220608124946.102623-1-maxime.coquelin@redhat.com>

This patch enables the compliant offloading flags mode by
default, which prevents the Rx path to set Tx offload flags,
which is illegal. A new legacy-ol-flags devarg is introduced
to enable the legacy behaviour.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
---
 doc/guides/nics/vhost.rst         |  6 ++++++
 drivers/net/vhost/rte_eth_vhost.c | 20 +++++++++++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/vhost.rst b/doc/guides/nics/vhost.rst
index ee802ec4a8..d7c0e2ade8 100644
--- a/doc/guides/nics/vhost.rst
+++ b/doc/guides/nics/vhost.rst
@@ -64,6 +64,12 @@ The user can specify below arguments in `--vdev` option.
     It is used to enable external buffer support in vhost library.
     (Default: 0 (disabled))
 
+#.  ``legacy-ol-flags``:
+
+    It is used to restore legacy behavior for offloading that was not
+    compliant with offloading API.
+    (Default: 0 (disabled))
+
 Vhost PMD event handling
 ------------------------
 
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 8dee629fb0..1620e30df8 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -31,9 +31,10 @@ enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
 #define ETH_VHOST_CLIENT_ARG		"client"
 #define ETH_VHOST_IOMMU_SUPPORT		"iommu-support"
 #define ETH_VHOST_POSTCOPY_SUPPORT	"postcopy-support"
-#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO "tso"
-#define ETH_VHOST_LINEAR_BUF  "linear-buffer"
-#define ETH_VHOST_EXT_BUF  "ext-buffer"
+#define ETH_VHOST_VIRTIO_NET_F_HOST_TSO	"tso"
+#define ETH_VHOST_LINEAR_BUF		"linear-buffer"
+#define ETH_VHOST_EXT_BUF		"ext-buffer"
+#define ETH_VHOST_LEGACY_OL_FLAGS	"legacy-ol-flags"
 #define VHOST_MAX_PKT_BURST 32
 
 static const char *valid_arguments[] = {
@@ -45,6 +46,7 @@ static const char *valid_arguments[] = {
 	ETH_VHOST_VIRTIO_NET_F_HOST_TSO,
 	ETH_VHOST_LINEAR_BUF,
 	ETH_VHOST_EXT_BUF,
+	ETH_VHOST_LEGACY_OL_FLAGS,
 	NULL
 };
 
@@ -1470,6 +1472,7 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
 	int tso = 0;
 	int linear_buf = 0;
 	int ext_buf = 0;
+	int legacy_ol_flags = 0;
 	struct rte_eth_dev *eth_dev;
 	const char *name = rte_vdev_device_name(dev);
 
@@ -1579,6 +1582,17 @@ rte_pmd_vhost_probe(struct rte_vdev_device *dev)
 			flags |= RTE_VHOST_USER_EXTBUF_SUPPORT;
 	}
 
+	if (rte_kvargs_count(kvlist, ETH_VHOST_LEGACY_OL_FLAGS) == 1) {
+		ret = rte_kvargs_process(kvlist,
+				ETH_VHOST_LEGACY_OL_FLAGS,
+				&open_int, &legacy_ol_flags);
+		if (ret < 0)
+			goto out_free;
+	}
+
+	if (legacy_ol_flags == 0)
+		flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS;
+
 	if (dev->device.numa_node == SOCKET_ID_ANY)
 		dev->device.numa_node = rte_socket_id();
 
-- 
2.35.3


  parent reply	other threads:[~2022-06-08 12:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 12:49 [PATCH v2 0/6] Vhost checksum offload improvements Maxime Coquelin
2022-06-08 12:49 ` [PATCH v2 1/6] Revert "app/testpmd: modify mac in csum forwarding" Maxime Coquelin
2022-06-13 12:24   ` Singh, Aman Deep
2022-06-17 12:42     ` Maxime Coquelin
2022-06-08 12:49 ` [PATCH v2 2/6] vhost: fix missing enqueue pseudo-header calculation Maxime Coquelin
2022-06-08 12:49 ` Maxime Coquelin [this message]
2022-06-08 12:49 ` [PATCH v2 4/6] net/vhost: make VLAN stripping flag a boolean Maxime Coquelin
2022-06-08 12:49 ` [PATCH v2 5/6] net/vhost: perform SW checksum in Rx path Maxime Coquelin
2022-06-09  1:59   ` Xia, Chenbo
2022-06-10  3:49   ` Xia, Chenbo
2022-06-10  7:19     ` Jiang, Cheng1
2022-06-08 12:49 ` [PATCH v2 6/6] net/vhost: perform SW checksum in Tx path Maxime Coquelin
2022-06-09  2:26   ` Xia, Chenbo
2022-06-10  3:49   ` Xia, Chenbo
2022-06-10  7:31     ` Jiang, Cheng1
2022-06-10  3:50   ` Xia, Chenbo
2022-06-17 14:06 ` [PATCH v2 0/6] Vhost checksum offload improvements Maxime Coquelin

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=20220608124946.102623-4-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=aman.deep.singh@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jasowang@redhat.com \
    --cc=olivier.matz@6wind.com \
    --cc=wenwux.ma@intel.com \
    --cc=yuying.zhang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.