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 F40C7A0093 for ; Tue, 19 May 2020 15:16:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC3491D702; Tue, 19 May 2020 15:16:02 +0200 (CEST) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 8A93D1D957 for ; Tue, 19 May 2020 15:16:01 +0200 (CEST) Received: by mail-wm1-f66.google.com with SMTP id g14so2429360wme.1 for ; Tue, 19 May 2020 06:16:01 -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=vDAGiLSkm/MrNhZxrcICVWuB0E4G9uBWhWl1y9di8U0=; b=Nd0qwB0PlyZVzD6ytpIwCX8asMlCR1Fllg5QnCvAkyhta9QoWqXmggDC0kYyJdkVfi /My+GC9KSWIpovPNM3rUKprwy4ORKhPW/wRVLbwMi4c9o50opsKQxTxgX1HdKUWZG8wo Oeuv4X9F/lp5z8EroekUbSXj21Pxoy71QmJf2XJyVyZDdlSIMMmIEfFBxhA3bg5MmRb7 3daFDZWISQvWtPw1ltaE2QciPo9/DFE3Bev5m8JNg7xRYO5eAxA3zdF/lg19xt03Rm8c zDE7s1EXC2kPAPpJkPwVyDSye+n4Y/ausL1IioviqOuizNsRwgycwwzuse6mQcynwB1Y To5A== 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=vDAGiLSkm/MrNhZxrcICVWuB0E4G9uBWhWl1y9di8U0=; b=BPaxBNJqWgFwN5lBw/0sKmef6RX32b3M+FkyOqOLBu5LVXiC6GRGlXh2p+oY/utSlJ ElXCt0DgAVIWoZ+Ut0CTXQ7MZZK5+7K31S9fwfj3PKTQW9jhTEPrQ0yOmatne0qx27Sf kbd2Y2AQCQ1f+jcSbYRB1LBZOEo4KPGLFWwgyMU3K84JZ+I3AlUdGUeO+H6RtRO60geU MAMdTQzEugkyXAGD8YrrEmd1FHL/txLq31JkahTu1KqXnOSrDq6b97CEtuuy1MDmWXy0 2PiOaBcD3fGM4q/YzHOxLIhcKqkhkM/4bEVazfjLL5LoHxzL1NnVfL35J1FoH7AAecAY r26w== X-Gm-Message-State: AOAM531T6UvmLGVXePCAv9fKy4os5pgITQVx9DSHu7qtGR7LIjcS30kA U+s1i3pCXWtPa7joj+sc6Mo= X-Google-Smtp-Source: ABdhPJwHXhOuf6JnNoR0ZtC5eWTPGVcIvb1SIyqLjD0qBwEPp9EDS+2vsef3E1p7Y1XnlwboWtyM7A== X-Received: by 2002:a1c:2089:: with SMTP id g131mr5182732wmg.47.1589894161299; Tue, 19 May 2020 06:16:01 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id q5sm22271145wra.36.2020.05.19.06.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2020 06:16:00 -0700 (PDT) From: luca.boccassi@gmail.com To: Marvin Liu Cc: Maxime Coquelin , dpdk stable Date: Tue, 19 May 2020 14:05:30 +0100 Message-Id: <20200519130549.112823-195-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 'net/virtio: fix crash when device reconnecting' 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 dafdf5879988e8eb64b4659a0f104b665fd5aab9 Mon Sep 17 00:00:00 2001 From: Marvin Liu Date: Wed, 6 May 2020 23:07:24 +0800 Subject: [PATCH] net/virtio: fix crash when device reconnecting [ upstream commit 01996a034a78db79686238a9656f8a49367fe963 ] When doing virtio device initialization, virtqueues will be reset in server mode if ring type is packed. It will cause issue because queues have been freed in the beginning of device initialization. Fix this issue by checking whether device has been initialized before reset. If device hasn't been initialized, there's no need to reset queues. Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode") Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin --- drivers/net/virtio/virtio_user_ethdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index e5b5a804a2..e2cbd2478d 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -89,7 +89,8 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev) dev->features &= dev->device_features; /* For packed ring, resetting queues is required in reconnection. */ - if (vtpci_packed_queue(hw)) { + if (vtpci_packed_queue(hw) && + (vtpci_get_status(hw) & VIRTIO_CONFIG_STATUS_DRIVER_OK)) { PMD_INIT_LOG(NOTICE, "Packets on the fly will be dropped" " when packed ring reconnecting."); virtio_user_reset_queues_packed(eth_dev); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-05-19 14:04:52.539641439 +0100 +++ 0195-net-virtio-fix-crash-when-device-reconnecting.patch 2020-05-19 14:04:44.556654535 +0100 @@ -1,8 +1,10 @@ -From 01996a034a78db79686238a9656f8a49367fe963 Mon Sep 17 00:00:00 2001 +From dafdf5879988e8eb64b4659a0f104b665fd5aab9 Mon Sep 17 00:00:00 2001 From: Marvin Liu Date: Wed, 6 May 2020 23:07:24 +0800 Subject: [PATCH] net/virtio: fix crash when device reconnecting +[ upstream commit 01996a034a78db79686238a9656f8a49367fe963 ] + When doing virtio device initialization, virtqueues will be reset in server mode if ring type is packed. It will cause issue because queues have been freed in the beginning of device initialization. @@ -12,7 +14,6 @@ queues. Fixes: 6ebbf4109f35 ("net/virtio-user: fix packed ring server mode") -Cc: stable@dpdk.org Signed-off-by: Marvin Liu Reviewed-by: Maxime Coquelin @@ -21,7 +22,7 @@ 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c -index dfc5291d4c..798f191c32 100644 +index e5b5a804a2..e2cbd2478d 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -89,7 +89,8 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev)