Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/132114/?format=api
http://patchwork.dpdk.org/api/patches/132114/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230928095300.1353-6-gmuthukrishn@marvell.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230928095300.1353-6-gmuthukrishn@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230928095300.1353-6-gmuthukrishn@marvell.com", "date": "2023-09-28T09:52:59", "name": "[RFC,5/6] examples/vhost_crypto: add asymmetric support", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "62d5a6258e965bf815d4ac22245087fd04aa13c0", "submitter": { "id": 2301, "url": "http://patchwork.dpdk.org/api/people/2301/?format=api", "name": "Gowrishankar Muthukrishnan", "email": "gmuthukrishn@marvell.com" }, "delegate": { "id": 6690, "url": "http://patchwork.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230928095300.1353-6-gmuthukrishn@marvell.com/mbox/", "series": [ { "id": 29674, "url": "http://patchwork.dpdk.org/api/series/29674/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29674", "date": "2023-09-28T09:52:54", "name": "vhost: add asymmetric crypto support", "version": 1, "mbox": "http://patchwork.dpdk.org/series/29674/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/132114/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/132114/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 7EC464265E;\n\tThu, 28 Sep 2023 11:53:56 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5AD0040E40;\n\tThu, 28 Sep 2023 11:53:39 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id EDF6E40E01\n for <dev@dpdk.org>; Thu, 28 Sep 2023 11:53:37 +0200 (CEST)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 38S8hFkE019297; Thu, 28 Sep 2023 02:53:37 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3tcu1qtdh4-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 28 Sep 2023 02:53:36 -0700", "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Thu, 28 Sep 2023 02:53:35 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Thu, 28 Sep 2023 02:53:35 -0700", "from BG-LT91401.marvell.com (BG-LT91401.marvell.com [10.28.168.34])\n by maili.marvell.com (Postfix) with ESMTP id BF2905C68EF;\n Thu, 28 Sep 2023 02:53:32 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=DMSzLSG9hsh7ZrtUft033e8ukGDRxHE2q9+Rgja3+9o=;\n b=HhsmT/GGKrDCIjIjXC4ZwKLHASnrMYfAqeJqQOn2HPpx0jQBmFS9nHpYoKfINiNM+4bO\n Fvo4TSXveL8WYhFwx2lZNHEMgkVJ9eNvQ6d2FXCLDeXGD+0B8hKt9VMP1mYS74Qu2jiq\n TpeT0bsVKe3f2dRymstWkDD8npHz+09kWOdhL8dYdsW975RgOiQSM7C91Kut8r8qP1h/\n sb+Z/gQwH2FUNWObJbWlP4L0vpX37z4oxEUWqdAKEfONTe+yuNaf4TRzUDLlaU4BTMzo\n Bjvi0Xm5GTbmwzlOTs1WNe2bV7jgMEw6VbDkfbRbiHhO8tg4bciupf6ymzGUOiCuMv37 Wg==", "From": "Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>", "To": "<dev@dpdk.org>", "CC": "<anoobj@marvell.com>, Akhil Goyal <gakhil@marvell.com>, Fan Zhang\n <fanzhang.oss@gmail.com>, Kai Ji <kai.ji@intel.com>, Arkadiusz Kusztal\n <arkadiuszx.kusztal@intel.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>,\n Chenbo Xia <chenbo.xia@intel.com>, Jay Zhou <jianjay.zhou@huawei.com>,\n Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>", "Subject": "[RFC 5/6] examples/vhost_crypto: add asymmetric support", "Date": "Thu, 28 Sep 2023 15:22:59 +0530", "Message-ID": "<20230928095300.1353-6-gmuthukrishn@marvell.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20230928095300.1353-1-gmuthukrishn@marvell.com>", "References": "<20230928095300.1353-1-gmuthukrishn@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "PDFloVCquP7qEao48nSQh2idPCNMsB8s", "X-Proofpoint-ORIG-GUID": "PDFloVCquP7qEao48nSQh2idPCNMsB8s", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-09-28_07,2023-09-27_01,2023-05-22_02", "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 symmetric support.\n\nSigned-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>\n---\n examples/vhost_crypto/main.c | 50 +++++++++++++++++++++---------------\n 1 file changed, 29 insertions(+), 21 deletions(-)", "diff": "diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c\nindex 02987ebd76..f9e2732d18 100644\n--- a/examples/vhost_crypto/main.c\n+++ b/examples/vhost_crypto/main.c\n@@ -45,7 +45,8 @@ struct lcore_option {\n struct vhost_crypto_info {\n \tint vids[MAX_NB_SOCKETS];\n \tuint32_t nb_vids;\n-\tstruct rte_mempool *sess_pool;\n+\tstruct rte_mempool *sym_sess_pool;\n+\tstruct rte_mempool *asym_sess_pool;\n \tstruct rte_mempool *cop_pool;\n \tuint8_t cid;\n \tuint32_t qid;\n@@ -302,7 +303,8 @@ new_device(int vid)\n \t\treturn -ENOENT;\n \t}\n \n-\tret = rte_vhost_crypto_create(vid, info->cid, info->sess_pool,\n+\tret = rte_vhost_crypto_create(vid, info->cid, info->sym_sess_pool,\n+\t\t\tinfo->asym_sess_pool,\n \t\t\trte_lcore_to_socket_id(options.los[i].lcore_id));\n \tif (ret) {\n \t\tRTE_LOG(ERR, USER1, \"Cannot create vhost crypto\\n\");\n@@ -362,8 +364,8 @@ destroy_device(int vid)\n }\n \n static const struct rte_vhost_device_ops virtio_crypto_device_ops = {\n-\t.new_device = new_device,\n-\t.destroy_device = destroy_device,\n+\t.new_connection = new_device,\n+\t.destroy_connection = destroy_device,\n };\n \n static int\n@@ -385,7 +387,7 @@ vhost_crypto_worker(void *arg)\n \n \tfor (i = 0; i < NB_VIRTIO_QUEUES; i++) {\n \t\tif (rte_crypto_op_bulk_alloc(info->cop_pool,\n-\t\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, ops[i],\n+\t\t\t\tRTE_CRYPTO_OP_TYPE_UNDEFINED, ops[i],\n \t\t\t\tburst_size) < burst_size) {\n \t\t\tRTE_LOG(ERR, USER1, \"Failed to alloc cops\\n\");\n \t\t\tret = -1;\n@@ -409,20 +411,12 @@ vhost_crypto_worker(void *arg)\n \t\t\t\t\t\trte_cryptodev_enqueue_burst(\n \t\t\t\t\t\tinfo->cid, info->qid, ops[j],\n \t\t\t\t\t\tfetched);\n-\t\t\t\tif (unlikely(rte_crypto_op_bulk_alloc(\n-\t\t\t\t\t\tinfo->cop_pool,\n-\t\t\t\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC,\n-\t\t\t\t\t\tops[j], fetched) < fetched)) {\n-\t\t\t\t\tRTE_LOG(ERR, USER1, \"Failed realloc\\n\");\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n-\n \t\t\t\tfetched = rte_cryptodev_dequeue_burst(\n \t\t\t\t\t\tinfo->cid, info->qid,\n \t\t\t\t\t\tops_deq[j], RTE_MIN(burst_size,\n \t\t\t\t\t\tinfo->nb_inflight_ops));\n \t\t\t\tfetched = rte_vhost_crypto_finalize_requests(\n-\t\t\t\t\t\tops_deq[j], fetched, callfds,\n+\t\t\t\t\t\tinfo->vids[i], j, ops_deq[j], fetched, callfds,\n \t\t\t\t\t\t&nb_callfds);\n \n \t\t\t\tinfo->nb_inflight_ops -= fetched;\n@@ -455,7 +449,8 @@ free_resource(void)\n \t\t\tcontinue;\n \n \t\trte_mempool_free(info->cop_pool);\n-\t\trte_mempool_free(info->sess_pool);\n+\t\trte_mempool_free(info->sym_sess_pool);\n+\t\trte_mempool_free(info->asym_sess_pool);\n \n \t\tfor (j = 0; j < lo->nb_sockets; j++) {\n \t\t\trte_vhost_driver_unregister(lo->socket_files[i]);\n@@ -539,21 +534,34 @@ main(int argc, char *argv[])\n \t\t\tgoto error_exit;\n \t\t}\n \n-\t\tsnprintf(name, 127, \"SESS_POOL_%u\", lo->lcore_id);\n-\t\tinfo->sess_pool = rte_cryptodev_sym_session_pool_create(name,\n+\t\tsnprintf(name, 127, \"SYM_SESS_POOL_%u\", lo->lcore_id);\n+\t\tinfo->sym_sess_pool = rte_cryptodev_sym_session_pool_create(name,\n \t\t\t\tSESSION_MAP_ENTRIES,\n \t\t\t\trte_cryptodev_sym_get_private_session_size(\n \t\t\t\tinfo->cid), 0, 0,\n \t\t\t\trte_lcore_to_socket_id(lo->lcore_id));\n \n-\t\tif (!info->sess_pool) {\n-\t\t\tRTE_LOG(ERR, USER1, \"Failed to create mempool\");\n+\t\tif (!info->sym_sess_pool) {\n+\t\t\tRTE_LOG(ERR, USER1, \"Failed to create sym session mempool\");\n+\t\t\tgoto error_exit;\n+\t\t}\n+\n+\t\t/* TODO: storing vhost_crypto_data_req (56 bytes) in user_data,\n+\t\t * but it needs to be moved somewhere.\n+\t\t */\n+\t\tsnprintf(name, 127, \"ASYM_SESS_POOL_%u\", lo->lcore_id);\n+\t\tinfo->asym_sess_pool = rte_cryptodev_asym_session_pool_create(name,\n+\t\t\t\tSESSION_MAP_ENTRIES, 0, 64,\n+\t\t\t\trte_lcore_to_socket_id(lo->lcore_id));\n+\n+\t\tif (!info->asym_sess_pool) {\n+\t\t\tRTE_LOG(ERR, USER1, \"Failed to create asym session mempool\");\n \t\t\tgoto error_exit;\n \t\t}\n \n \t\tsnprintf(name, 127, \"COPPOOL_%u\", lo->lcore_id);\n \t\tinfo->cop_pool = rte_crypto_op_pool_create(name,\n-\t\t\t\tRTE_CRYPTO_OP_TYPE_SYMMETRIC, NB_MEMPOOL_OBJS,\n+\t\t\t\tRTE_CRYPTO_OP_TYPE_UNDEFINED, NB_MEMPOOL_OBJS,\n \t\t\t\tNB_CACHE_OBJS, VHOST_CRYPTO_MAX_IV_LEN,\n \t\t\t\trte_lcore_to_socket_id(lo->lcore_id));\n \n@@ -566,7 +574,7 @@ main(int argc, char *argv[])\n \t\toptions.infos[i] = info;\n \n \t\tqp_conf.nb_descriptors = NB_CRYPTO_DESCRIPTORS;\n-\t\tqp_conf.mp_session = info->sess_pool;\n+\t\tqp_conf.mp_session = info->sym_sess_pool;\n \n \t\tfor (j = 0; j < dev_info.max_nb_queue_pairs; j++) {\n \t\t\tret = rte_cryptodev_queue_pair_setup(info->cid, j,\n", "prefixes": [ "RFC", "5/6" ] }{ "id": 132114, "url": "