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 45E39A0093 for ; Tue, 19 May 2020 15:13:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3E2C31D8E1; Tue, 19 May 2020 15:13:24 +0200 (CEST) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 027401D702 for ; Tue, 19 May 2020 15:13:23 +0200 (CEST) Received: by mail-wr1-f68.google.com with SMTP id s8so15852177wrt.9 for ; Tue, 19 May 2020 06:13:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tFxUaMUn0S6KAWRBZzx5Svj/y8Rtce7yz0OvU+/5u5I=; b=Aq0+xbIUCgjksEQc8izlbSZx7nYNQJy96DzIqulrJbcqqTFY7bEyjl/1ym2s4z9Fu+ afUskEb3b70bRZiEBxJ4wNRX5qij0EGDyS84JqPEAQQPMPYfYTrEqAwN3yzL3BIM0Wdo 2dV7GrZZcT/Gtoxbe4DGdaxM6krGS5gR79s4vp3HODY0ziIs12tG3C9PnVOu4c/BqsuC NZcwH/xpPhyiiXqFrm2aBIP2Z1v0EhKSY2AJS+rnD1w6ye7996PQASgsfoa3/O2oVWuG BoJY3xhRtK1GcEs0Lnl0lo8Pefmib5pA8tWrJqm+R8x6vNk6oodgwvALBm1Hb5MycDqU 0bCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tFxUaMUn0S6KAWRBZzx5Svj/y8Rtce7yz0OvU+/5u5I=; b=dpYS8EUzzPYisEww4AWfdF149tY+foHk34fvnH1XMuzw52Ny3iF/u/6IexNEHVyWrK mE4AtwVounnVkWRgYhI7zx5IBSdscaR7JtGhvA9JfXYz0UoPzZ2FsQEeaSJOlbJFu0yv 8lgSIVaVpjAFQLEdibqKpsNYIs8cHa0zdjnMFX4j+tVd25VrcvC8EZZoAAGXJL2KGv7s S0cugQLxx1LICRAeVByt3a5FMdkegXG5vziytA8plPS5gliYF9X+ZVpxZjKDV3M419np jB9pw0DxNzj0LN338vhfM5/1PeHaSSQQAksNG9X6xy3lEJj/CerSro5xZCK8HCoLYNqm VM0Q== X-Gm-Message-State: AOAM532fdUL4lrzTbAS2Q8GSHOlnddvtvE/3sTrbgs3ji+AM5O1jGUXV E0QUUjeFX2aZJC6kLcepMhI= X-Google-Smtp-Source: ABdhPJyWBI9drU1cMDQncCkD0P0fsK4Rd0h2n7c2SWuCYH/QoWwiUR4IyJqN0uiPOR3yR+sir83B2A== X-Received: by 2002:a5d:4dc9:: with SMTP id f9mr25478739wru.407.1589894002761; Tue, 19 May 2020 06:13:22 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id i74sm20986148wri.49.2020.05.19.06.13.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:13:22 -0700 (PDT) From: luca.boccassi@gmail.com To: Xuan Ding Cc: Yinan Wang , Maxime Coquelin , dpdk stable Date: Tue, 19 May 2020 14:04:37 +0100 Message-Id: <20200519130549.112823-142-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519130549.112823-1-luca.boccassi@gmail.com> References: <20200519125804.104349-1-luca.boccassi@gmail.com> <20200519130549.112823-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'vhost: prevent zero-copy with incompatible client mode' has been queued to stable release 19.11.3 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 stable release 19.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/21/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. Thanks. Luca Boccassi --- >From a6ae060e3995d8157b363155f88e39e6a67bbd63 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 c9322707e7..8a87c38c4e 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -926,6 +926,12 @@ rte_vhost_driver_register(const char *path, uint64_t flags) ret = -1; goto out_mutex; } + 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.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:50.221520306 +0100 +++ 0142-vhost-prevent-zero-copy-with-incompatible-client-mod.patch 2020-05-19 14:04:44.456652723 +0100 @@ -1,8 +1,10 @@ -From 715070ea10e6da1169deef2a3ea77ae934b4c333 Mon Sep 17 00:00:00 2001 +From a6ae060e3995d8157b363155f88e39e6a67bbd63 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 @@ -11,7 +13,6 @@ Add handling when vhost-user enables dequeue_zero_copy as client. Fixes: 64ab701c3d1e ("vhost: add vhost-user client mode") -Cc: stable@dpdk.org Signed-off-by: Xuan Ding Tested-by: Yinan Wang @@ -21,7 +22,7 @@ 1 file changed, 6 insertions(+) diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c -index 7c80121790..bb8d0d7801 100644 +index c9322707e7..8a87c38c4e 100644 --- a/lib/librte_vhost/socket.c +++ b/lib/librte_vhost/socket.c @@ -926,6 +926,12 @@ rte_vhost_driver_register(const char *path, uint64_t flags) @@ -29,7 +30,7 @@ goto out_mutex; } + if (!vsocket->is_server) { -+ VHOST_LOG_CONFIG(ERR, ++ RTE_LOG(ERR, VHOST_CONFIG, + "error: zero copy is incompatible with vhost client mode\n"); + ret = -1; + goto out_mutex;