get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/77434/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 77434,
    "url": "http://patches.dpdk.org/api/patches/77434/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200911150805.79901-7-maxime.coquelin@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": "<20200911150805.79901-7-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200911150805.79901-7-maxime.coquelin@redhat.com",
    "date": "2020-09-11T15:08:04",
    "name": "[6/7] net/virtio: split virtio-user start",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9f11a5738b21830c16a8eeb00c28630642b409a9",
    "submitter": {
        "id": 512,
        "url": "http://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200911150805.79901-7-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 12149,
            "url": "http://patches.dpdk.org/api/series/12149/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12149",
            "date": "2020-09-11T15:07:58",
            "name": "virtio-user: introduce vhost-vdpa backend",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/12149/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77434/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77434/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 45E05A04BB;\n\tFri, 11 Sep 2020 17:09:24 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 45905DE0;\n\tFri, 11 Sep 2020 17:08:32 +0200 (CEST)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com\n [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 161471C122\n for <dev@dpdk.org>; Fri, 11 Sep 2020 17:08:29 +0200 (CEST)",
            "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-534-3ZxLPLanMdi1sEKyb23-Aw-1; Fri, 11 Sep 2020 11:08:28 -0400",
            "from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com\n [10.5.11.23])\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 1A2DF800469;\n Fri, 11 Sep 2020 15:08:27 +0000 (UTC)",
            "from localhost.localdomain (unknown [10.36.110.16])\n by smtp.corp.redhat.com (Postfix) with ESMTP id C7A853C89;\n Fri, 11 Sep 2020 15:08:25 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1599836909;\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=3NBIZHlsnAXdefszM+mYRPSMrnVWptsRmA58ZAEPg30=;\n b=EkJn9yZfvkbBNO6X5TEw5oYyACgM9rDKsjBMpmGcqrdtJcSIAFAPLzYYFkiGshUyuppSKo\n ukxpEBJL8TeMlqQaAplWx9CmGp2VclawS0Sw/TC2j0B0r9AjSqas/1n+VZvl0V6D1fOfVJ\n owQXAw5jMn2l1/JwxDbyLXG4e2fu1hg=",
        "X-MC-Unique": "3ZxLPLanMdi1sEKyb23-Aw-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org,\n\tpatrick.fu@intel.com,\n\tamorenoz@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Fri, 11 Sep 2020 17:08:04 +0200",
        "Message-Id": "<20200911150805.79901-7-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20200911150805.79901-1-maxime.coquelin@redhat.com>",
        "References": "<20200911150805.79901-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.84 on 10.5.11.23",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com",
        "X-Mimecast-Spam-Score": "0.002",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 6/7] net/virtio: split virtio-user start",
        "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": "Move feature bit settings in device start out as an standalone\nfunction, so that feature bit could be negotiated at device\nfeature_ok status.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n .../net/virtio/virtio_user/virtio_user_dev.c  | 50 ++++++++++++-------\n .../net/virtio/virtio_user/virtio_user_dev.h  |  1 +\n drivers/net/virtio/virtio_user_ethdev.c       |  4 ++\n 3 files changed, 37 insertions(+), 18 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 97baa243cd..2e097a95ea 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -165,25 +165,11 @@ virtio_user_backend_type(const char *path)\n }\n \n int\n-virtio_user_start_device(struct virtio_user_dev *dev)\n+virtio_user_dev_set_features(struct virtio_user_dev *dev)\n {\n \tuint64_t features;\n-\tint ret;\n+\tint ret = -1;\n \n-\t/*\n-\t * XXX workaround!\n-\t *\n-\t * We need to make sure that the locks will be\n-\t * taken in the correct order to avoid deadlocks.\n-\t *\n-\t * Before releasing this lock, this thread should\n-\t * not trigger any memory hotplug events.\n-\t *\n-\t * This is a temporary workaround, and should be\n-\t * replaced when we get proper supports from the\n-\t * memory subsystem in the future.\n-\t */\n-\trte_mcfg_mem_read_lock();\n \tpthread_mutex_lock(&dev->mutex);\n \n \tif (virtio_user_backend_type(dev->path) ==\n@@ -194,10 +180,8 @@ virtio_user_start_device(struct virtio_user_dev *dev)\n \tif (virtio_user_queue_setup(dev, virtio_user_create_queue) < 0)\n \t\tgoto error;\n \n-\t/* Step 1: negotiate protocol features & set features */\n \tfeatures = dev->features;\n \n-\n \t/* Strip VIRTIO_NET_F_MAC, as MAC address is handled in vdev init */\n \tfeatures &= ~(1ull << VIRTIO_NET_F_MAC);\n \t/* Strip VIRTIO_NET_F_CTRL_VQ, as devices do not really need to know */\n@@ -207,6 +191,36 @@ virtio_user_start_device(struct virtio_user_dev *dev)\n \tif (ret < 0)\n \t\tgoto error;\n \tPMD_DRV_LOG(INFO, \"set features: %\" PRIx64, features);\n+error:\n+\tpthread_mutex_unlock(&dev->mutex);\n+\n+\treturn ret;\n+}\n+\n+int\n+virtio_user_start_device(struct virtio_user_dev *dev)\n+{\n+\tint ret;\n+\n+\t/*\n+\t * XXX workaround!\n+\t *\n+\t * We need to make sure that the locks will be\n+\t * taken in the correct order to avoid deadlocks.\n+\t *\n+\t * Before releasing this lock, this thread should\n+\t * not trigger any memory hotplug events.\n+\t *\n+\t * This is a temporary workaround, and should be\n+\t * replaced when we get proper supports from the\n+\t * memory subsystem in the future.\n+\t */\n+\trte_mcfg_mem_read_lock();\n+\tpthread_mutex_lock(&dev->mutex);\n+\n+\tif (virtio_user_backend_type(dev->path) ==\n+\t\tVIRTIO_USER_BACKEND_VHOST_USER && dev->vhostfd < 0)\n+\t\tgoto error;\n \n \t/* Step 2: share memory regions */\n \tret = dev->ops->send_request(dev, VHOST_USER_SET_MEM_TABLE, NULL);\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h\nindex 4bb7cdbd26..68ec9dc3f1 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h\n@@ -69,6 +69,7 @@ struct virtio_user_dev {\n };\n \n enum virtio_user_backend_type virtio_user_backend_type(const char *path);\n+int virtio_user_dev_set_features(struct virtio_user_dev *dev);\n int virtio_user_start_device(struct virtio_user_dev *dev);\n int virtio_user_stop_device(struct virtio_user_dev *dev);\n int virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex 2163d0e30d..91eebbedab 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -266,7 +266,11 @@ static void\n virtio_user_set_status(struct virtio_hw *hw, uint8_t status)\n {\n \tstruct virtio_user_dev *dev = virtio_user_get_dev(hw);\n+\tuint8_t old_status = dev->status;\n \n+\tif (status & VIRTIO_CONFIG_STATUS_FEATURES_OK &&\n+\t\t\t~old_status & VIRTIO_CONFIG_STATUS_FEATURES_OK)\n+\t\tvirtio_user_dev_set_features(dev);\n \tif (status & VIRTIO_CONFIG_STATUS_DRIVER_OK)\n \t\tvirtio_user_start_device(dev);\n \telse if (status == VIRTIO_CONFIG_STATUS_RESET)\n",
    "prefixes": [
        "6/7"
    ]
}