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 CB08FA0542 for ; Thu, 24 Nov 2022 15:04:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3CE442DC0; Thu, 24 Nov 2022 15:04:38 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 317DB42DBF for ; Thu, 24 Nov 2022 15:04:37 +0100 (CET) Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 0AF0F3F195 for ; Thu, 24 Nov 2022 14:04:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1669298676; bh=r1FPj410EUP/oTvQ7mu5JaBw70elqJuIs6h+fEvlRvY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=VEryHmU1A2kF1jB7WfvRLPzOpoAvVAu9RlctzAFTP9yaq3BLT0sq3gdb+SO6GNyO+ cR2uoLcJ5evkd9Ivg5ATFh0KmchT4ofZzDXP6m2BUP+u5/jxvcR/0VDrEDGh53DjQ6 1mTMoFlxXudHfWJx2Sdm3skznZQDL/gDDfZLFeC5HaLIHw6tqjP/gA7cF8SgVIds+/ Co/u0hJxsrlfznqiisiV4fswy4gDuIuccXsSrbnb/miq6rBCbYDGpqigqppq+ik9mJ x52+1e3Of55lepRwwdtXFlx6DcOJvv7IBgjJgXxzHIMfeLHFJuLlQoMEk1C1rm/Lxv 70zhZti5FFCig== Received: by mail-oo1-f71.google.com with SMTP id g1-20020a4a9241000000b0049fd16671b4so468935ooh.14 for ; Thu, 24 Nov 2022 06:04:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r1FPj410EUP/oTvQ7mu5JaBw70elqJuIs6h+fEvlRvY=; b=YJSlE+2ov87sN5IqC7gZzI8+qLA6AI8I7VJNRtKZXlxh/yI7mGrbIHaCptqd6Ei2BW TRqTjSND6jKNW8bCSTzUjav/mhlsC8F4LqGTHCl6UhOTrBhXZfLgYHFZalwb6Z1qqfYt UA9MiCuocBETgRcREx2+NzM2Ap8CI3vRcSvdhJ9oOf++0ggE6vX+GveEcdIlVzTLtToZ EzL3afFWTKxE27vg1yMkq0ZlJbN944RlMicTZs3cu6yEOLUY4WaornAZ6ExLMqt6ljwA GVwbAkZi2Cgio0xiCzyXfvj6tV6w2vYPUDeqcYsKsG3d26sJJfXHWtxJc4hCf8Lz95oO ctqg== X-Gm-Message-State: ANoB5plGovcorJ+QjE5KKVsuJ5MIQy4UUqtdj4zc+M/L2K3YXdus3m/v eStZ6uwM0F6W7L4GAIfIIkCGDvhwMlSPFZzVX7U6QHdHRVcA6KRusQ+/0DbfPSVv+mIZrG3rh1s EmCsP25Kbce5R6+U+/hQHZexXjh81vuSEr0Wg0cLJ X-Received: by 2002:a05:6830:201a:b0:66c:49e4:82f8 with SMTP id e26-20020a056830201a00b0066c49e482f8mr16859591otp.371.1669298674888; Thu, 24 Nov 2022 06:04:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf54V4+HF7xNYqhdmj4CFoTLwpfw8spmJOzgpYftfP7coLa2KAwXQsXKsT7cNLYhNtgeBaJ9GKrivWFV4V+P/Zs= X-Received: by 2002:a05:6830:201a:b0:66c:49e4:82f8 with SMTP id e26-20020a056830201a00b0066c49e482f8mr16859570otp.371.1669298674618; Thu, 24 Nov 2022 06:04:34 -0800 (PST) MIME-Version: 1.0 References: <20221124140034.770192-1-christian.ehrhardt@canonical.com> In-Reply-To: <20221124140034.770192-1-christian.ehrhardt@canonical.com> From: Christian Ehrhardt Date: Thu, 24 Nov 2022 15:04:08 +0100 Message-ID: Subject: Re: patch 'vdpa/ifc: handle data path update failure' has been queued to stable release 19.11.14 To: Taekyung Kim Cc: Chenbo Xia , Maxime Coquelin , Andy Pei , dpdk stable Content-Type: text/plain; charset="UTF-8" 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 On Thu, Nov 24, 2022 at 3:00 PM wrote: > > Hi, > > FYI, your patch has been queued to stable release 19.11.14 Sorry, this caused build errors so I had to withdraw it again. > 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/26/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/cpaelzer/dpdk-stable-queue > > This queued commit can be viewed at: > https://github.com/cpaelzer/dpdk-stable-queue/commit/b9dbbd4a5a69f467f2e2762c7fafd79a7fb72a2c > > Thanks. > > Christian Ehrhardt > > --- > From b9dbbd4a5a69f467f2e2762c7fafd79a7fb72a2c 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/net/ifc/ifcvf_vdpa.c | 27 +++++++++++++++++++++++---- > 1 file changed, 23 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c > index e0044ec29e..0981b61242 100644 > --- a/drivers/net/ifc/ifcvf_vdpa.c > +++ b/drivers/net/ifc/ifcvf_vdpa.c > @@ -893,7 +893,12 @@ ifcvf_dev_config(int vid) > internal = list->internal; > 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, true) != 0) > DRV_LOG(NOTICE, "vDPA (%d): software relay is used.", did); > @@ -933,7 +938,12 @@ ifcvf_dev_close(int vid) > internal->sw_fallback_running = false; > } 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; > + } > } > > return 0; > @@ -1202,7 +1212,15 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > pthread_mutex_unlock(&internal_list_lock); > > 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); > return 0; > @@ -1231,7 +1249,8 @@ 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); > rte_vfio_container_destroy(internal->vfio_container_fd); > -- > 2.38.1 > > --- > Diff of the applied patch vs upstream commit (please double-check if non-empty: > --- > --- - 2022-11-24 14:58:12.152133231 +0100 > +++ 0001-vdpa-ifc-handle-data-path-update-failure.patch 2022-11-24 14:58:11.805189452 +0100 > @@ -1 +1 @@ > -From 903ec2b1b49e496815c016b0104fd655cd972661 Mon Sep 17 00:00:00 2001 > +From b9dbbd4a5a69f467f2e2762c7fafd79a7fb72a2c Mon Sep 17 00:00:00 2001 > @@ -5,0 +6,2 @@ > +[ upstream commit 903ec2b1b49e496815c016b0104fd655cd972661 ] > + > @@ -12 +13,0 @@ > -Cc: stable@dpdk.org > @@ -19 +20 @@ > - drivers/vdpa/ifc/ifcvf_vdpa.c | 27 +++++++++++++++++++++++---- > + drivers/net/ifc/ifcvf_vdpa.c | 27 +++++++++++++++++++++++---- > @@ -22,5 +23,5 @@ > -diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c > -index 8dfd49336e..49d68ad1b1 100644 > ---- a/drivers/vdpa/ifc/ifcvf_vdpa.c > -+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c > -@@ -1098,7 +1098,12 @@ ifcvf_dev_config(int vid) > +diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c > +index e0044ec29e..0981b61242 100644 > +--- a/drivers/net/ifc/ifcvf_vdpa.c > ++++ b/drivers/net/ifc/ifcvf_vdpa.c > +@@ -893,7 +893,12 @@ ifcvf_dev_config(int vid) > @@ -38,3 +39,3 @@ > - hw = &internal->hw; > - for (i = 0; i < hw->nr_vring; i++) { > -@@ -1146,7 +1151,12 @@ ifcvf_dev_close(int vid) > + if (rte_vhost_host_notifier_ctrl(vid, true) != 0) > + DRV_LOG(NOTICE, "vDPA (%d): software relay is used.", did); > +@@ -933,7 +938,12 @@ ifcvf_dev_close(int vid) > @@ -53,3 +54,3 @@ > - internal->configured = 0; > -@@ -1752,7 +1762,15 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > - } > + return 0; > +@@ -1202,7 +1212,15 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, > + pthread_mutex_unlock(&internal_list_lock); > @@ -71 +72 @@ > -@@ -1781,7 +1799,8 @@ ifcvf_pci_remove(struct rte_pci_device *pci_dev) > +@@ -1231,7 +1249,8 @@ ifcvf_pci_remove(struct rte_pci_device *pci_dev) -- Christian Ehrhardt Senior Staff Engineer, Ubuntu Server Canonical Ltd