From patchwork Thu Jul 13 13:52:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 129526 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CA91442E5F; Thu, 13 Jul 2023 15:52:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F8B341156; Thu, 13 Jul 2023 15:52:51 +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 A167F40DDA for ; Thu, 13 Jul 2023 15:52:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689256369; 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=sLbw/bhLRKFLcrfie1PEQp4YUUCdrX7384C7LjFrq2s=; b=VAk/lMUJ+tFIeqKBA5Sz1nqSYp8qfTXCjWHzGS9QTVHS5Pr5W0FpgVkS/xLlWBcGMfoLaz Evv14JikwB+vzD/OPvrCG+LOx3wXkgSLUBZPQfYMcl+OmvolUr1aVbSea4wNcCWvnKVmE/ CuNVaS4RoFP+zWF7Vl7kLr5Fv7KLoDE= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-jlWvtodzP5W2uuqQuC1HTw-1; Thu, 13 Jul 2023 09:52:46 -0400 X-MC-Unique: jlWvtodzP5W2uuqQuC1HTw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 396E1293248B; Thu, 13 Jul 2023 13:52:46 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id B27911454142; Thu, 13 Jul 2023 13:52:44 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, david.marchand@redhat.com, thomas@monjalon.net, chenbo.xia@intel.com, aconole@redhat.com, ktraynor@redhat.com Cc: Maxime Coquelin Subject: [PATCH v3 1/2] vhost: fix net offload compliance Date: Thu, 13 Jul 2023 15:52:39 +0200 Message-ID: <20230713135240.240453-2-maxime.coquelin@redhat.com> In-Reply-To: <20230713135240.240453-1-maxime.coquelin@redhat.com> References: <20230713135240.240453-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Initial VDUSE support assumed the application always used the net offload compliant mode, which is not the case for OVS. This patch propagates the value set by the application. Fixes: 0adb8eccc6a6 ("vhost: add VDUSE device creation and destruction") Signed-off-by: Maxime Coquelin Acked-by: Kevin Traynor --- lib/vhost/socket.c | 2 +- lib/vhost/vduse.c | 4 ++-- lib/vhost/vduse.h | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c index f55fb299fd..57dfe3d2fe 100644 --- a/lib/vhost/socket.c +++ b/lib/vhost/socket.c @@ -1233,7 +1233,7 @@ rte_vhost_driver_start(const char *path) return -1; if (vsocket->is_vduse) - return vduse_device_create(path); + return vduse_device_create(path, vsocket->net_compliant_ol_flags); if (fdset_tid == 0) { /** diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c index 5c595e3f94..73ed424232 100644 --- a/lib/vhost/vduse.c +++ b/lib/vhost/vduse.c @@ -412,7 +412,7 @@ vduse_events_handler(int fd, void *arg, int *remove __rte_unused) } int -vduse_device_create(const char *path) +vduse_device_create(const char *path, bool compliant_ol_flags) { int control_fd, dev_fd, vid, ret; pthread_t fdset_tid; @@ -538,7 +538,7 @@ vduse_device_create(const char *path) strncpy(dev->ifname, path, IF_NAME_SZ - 1); dev->vduse_ctrl_fd = control_fd; dev->vduse_dev_fd = dev_fd; - vhost_setup_virtio_net(dev->vid, true, true, true, true); + vhost_setup_virtio_net(dev->vid, true, compliant_ol_flags, true, true); for (i = 0; i < total_queues; i++) { struct vduse_vq_config vq_cfg = { 0 }; diff --git a/lib/vhost/vduse.h b/lib/vhost/vduse.h index d0142694a7..4879b1f900 100644 --- a/lib/vhost/vduse.h +++ b/lib/vhost/vduse.h @@ -11,14 +11,16 @@ #ifdef VHOST_HAS_VDUSE -int vduse_device_create(const char *path); +int vduse_device_create(const char *path, bool compliant_ol_flags); int vduse_device_destroy(const char *path); #else static inline int -vduse_device_create(const char *path) +vduse_device_create(const char *path, bool compliant_ol_flags) { + RTE_SET_USED(compliant_ol_flags); + VHOST_LOG_CONFIG(path, ERR, "VDUSE support disabled at build time\n"); return -1; }