From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A6731A04FD for ; Wed, 23 Nov 2022 19:05:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A179642DAE; Wed, 23 Nov 2022 19:05:19 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id DFE7040E5A for ; Wed, 23 Nov 2022 19:05:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669226716; 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=wEGCEIQGc+FuokIyTAc4GMNbsQ5Bcpt/GZAZIsTX5yo=; b=ZzzFmbg0KEqVwQyne1fqqST3oQkTDjaAEwFPYjQz97iq/Vkh8KEUv1mxi5knWGNs7KkTCX WnJwUreMjXf5LUyCaWz/buHVC98i5LrvwsTt1aZmb0VORD8+pz+2dgsqWTrzJe0u8UQaZK GrCSHAaC/TusdUX6qUPTEHrRW1fEuyg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-335-tLO6DVniOTWHoDu5rkuhrw-1; Wed, 23 Nov 2022 13:05:10 -0500 X-MC-Unique: tLO6DVniOTWHoDu5rkuhrw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 062398582B9; Wed, 23 Nov 2022 18:05:10 +0000 (UTC) Received: from rh.Home (unknown [10.39.195.16]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC7CA492B07; Wed, 23 Nov 2022 18:05:08 +0000 (UTC) From: Kevin Traynor To: Taekyung Kim Cc: Chenbo Xia , Maxime Coquelin , Andy Pei , dpdk stable Subject: patch 'vdpa/ifc: handle data path update failure' has been queued to stable release 21.11.3 Date: Wed, 23 Nov 2022 18:03:54 +0000 Message-Id: <20221123180413.733554-41-ktraynor@redhat.com> In-Reply-To: <20221123180413.733554-1-ktraynor@redhat.com> References: <20221123180413.733554-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 Hi, FYI, your patch has been queued to stable release 21.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 11/28/22. 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 This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/3930398baae271d77ff8c5caa955bfb88e3ab2b4 Thanks. Kevin --- >From 3930398baae271d77ff8c5caa955bfb88e3ab2b4 Mon Sep 17 00:00:00 2001 From: Taekyung Kim Date: Thu, 10 Nov 2022 13:09:43 +0900 Subject: [PATCH] vdpa/ifc: handle data path update failure [ upstream commit 903ec2b1b49e496815c016b0104fd655cd972661 ] Stop and return the error code when update_datapath fails. update_datapath prepares resources for the vdpa device. The driver should not perform any further actions if update_datapath returns an error. Fixes: a3f8150eac6d ("net/ifcvf: add ifcvf vDPA driver") Signed-off-by: Taekyung Kim Reviewed-by: Chenbo Xia Reviewed-by: Maxime Coquelin Acked-by: Andy Pei --- drivers/vdpa/ifc/ifcvf_vdpa.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 6a915b0d5e..f061d55b06 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -901,5 +901,10 @@ ifcvf_dev_config(int vid) internal->vid = vid; rte_atomic32_set(&internal->dev_attached, 1); - update_datapath(internal); + if (update_datapath(internal) < 0) { + DRV_LOG(ERR, "failed to update datapath for vDPA device %s", + vdev->device->name); + rte_atomic32_set(&internal->dev_attached, 0); + return -1; + } if (rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, true) != 0) @@ -943,5 +948,10 @@ ifcvf_dev_close(int vid) } else { rte_atomic32_set(&internal->dev_attached, 0); - update_datapath(internal); + if (update_datapath(internal) < 0) { + DRV_LOG(ERR, "failed to update datapath for vDPA device %s", + vdev->device->name); + internal->configured = 0; + return -1; + } } @@ -1262,5 +1272,13 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, rte_atomic32_set(&internal->started, 1); - update_datapath(internal); + if (update_datapath(internal) < 0) { + DRV_LOG(ERR, "failed to update datapath %s", pci_dev->name); + rte_atomic32_set(&internal->started, 0); + rte_vdpa_unregister_device(internal->vdev); + pthread_mutex_lock(&internal_list_lock); + TAILQ_REMOVE(&internal_list, list, next); + pthread_mutex_unlock(&internal_list_lock); + goto error; + } rte_kvargs_free(kvlist); @@ -1291,5 +1309,6 @@ ifcvf_pci_remove(struct rte_pci_device *pci_dev) internal = list->internal; rte_atomic32_set(&internal->started, 0); - update_datapath(internal); + if (update_datapath(internal) < 0) + DRV_LOG(ERR, "failed to update datapath %s", pci_dev->name); rte_pci_unmap_device(internal->pdev); -- 2.38.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-11-23 09:55:58.039872385 +0000 +++ 0041-vdpa-ifc-handle-data-path-update-failure.patch 2022-11-23 09:55:57.092149365 +0000 @@ -1 +1 @@ -From 903ec2b1b49e496815c016b0104fd655cd972661 Mon Sep 17 00:00:00 2001 +From 3930398baae271d77ff8c5caa955bfb88e3ab2b4 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 903ec2b1b49e496815c016b0104fd655cd972661 ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 8dfd49336e..49d68ad1b1 100644 +index 6a915b0d5e..f061d55b06 100644 @@ -26 +27 @@ -@@ -1099,5 +1099,10 @@ ifcvf_dev_config(int vid) +@@ -901,5 +901,10 @@ ifcvf_dev_config(int vid) @@ -37,2 +38,2 @@ - hw = &internal->hw; -@@ -1147,5 +1152,10 @@ ifcvf_dev_close(int vid) + if (rte_vhost_host_notifier_ctrl(vid, RTE_VHOST_QUEUE_ALL, true) != 0) +@@ -943,5 +948,10 @@ ifcvf_dev_close(int vid) @@ -50 +51 @@ -@@ -1753,5 +1763,13 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, +@@ -1262,5 +1272,13 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, @@ -65 +66 @@ -@@ -1782,5 +1800,6 @@ ifcvf_pci_remove(struct rte_pci_device *pci_dev) +@@ -1291,5 +1309,6 @@ ifcvf_pci_remove(struct rte_pci_device *pci_dev)