get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87324,
    "url": "https://patches.dpdk.org/api/patches/87324/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210126101639.250481-35-maxime.coquelin@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": "<20210126101639.250481-35-maxime.coquelin@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210126101639.250481-35-maxime.coquelin@redhat.com",
    "date": "2021-01-26T10:16:29",
    "name": "[v4,34/44] net/virtio: remove useless request ops",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "af226f9dd8e83e93dfed36ee1fa395490cdbc919",
    "submitter": {
        "id": 512,
        "url": "https://patches.dpdk.org/api/people/512/?format=api",
        "name": "Maxime Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210126101639.250481-35-maxime.coquelin@redhat.com/mbox/",
    "series": [
        {
            "id": 14950,
            "url": "https://patches.dpdk.org/api/series/14950/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14950",
            "date": "2021-01-26T10:15:55",
            "name": "net/virtio: Virtio PMD rework",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/14950/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87324/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/87324/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 509A8A052A;\n\tTue, 26 Jan 2021 11:22:52 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BA90F141416;\n\tTue, 26 Jan 2021 11:18:34 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [216.205.24.124])\n by mails.dpdk.org (Postfix) with ESMTP id B77F0141402\n for <dev@dpdk.org>; Tue, 26 Jan 2021 11:18:29 +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-523-iXquHm7ZP9-gfwPGVSP6Lg-1; Tue, 26 Jan 2021 05:18:20 -0500",
            "from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com\n [10.5.11.11])\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 CA8208735C5;\n Tue, 26 Jan 2021 10:18:18 +0000 (UTC)",
            "from max-t490s.redhat.com (unknown [10.36.110.31])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 5CB2E6F45C;\n Tue, 26 Jan 2021 10:18:17 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1611656309;\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=GuUWQ8YkcN2HQCyMIqc585GJsHnFHLcY2YtJ2ngkSkY=;\n b=R4tMFH5lHJW8mghwzgTGQzqZ6T+alEov4GDryKBi+r88PFFrJJJvCvyV5V26ogy8wJJlAg\n XsP+3AlX5Gw06fQZGdLWYIJouskZhA/8S63n5A7bfPul6mBs2HYDX9zwBM1/vmQWDpnUoC\n T6FNlq0tMhHSt6p5movCht0XdHfjkwI=",
        "X-MC-Unique": "iXquHm7ZP9-gfwPGVSP6Lg-1",
        "From": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "To": "dev@dpdk.org, chenbo.xia@intel.com, olivier.matz@6wind.com,\n amorenoz@redhat.com, david.marchand@redhat.com",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>",
        "Date": "Tue, 26 Jan 2021 11:16:29 +0100",
        "Message-Id": "<20210126101639.250481-35-maxime.coquelin@redhat.com>",
        "In-Reply-To": "<20210126101639.250481-1-maxime.coquelin@redhat.com>",
        "References": "<20210126101639.250481-1-maxime.coquelin@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11",
        "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"",
        "Subject": "[dpdk-dev] [PATCH v4 34/44] net/virtio: remove useless request ops",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Now that all the ops have been implemented, we\ncan remove the send_request ops for all backends.\n\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\nReviewed-by: Chenbo Xia <chenbo.xia@intel.com>\n---\n drivers/net/virtio/virtio_user/vhost.h        |  15 +--\n drivers/net/virtio/virtio_user/vhost_kernel.c |  43 --------\n drivers/net/virtio/virtio_user/vhost_user.c   | 102 ------------------\n drivers/net/virtio/virtio_user/vhost_vdpa.c   |  49 ---------\n 4 files changed, 3 insertions(+), 206 deletions(-)",
    "diff": "diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h\nindex c896f0836d..6294b8afee 100644\n--- a/drivers/net/virtio/virtio_user/vhost.h\n+++ b/drivers/net/virtio/virtio_user/vhost.h\n@@ -96,8 +96,6 @@ enum vhost_user_request {\n #define VHOST_BACKEND_F_IOTLB_BATCH 2\n #endif\n \n-extern const char * const vhost_msg_strings[VHOST_USER_MAX];\n-\n struct vhost_memory_region {\n \tuint64_t guest_phys_addr;\n \tuint64_t memory_size; /* bytes */\n@@ -123,16 +121,9 @@ struct virtio_user_backend_ops {\n \tint (*set_vring_addr)(struct virtio_user_dev *dev, struct vhost_vring_addr *addr);\n \tint (*get_status)(struct virtio_user_dev *dev, uint8_t *status);\n \tint (*set_status)(struct virtio_user_dev *dev, uint8_t status);\n-\tint (*send_request)(struct virtio_user_dev *dev,\n-\t\t\t    enum vhost_user_request req,\n-\t\t\t    void *arg);\n-\tint (*enable_qp)(struct virtio_user_dev *dev,\n-\t\t\t uint16_t pair_idx,\n-\t\t\t int enable);\n-\tint (*dma_map)(struct virtio_user_dev *dev, void *addr,\n-\t\t\t\t  uint64_t iova, size_t len);\n-\tint (*dma_unmap)(struct virtio_user_dev *dev, void *addr,\n-\t\t\t\t  uint64_t iova, size_t len);\n+\tint (*enable_qp)(struct virtio_user_dev *dev, uint16_t pair_idx, int enable);\n+\tint (*dma_map)(struct virtio_user_dev *dev, void *addr, uint64_t iova, size_t len);\n+\tint (*dma_unmap)(struct virtio_user_dev *dev, void *addr, uint64_t iova, size_t len);\n };\n \n extern struct virtio_user_backend_ops virtio_ops_user;\ndiff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c b/drivers/net/virtio/virtio_user/vhost_kernel.c\nindex 4de4b669d2..16065c8d11 100644\n--- a/drivers/net/virtio/virtio_user/vhost_kernel.c\n+++ b/drivers/net/virtio/virtio_user/vhost_kernel.c\n@@ -328,48 +328,6 @@ vhost_kernel_set_status(struct virtio_user_dev *dev __rte_unused, uint8_t status\n \treturn -ENOTSUP;\n }\n \n-static uint64_t vhost_req_user_to_kernel[] = {\n-\t[VHOST_USER_RESET_OWNER] = VHOST_RESET_OWNER,\n-};\n-\n-static int\n-vhost_kernel_send_request(struct virtio_user_dev *dev,\n-\t\t   enum vhost_user_request req,\n-\t\t   void *arg)\n-{\n-\tint ret = -1;\n-\tunsigned int i;\n-\tuint64_t req_kernel;\n-\tint vhostfd;\n-\n-\tPMD_DRV_LOG(INFO, \"%s\", vhost_msg_strings[req]);\n-\n-\treq_kernel = vhost_req_user_to_kernel[req];\n-\n-\tswitch (req_kernel) {\n-\tdefault:\n-\t\tvhostfd = -1;\n-\t}\n-\tif (vhostfd == -1) {\n-\t\tfor (i = 0; i < dev->max_queue_pairs; ++i) {\n-\t\t\tif (dev->vhostfds[i] < 0)\n-\t\t\t\tcontinue;\n-\n-\t\t\tret = ioctl(dev->vhostfds[i], req_kernel, arg);\n-\t\t\tif (ret < 0)\n-\t\t\t\tbreak;\n-\t\t}\n-\t} else {\n-\t\tret = ioctl(vhostfd, req_kernel, arg);\n-\t}\n-\n-\tif (ret < 0)\n-\t\tPMD_DRV_LOG(ERR, \"%s failed: %s\",\n-\t\t\t    vhost_msg_strings[req], strerror(errno));\n-\n-\treturn ret;\n-}\n-\n /**\n  * Set up environment to talk with a vhost kernel backend.\n  *\n@@ -501,6 +459,5 @@ struct virtio_user_backend_ops virtio_ops_kernel = {\n \t.set_vring_addr = vhost_kernel_set_vring_addr,\n \t.get_status = vhost_kernel_get_status,\n \t.set_status = vhost_kernel_set_status,\n-\t.send_request = vhost_kernel_send_request,\n \t.enable_qp = vhost_kernel_enable_queue_pair\n };\ndiff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c\nindex 91ecb50342..165cf820b4 100644\n--- a/drivers/net/virtio/virtio_user/vhost_user.c\n+++ b/drivers/net/virtio/virtio_user/vhost_user.c\n@@ -649,107 +649,6 @@ vhost_user_set_status(struct virtio_user_dev *dev, uint8_t status)\n \treturn vhost_user_check_reply_ack(dev, &msg);\n }\n \n-static struct vhost_user_msg m;\n-\n-const char * const vhost_msg_strings[] = {\n-\t[VHOST_USER_RESET_OWNER] = \"VHOST_RESET_OWNER\",\n-};\n-\n-static int\n-vhost_user_sock(struct virtio_user_dev *dev,\n-\t\tenum vhost_user_request req,\n-\t\tvoid *arg)\n-{\n-\tstruct vhost_user_msg msg;\n-\tstruct vhost_vring_file *file = 0;\n-\tint need_reply = 0;\n-\tint fds[VHOST_MEMORY_MAX_NREGIONS];\n-\tint fd_num = 0;\n-\tint vhostfd = dev->vhostfd;\n-\n-\tRTE_SET_USED(m);\n-\n-\tPMD_DRV_LOG(INFO, \"%s\", vhost_msg_strings[req]);\n-\n-\tif (dev->is_server && vhostfd < 0)\n-\t\treturn -1;\n-\n-\tmsg.request = req;\n-\tmsg.flags = VHOST_USER_VERSION;\n-\tmsg.size = 0;\n-\n-\tswitch (req) {\n-\tcase VHOST_USER_SET_LOG_BASE:\n-\t\tmsg.payload.u64 = *((__u64 *)arg);\n-\t\tmsg.size = sizeof(m.payload.u64);\n-\t\tbreak;\n-\n-\tcase VHOST_USER_SET_FEATURES:\n-\t\tmsg.payload.u64 = *((__u64 *)arg) | (dev->device_features &\n-\t\t\t(1ULL << VHOST_USER_F_PROTOCOL_FEATURES));\n-\t\tmsg.size = sizeof(m.payload.u64);\n-\t\tbreak;\n-\n-\tcase VHOST_USER_RESET_OWNER:\n-\t\tbreak;\n-\n-\tcase VHOST_USER_SET_LOG_FD:\n-\t\tfds[fd_num++] = *((int *)arg);\n-\t\tbreak;\n-\n-\tcase VHOST_USER_SET_VRING_ERR:\n-\t\tfile = arg;\n-\t\tmsg.payload.u64 = file->index & VHOST_USER_VRING_IDX_MASK;\n-\t\tmsg.size = sizeof(m.payload.u64);\n-\t\tif (file->fd > 0)\n-\t\t\tfds[fd_num++] = file->fd;\n-\t\telse\n-\t\t\tmsg.payload.u64 |= VHOST_USER_VRING_NOFD_MASK;\n-\t\tbreak;\n-\n-\tdefault:\n-\t\tPMD_DRV_LOG(ERR, \"trying to send unhandled msg type\");\n-\t\treturn -1;\n-\t}\n-\n-\tif (vhost_user_write(vhostfd, &msg, fds, fd_num) < 0) {\n-\t\tPMD_DRV_LOG(ERR, \"%s failed: %s\",\n-\t\t\t    vhost_msg_strings[req], strerror(errno));\n-\t\treturn -1;\n-\t}\n-\n-\tif (need_reply || msg.flags & VHOST_USER_NEED_REPLY_MASK) {\n-\t\tif (vhost_user_read(vhostfd, &msg) < 0) {\n-\t\t\tPMD_DRV_LOG(ERR, \"Received msg failed: %s\",\n-\t\t\t\t    strerror(errno));\n-\t\t\treturn -1;\n-\t\t}\n-\n-\t\tif (req != msg.request) {\n-\t\t\tPMD_DRV_LOG(ERR, \"Received unexpected msg type\");\n-\t\t\treturn -1;\n-\t\t}\n-\n-\t\tswitch (req) {\n-\t\tdefault:\n-\t\t\t/* Reply-ack handling */\n-\t\t\tif (msg.size != sizeof(m.payload.u64)) {\n-\t\t\t\tPMD_DRV_LOG(ERR, \"Received bad msg size\");\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\n-\t\t\tif (msg.payload.u64 != 0) {\n-\t\t\t\tPMD_DRV_LOG(ERR, \"Slave replied NACK\");\n-\t\t\t\treturn -1;\n-\t\t\t}\n-\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\n-\treturn 0;\n-}\n-\n #define MAX_VIRTIO_USER_BACKLOG 1\n static int\n virtio_user_start_server(struct virtio_user_dev *dev, struct sockaddr_un *un)\n@@ -865,6 +764,5 @@ struct virtio_user_backend_ops virtio_ops_user = {\n \t.set_vring_addr = vhost_user_set_vring_addr,\n \t.get_status = vhost_user_get_status,\n \t.set_status = vhost_user_set_status,\n-\t.send_request = vhost_user_sock,\n \t.enable_qp = vhost_user_enable_queue_pair\n };\ndiff --git a/drivers/net/virtio/virtio_user/vhost_vdpa.c b/drivers/net/virtio/virtio_user/vhost_vdpa.c\nindex 8ebc679f1b..7fb1249569 100644\n--- a/drivers/net/virtio/virtio_user/vhost_vdpa.c\n+++ b/drivers/net/virtio/virtio_user/vhost_vdpa.c\n@@ -36,10 +36,6 @@\n #define VHOST_SET_BACKEND_FEATURES _IOW(VHOST_VIRTIO, 0x25, __u64)\n #define VHOST_GET_BACKEND_FEATURES _IOR(VHOST_VIRTIO, 0x26, __u64)\n \n-static uint64_t vhost_req_user_to_vdpa[] = {\n-\t[VHOST_USER_RESET_OWNER] = VHOST_RESET_OWNER,\n-};\n-\n /* no alignment requirement */\n struct vhost_iotlb_msg {\n \tuint64_t iova;\n@@ -389,50 +385,6 @@ vhost_vdpa_set_status(struct virtio_user_dev *dev, uint8_t status)\n \treturn vhost_vdpa_ioctl(dev->vhostfd, VHOST_VDPA_SET_STATUS, &status);\n }\n \n-/* with below features, vhost vdpa does not need to do the checksum and TSO,\n- * these info will be passed to virtio_user through virtio net header.\n- */\n-#define VHOST_VDPA_GUEST_OFFLOADS_MASK\t\\\n-\t((1ULL << VIRTIO_NET_F_GUEST_CSUM) |\t\\\n-\t (1ULL << VIRTIO_NET_F_GUEST_TSO4) |\t\\\n-\t (1ULL << VIRTIO_NET_F_GUEST_TSO6) |\t\\\n-\t (1ULL << VIRTIO_NET_F_GUEST_ECN)  |\t\\\n-\t (1ULL << VIRTIO_NET_F_GUEST_UFO))\n-\n-#define VHOST_VDPA_HOST_OFFLOADS_MASK\t\t\\\n-\t((1ULL << VIRTIO_NET_F_HOST_TSO4) |\t\\\n-\t (1ULL << VIRTIO_NET_F_HOST_TSO6) |\t\\\n-\t (1ULL << VIRTIO_NET_F_CSUM))\n-\n-static int\n-vhost_vdpa_send_request(struct virtio_user_dev *dev,\n-\t\t   enum vhost_user_request req,\n-\t\t   void *arg)\n-{\n-\tint ret = -1;\n-\tuint64_t req_vdpa;\n-\n-\tPMD_DRV_LOG(INFO, \"%s\", vhost_msg_strings[req]);\n-\n-\treq_vdpa = vhost_req_user_to_vdpa[req];\n-\n-\tswitch (req_vdpa) {\n-\tcase VHOST_SET_VRING_ADDR:\n-\t\tPMD_DRV_LOG(DEBUG, \"vhostfd=%d, index=%u\",\n-\t\t\t    dev->vhostfd, *(unsigned int *)arg);\n-\t\tbreak;\n-\tdefault:\n-\t\tbreak;\n-\t}\n-\n-\tret = ioctl(dev->vhostfd, req_vdpa, arg);\n-\tif (ret < 0)\n-\t\tPMD_DRV_LOG(ERR, \"%s failed: %s\",\n-\t\t\t    vhost_msg_strings[req], strerror(errno));\n-\n-\treturn ret;\n-}\n-\n /**\n  * Set up environment to talk with a vhost vdpa backend.\n  *\n@@ -502,7 +454,6 @@ struct virtio_user_backend_ops virtio_ops_vdpa = {\n \t.set_vring_addr = vhost_vdpa_set_vring_addr,\n \t.get_status = vhost_vdpa_get_status,\n \t.set_status = vhost_vdpa_set_status,\n-\t.send_request = vhost_vdpa_send_request,\n \t.enable_qp = vhost_vdpa_enable_queue_pair,\n \t.dma_map = vhost_vdpa_dma_map_batch,\n \t.dma_unmap = vhost_vdpa_dma_unmap_batch,\n",
    "prefixes": [
        "v4",
        "34/44"
    ]
}