Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/138954/?format=api
http://patchwork.dpdk.org/api/patches/138954/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240328130813.3696005-4-maxime.coquelin@redhat.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20240328130813.3696005-4-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240328130813.3696005-4-maxime.coquelin@redhat.com", "date": "2024-03-28T13:08:12", "name": "[v2,3/4] net/virtio-user: fix shadow control queue notification init", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "048c70661dd99b8783b3745839a0aad7e8bff007", "submitter": { "id": 512, "url": "http://patchwork.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@redhat.com" }, "delegate": { "id": 2642, "url": "http://patchwork.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20240328130813.3696005-4-maxime.coquelin@redhat.com/mbox/", "series": [ { "id": 31637, "url": "http://patchwork.dpdk.org/api/series/31637/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31637", "date": "2024-03-28T13:08:09", "name": "Virtio-user queues setup fixes", "version": 2, "mbox": "http://patchwork.dpdk.org/series/31637/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/138954/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/138954/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 923FD43D6C;\n\tThu, 28 Mar 2024 14:08:44 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id C3B69410FC;\n\tThu, 28 Mar 2024 14:08:34 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 4B26C406BC\n for <dev@dpdk.org>; Thu, 28 Mar 2024 14:08:32 +0100 (CET)", "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-392-aCwUbzSvPyO6-N3wXxP61w-1; Thu, 28 Mar 2024 09:08:28 -0400", "from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com\n [10.11.54.10])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3C4B980F7E5;\n Thu, 28 Mar 2024 13:08:28 +0000 (UTC)", "from max-p1.redhat.com (unknown [10.39.208.26])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 6993E492BDA;\n Thu, 28 Mar 2024 13:08:25 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1711631311;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=lbHyf2Z5EpWrr5n9eaLRVssJCBZP6TFjepYJo8BDChE=;\n b=F6L7AAKknd0UGpZCSXPn+lCGWpkm6nRtHD925/zCswz6gQ3OLzrXPncn7Wzl369YdQHpJJ\n CQX2ynIm9RqRkQzKxgh7mK2YK++0I7Jx4tH7zKAtboUt+fdT02XRQy9F9Uj1FFTpxkwnjt\n ep6u0cncHVp0y+3oFvQRtT0mXzlKRcY=", "X-MC-Unique": "aCwUbzSvPyO6-N3wXxP61w-1", "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "dev@dpdk.org,\n\tdavid.marchand@redhat.com,\n\tchenbox@nvidia.com", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n\tstable@dpdk.org", "Subject": "[PATCH v2 3/4] net/virtio-user: fix shadow control queue notification\n init", "Date": "Thu, 28 Mar 2024 14:08:12 +0100", "Message-ID": "<20240328130813.3696005-4-maxime.coquelin@redhat.com>", "In-Reply-To": "<20240328130813.3696005-1-maxime.coquelin@redhat.com>", "References": "<20240328130813.3696005-1-maxime.coquelin@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.4.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": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "The Virtio-user control queue kick and call FDs were not\nuninitialized at device stop time.\n\nThis patch fixes this using the queues iterator helper for\nboth initialization and uninitialization.\n\nFixes: 90966e8e5b67 (\"net/virtio-user: send shadow virtqueue info to the backend\")\nCc: stable@dpdk.org\n\nAcked-by: David Marchand <david.marchand@redhat.com>\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n .../net/virtio/virtio_user/virtio_user_dev.c | 90 +++++++++----------\n 1 file changed, 43 insertions(+), 47 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex 0776c54deb..912e87fecf 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -33,6 +33,45 @@ const char * const virtio_user_backend_strings[] = {\n \t[VIRTIO_USER_BACKEND_VHOST_VDPA] = \"VHOST_VDPA\",\n };\n \n+static int\n+virtio_user_uninit_notify_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n+{\n+\tif (dev->kickfds[queue_sel] >= 0) {\n+\t\tclose(dev->kickfds[queue_sel]);\n+\t\tdev->kickfds[queue_sel] = -1;\n+\t}\n+\n+\tif (dev->callfds[queue_sel] >= 0) {\n+\t\tclose(dev->callfds[queue_sel]);\n+\t\tdev->callfds[queue_sel] = -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+virtio_user_init_notify_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n+{\n+\t/* May use invalid flag, but some backend uses kickfd and\n+\t * callfd as criteria to judge if dev is alive. so finally we\n+\t * use real event_fd.\n+\t */\n+\tdev->callfds[queue_sel] = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);\n+\tif (dev->callfds[queue_sel] < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"(%s) Failed to setup callfd for queue %u: %s\",\n+\t\t\t\tdev->path, queue_sel, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\tdev->kickfds[queue_sel] = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);\n+\tif (dev->kickfds[queue_sel] < 0) {\n+\t\tPMD_DRV_LOG(ERR, \"(%s) Failed to setup kickfd for queue %u: %s\",\n+\t\t\t\tdev->path, queue_sel, strerror(errno));\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n virtio_user_destroy_queue(struct virtio_user_dev *dev, uint32_t queue_sel)\n {\n@@ -423,33 +462,9 @@ virtio_user_dev_init_mac(struct virtio_user_dev *dev, const char *mac)\n static int\n virtio_user_dev_init_notify(struct virtio_user_dev *dev)\n {\n-\tuint32_t i, j, nr_vq;\n-\tint callfd;\n-\tint kickfd;\n-\n-\tnr_vq = dev->max_queue_pairs * 2;\n-\tif (dev->hw_cvq)\n-\t\tnr_vq++;\n \n-\tfor (i = 0; i < nr_vq; i++) {\n-\t\t/* May use invalid flag, but some backend uses kickfd and\n-\t\t * callfd as criteria to judge if dev is alive. so finally we\n-\t\t * use real event_fd.\n-\t\t */\n-\t\tcallfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);\n-\t\tif (callfd < 0) {\n-\t\t\tPMD_DRV_LOG(ERR, \"(%s) callfd error, %s\", dev->path, strerror(errno));\n-\t\t\tgoto err;\n-\t\t}\n-\t\tkickfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK);\n-\t\tif (kickfd < 0) {\n-\t\t\tclose(callfd);\n-\t\t\tPMD_DRV_LOG(ERR, \"(%s) kickfd error, %s\", dev->path, strerror(errno));\n-\t\t\tgoto err;\n-\t\t}\n-\t\tdev->callfds[i] = callfd;\n-\t\tdev->kickfds[i] = kickfd;\n-\t}\n+\tif (virtio_user_foreach_queue(dev, virtio_user_init_notify_queue) < 0)\n+\t\tgoto err;\n \n \tif (dev->device_features & (1ULL << VIRTIO_F_NOTIFICATION_DATA))\n \t\tif (dev->ops->map_notification_area &&\n@@ -458,16 +473,7 @@ virtio_user_dev_init_notify(struct virtio_user_dev *dev)\n \n \treturn 0;\n err:\n-\tfor (j = 0; j < i; j++) {\n-\t\tif (dev->kickfds[j] >= 0) {\n-\t\t\tclose(dev->kickfds[j]);\n-\t\t\tdev->kickfds[j] = -1;\n-\t\t}\n-\t\tif (dev->callfds[j] >= 0) {\n-\t\t\tclose(dev->callfds[j]);\n-\t\t\tdev->callfds[j] = -1;\n-\t\t}\n-\t}\n+\tvirtio_user_foreach_queue(dev, virtio_user_uninit_notify_queue);\n \n \treturn -1;\n }\n@@ -475,18 +481,8 @@ virtio_user_dev_init_notify(struct virtio_user_dev *dev)\n static void\n virtio_user_dev_uninit_notify(struct virtio_user_dev *dev)\n {\n-\tuint32_t i;\n+\tvirtio_user_foreach_queue(dev, virtio_user_uninit_notify_queue);\n \n-\tfor (i = 0; i < dev->max_queue_pairs * 2; ++i) {\n-\t\tif (dev->kickfds[i] >= 0) {\n-\t\t\tclose(dev->kickfds[i]);\n-\t\t\tdev->kickfds[i] = -1;\n-\t\t}\n-\t\tif (dev->callfds[i] >= 0) {\n-\t\t\tclose(dev->callfds[i]);\n-\t\t\tdev->callfds[i] = -1;\n-\t\t}\n-\t}\n \tif (dev->ops->unmap_notification_area && dev->notify_area)\n \t\tdev->ops->unmap_notification_area(dev);\n }\n", "prefixes": [ "v2", "3/4" ] }{ "id": 138954, "url": "