Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/124501/?format=api
https://patches.dpdk.org/api/patches/124501/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230224081642.2566619-12-david.marchand@redhat.com/", "project": { "id": 1, "url": "https://patches.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": "<20230224081642.2566619-12-david.marchand@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230224081642.2566619-12-david.marchand@redhat.com", "date": "2023-02-24T08:16:39", "name": "[11/14] net/virtio: annotate lock for guest announce", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5ee8fa158fcc3566bf6783ee2eb420531fa92809", "submitter": { "id": 1173, "url": "https://patches.dpdk.org/api/people/1173/?format=api", "name": "David Marchand", "email": "david.marchand@redhat.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230224081642.2566619-12-david.marchand@redhat.com/mbox/", "series": [ { "id": 27167, "url": "https://patches.dpdk.org/api/series/27167/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=27167", "date": "2023-02-24T08:16:28", "name": "Enable lock annotations on most libraries and drivers", "version": 1, "mbox": "https://patches.dpdk.org/series/27167/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/124501/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/124501/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 B323841D5D;\n\tFri, 24 Feb 2023 09:18:05 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5459A42D32;\n\tFri, 24 Feb 2023 09:17:30 +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 CF09242D10\n for <dev@dpdk.org>; Fri, 24 Feb 2023 09:17:26 +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.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-532-3oWhGuE4Ncyc9kOWTfP_5w-1; Fri, 24 Feb 2023 03:17:24 -0500", "from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com\n [10.11.54.6])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6E95185D061;\n Fri, 24 Feb 2023 08:17:24 +0000 (UTC)", "from dmarchan.redhat.com (unknown [10.45.224.55])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 7C4FF2166B29;\n Fri, 24 Feb 2023 08:17:23 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1677226646;\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=FNKdnYQyMUzLNusZYQbwqNoGk9i+a3hOl3yqKhvqFhg=;\n b=Go8VU6gjqp6lfeQu1wX7qHB5Kr9xrQI5h0UvzeVS61hCW/GclcM0u/E+OlvSZi+9W8zR1p\n avP2lopWSGJLIvoIwqukUpSFOmXhgT3DbtYtB38RRFvkPCru7Q6EVnetFtHQBW/MqTPVob\n sdpJEicUwjG3AvsvH1LMCSe9+mthdSg=", "X-MC-Unique": "3oWhGuE4Ncyc9kOWTfP_5w-1", "From": "David Marchand <david.marchand@redhat.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>", "Subject": "[PATCH 11/14] net/virtio: annotate lock for guest announce", "Date": "Fri, 24 Feb 2023 09:16:39 +0100", "Message-Id": "<20230224081642.2566619-12-david.marchand@redhat.com>", "In-Reply-To": "<20230224081642.2566619-1-david.marchand@redhat.com>", "References": "<20230224081642.2566619-1-david.marchand@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.6", "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": "Expose requirements for helpers dealing with the\nVIRTIO_DEV_TO_HW(dev)->state_lock lock.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n drivers/net/virtio/virtio_ethdev.c | 8 ++++----\n drivers/net/virtio/virtio_ethdev.h | 7 +++++--\n 2 files changed, 9 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c\nindex 0103d95920..a3de44958c 100644\n--- a/drivers/net/virtio/virtio_ethdev.c\n+++ b/drivers/net/virtio/virtio_ethdev.c\n@@ -1149,11 +1149,11 @@ virtio_dev_pause(struct rte_eth_dev *dev)\n {\n \tstruct virtio_hw *hw = dev->data->dev_private;\n \n-\trte_spinlock_lock(&hw->state_lock);\n+\trte_spinlock_lock(&VIRTIO_DEV_TO_HW(dev)->state_lock);\n \n \tif (hw->started == 0) {\n \t\t/* Device is just stopped. */\n-\t\trte_spinlock_unlock(&hw->state_lock);\n+\t\trte_spinlock_unlock(&VIRTIO_DEV_TO_HW(dev)->state_lock);\n \t\treturn -1;\n \t}\n \thw->started = 0;\n@@ -1174,7 +1174,7 @@ virtio_dev_resume(struct rte_eth_dev *dev)\n \tstruct virtio_hw *hw = dev->data->dev_private;\n \n \thw->started = 1;\n-\trte_spinlock_unlock(&hw->state_lock);\n+\trte_spinlock_unlock(&VIRTIO_DEV_TO_HW(dev)->state_lock);\n }\n \n /*\n@@ -1217,7 +1217,7 @@ virtio_notify_peers(struct rte_eth_dev *dev)\n \t}\n \n \t/* If virtio port just stopped, no need to send RARP */\n-\tif (virtio_dev_pause(dev) < 0) {\n+\tif (virtio_dev_pause(dev) != 0) {\n \t\trte_pktmbuf_free(rarp_mbuf);\n \t\treturn;\n \t}\ndiff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h\nindex c08f382791..ece0130603 100644\n--- a/drivers/net/virtio/virtio_ethdev.h\n+++ b/drivers/net/virtio/virtio_ethdev.h\n@@ -112,8 +112,11 @@ int eth_virtio_dev_init(struct rte_eth_dev *eth_dev);\n \n void virtio_interrupt_handler(void *param);\n \n-int virtio_dev_pause(struct rte_eth_dev *dev);\n-void virtio_dev_resume(struct rte_eth_dev *dev);\n+#define VIRTIO_DEV_TO_HW(dev) ((struct virtio_hw *)(dev)->data->dev_private)\n+int virtio_dev_pause(struct rte_eth_dev *dev)\n+\t__rte_exclusive_trylock_function(0, &VIRTIO_DEV_TO_HW(dev)->state_lock);\n+void virtio_dev_resume(struct rte_eth_dev *dev)\n+\t__rte_unlock_function(&VIRTIO_DEV_TO_HW(dev)->state_lock);\n int virtio_dev_stop(struct rte_eth_dev *dev);\n int virtio_dev_close(struct rte_eth_dev *dev);\n int virtio_inject_pkts(struct rte_eth_dev *dev, struct rte_mbuf **tx_pkts,\n", "prefixes": [ "11/14" ] }{ "id": 124501, "url": "