Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/111675/?format=api
http://patches.dpdk.org/api/patches/111675/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1653360497-18080-4-git-send-email-andy.pei@intel.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": "<1653360497-18080-4-git-send-email-andy.pei@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1653360497-18080-4-git-send-email-andy.pei@intel.com", "date": "2022-05-24T02:48:07", "name": "[v10,03/13] vhost: add vhost msg support for get/set config", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "590c3ee4532f01340a64063f7f527fb85f83c854", "submitter": { "id": 1185, "url": "http://patches.dpdk.org/api/people/1185/?format=api", "name": "Pei, Andy", "email": "andy.pei@intel.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/1653360497-18080-4-git-send-email-andy.pei@intel.com/mbox/", "series": [ { "id": 23108, "url": "http://patches.dpdk.org/api/series/23108/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23108", "date": "2022-05-24T02:48:04", "name": "add virtio_blk device support to vdpa/ifc", "version": 10, "mbox": "http://patches.dpdk.org/series/23108/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/111675/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/111675/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 3753DA04FF;\n\tTue, 24 May 2022 05:35:46 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D815B427F3;\n\tTue, 24 May 2022 05:35:37 +0200 (CEST)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id 27CC942670\n for <dev@dpdk.org>; Tue, 24 May 2022 05:35:34 +0200 (CEST)", "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 23 May 2022 20:35:33 -0700", "from dpdk-dipei.sh.intel.com ([10.67.110.238])\n by orsmga005.jf.intel.com with ESMTP; 23 May 2022 20:35:31 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1653363334; x=1684899334;\n h=from:to:cc:subject:date:message-id:in-reply-to: references;\n bh=Xsa8luJn8gZWq6vnV3W1pGrvRgk4FSxK7QolrtpOReM=;\n b=eW9UXC2YTSSfCSP/eqXnOa0PFZauqESPB0pPy3qiLTcrBJADLLOBZ52K\n 2uQlHxuK+VPbuDwaWWmintwlVBdO6WmUKhZRYtUjt73GZhXPd9Hz14Vdb\n hZkLL7BxBlhnmM0+3wSBjM0H06SvIRXfgDPN/A5r+vnhcZB4EvNrRuOox\n sgLOeuIkLfJsjWAjk9aXYuTUHqPJ816dHDiMGK/PucBhQw+ccWs2tnJhB\n luUv/AMGYsjIpr+elUp8ldUrlqwh9jGz+ut/Se8fWnq9wrGSpan6yxiWo\n uxMwSn7j0f+qIMIDQx0nhu4zGWPNW94DoZs//bJqkCEsMZVc9qaua266W w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10356\"; a=\"273533604\"", "E=Sophos;i=\"5.91,247,1647327600\"; d=\"scan'208\";a=\"273533604\"", "E=Sophos;i=\"5.91,247,1647327600\"; d=\"scan'208\";a=\"745046926\"" ], "X-ExtLoop1": "1", "From": "Andy Pei <andy.pei@intel.com>", "To": "dev@dpdk.org", "Cc": "chenbo.xia@intel.com, maxime.coquelin@redhat.com, gang.cao@intel.com,\n changpeng.liu@intel.com, rosen.xu@intel.com, qimaix.xiao@intel.com", "Subject": "[PATCH v10 03/13] vhost: add vhost msg support for get/set config", "Date": "Tue, 24 May 2022 10:48:07 +0800", "Message-Id": "<1653360497-18080-4-git-send-email-andy.pei@intel.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1653360497-18080-1-git-send-email-andy.pei@intel.com>", "References": "<1643093258-47258-2-git-send-email-andy.pei@intel.com>\n <1653360497-18080-1-git-send-email-andy.pei@intel.com>", "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" }, "content": "Add support for VHOST_USER_GET_CONFIG and VHOST_USER_SET_CONFIG.\nVHOST_USER_GET_CONFIG and VHOST_USER_SET_CONFIG message is only\nsupported by virtio blk VDPA device.\n\nSigned-off-by: Andy Pei <andy.pei@intel.com>\n---\n lib/vhost/vhost_user.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++\n lib/vhost/vhost_user.h | 13 ++++++++\n 2 files changed, 98 insertions(+)", "diff": "diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c\nindex 850848c..4f2a777 100644\n--- a/lib/vhost/vhost_user.c\n+++ b/lib/vhost/vhost_user.c\n@@ -2468,6 +2468,89 @@ static int is_vring_iotlb(struct virtio_net *dev,\n }\n \n static int\n+vhost_user_get_config(struct virtio_net **pdev,\n+\t\t\tstruct vhu_msg_context *ctx,\n+\t\t\tint main_fd __rte_unused)\n+{\n+\tstruct virtio_net *dev = *pdev;\n+\tstruct rte_vdpa_device *vdpa_dev = dev->vdpa_dev;\n+\tint ret = 0;\n+\n+\tif (validate_msg_fds(dev, ctx, 0) != 0)\n+\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n+\n+\tif (!vdpa_dev) {\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) is not vDPA device!\\n\",\n+\t\t\t\t dev->ifname);\n+\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n+\t}\n+\n+\tif (vdpa_dev->ops->get_config) {\n+\t\tret = vdpa_dev->ops->get_config(dev->vid,\n+\t\t\t\t\t ctx->msg.payload.cfg.region,\n+\t\t\t\t\t ctx->msg.payload.cfg.size);\n+\t\tif (ret != 0) {\n+\t\t\tctx->msg.size = 0;\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n+\t\t\t\t\t \"(%s) get_config() return error!\\n\",\n+\t\t\t\t\t dev->ifname);\n+\t\t}\n+\t} else {\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) get_config() not supported!\\n\",\n+\t\t\t\t dev->ifname);\n+\t}\n+\n+\treturn RTE_VHOST_MSG_RESULT_REPLY;\n+}\n+\n+static int\n+vhost_user_set_config(struct virtio_net **pdev,\n+\t\t\tstruct vhu_msg_context *ctx,\n+\t\t\tint main_fd __rte_unused)\n+{\n+\tstruct virtio_net *dev = *pdev;\n+\tstruct rte_vdpa_device *vdpa_dev = dev->vdpa_dev;\n+\tint ret = 0;\n+\n+\tif (validate_msg_fds(dev, ctx, 0) != 0)\n+\t\treturn RTE_VHOST_MSG_RESULT_ERR;\n+\n+\tif (ctx->msg.payload.cfg.size > VHOST_USER_MAX_CONFIG_SIZE) {\n+\t\tVHOST_LOG_CONFIG(ERR,\n+\t\t\t\"(%s) vhost_user_config size: %\"PRIu32\", should not be larger than %d\\n\",\n+\t\t\tdev->ifname, ctx->msg.payload.cfg.size,\n+\t\t\tVHOST_USER_MAX_CONFIG_SIZE);\n+\t\tgoto out;\n+\t}\n+\n+\tif (!vdpa_dev) {\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) is not vDPA device!\\n\",\n+\t\t\t\t dev->ifname);\n+\t\tgoto out;\n+\t}\n+\n+\tif (vdpa_dev->ops->set_config) {\n+\t\tret = vdpa_dev->ops->set_config(dev->vid,\n+\t\t\tctx->msg.payload.cfg.region,\n+\t\t\tctx->msg.payload.cfg.offset,\n+\t\t\tctx->msg.payload.cfg.size,\n+\t\t\tctx->msg.payload.cfg.flags);\n+\t\tif (ret)\n+\t\t\tVHOST_LOG_CONFIG(ERR,\n+\t\t\t\t\t \"(%s) set_config() return error!\\n\",\n+\t\t\t\t\t dev->ifname);\n+\t} else {\n+\t\tVHOST_LOG_CONFIG(ERR, \"(%s) set_config() not supported!\\n\",\n+\t\t\t\t dev->ifname);\n+\t}\n+\n+\treturn RTE_VHOST_MSG_RESULT_OK;\n+\n+out:\n+\treturn RTE_VHOST_MSG_RESULT_ERR;\n+}\n+\n+static int\n vhost_user_iotlb_msg(struct virtio_net **pdev,\n \t\t\tstruct vhu_msg_context *ctx,\n \t\t\tint main_fd __rte_unused)\n@@ -2686,6 +2769,8 @@ static int is_vring_iotlb(struct virtio_net *dev,\n VHOST_MESSAGE_HANDLER(VHOST_USER_NET_SET_MTU, vhost_user_net_set_mtu, false) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_SET_SLAVE_REQ_FD, vhost_user_set_req_fd, true) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_IOTLB_MSG, vhost_user_iotlb_msg, false) \\\n+VHOST_MESSAGE_HANDLER(VHOST_USER_GET_CONFIG, vhost_user_get_config, false) \\\n+VHOST_MESSAGE_HANDLER(VHOST_USER_SET_CONFIG, vhost_user_set_config, false) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_POSTCOPY_ADVISE, vhost_user_set_postcopy_advise, false) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_POSTCOPY_LISTEN, vhost_user_set_postcopy_listen, false) \\\n VHOST_MESSAGE_HANDLER(VHOST_USER_POSTCOPY_END, vhost_user_postcopy_end, false) \\\ndiff --git a/lib/vhost/vhost_user.h b/lib/vhost/vhost_user.h\nindex ba1c5c7..c4d091e 100644\n--- a/lib/vhost/vhost_user.h\n+++ b/lib/vhost/vhost_user.h\n@@ -50,6 +50,8 @@\n \tVHOST_USER_NET_SET_MTU = 20,\n \tVHOST_USER_SET_SLAVE_REQ_FD = 21,\n \tVHOST_USER_IOTLB_MSG = 22,\n+\tVHOST_USER_GET_CONFIG = 24,\n+\tVHOST_USER_SET_CONFIG = 25,\n \tVHOST_USER_CRYPTO_CREATE_SESS = 26,\n \tVHOST_USER_CRYPTO_CLOSE_SESS = 27,\n \tVHOST_USER_POSTCOPY_ADVISE = 28,\n@@ -123,6 +125,16 @@\n \tuint16_t queue_size;\n } VhostUserInflight;\n \n+#define VHOST_USER_MAX_CONFIG_SIZE\t\t256\n+\n+/** Get/set config msg payload */\n+struct vhost_user_config {\n+\tuint32_t offset;\n+\tuint32_t size;\n+\tuint32_t flags;\n+\tuint8_t region[VHOST_USER_MAX_CONFIG_SIZE];\n+};\n+\n typedef struct VhostUserMsg {\n \tunion {\n \t\tuint32_t master; /* a VhostUserRequest value */\n@@ -146,6 +158,7 @@\n \t\tVhostUserCryptoSessionParam crypto_session;\n \t\tVhostUserVringArea area;\n \t\tVhostUserInflight inflight;\n+\t\tstruct vhost_user_config cfg;\n \t} payload;\n \t/* Nothing should be added after the payload */\n } __rte_packed VhostUserMsg;\n", "prefixes": [ "v10", "03/13" ] }{ "id": 111675, "url": "