get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74128,
    "url": "http://patches.dpdk.org/api/patches/74128/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200715171828.95887-5-amorenoz@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": "<20200715171828.95887-5-amorenoz@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200715171828.95887-5-amorenoz@redhat.com",
    "date": "2020-07-15T17:18:27",
    "name": "[4/5] net/virtio: add GET_STATUS support to virtio-user",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "eff45b7d679d79ee472847548ae709b18a21138c",
    "submitter": {
        "id": 1397,
        "url": "http://patches.dpdk.org/api/people/1397/?format=api",
        "name": "Adrian Moreno",
        "email": "amorenoz@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/20200715171828.95887-5-amorenoz@redhat.com/mbox/",
    "series": [
        {
            "id": 11059,
            "url": "http://patches.dpdk.org/api/series/11059/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11059",
            "date": "2020-07-15T17:18:23",
            "name": "Add support for GET/SET_STATUS on virtio-user pmd",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/11059/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74128/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/74128/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 EB55BA0542;\n\tWed, 15 Jul 2020 19:19:07 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D84481BE8C;\n\tWed, 15 Jul 2020 19:18:53 +0200 (CEST)",
            "from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com\n [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id E9BE11B6B4\n for <dev@dpdk.org>; Wed, 15 Jul 2020 19:18:49 +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-437-_GlZ2UJsPi2G86fnBOXToQ-1; Wed, 15 Jul 2020 13:18:47 -0400",
            "from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com\n [10.5.11.12])\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 901BC1085;\n Wed, 15 Jul 2020 17:18:46 +0000 (UTC)",
            "from amorenoz.users.ipa.redhat.com (ovpn-113-28.ams2.redhat.com\n [10.36.113.28])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 212AF60BF1;\n Wed, 15 Jul 2020 17:18:44 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1594833529;\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=iyIf4bjMAtaB9Zb+v17CB5bQD86QQ5eAbcNiCd1P+Cs=;\n b=AiIEzrEdxTcDMfTKSWVgWOGvcUTAQ7jwb95JWYy/0lonT9NgvVsoVEYeL1mER926s2wZfa\n o6mhBWjbdQcmlk/31E4fxALqeAwbFkeQN/G2wU3BYWHxohgGn2+YquHN22A7/W441Bfe/e\n Z59JlXEMyAZDz7NlRdjbOk85PtdEcVA=",
        "X-MC-Unique": "_GlZ2UJsPi2G86fnBOXToQ-1",
        "From": "Adrian Moreno <amorenoz@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "maxime.coquelin@redhat.com, zhihong.wang@intel.com, amorenoz@redhat.com,\n chenbo.xia@intel.com",
        "Date": "Wed, 15 Jul 2020 19:18:27 +0200",
        "Message-Id": "<20200715171828.95887-5-amorenoz@redhat.com>",
        "In-Reply-To": "<20200715171828.95887-1-amorenoz@redhat.com>",
        "References": "<20200715171828.95887-1-amorenoz@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "text/plain; charset=US-ASCII",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 4/5] net/virtio: add GET_STATUS support to\n\tvirtio-user",
        "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": "This patch adds support for VHOST_USER_GET_STATUS request.\n\nOnly vhost-user backed is supported for now\n\nSigned-off-by: Adrian Moreno <amorenoz@redhat.com>\n---\n drivers/net/virtio/virtio_user/vhost_user.c   |  2 +\n .../net/virtio/virtio_user/virtio_user_dev.c  | 39 +++++++++++++++++++\n .../net/virtio/virtio_user/virtio_user_dev.h  |  1 +\n drivers/net/virtio/virtio_user_ethdev.c       |  2 +\n 4 files changed, 44 insertions(+)",
    "diff": "diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c\nindex 2332e01d1..43c630e47 100644\n--- a/drivers/net/virtio/virtio_user/vhost_user.c\n+++ b/drivers/net/virtio/virtio_user/vhost_user.c\n@@ -279,6 +279,7 @@ vhost_user_sock(struct virtio_user_dev *dev,\n \tswitch (req) {\n \tcase VHOST_USER_GET_FEATURES:\n \tcase VHOST_USER_GET_PROTOCOL_FEATURES:\n+\tcase VHOST_USER_GET_STATUS:\n \t\tneed_reply = 1;\n \t\tbreak;\n \n@@ -373,6 +374,7 @@ vhost_user_sock(struct virtio_user_dev *dev,\n \n \t\tswitch (req) {\n \t\tcase VHOST_USER_GET_FEATURES:\n+\t\tcase VHOST_USER_GET_STATUS:\n \t\tcase VHOST_USER_GET_PROTOCOL_FEATURES:\n \t\t\tif (msg.size != sizeof(m.payload.u64)) {\n \t\t\t\tPMD_DRV_LOG(ERR, \"Received bad msg size\");\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c\nindex 2c400a448..613caef56 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c\n@@ -804,3 +804,42 @@ virtio_user_send_status_update(struct virtio_user_dev *dev, uint8_t status)\n \n \treturn 0;\n }\n+\n+int\n+virtio_user_update_status(struct virtio_user_dev *dev)\n+{\n+\tuint64_t ret;\n+\n+\t/* Vhost-user only for now */\n+\tif (!is_vhost_user_by_type(dev->path))\n+\t\treturn 0;\n+\n+\tif (!(dev->protocol_features & (1UL << VHOST_USER_PROTOCOL_F_STATUS)))\n+\t\treturn 0;\n+\n+\tif (dev->ops->send_request(dev, VHOST_USER_GET_STATUS, &ret) < 0) {\n+\t\tPMD_INIT_LOG(ERR, \"GET_STATUS failed: %s\", strerror(errno));\n+\t\treturn -1;\n+\t}\n+\tif (ret > UINT8_MAX) {\n+\t\tPMD_INIT_LOG(ERR, \"Invalid VHOST_USER_GET_STATUS response 0x%\" PRIx64 \"\\n\", ret);\n+\t\treturn -1;\n+\t}\n+\n+\tdev->status = ret;\n+\tPMD_INIT_LOG(DEBUG, \"Updated Device Status(0x%08x):\\n\"\n+\t\t\t\"\\t-ACKNOWLEDGE: %u\\n\"\n+\t\t\t\"\\t-DRIVER: %u\\n\"\n+\t\t\t\"\\t-DRIVER_OK: %u\\n\"\n+\t\t\t\"\\t-FEATURES_OK: %u\\n\"\n+\t\t\t\"\\t-DEVICE_NEED_RESET: %u\\n\"\n+\t\t\t\"\\t-FAILED: %u\\n\",\n+\t\t\tdev->status,\n+\t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_ACK),\n+\t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_DRIVER),\n+\t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_DRIVER_OK),\n+\t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_FEATURES_OK),\n+\t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_DEV_NEED_RESET),\n+\t\t\t!!(dev->status & VIRTIO_CONFIG_STATUS_FAILED));\n+\treturn 0;\n+}\ndiff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h\nindex a76d7cfaf..1a045af6f 100644\n--- a/drivers/net/virtio/virtio_user/virtio_user_dev.h\n+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h\n@@ -75,4 +75,5 @@ void virtio_user_handle_cq_packed(struct virtio_user_dev *dev,\n \t\t\t\t  uint16_t queue_idx);\n uint8_t virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs);\n int virtio_user_send_status_update(struct virtio_user_dev *dev, uint8_t status);\n+int virtio_user_update_status(struct virtio_user_dev *dev);\n #endif\ndiff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c\nindex e52f11341..40330deed 100644\n--- a/drivers/net/virtio/virtio_user_ethdev.c\n+++ b/drivers/net/virtio/virtio_user_ethdev.c\n@@ -281,6 +281,8 @@ virtio_user_get_status(struct virtio_hw *hw)\n {\n \tstruct virtio_user_dev *dev = virtio_user_get_dev(hw);\n \n+\tvirtio_user_update_status(dev);\n+\n \treturn dev->status;\n }\n \n",
    "prefixes": [
        "4/5"
    ]
}