get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54969,
    "url": "http://patches.dpdk.org/api/patches/54969/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1560957293-17294-16-git-send-email-ndragazis@arrikto.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": "<1560957293-17294-16-git-send-email-ndragazis@arrikto.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1560957293-17294-16-git-send-email-ndragazis@arrikto.com",
    "date": "2019-06-19T15:14:40",
    "name": "[15/28] vhost: remove main fd parameter from msg handlers",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "b08fb900051e9566750826ef59c92aed81d1365f",
    "submitter": {
        "id": 1339,
        "url": "http://patches.dpdk.org/api/people/1339/?format=api",
        "name": "Nikos Dragazis",
        "email": "ndragazis@arrikto.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/1560957293-17294-16-git-send-email-ndragazis@arrikto.com/mbox/",
    "series": [
        {
            "id": 5082,
            "url": "http://patches.dpdk.org/api/series/5082/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5082",
            "date": "2019-06-19T15:14:25",
            "name": "vhost: add virtio-vhost-user transport",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/5082/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54969/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54969/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id ACD351C402;\n\tWed, 19 Jun 2019 17:16:26 +0200 (CEST)",
            "from mx0.arrikto.com (mx0.arrikto.com [212.71.252.59])\n\tby dpdk.org (Postfix) with ESMTP id C99E41C393\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 17:15:42 +0200 (CEST)",
            "from troi.prod.arr (mail.arr [10.99.0.5])\n\tby mx0.arrikto.com (Postfix) with ESMTP id 884F0182013;\n\tWed, 19 Jun 2019 18:15:42 +0300 (EEST)",
            "from localhost.localdomain (unknown [10.89.50.133])\n\tby troi.prod.arr (Postfix) with ESMTPSA id C68A1394;\n\tWed, 19 Jun 2019 18:15:41 +0300 (EEST)"
        ],
        "From": "Nikos Dragazis <ndragazis@arrikto.com>",
        "To": "dev@dpdk.org",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n\tTiwei Bie <tiwei.bie@intel.com>, Zhihong Wang <zhihong.wang@intel.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, Wei Wang <wei.w.wang@intel.com>,\n\tStojaczyk Dariusz <dariusz.stojaczyk@intel.com>,\n\tVangelis Koukis <vkoukis@arrikto.com>",
        "Date": "Wed, 19 Jun 2019 18:14:40 +0300",
        "Message-Id": "<1560957293-17294-16-git-send-email-ndragazis@arrikto.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1560957293-17294-1-git-send-email-ndragazis@arrikto.com>",
        "References": "<1560957293-17294-1-git-send-email-ndragazis@arrikto.com>",
        "Subject": "[dpdk-dev] [PATCH 15/28] vhost: remove main fd parameter from msg\n\thandlers",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "After refactoring the socket I/O and the vhost-user map/unmap operations\nin previous patches, there is no need for the connection fds in the core\nvhost-user code. This patch removes the connection fds from the core\nvhost-user code.\n\nConnection fds are used for socket I/O between master and slave.\nHowever, this mechanism is transport-specific. Other transports may use\nother mechanisms for the master/slave communication. Therefore, the\nconnection fds are moved into the AF_UNIX transport code.\n\nSigned-off-by: Nikos Dragazis <ndragazis@arrikto.com>\n---\n lib/librte_vhost/trans_af_unix.c |  2 +-\n lib/librte_vhost/vhost_user.c    | 82 ++++++++++++++--------------------------\n lib/librte_vhost/vhost_user.h    |  2 +-\n 3 files changed, 30 insertions(+), 56 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/trans_af_unix.c b/lib/librte_vhost/trans_af_unix.c\nindex 35b1c45..a451880 100644\n--- a/lib/librte_vhost/trans_af_unix.c\n+++ b/lib/librte_vhost/trans_af_unix.c\n@@ -374,7 +374,7 @@ vhost_user_read_cb(int connfd, void *dat, int *remove)\n \t\tgoto err;\n \t}\n \n-\tret = vhost_user_msg_handler(conn->device.vid, connfd, &msg);\n+\tret = vhost_user_msg_handler(conn->device.vid, &msg);\n \tif (ret < 0) {\n err:\n \t\tclose(connfd);\ndiff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c\nindex acb1135..d3c9c5f 100644\n--- a/lib/librte_vhost/vhost_user.c\n+++ b/lib/librte_vhost/vhost_user.c\n@@ -151,16 +151,14 @@ vhost_backend_cleanup(struct virtio_net *dev)\n  */\n static int\n vhost_user_set_owner(struct virtio_net **pdev __rte_unused,\n-\t\t\tstruct VhostUserMsg *msg __rte_unused,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg __rte_unused)\n {\n \treturn RTE_VHOST_MSG_RESULT_OK;\n }\n \n static int\n vhost_user_reset_owner(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg __rte_unused,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg __rte_unused)\n {\n \tstruct virtio_net *dev = *pdev;\n \tvhost_destroy_device_notify(dev);\n@@ -174,8 +172,7 @@ vhost_user_reset_owner(struct virtio_net **pdev,\n  * The features that we support are requested.\n  */\n static int\n-vhost_user_get_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_get_features(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tuint64_t features = 0;\n@@ -193,8 +190,7 @@ vhost_user_get_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n  * The queue number that we support are requested.\n  */\n static int\n-vhost_user_get_queue_num(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_get_queue_num(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tuint32_t queue_num = 0;\n@@ -212,8 +208,7 @@ vhost_user_get_queue_num(struct virtio_net **pdev, struct VhostUserMsg *msg,\n  * We receive the negotiated features supported by us and the virtio device.\n  */\n static int\n-vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tuint64_t features = msg->payload.u64;\n@@ -295,8 +290,7 @@ vhost_user_set_features(struct virtio_net **pdev, struct VhostUserMsg *msg,\n  */\n static int\n vhost_user_set_vring_num(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_virtqueue *vq = dev->virtqueue[msg->payload.state.index];\n@@ -665,8 +659,7 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index)\n  * This function then converts these to our address space.\n  */\n static int\n-vhost_user_set_vring_addr(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_set_vring_addr(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_virtqueue *vq;\n@@ -703,8 +696,7 @@ vhost_user_set_vring_addr(struct virtio_net **pdev, struct VhostUserMsg *msg,\n  */\n static int\n vhost_user_set_vring_base(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_virtqueue *vq = dev->virtqueue[msg->payload.state.index];\n@@ -857,8 +849,7 @@ vhost_memory_changed(struct VhostUserMemory *new,\n }\n \n static int\n-vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_set_mem_table(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct VhostUserMemory *memory = &msg->payload.memory;\n@@ -1019,8 +1010,7 @@ virtio_is_ready(struct virtio_net *dev)\n }\n \n static int\n-vhost_user_set_vring_call(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_set_vring_call(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_vring_file file;\n@@ -1044,8 +1034,7 @@ vhost_user_set_vring_call(struct virtio_net **pdev, struct VhostUserMsg *msg,\n }\n \n static int vhost_user_set_vring_err(struct virtio_net **pdev __rte_unused,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tif (!(msg->payload.u64 & VHOST_USER_VRING_NOFD_MASK))\n \t\tclose(msg->fds[0]);\n@@ -1055,8 +1044,7 @@ static int vhost_user_set_vring_err(struct virtio_net **pdev __rte_unused,\n }\n \n static int\n-vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_set_vring_kick(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_vring_file file;\n@@ -1111,8 +1099,7 @@ free_zmbufs(struct vhost_virtqueue *vq)\n  */\n static int\n vhost_user_get_vring_base(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_virtqueue *vq = dev->virtqueue[msg->payload.state.index];\n@@ -1182,8 +1169,7 @@ vhost_user_get_vring_base(struct virtio_net **pdev,\n  */\n static int\n vhost_user_set_vring_enable(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tint enable = (int)msg->payload.state.num;\n@@ -1215,8 +1201,7 @@ vhost_user_set_vring_enable(struct virtio_net **pdev,\n \n static int\n vhost_user_get_protocol_features(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tuint64_t features, protocol_features;\n@@ -1242,8 +1227,7 @@ vhost_user_get_protocol_features(struct virtio_net **pdev,\n \n static int\n vhost_user_set_protocol_features(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tuint64_t protocol_features = msg->payload.u64;\n@@ -1264,8 +1248,7 @@ vhost_user_set_protocol_features(struct virtio_net **pdev,\n }\n \n static int\n-vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tint fd = msg->fds[0];\n@@ -1312,8 +1295,7 @@ vhost_user_set_log_base(struct virtio_net **pdev, struct VhostUserMsg *msg,\n }\n \n static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tclose(msg->fds[0]);\n \tRTE_LOG(INFO, VHOST_CONFIG, \"not implemented.\\n\");\n@@ -1330,8 +1312,7 @@ static int vhost_user_set_log_fd(struct virtio_net **pdev __rte_unused,\n  * a flag 'broadcast_rarp' to let rte_vhost_dequeue_burst() inject it.\n  */\n static int\n-vhost_user_send_rarp(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_send_rarp(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tuint8_t *mac = (uint8_t *)&msg->payload.u64;\n@@ -1361,8 +1342,7 @@ vhost_user_send_rarp(struct virtio_net **pdev, struct VhostUserMsg *msg,\n }\n \n static int\n-vhost_user_net_set_mtu(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_net_set_mtu(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tif (msg->payload.u64 < VIRTIO_MIN_MTU ||\n@@ -1379,8 +1359,7 @@ vhost_user_net_set_mtu(struct virtio_net **pdev, struct VhostUserMsg *msg,\n }\n \n static int\n-vhost_user_set_req_fd(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_set_req_fd(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tint ret;\n \tstruct virtio_net *dev = *pdev;\n@@ -1443,8 +1422,7 @@ is_vring_iotlb_invalidate(struct vhost_virtqueue *vq,\n }\n \n static int\n-vhost_user_iotlb_msg(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_iotlb_msg(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \tstruct vhost_iotlb_msg *imsg = &msg->payload.iotlb;\n@@ -1490,8 +1468,7 @@ vhost_user_iotlb_msg(struct virtio_net **pdev, struct VhostUserMsg *msg,\n \n static int\n vhost_user_set_postcopy_advise(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n #ifdef RTE_LIBRTE_VHOST_POSTCOPY\n@@ -1527,8 +1504,7 @@ vhost_user_set_postcopy_advise(struct virtio_net **pdev,\n \n static int\n vhost_user_set_postcopy_listen(struct virtio_net **pdev,\n-\t\t\tstruct VhostUserMsg *msg __rte_unused,\n-\t\t\tint main_fd __rte_unused)\n+\t\t\tstruct VhostUserMsg *msg __rte_unused)\n {\n \tstruct virtio_net *dev = *pdev;\n \n@@ -1543,8 +1519,7 @@ vhost_user_set_postcopy_listen(struct virtio_net **pdev,\n }\n \n static int\n-vhost_user_postcopy_end(struct virtio_net **pdev, struct VhostUserMsg *msg,\n-\t\t\tint main_fd __rte_unused)\n+vhost_user_postcopy_end(struct virtio_net **pdev, struct VhostUserMsg *msg)\n {\n \tstruct virtio_net *dev = *pdev;\n \n@@ -1562,8 +1537,7 @@ vhost_user_postcopy_end(struct virtio_net **pdev, struct VhostUserMsg *msg,\n }\n \n typedef int (*vhost_message_handler_t)(struct virtio_net **pdev,\n-\t\t\t\t\tstruct VhostUserMsg *msg,\n-\t\t\t\t\tint main_fd);\n+\t\t\t\t\tstruct VhostUserMsg *msg);\n static vhost_message_handler_t vhost_message_handlers[VHOST_USER_MAX] = {\n \t[VHOST_USER_NONE] = NULL,\n \t[VHOST_USER_GET_FEATURES] = vhost_user_get_features,\n@@ -1681,7 +1655,7 @@ vhost_user_unlock_all_queue_pairs(struct virtio_net *dev)\n }\n \n int\n-vhost_user_msg_handler(int vid, int fd, const struct VhostUserMsg *msg_)\n+vhost_user_msg_handler(int vid, const struct VhostUserMsg *msg_)\n {\n \tstruct VhostUserMsg msg = *msg_; /* copy so we can build the reply */\n \tstruct virtio_net *dev;\n@@ -1785,7 +1759,7 @@ vhost_user_msg_handler(int vid, int fd, const struct VhostUserMsg *msg_)\n \tif (request > VHOST_USER_NONE && request < VHOST_USER_MAX) {\n \t\tif (!vhost_message_handlers[request])\n \t\t\tgoto skip_to_post_handle;\n-\t\tret = vhost_message_handlers[request](&dev, &msg, fd);\n+\t\tret = vhost_message_handlers[request](&dev, &msg);\n \n \t\tswitch (ret) {\n \t\tcase RTE_VHOST_MSG_RESULT_ERR:\ndiff --git a/lib/librte_vhost/vhost_user.h b/lib/librte_vhost/vhost_user.h\nindex 200e47b..4cc912d 100644\n--- a/lib/librte_vhost/vhost_user.h\n+++ b/lib/librte_vhost/vhost_user.h\n@@ -146,7 +146,7 @@ typedef struct VhostUserMsg {\n \n \n /* vhost_user.c */\n-int vhost_user_msg_handler(int vid, int fd, const struct VhostUserMsg *msg);\n+int vhost_user_msg_handler(int vid, const struct VhostUserMsg *msg);\n int add_guest_pages(struct virtio_net *dev,\n \t\t   struct rte_vhost_mem_region *reg,\n \t\t   uint64_t page_size);\n",
    "prefixes": [
        "15/28"
    ]
}