Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/64680/?format=api
http://patchwork.dpdk.org/api/patches/64680/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200114185357.25819-1-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": "<20200114185357.25819-1-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200114185357.25819-1-maxime.coquelin@redhat.com", "date": "2020-01-14T18:53:57", "name": "vhost: fix deadlock on port deletion", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "633891c45c990011f40e1c0f7cbdf8a76a316227", "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/20200114185357.25819-1-maxime.coquelin@redhat.com/mbox/", "series": [ { "id": 8124, "url": "http://patchwork.dpdk.org/api/series/8124/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=8124", "date": "2020-01-14T18:53:57", "name": "vhost: fix deadlock on port deletion", "version": 1, "mbox": "http://patchwork.dpdk.org/series/8124/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/64680/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/64680/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8A2B8A0512;\n\tTue, 14 Jan 2020 19:54:15 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 6083F1C11E;\n\tTue, 14 Jan 2020 19:54:15 +0100 (CET)", "from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com\n [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 5EAD91C10E\n for <dev@dpdk.org>; Tue, 14 Jan 2020 19:54:13 +0100 (CET)", "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-165-1qqMWHXGO_OMXJfUm0sjeQ-1; Tue, 14 Jan 2020 13:54:11 -0500", "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com\n [10.5.11.14])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 50F39DB2F;\n Tue, 14 Jan 2020 18:54:08 +0000 (UTC)", "from localhost.localdomain (unknown [10.36.112.13])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 8C0585DDA5;\n Tue, 14 Jan 2020 18:54:03 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1579028052;\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 bh=B+1t00Cd2XHRTvROkJHc4sKyCPvGHQWMaxSgKJmuGxc=;\n b=cl8WtE5F3gqvInOqWbXI5GKM/fi2wbC0DQA5P5mlnzNHvuQbsixzHqAUpTcsU/1o3kBji+\n /rGhPiXq6O2LPATNocJwf+rWfsS+yrbBHUy95RMW0MKN4ADOTZsBUC7YkEM9/DhrhK7MXg\n XQj5oYf7oJSFKYzFKW8qM/5iaNhuUTk=", "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "dev@dpdk.org, tiwei.bie@intel.com, amorenoz@redhat.com,\n zhihong.wang@intel.com, echaudro@redhat.com", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n\tstable@dpdk.org", "Date": "Tue, 14 Jan 2020 19:53:57 +0100", "Message-Id": "<20200114185357.25819-1-maxime.coquelin@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14", "X-MC-Unique": "1qqMWHXGO_OMXJfUm0sjeQ-1", "X-Mimecast-Spam-Score": "0", "Content-Type": "text/plain; charset=US-ASCII", "Content-Transfer-Encoding": "quoted-printable", "Subject": "[dpdk-dev] [PATCH] vhost: fix deadlock on port deletion", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "If the vhost-user application (e.g. OVS) deletes the vhost-user\nport while Qemu sends a vhost-user request, a deadlock can\nhappen if the request handler tries to acquire vhost-user's\nglobal mutex, which is also locked by the vhost-user port\ndeletion API (rte_vhost_driver_unregister).\n\nThis patch prevents the deadlock by making\nrte_vhost_driver_unregister() to release the mutex and try\nagain if a request is being handled to give a chance to\nthe request handler to complete.\n\nFixes: 8b4b949144b8 (\"vhost: fix dead lock on closing in server mode\")\nFixes: 5fbb3941da9f (\"vhost: introduce driver features related APIs\")\nCc: stable@dpdk.org\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n lib/librte_vhost/socket.c | 20 +++++++++++++++-----\n 1 file changed, 15 insertions(+), 5 deletions(-)", "diff": "diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex 633c2cbc27..c57a0c7cdd 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -1052,9 +1052,10 @@ rte_vhost_driver_unregister(const char *path)\n \t\t\t\tnext = TAILQ_NEXT(conn, next);\n \n \t\t\t\t/*\n-\t\t\t\t * If r/wcb is executing, release the\n-\t\t\t\t * conn_mutex lock, and try again since\n-\t\t\t\t * the r/wcb may use the conn_mutex lock.\n+\t\t\t\t * If r/wcb is executing, release vsocket's\n+\t\t\t\t * conn_mutex and vhost_user's mutex locks, and\n+\t\t\t\t * try again since the r/wcb may use the\n+\t\t\t\t * conn_mutex and mutex locks.\n \t\t\t\t */\n \t\t\t\tif (fdset_try_del(&vhost_user.fdset,\n \t\t\t\t\t\t conn->connfd) == -1) {\n@@ -1075,8 +1076,17 @@ rte_vhost_driver_unregister(const char *path)\n \t\t\tpthread_mutex_unlock(&vsocket->conn_mutex);\n \n \t\t\tif (vsocket->is_server) {\n-\t\t\t\tfdset_del(&vhost_user.fdset,\n-\t\t\t\t\t\tvsocket->socket_fd);\n+\t\t\t\t/*\n+\t\t\t\t * If r/wcb is executing, release vhost_user's\n+\t\t\t\t * mutex lock, and try again since the r/wcb\n+\t\t\t\t * may use the mutex lock.\n+\t\t\t\t */\n+\t\t\t\tif (fdset_try_del(&vhost_user.fdset,\n+\t\t\t\t\t\tvsocket->socket_fd) == -1) {\n+\t\t\t\t\tpthread_mutex_unlock(&vhost_user.mutex);\n+\t\t\t\t\tgoto again;\n+\t\t\t\t}\n+\n \t\t\t\tclose(vsocket->socket_fd);\n \t\t\t\tunlink(path);\n \t\t\t} else if (vsocket->reconnect) {\n", "prefixes": [] }{ "id": 64680, "url": "