Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/101505/?format=api
http://patches.dpdk.org/api/patches/101505/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211013192222.1582631-5-gakhil@marvell.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": "<20211013192222.1582631-5-gakhil@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211013192222.1582631-5-gakhil@marvell.com", "date": "2021-10-13T19:22:19", "name": "[v2,4/7] security: pass session iova in PMD sess create", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "047e6287e4ef00732a67d2ff7201d3af016e71d5", "submitter": { "id": 2094, "url": "http://patches.dpdk.org/api/people/2094/?format=api", "name": "Akhil Goyal", "email": "gakhil@marvell.com" }, "delegate": { "id": 6690, "url": "http://patches.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20211013192222.1582631-5-gakhil@marvell.com/mbox/", "series": [ { "id": 19616, "url": "http://patches.dpdk.org/api/series/19616/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=19616", "date": "2021-10-13T19:22:15", "name": "crypto/security session framework rework", "version": 2, "mbox": "http://patches.dpdk.org/series/19616/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/101505/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/101505/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 7BC85A0C55;\n\tWed, 13 Oct 2021 21:23:12 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CCF2241251;\n\tWed, 13 Oct 2021 21:23:07 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 0F5044111B\n for <dev@dpdk.org>; Wed, 13 Oct 2021 21:23:05 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id\n 19DIusmp029372;\n Wed, 13 Oct 2021 12:23:02 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 3bp0h3sjyu-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 13 Oct 2021 12:23:02 -0700", "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Wed, 13 Oct 2021 12:22:59 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Wed, 13 Oct 2021 12:22:59 -0700", "from localhost.localdomain (unknown [10.28.36.185])\n by maili.marvell.com (Postfix) with ESMTP id 60CA13F7082;\n Wed, 13 Oct 2021 12:22:53 -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=++CLkORuT+Xs4EH5CkCQFRs8xsniYmmvq7sWNJv+Khk=;\n b=dOwnjhcdrSJPV86hMFHqwVnQ/BWfXjXbgPRrLYkV8uo5wG4WZTNCoryCUAcfefAROk4g\n xs3aAxhvLLtRfSGM+5JInN0D65Dr+6mlFLDBbEgYteKkAI4ez/w54nZtTzgO8LnCkxxh\n xfrTt/wmEHkHwz3afR//Vjb/OQQCqte2kJcKF8rt09kVDB5h50Q9/4yf8GP1OlftXfwN\n DvYV5cT5SFAbjjGU8eQ/BNeXJgIrIKpYFqamghhz8olE8+uBXlb1wp0aJTqx0SX2G4Uo\n gB6LrcycvqhK9HQ1ffD5QnrZQIObUeZm+fSIc42w9R22jn4+L52MEn2A6Nq7eMTbfZnZ kw==", "From": "Akhil Goyal <gakhil@marvell.com>", "To": "<dev@dpdk.org>", "CC": "<thomas@monjalon.net>, <david.marchand@redhat.com>,\n <hemant.agrawal@nxp.com>, <anoobj@marvell.com>,\n <pablo.de.lara.guarch@intel.com>, <fiona.trahe@intel.com>,\n <declan.doherty@intel.com>, <matan@nvidia.com>, <g.singh@nxp.com>,\n <roy.fan.zhang@intel.com>, <jianjay.zhou@huawei.com>,\n <asomalap@amd.com>, <ruifeng.wang@arm.com>,\n <konstantin.ananyev@intel.com>, <radu.nicolau@intel.com>,\n <ajit.khaparde@broadcom.com>, <rnagadheeraj@marvell.com>,\n <adwivedi@marvell.com>, <ciara.power@intel.com>,\n <haiyue.wang@intel.com>, <jiawenwu@trustnetic.com>,\n <jianwang@trustnetic.com>, Akhil Goyal <gakhil@marvell.com>", "Date": "Thu, 14 Oct 2021 00:52:19 +0530", "Message-ID": "<20211013192222.1582631-5-gakhil@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211013192222.1582631-1-gakhil@marvell.com>", "References": "<20210930145014.2476799-1-gakhil@marvell.com>\n <20211013192222.1582631-1-gakhil@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "6YALNqtMjk5JpeDtPGjfo19rBw9VBpmJ", "X-Proofpoint-ORIG-GUID": "6YALNqtMjk5JpeDtPGjfo19rBw9VBpmJ", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475\n definitions=2021-10-13_07,2021-10-13_02,2020-04-07_01", "Subject": "[dpdk-dev] [PATCH v2 4/7] security: pass session iova in PMD sess\n create", "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": "Some PMDs need session physical address which can be passed\nto the hardware. But since security_session_create\ndoes not allow PMD to get mempool object, the PMD cannot\ncall rte_mempool_virt2iova().\nHence the library layer need to calculate the iova for session\nprivate data and pass it to the PMD.\n\nSigned-off-by: Akhil Goyal <gakhil@marvell.com>\n---\n app/test/test_ipsec.c | 3 +-\n app/test/test_security.c | 5 +--\n .../crypto/aesni_mb/rte_aesni_mb_pmd_ops.c | 2 +-\n drivers/crypto/caam_jr/caam_jr.c | 3 +-\n drivers/crypto/cnxk/cn10k_ipsec.c | 2 +-\n drivers/crypto/cnxk/cn9k_ipsec.c | 35 +++++++++++--------\n drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 3 +-\n drivers/crypto/dpaa_sec/dpaa_sec.c | 3 +-\n drivers/crypto/octeontx2/otx2_cryptodev_sec.c | 33 +++++++++--------\n drivers/crypto/qat/qat_sym_session.c | 10 +++---\n drivers/crypto/qat/qat_sym_session.h | 2 +-\n drivers/net/cnxk/cn10k_ethdev_sec.c | 2 +-\n drivers/net/cnxk/cn9k_ethdev_sec.c | 2 +-\n drivers/net/ixgbe/ixgbe_ipsec.c | 2 +-\n drivers/net/octeontx2/otx2_ethdev_sec.c | 3 +-\n drivers/net/txgbe/txgbe_ipsec.c | 2 +-\n lib/security/rte_security.c | 6 +++-\n lib/security/rte_security_driver.h | 4 +--\n 18 files changed, 71 insertions(+), 51 deletions(-)", "diff": "diff --git a/app/test/test_ipsec.c b/app/test/test_ipsec.c\nindex 2ffa2a8e79..3b49a0b13a 100644\n--- a/app/test/test_ipsec.c\n+++ b/app/test/test_ipsec.c\n@@ -148,11 +148,12 @@ const struct supported_auth_algo auth_algos[] = {\n \n static int\n dummy_sec_create(void *device, struct rte_security_session_conf *conf,\n-\tvoid *sess)\n+\tvoid *sess, rte_iova_t sess_iova)\n {\n \tRTE_SET_USED(device);\n \tRTE_SET_USED(conf);\n \tRTE_SET_USED(sess);\n+\tRTE_SET_USED(sess_iova);\n \treturn 0;\n }\n \ndiff --git a/app/test/test_security.c b/app/test/test_security.c\nindex 1cea756880..50981f62fa 100644\n--- a/app/test/test_security.c\n+++ b/app/test/test_security.c\n@@ -246,9 +246,10 @@ static struct mock_session_create_data {\n static int\n mock_session_create(void *device,\n \t\tstruct rte_security_session_conf *conf,\n-\t\tvoid *sess)\n+\t\tvoid *sess,\n+\t\trte_iova_t sess_iova)\n {\n-\n+\tRTE_SET_USED(sess_iova);\n \tmock_session_create_exp.called++;\n \n \tMOCK_TEST_ASSERT_POINTER_PARAMETER(mock_session_create_exp, device);\ndiff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c\nindex 39c67e3952..8ae6d18f36 100644\n--- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c\n+++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c\n@@ -1056,7 +1056,7 @@ struct rte_cryptodev_ops *rte_aesni_mb_pmd_ops = &aesni_mb_pmd_ops;\n */\n static int\n aesni_mb_pmd_sec_sess_create(void *dev, struct rte_security_session_conf *conf,\n-\t\t\t void *sess)\n+\t\t\t void *sess, rte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_cryptodev *cdev = (struct rte_cryptodev *)dev;\n \tint ret;\ndiff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c\nindex ce7a100778..0567f1e066 100644\n--- a/drivers/crypto/caam_jr/caam_jr.c\n+++ b/drivers/crypto/caam_jr/caam_jr.c\n@@ -1909,7 +1909,8 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,\n static int\n caam_jr_security_session_create(void *dev,\n \t\t\t\tstruct rte_security_session_conf *conf,\n-\t\t\t\tvoid *sess)\n+\t\t\t\tvoid *sess,\n+\t\t\t\trte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_cryptodev *cdev = (struct rte_cryptodev *)dev;\n \tint ret;\ndiff --git a/drivers/crypto/cnxk/cn10k_ipsec.c b/drivers/crypto/cnxk/cn10k_ipsec.c\nindex 425fe599e0..b0dcd71e35 100644\n--- a/drivers/crypto/cnxk/cn10k_ipsec.c\n+++ b/drivers/crypto/cnxk/cn10k_ipsec.c\n@@ -200,7 +200,7 @@ cn10k_ipsec_session_create(void *dev,\n \n static int\n cn10k_sec_session_create(void *device, struct rte_security_session_conf *conf,\n-\t\t\t void *sess)\n+\t\t\t void *sess, rte_iova_t sess_iova __rte_unused)\n {\n \tstruct cn10k_sec_session *priv = sess;\n \ndiff --git a/drivers/crypto/cnxk/cn9k_ipsec.c b/drivers/crypto/cnxk/cn9k_ipsec.c\nindex a602d38a11..b3d2f8c012 100644\n--- a/drivers/crypto/cnxk/cn9k_ipsec.c\n+++ b/drivers/crypto/cnxk/cn9k_ipsec.c\n@@ -16,8 +16,8 @@\n #include \"roc_api.h\"\n \n static inline int\n-cn9k_cpt_enq_sa_write(struct cn9k_ipsec_sa *sa, struct cnxk_cpt_qp *qp,\n-\t\t uint8_t opcode, size_t ctx_len)\n+cn9k_cpt_enq_sa_write(struct cnxk_cpt_qp *qp, uint8_t opcode,\n+\t\t size_t ctx_len, rte_iova_t sess_iova)\n {\n \tstruct roc_cpt *roc_cpt = qp->lf.roc_cpt;\n \tuint64_t lmtline = qp->lmtline.lmt_base;\n@@ -39,9 +39,9 @@ cn9k_cpt_enq_sa_write(struct cn9k_ipsec_sa *sa, struct cnxk_cpt_qp *qp,\n \tinst.w4.s.param1 = 0;\n \tinst.w4.s.param2 = 0;\n \tinst.w4.s.dlen = ctx_len;\n-\tinst.dptr = rte_mempool_virt2iova(sa);\n+\tinst.dptr = sess_iova;\n \tinst.rptr = 0;\n-\tinst.w7.s.cptr = rte_mempool_virt2iova(sa);\n+\tinst.w7.s.cptr = sess_iova;\n \tinst.w7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_IE];\n \n \tinst.w0.u64 = 0;\n@@ -275,7 +275,8 @@ static int\n cn9k_ipsec_outb_sa_create(struct cnxk_cpt_qp *qp,\n \t\t\t struct rte_security_ipsec_xform *ipsec,\n \t\t\t struct rte_crypto_sym_xform *crypto_xform,\n-\t\t\t struct cn9k_sec_session *sess)\n+\t\t\t struct cn9k_sec_session *sess,\n+\t\t\t rte_iova_t sess_iova)\n {\n \tstruct rte_crypto_sym_xform *auth_xform = crypto_xform->next;\n \tstruct roc_ie_on_ip_template *template = NULL;\n@@ -409,18 +410,20 @@ cn9k_ipsec_outb_sa_create(struct cnxk_cpt_qp *qp,\n \n \tw7.u64 = 0;\n \tw7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_IE];\n-\tw7.s.cptr = rte_mempool_virt2iova(out_sa);\n+\tw7.s.cptr = sess_iova;\n \tinst_tmpl->w7 = w7.u64;\n \n \treturn cn9k_cpt_enq_sa_write(\n-\t\tsa, qp, ROC_IE_ON_MAJOR_OP_WRITE_IPSEC_OUTBOUND, ctx_len);\n+\t\tqp, ROC_IE_ON_MAJOR_OP_WRITE_IPSEC_OUTBOUND,\n+\t\tctx_len, sess_iova);\n }\n \n static int\n cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp,\n \t\t\t struct rte_security_ipsec_xform *ipsec,\n \t\t\t struct rte_crypto_sym_xform *crypto_xform,\n-\t\t\t struct cn9k_sec_session *sess)\n+\t\t\t struct cn9k_sec_session *sess,\n+\t\t\t rte_iova_t sess_iova)\n {\n \tstruct rte_crypto_sym_xform *auth_xform = crypto_xform;\n \tstruct roc_cpt *roc_cpt = qp->lf.roc_cpt;\n@@ -474,11 +477,12 @@ cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp,\n \n \tw7.u64 = 0;\n \tw7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_IE];\n-\tw7.s.cptr = rte_mempool_virt2iova(in_sa);\n+\tw7.s.cptr = sess_iova;\n \tinst_tmpl->w7 = w7.u64;\n \n \treturn cn9k_cpt_enq_sa_write(\n-\t\tsa, qp, ROC_IE_ON_MAJOR_OP_WRITE_IPSEC_INBOUND, ctx_len);\n+\t\tqp, ROC_IE_ON_MAJOR_OP_WRITE_IPSEC_INBOUND,\n+\t\tctx_len, sess_iova);\n }\n \n static inline int\n@@ -497,7 +501,8 @@ static int\n cn9k_ipsec_session_create(void *dev,\n \t\t\t struct rte_security_ipsec_xform *ipsec_xform,\n \t\t\t struct rte_crypto_sym_xform *crypto_xform,\n-\t\t\t struct cn9k_sec_session *sess)\n+\t\t\t struct cn9k_sec_session *sess,\n+\t\t\t rte_iova_t sess_iova)\n {\n \tstruct rte_cryptodev *crypto_dev = dev;\n \tstruct cnxk_cpt_qp *qp;\n@@ -520,15 +525,15 @@ cn9k_ipsec_session_create(void *dev,\n \n \tif (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS)\n \t\treturn cn9k_ipsec_inb_sa_create(qp, ipsec_xform, crypto_xform,\n-\t\t\t\t\t\tsess);\n+\t\t\t\t\t\tsess, sess_iova);\n \telse\n \t\treturn cn9k_ipsec_outb_sa_create(qp, ipsec_xform, crypto_xform,\n-\t\t\t\t\t\t sess);\n+\t\t\t\t\t\t sess, sess_iova);\n }\n \n static int\n cn9k_sec_session_create(void *device, struct rte_security_session_conf *conf,\n-\t\t\tvoid *sess)\n+\t\t\tvoid *sess, rte_iova_t sess_iova)\n {\n \tstruct cn9k_sec_session *priv = sess;\n \n@@ -542,7 +547,7 @@ cn9k_sec_session_create(void *device, struct rte_security_session_conf *conf,\n \t}\n \n \treturn cn9k_ipsec_session_create(device, &conf->ipsec,\n-\t\t\t\t\tconf->crypto_xform, priv);\n+\t\t\t\t\tconf->crypto_xform, priv, sess_iova);\n }\n \n static int\ndiff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c\nindex 176f1a27a0..15ea5de18d 100644\n--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c\n+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c\n@@ -3393,7 +3393,8 @@ dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev,\n static int\n dpaa2_sec_security_session_create(void *dev,\n \t\t\t\t struct rte_security_session_conf *conf,\n-\t\t\t\t void *sess)\n+\t\t\t\t void *sess,\n+\t\t\t\t rte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_cryptodev *cdev = (struct rte_cryptodev *)dev;\n \tint ret;\ndiff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c\nindex 832b6e64ec..0497931c67 100644\n--- a/drivers/crypto/dpaa_sec/dpaa_sec.c\n+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c\n@@ -3114,7 +3114,8 @@ dpaa_sec_set_pdcp_session(struct rte_cryptodev *dev,\n static int\n dpaa_sec_security_session_create(void *dev,\n \t\t\t\t struct rte_security_session_conf *conf,\n-\t\t\t\t void *sess)\n+\t\t\t\t void *sess,\n+\t\t\t\t rte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_cryptodev *cdev = (struct rte_cryptodev *)dev;\n \tint ret;\ndiff --git a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c\nindex 56900e3187..5a8be84444 100644\n--- a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c\n+++ b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c\n@@ -87,7 +87,8 @@ ipsec_lp_len_precalc(struct rte_security_ipsec_xform *ipsec,\n \n static int\n otx2_cpt_enq_sa_write(struct otx2_sec_session_ipsec_lp *lp,\n-\t\t struct otx2_cpt_qp *qptr, uint8_t opcode)\n+\t\t struct otx2_cpt_qp *qptr, uint8_t opcode,\n+\t\t rte_iova_t sess_iova)\n {\n \tuint64_t lmt_status, time_out;\n \tvoid *lmtline = qptr->lmtline;\n@@ -107,9 +108,9 @@ otx2_cpt_enq_sa_write(struct otx2_sec_session_ipsec_lp *lp,\n \tinst.param1 = 0;\n \tinst.param2 = 0;\n \tinst.dlen = lp->ctx_len << 3;\n-\tinst.dptr = rte_mempool_virt2iova(lp);\n+\tinst.dptr = sess_iova;\n \tinst.rptr = 0;\n-\tinst.cptr = rte_mempool_virt2iova(lp);\n+\tinst.cptr = sess_iova;\n \tinst.egrp = OTX2_CPT_EGRP_SE;\n \n \tinst.u64[0] = 0;\n@@ -203,7 +204,8 @@ static int\n crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \t\t\t\t struct rte_security_ipsec_xform *ipsec,\n \t\t\t\t struct rte_crypto_sym_xform *crypto_xform,\n-\t\t\t\t struct otx2_sec_session *sess)\n+\t\t\t\t struct otx2_sec_session *sess,\n+\t\t\t\t rte_iova_t sess_iova)\n {\n \tstruct rte_crypto_sym_xform *auth_xform, *cipher_xform;\n \tstruct otx2_ipsec_po_ip_template *template = NULL;\n@@ -379,7 +381,7 @@ crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \n \tinst.u64[7] = 0;\n \tinst.egrp = OTX2_CPT_EGRP_SE;\n-\tinst.cptr = rte_mempool_virt2iova(sa);\n+\tinst.cptr = sess_iova;\n \n \tlp->cpt_inst_w7 = inst.u64[7];\n \tlp->ucmd_opcode = (lp->ctx_len << 8) |\n@@ -389,14 +391,15 @@ crypto_sec_ipsec_outb_session_create(struct rte_cryptodev *crypto_dev,\n \t\t\t\t auth_xform, cipher_xform);\n \n \treturn otx2_cpt_enq_sa_write(lp, crypto_dev->data->queue_pairs[0],\n-\t\t\t\t OTX2_IPSEC_PO_WRITE_IPSEC_OUTB);\n+\t\t\t\t OTX2_IPSEC_PO_WRITE_IPSEC_OUTB, sess_iova);\n }\n \n static int\n crypto_sec_ipsec_inb_session_create(struct rte_cryptodev *crypto_dev,\n \t\t\t\t struct rte_security_ipsec_xform *ipsec,\n \t\t\t\t struct rte_crypto_sym_xform *crypto_xform,\n-\t\t\t\t struct otx2_sec_session *sess)\n+\t\t\t\t struct otx2_sec_session *sess,\n+\t\t\t\t rte_iova_t sess_iova)\n {\n \tstruct rte_crypto_sym_xform *auth_xform, *cipher_xform;\n \tconst uint8_t *cipher_key, *auth_key;\n@@ -473,7 +476,7 @@ crypto_sec_ipsec_inb_session_create(struct rte_cryptodev *crypto_dev,\n \n \tinst.u64[7] = 0;\n \tinst.egrp = OTX2_CPT_EGRP_SE;\n-\tinst.cptr = rte_mempool_virt2iova(sa);\n+\tinst.cptr = sess_iova;\n \n \tlp->cpt_inst_w7 = inst.u64[7];\n \tlp->ucmd_opcode = (lp->ctx_len << 8) |\n@@ -501,14 +504,15 @@ crypto_sec_ipsec_inb_session_create(struct rte_cryptodev *crypto_dev,\n \t}\n \n \treturn otx2_cpt_enq_sa_write(lp, crypto_dev->data->queue_pairs[0],\n-\t\t\t\t OTX2_IPSEC_PO_WRITE_IPSEC_INB);\n+\t\t\t\t OTX2_IPSEC_PO_WRITE_IPSEC_INB, sess_iova);\n }\n \n static int\n crypto_sec_ipsec_session_create(struct rte_cryptodev *crypto_dev,\n \t\t\t\tstruct rte_security_ipsec_xform *ipsec,\n \t\t\t\tstruct rte_crypto_sym_xform *crypto_xform,\n-\t\t\t\tstruct otx2_sec_session *sess)\n+\t\t\t\tstruct otx2_sec_session *sess,\n+\t\t\t\trte_iova_t sess_iova)\n {\n \tint ret;\n \n@@ -523,16 +527,17 @@ crypto_sec_ipsec_session_create(struct rte_cryptodev *crypto_dev,\n \n \tif (ipsec->direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS)\n \t\treturn crypto_sec_ipsec_inb_session_create(crypto_dev, ipsec,\n-\t\t\t\t\t\t\t crypto_xform, sess);\n+\t\t\t\t\t\tcrypto_xform, sess, sess_iova);\n \telse\n \t\treturn crypto_sec_ipsec_outb_session_create(crypto_dev, ipsec,\n-\t\t\t\t\t\t\t crypto_xform, sess);\n+\t\t\t\t\t\tcrypto_xform, sess, sess_iova);\n }\n \n static int\n otx2_crypto_sec_session_create(void *device,\n \t\t\t struct rte_security_session_conf *conf,\n-\t\t\t void *sess)\n+\t\t\t void *sess,\n+\t\t\t rte_iova_t sess_iova)\n {\n \tstruct otx2_sec_session *priv = sess;\n \tint ret;\n@@ -548,7 +553,7 @@ otx2_crypto_sec_session_create(void *device,\n \tif (conf->protocol == RTE_SECURITY_PROTOCOL_IPSEC)\n \t\tret = crypto_sec_ipsec_session_create(device, &conf->ipsec,\n \t\t\t\t\t\t conf->crypto_xform,\n-\t\t\t\t\t\t priv);\n+\t\t\t\t\t\t priv, sess_iova);\n \telse\n \t\tret = -ENOTSUP;\n \ndiff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c\nindex 2a22347c7f..2c0e44dff4 100644\n--- a/drivers/crypto/qat/qat_sym_session.c\n+++ b/drivers/crypto/qat/qat_sym_session.c\n@@ -2232,7 +2232,8 @@ qat_sec_session_check_docsis(struct rte_security_session_conf *conf)\n \n static int\n qat_sec_session_set_docsis_parameters(struct rte_cryptodev *dev,\n-\t\tstruct rte_security_session_conf *conf, void *session_private)\n+\t\tstruct rte_security_session_conf *conf, void *session_private,\n+\t\trte_iova_t session_paddr)\n {\n \tint ret;\n \tint qat_cmd_id;\n@@ -2251,7 +2252,6 @@ qat_sec_session_set_docsis_parameters(struct rte_cryptodev *dev,\n \txform = conf->crypto_xform;\n \n \t/* Verify the session physical address is known */\n-\trte_iova_t session_paddr = rte_mempool_virt2iova(session);\n \tif (session_paddr == 0 || session_paddr == RTE_BAD_IOVA) {\n \t\tQAT_LOG(ERR,\n \t\t\t\"Session physical address unknown. Bad memory pool.\");\n@@ -2282,8 +2282,8 @@ qat_sec_session_set_docsis_parameters(struct rte_cryptodev *dev,\n \n int\n qat_security_session_create(void *dev,\n-\t\t\t\tstruct rte_security_session_conf *conf,\n-\t\t\t\tvoid *sess_private_data)\n+\t\t\tstruct rte_security_session_conf *conf,\n+\t\t\tvoid *sess_private_data, rte_iova_t sess_priv_iova)\n {\n \tstruct rte_cryptodev *cdev = (struct rte_cryptodev *)dev;\n \tint ret;\n@@ -2295,7 +2295,7 @@ qat_security_session_create(void *dev,\n \t}\n \n \tret = qat_sec_session_set_docsis_parameters(cdev, conf,\n-\t\t\tsess_private_data);\n+\t\t\tsess_private_data, sess_priv_iova);\n \tif (ret != 0) {\n \t\tQAT_LOG(ERR, \"Failed to configure session parameters\");\n \t\treturn ret;\ndiff --git a/drivers/crypto/qat/qat_sym_session.h b/drivers/crypto/qat/qat_sym_session.h\nindex 7fcc1d6f7b..b93dc549ef 100644\n--- a/drivers/crypto/qat/qat_sym_session.h\n+++ b/drivers/crypto/qat/qat_sym_session.h\n@@ -166,7 +166,7 @@ qat_sym_validate_zuc_key(int key_len, enum icp_qat_hw_cipher_algo *alg);\n #ifdef RTE_LIB_SECURITY\n int\n qat_security_session_create(void *dev, struct rte_security_session_conf *conf,\n-\t\tvoid *sess);\n+\t\tvoid *sess, rte_iova_t sess_iova);\n int\n qat_security_session_destroy(void *dev, void *sess);\n #endif\ndiff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c\nindex 3d0f4044d9..ee0847e35c 100644\n--- a/drivers/net/cnxk/cn10k_ethdev_sec.c\n+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c\n@@ -228,7 +228,7 @@ cn10k_eth_sec_sso_work_cb(uint64_t *gw, void *args)\n static int\n cn10k_eth_sec_session_create(void *device,\n \t\t\t struct rte_security_session_conf *conf,\n-\t\t\t void *sess_priv)\n+\t\t\t void *sess_priv, rte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_eth_dev *eth_dev = (struct rte_eth_dev *)device;\n \tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\ndiff --git a/drivers/net/cnxk/cn9k_ethdev_sec.c b/drivers/net/cnxk/cn9k_ethdev_sec.c\nindex 8a6fa75b37..7c10339295 100644\n--- a/drivers/net/cnxk/cn9k_ethdev_sec.c\n+++ b/drivers/net/cnxk/cn9k_ethdev_sec.c\n@@ -137,7 +137,7 @@ ar_window_init(struct cn9k_inb_priv_data *inb_priv)\n static int\n cn9k_eth_sec_session_create(void *device,\n \t\t\t struct rte_security_session_conf *conf,\n-\t\t\t void *sess_priv)\n+\t\t\t void *sess_priv, rte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_eth_dev *eth_dev = (struct rte_eth_dev *)device;\n \tstruct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);\ndiff --git a/drivers/net/ixgbe/ixgbe_ipsec.c b/drivers/net/ixgbe/ixgbe_ipsec.c\nindex cd54a3beee..f2d4cfa2ba 100644\n--- a/drivers/net/ixgbe/ixgbe_ipsec.c\n+++ b/drivers/net/ixgbe/ixgbe_ipsec.c\n@@ -369,7 +369,7 @@ ixgbe_crypto_remove_sa(struct rte_eth_dev *dev,\n static int\n ixgbe_crypto_create_session(void *device,\n \t\tstruct rte_security_session_conf *conf,\n-\t\tvoid *session)\n+\t\tvoid *session, rte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_eth_dev *eth_dev = (struct rte_eth_dev *)device;\n \tstruct ixgbe_crypto_session *ic_session = session;\ndiff --git a/drivers/net/octeontx2/otx2_ethdev_sec.c b/drivers/net/octeontx2/otx2_ethdev_sec.c\nindex ef851fe52c..c1901f8f34 100644\n--- a/drivers/net/octeontx2/otx2_ethdev_sec.c\n+++ b/drivers/net/octeontx2/otx2_ethdev_sec.c\n@@ -638,7 +638,8 @@ eth_sec_ipsec_sess_create(struct rte_eth_dev *eth_dev,\n static int\n otx2_eth_sec_session_create(void *device,\n \t\t\t struct rte_security_session_conf *conf,\n-\t\t\t void *sess)\n+\t\t\t void *sess,\n+\t\t\t rte_iova_t sess_iova __rte_unused)\n {\n \tstruct otx2_sec_session *priv = sess;\n \tint ret;\ndiff --git a/drivers/net/txgbe/txgbe_ipsec.c b/drivers/net/txgbe/txgbe_ipsec.c\nindex 444da5b8f3..6187e84063 100644\n--- a/drivers/net/txgbe/txgbe_ipsec.c\n+++ b/drivers/net/txgbe/txgbe_ipsec.c\n@@ -349,7 +349,7 @@ txgbe_crypto_remove_sa(struct rte_eth_dev *dev,\n static int\n txgbe_crypto_create_session(void *device,\n \t\tstruct rte_security_session_conf *conf,\n-\t\tvoid *session)\n+\t\tvoid *session, rte_iova_t sess_iova __rte_unused)\n {\n \tstruct rte_eth_dev *eth_dev = (struct rte_eth_dev *)device;\n \tstruct txgbe_crypto_session *ic_session = session;\ndiff --git a/lib/security/rte_security.c b/lib/security/rte_security.c\nindex 06560b9cba..93eaf395bb 100644\n--- a/lib/security/rte_security.c\n+++ b/lib/security/rte_security.c\n@@ -45,6 +45,7 @@ rte_security_session_create(struct rte_security_ctx *instance,\n \t\t\t struct rte_mempool *mp)\n {\n \tstruct rte_security_session *sess = NULL;\n+\trte_iova_t sess_priv_iova;\n \n \tRTE_PTR_CHAIN3_OR_ERR_RET(instance, ops, session_create, NULL, NULL);\n \tRTE_PTR_OR_ERR_RET(conf, NULL);\n@@ -57,8 +58,11 @@ rte_security_session_create(struct rte_security_ctx *instance,\n \tif (rte_mempool_get(mp, (void **)&sess))\n \t\treturn NULL;\n \n+\tsess_priv_iova = rte_mempool_virt2iova(sess) +\n+\t\toffsetof(struct rte_security_session, sess_private_data);\n+\n \tif (instance->ops->session_create(instance->device, conf,\n-\t\t\t\tsess->sess_private_data)) {\n+\t\t\t\tsess->sess_private_data, sess_priv_iova)) {\n \t\trte_mempool_put(mp, (void *)sess);\n \t\treturn NULL;\n \t}\ndiff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h\nindex 13f2f9da32..04c418a893 100644\n--- a/lib/security/rte_security_driver.h\n+++ b/lib/security/rte_security_driver.h\n@@ -38,7 +38,7 @@ struct rte_security_session {\n * @param\tdevice\t\tCrypto/eth device pointer\n * @param\tconf\t\tSecurity session configuration\n * @param\tsess\t\tPointer to Security private session structure\n- * @param\tmp\t\tMempool where the private session is allocated\n+ * @param\tsess_iova\tPrivate session IOVA\n *\n * @return\n * - Returns 0 if private session structure have been created successfully.\n@@ -48,7 +48,7 @@ struct rte_security_session {\n */\n typedef int (*security_session_create_t)(void *device,\n \t\tstruct rte_security_session_conf *conf,\n-\t\tvoid *sess);\n+\t\tvoid *sess, rte_iova_t sess_iova);\n \n /**\n * Free driver private session data.\n", "prefixes": [ "v2", "4/7" ] }{ "id": 101505, "url": "