From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B17C9A04A3 for ; Fri, 5 Jun 2020 20:26:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AA3341D510; Fri, 5 Jun 2020 20:26:04 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id 3ADD01D510 for ; Fri, 5 Jun 2020 20:26:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591381562; 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=6jl9uFLTIQ790fVHZ6Dbd6RBMBCy20E/naKmzZk0oLA=; b=cGCTsMKG2y4yVpCAIOOYatNKtdn/ywPeDNJk9to7kW7wLKRawJvUCTAvWAg3YZstccqjWJ bVYd//iXi03QgHEULskJDQH+XjFQZU9kKOFZb2ouhliOztBoxOpnWYv4zf8L90/H6iy49g C84vzttSlUM+vEVWRWWZLPyXK+s22sQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-28-HiVS8kXgOCGvq0hVl1En5w-1; Fri, 05 Jun 2020 14:25:59 -0400 X-MC-Unique: HiVS8kXgOCGvq0hVl1En5w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8C55F106B216; Fri, 5 Jun 2020 18:25:58 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBAE6610F2; Fri, 5 Jun 2020 18:25:54 +0000 (UTC) From: Kevin Traynor To: Xuan Ding Cc: Yinan Wang , Maxime Coquelin , dpdk stable Date: Fri, 5 Jun 2020 19:24:09 +0100 Message-Id: <20200605182525.22483-12-ktraynor@redhat.com> In-Reply-To: <20200605182525.22483-1-ktraynor@redhat.com> References: <20200605182525.22483-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: prevent zero-copy with incompatible client mode' has been queued to LTS release 18.11.9 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/10/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/06b2fe9781c3cb251b2ac4255f2578636ace2b54 Thanks. Kevin. --- >From 06b2fe9781c3cb251b2ac4255f2578636ace2b54 Mon Sep 17 00:00:00 2001 From: Xuan Ding Date: Wed, 29 Apr 2020 02:59:46 +0000 Subject: [PATCH] vhost: prevent zero-copy with incompatible client mode [ upstream commit 715070ea10e6da1169deef2a3ea77ae934b4c333 ] In server mode, virtio-user inits under the assumption that vhost-user supports a list of features. However, this could be problematic when in_order feature is negotiated but not supported by vhost-user when enables dequeue_zero_copy later. Add handling when vhost-user enables dequeue_zero_copy as client. Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode") Signed-off-by: Xuan Ding Tested-by: Yinan Wang Reviewed-by: Maxime Coquelin --- lib/librte_vhost/socket.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index 75f6703f56..fb946e8c54 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -891,4 +891,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags) */ if (vsocket->dequeue_zero_copy) { + if (!vsocket->is_server) { + RTE_LOG(ERR, VHOST_CONFIG, + "error: zero copy is incompatible with vhost client mode\n"); + ret = -1; + goto out_mutex; + } vsocket->supported_features &= ~(1ULL << VIRTIO_F_IN_ORDER); vsocket->features &= ~(1ULL << VIRTIO_F_IN_ORDER); -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-06-05 19:20:51.605232045 +0100 +++ 0012-vhost-prevent-zero-copy-with-incompatible-client-mod.patch 2020-06-05 19:20:50.725042744 +0100 @@ -1 +1 @@ -From 715070ea10e6da1169deef2a3ea77ae934b4c333 Mon Sep 17 00:00:00 2001 +From 06b2fe9781c3cb251b2ac4255f2578636ace2b54 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 715070ea10e6da1169deef2a3ea77ae934b4c333 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -24 +25 @@ -index 7c80121790..bb8d0d7801 100644 +index 75f6703f56..fb946e8c54 100644 @@ -27,3 +28,3 @@ -@@ -927,4 +927,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags) - goto out_mutex; - } +@@ -891,4 +891,10 @@ rte_vhost_driver_register(const char *path, uint64_t flags) + */ + if (vsocket->dequeue_zero_copy) { @@ -31 +32 @@ -+ VHOST_LOG_CONFIG(ERR, ++ RTE_LOG(ERR, VHOST_CONFIG,