Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/109585/?format=api
http://patches.dpdk.org/api/patches/109585/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220411110013.18624-7-david.marchand@redhat.com/", "project": { "id": 1, "url": "http://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": "<20220411110013.18624-7-david.marchand@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220411110013.18624-7-david.marchand@redhat.com", "date": "2022-04-11T11:00:11", "name": "[RFC,v3,6/8] vhost: annotate vDPA device list accesses", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "3911e326e435959946186a39637122e2d3e25074", "submitter": { "id": 1173, "url": "http://patches.dpdk.org/api/people/1173/?format=api", "name": "David Marchand", "email": "david.marchand@redhat.com" }, "delegate": { "id": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220411110013.18624-7-david.marchand@redhat.com/mbox/", "series": [ { "id": 22474, "url": "http://patches.dpdk.org/api/series/22474/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22474", "date": "2022-04-11T11:00:05", "name": "vhost lock annotations", "version": 3, "mbox": "http://patches.dpdk.org/series/22474/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/109585/comments/", "check": "pending", "checks": "http://patches.dpdk.org/api/patches/109585/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 7F322A0093;\n\tMon, 11 Apr 2022 13:01:08 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B991041157;\n\tMon, 11 Apr 2022 13:00:53 +0200 (CEST)", "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 C471242803\n for <dev@dpdk.org>; Mon, 11 Apr 2022 13:00:51 +0200 (CEST)", "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) 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-504-lXEz8zhiP2ur7xAEi9lcrQ-1; Mon, 11 Apr 2022 07:00:48 -0400", "from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com\n [10.11.54.7])\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 A903429DD9A7;\n Mon, 11 Apr 2022 11:00:47 +0000 (UTC)", "from dmarchan.remote.csb (unknown [10.40.192.83])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 45F88140EBD5;\n Mon, 11 Apr 2022 11:00:46 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1649674851;\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=TvhwSYjMz20SABOWxzyr2HY5wl3VaZrqLfEMKi08jKU=;\n b=ilCu61jFSuQe49neftF3NnvYWf+xGARkVc+TTWygUDD8xoSOETzkKnMj9AnV6eeKiPgw2l\n 37Qx27HLl2TBOtHZPXDvR7Fb10YIW1Rdaysq6JbSzXduFJTtaDCs7aCEg696VHkL+j4DZX\n +7Nrray6w03QBlJZx+QnRo8WZUp7tTs=", "X-MC-Unique": "lXEz8zhiP2ur7xAEi9lcrQ-1", "From": "David Marchand <david.marchand@redhat.com>", "To": "dev@dpdk.org", "Cc": "maxime.coquelin@redhat.com, stephen@networkplumber.org,\n chenbo.xia@intel.com, jiayu.hu@intel.com, yuanx.wang@intel.com,\n xuan.ding@intel.com", "Subject": "[RFC PATCH v3 6/8] vhost: annotate vDPA device list accesses", "Date": "Mon, 11 Apr 2022 13:00:11 +0200", "Message-Id": "<20220411110013.18624-7-david.marchand@redhat.com>", "In-Reply-To": "<20220411110013.18624-1-david.marchand@redhat.com>", "References": "<20220328121758.26632-1-david.marchand@redhat.com>\n <20220411110013.18624-1-david.marchand@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.85 on 10.11.54.7", "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com", "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": "vdpa_device_list access must be protected with vdpa_device_list_lock\nspinlock.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\n lib/vhost/vdpa.c | 17 ++++++++++-------\n 1 file changed, 10 insertions(+), 7 deletions(-)", "diff": "diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c\nindex 8fa2153023..a3f9f8f072 100644\n--- a/lib/vhost/vdpa.c\n+++ b/lib/vhost/vdpa.c\n@@ -22,21 +22,24 @@\n /** Double linked list of vDPA devices. */\n TAILQ_HEAD(vdpa_device_list, rte_vdpa_device);\n \n-static struct vdpa_device_list vdpa_device_list =\n-\t\tTAILQ_HEAD_INITIALIZER(vdpa_device_list);\n+static struct vdpa_device_list vdpa_device_list__ =\n+\t\tTAILQ_HEAD_INITIALIZER(vdpa_device_list__);\n static rte_spinlock_t vdpa_device_list_lock = RTE_SPINLOCK_INITIALIZER;\n+static struct vdpa_device_list * const vdpa_device_list\n+\t__rte_guarded_by(&vdpa_device_list_lock) = &vdpa_device_list__;\n \n \n /* Unsafe, needs to be called with vdpa_device_list_lock held */\n static struct rte_vdpa_device *\n __vdpa_find_device_by_name(const char *name)\n+\t__rte_exclusive_locks_required(&vdpa_device_list_lock)\n {\n \tstruct rte_vdpa_device *dev, *ret = NULL;\n \n \tif (name == NULL)\n \t\treturn NULL;\n \n-\tTAILQ_FOREACH(dev, &vdpa_device_list, next) {\n+\tTAILQ_FOREACH(dev, vdpa_device_list, next) {\n \t\tif (!strncmp(dev->device->name, name, RTE_DEV_NAME_MAX_LEN)) {\n \t\t\tret = dev;\n \t\t\tbreak;\n@@ -100,7 +103,7 @@ rte_vdpa_register_device(struct rte_device *rte_dev,\n \n \tdev->device = rte_dev;\n \tdev->ops = ops;\n-\tTAILQ_INSERT_TAIL(&vdpa_device_list, dev, next);\n+\tTAILQ_INSERT_TAIL(vdpa_device_list, dev, next);\n out_unlock:\n \trte_spinlock_unlock(&vdpa_device_list_lock);\n \n@@ -114,11 +117,11 @@ rte_vdpa_unregister_device(struct rte_vdpa_device *dev)\n \tint ret = -1;\n \n \trte_spinlock_lock(&vdpa_device_list_lock);\n-\tRTE_TAILQ_FOREACH_SAFE(cur_dev, &vdpa_device_list, next, tmp_dev) {\n+\tRTE_TAILQ_FOREACH_SAFE(cur_dev, vdpa_device_list, next, tmp_dev) {\n \t\tif (dev != cur_dev)\n \t\t\tcontinue;\n \n-\t\tTAILQ_REMOVE(&vdpa_device_list, dev, next);\n+\t\tTAILQ_REMOVE(vdpa_device_list, dev, next);\n \t\trte_free(dev);\n \t\tret = 0;\n \t\tbreak;\n@@ -316,7 +319,7 @@ vdpa_find_device(const struct rte_vdpa_device *start, rte_vdpa_cmp_t cmp,\n \n \trte_spinlock_lock(&vdpa_device_list_lock);\n \tif (start == NULL)\n-\t\tdev = TAILQ_FIRST(&vdpa_device_list);\n+\t\tdev = TAILQ_FIRST(vdpa_device_list);\n \telse\n \t\tdev = TAILQ_NEXT(start, next);\n \n", "prefixes": [ "RFC", "v3", "6/8" ] }{ "id": 109585, "url": "