From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3AABCA04FD; Wed, 8 Jun 2022 14:50:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2389D42BA4; Wed, 8 Jun 2022 14:50:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id F409942B7C for ; Wed, 8 Jun 2022 14:50:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654692605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ulq83Zi9HdKaONaVXzq4QhCEyAlmquVw8bLqqClGSFU=; b=ENoKSQC1YhEq+YNP7gKfrDTT/rts15ookB6pgTA1ynAp8E1k2XRTgG7oQsjJ/O3pdZwUSR PZD0o0V4t5/0lPVcCh6d3lxYlcbIMFVDlguqSVRRnd8rr77sK2LJgvaN7zJKzeLlTQBmS3 KJDGTxsD9iL0uSPfFxMdSGkazMkADgI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-602-Myzi1-hIMKKJdXF7DNhaJQ-1; Wed, 08 Jun 2022 08:50:02 -0400 X-MC-Unique: Myzi1-hIMKKJdXF7DNhaJQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 041E5101AA45; Wed, 8 Jun 2022 12:50:02 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21E4E40CF8E8; Wed, 8 Jun 2022 12:49:59 +0000 (UTC) From: Maxime Coquelin 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 Subject: [PATCH v2 3/6] net/vhost: enable compliant offloading mode Date: Wed, 8 Jun 2022 14:49:43 +0200 Message-Id: <20220608124946.102623-4-maxime.coquelin@redhat.com> In-Reply-To: <20220608124946.102623-1-maxime.coquelin@redhat.com> References: <20220608124946.102623-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Reviewed-by: Chenbo Xia --- 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