From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 02C201B4FC for ; Fri, 23 Nov 2018 11:29:47 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CE1F3082E10; Fri, 23 Nov 2018 10:29:46 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id D446E413C; Fri, 23 Nov 2018 10:29:44 +0000 (UTC) From: Kevin Traynor To: Tiwei Bie Cc: Maxime Coquelin , dpdk stable Date: Fri, 23 Nov 2018 10:26:38 +0000 Message-Id: <20181123102713.17309-34-ktraynor@redhat.com> In-Reply-To: <20181123102713.17309-1-ktraynor@redhat.com> References: <20181123102713.17309-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Fri, 23 Nov 2018 10:29:46 +0000 (UTC) Subject: [dpdk-stable] patch 'net/virtio-user: fix device features for server mode' has been queued to stable release 18.08.1 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: , X-List-Received-Date: Fri, 23 Nov 2018 10:29:47 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/29/18. 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. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 3f2cf62ac5e52c86a672fc0e76a40f2fcfce0003 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Mon, 29 Oct 2018 13:28:06 +0800 Subject: [PATCH] net/virtio-user: fix device features for server mode [ upstream commit bb97d2dd96c0425b0cd9a58749de252ddf675b47 ] We need to save the supported frontend features (which won't be announced by vhost backend), otherwise we will lost them when the connection to vhost-user backend is established in server mode. Fixes: 201a41651715 ("net/virtio-user: fix multiple queues fail in server mode") Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 8 +++++--- drivers/net/virtio/virtio_user/virtio_user_dev.h | 1 + drivers/net/virtio/virtio_user_ethdev.c | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 85c35246b..5c10bf8e0 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -416,4 +416,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, dev->queue_size = queue_size; dev->mac_specified = 0; + dev->frontend_features = 0; dev->unsupported_features = 0; parse_mac(dev, mac); @@ -463,5 +464,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, if (dev->mac_specified) { - dev->device_features |= (1ull << VIRTIO_NET_F_MAC); + dev->frontend_features |= (1ull << VIRTIO_NET_F_MAC); } else { dev->device_features &= ~(1ull << VIRTIO_NET_F_MAC); @@ -473,5 +474,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, * so if necessary, we just claim to support CQ */ - dev->device_features |= (1ull << VIRTIO_NET_F_CTRL_VQ); + dev->frontend_features |= (1ull << VIRTIO_NET_F_CTRL_VQ); } else { dev->device_features &= ~(1ull << VIRTIO_NET_F_CTRL_VQ); @@ -494,6 +495,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, /* The backend will not report this feature, we add it explicitly */ if (is_vhost_user_by_type(dev->path)) - dev->device_features |= (1ull << VIRTIO_NET_F_STATUS); + dev->frontend_features |= (1ull << VIRTIO_NET_F_STATUS); + dev->device_features |= dev->frontend_features; dev->device_features &= VIRTIO_USER_SUPPORTED_FEATURES; dev->unsupported_features |= ~VIRTIO_USER_SUPPORTED_FEATURES; diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h index d6e0e137b..c42ce5d4b 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.h +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h @@ -34,4 +34,5 @@ struct virtio_user_dev { */ uint64_t device_features; /* supported features by device */ + uint64_t frontend_features; /* enabled frontend features */ uint64_t unsupported_features; /* unsupported features mask */ uint8_t status; diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index ba8e59e58..b9860a23e 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -44,4 +44,6 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev) } + dev->device_features |= dev->frontend_features; + /* umask vhost-user unsupported features */ dev->device_features &= ~(dev->unsupported_features); -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-23 10:22:55.143409903 +0000 +++ 0034-net-virtio-user-fix-device-features-for-server-mode.patch 2018-11-23 10:22:54.000000000 +0000 @@ -1,14 +1,15 @@ -From bb97d2dd96c0425b0cd9a58749de252ddf675b47 Mon Sep 17 00:00:00 2001 +From 3f2cf62ac5e52c86a672fc0e76a40f2fcfce0003 Mon Sep 17 00:00:00 2001 From: Tiwei Bie Date: Mon, 29 Oct 2018 13:28:06 +0800 Subject: [PATCH] net/virtio-user: fix device features for server mode +[ upstream commit bb97d2dd96c0425b0cd9a58749de252ddf675b47 ] + We need to save the supported frontend features (which won't be announced by vhost backend), otherwise we will lost them when the connection to vhost-user backend is established in server mode. Fixes: 201a41651715 ("net/virtio-user: fix multiple queues fail in server mode") -Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin @@ -19,30 +20,30 @@ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c -index 0eb0f244b..ff1c2034f 100644 +index 85c35246b..5c10bf8e0 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c -@@ -422,4 +422,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, +@@ -416,4 +416,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, dev->queue_size = queue_size; dev->mac_specified = 0; + dev->frontend_features = 0; dev->unsupported_features = 0; parse_mac(dev, mac); -@@ -469,5 +470,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, +@@ -463,5 +464,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, if (dev->mac_specified) { - dev->device_features |= (1ull << VIRTIO_NET_F_MAC); + dev->frontend_features |= (1ull << VIRTIO_NET_F_MAC); } else { dev->device_features &= ~(1ull << VIRTIO_NET_F_MAC); -@@ -479,5 +480,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, +@@ -473,5 +474,5 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, * so if necessary, we just claim to support CQ */ - dev->device_features |= (1ull << VIRTIO_NET_F_CTRL_VQ); + dev->frontend_features |= (1ull << VIRTIO_NET_F_CTRL_VQ); } else { dev->device_features &= ~(1ull << VIRTIO_NET_F_CTRL_VQ); -@@ -500,6 +501,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, +@@ -494,6 +495,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues, /* The backend will not report this feature, we add it explicitly */ if (is_vhost_user_by_type(dev->path)) - dev->device_features |= (1ull << VIRTIO_NET_F_STATUS); @@ -62,7 +63,7 @@ uint64_t unsupported_features; /* unsupported features mask */ uint8_t status; diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c -index a31b9b44a..61b7c0a38 100644 +index ba8e59e58..b9860a23e 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -44,4 +44,6 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)