get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 110075,
    "url": "http://patches.dpdk.org/api/patches/110075/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220422043857.2154566-3-kirankumark@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": "<20220422043857.2154566-3-kirankumark@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220422043857.2154566-3-kirankumark@marvell.com",
    "date": "2022-04-22T04:38:57",
    "name": "[3/3] net/cnxk: adding cnxk support to configure custom sa index",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6d6bb1314475420ea8745d57e33e274e4fccd0a7",
    "submitter": {
        "id": 1260,
        "url": "http://patches.dpdk.org/api/people/1260/?format=api",
        "name": "Kiran Kumar Kokkilagadda",
        "email": "kirankumark@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220422043857.2154566-3-kirankumark@marvell.com/mbox/",
    "series": [
        {
            "id": 22608,
            "url": "http://patches.dpdk.org/api/series/22608/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22608",
            "date": "2022-04-22T04:38:55",
            "name": "[1/3] common/cnxk: add ROC support to parse cnxk custom sa action",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/22608/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/110075/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/110075/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 50AEEA0093;\n\tFri, 22 Apr 2022 06:39:25 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F1F95427EA;\n\tFri, 22 Apr 2022 06:39:22 +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 5D1EA41611\n for <dev@dpdk.org>; Fri, 22 Apr 2022 06:39:21 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id\n 23M0F6Zb003121;\n Thu, 21 Apr 2022 21:39:17 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3fk7mk341d-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 21 Apr 2022 21:39:16 -0700",
            "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Thu, 21 Apr 2022 21:39:15 -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.2 via Frontend\n Transport; Thu, 21 Apr 2022 21:39:15 -0700",
            "from localhost.localdomain (unknown [10.28.34.15])\n by maili.marvell.com (Postfix) with ESMTP id 7F7AD3F7085;\n Thu, 21 Apr 2022 21:39:13 -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=e/uccJ1p39I27dZuuk4NNRuNmE+FH/JxirM5WcnXLmA=;\n b=iMaKKo3TXUDGZ3aYrOnKulTopfy9Sbu4bDaJeKkreCIRnHG/Rm9pz/l3RE4mE1Yzihcl\n UYyOB+EUiRlSItiMzID59C0QSfpOZ63TLvV+N4y8n/W2KsNCLfSeRe9MxaGOm6ywf49N\n kacicGl5LfHFjfX3B25IQgt2GLwTdlXrYiFtx1KhAgJSpZeSqfthnmpiu733X06ARXlk\n L4hVw9uIT6dDYVb9/YSbnpdZTtFB/aiC1/TkaZhIqYBvyfB7HPA8mo63ZpH6pWsFhHKI\n lfJcqC1xS6KlOJZi00mYwMc0nR42u20h/BPEADCfVkbgma4ymlZZKlu+Wchltm/qsd97 Dw==",
        "From": "<kirankumark@marvell.com>",
        "To": "Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K\n <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao\n <skoteshwar@marvell.com>, Ray Kinsella <mdr@ashroe.eu>",
        "CC": "<dev@dpdk.org>",
        "Subject": "[dpdk-dev][PATCH 3/3] net/cnxk: adding cnxk support to configure\n custom sa index",
        "Date": "Fri, 22 Apr 2022 10:08:57 +0530",
        "Message-ID": "<20220422043857.2154566-3-kirankumark@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220422043857.2154566-1-kirankumark@marvell.com>",
        "References": "<20220422043857.2154566-1-kirankumark@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "yWPrvglO6Ua7dOac_En5cMcblmHNInPV",
        "X-Proofpoint-GUID": "yWPrvglO6Ua7dOac_En5cMcblmHNInPV",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514\n definitions=2022-04-22_01,2022-04-21_01,2022-02-23_01",
        "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": "From: Kiran Kumar K <kirankumark@marvell.com>\n\nAdding cnxk device driver support to configure custom sa index.\nCustom sa index can be configured as part of the session create\nas SPI, and later original SPI can be updated using session update.\n\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\n---\n doc/api/doxy-api-index.md           |   3 +-\n doc/api/doxy-api.conf.in            |   1 +\n drivers/net/cnxk/cn10k_ethdev_sec.c | 107 +++++++++++++++++++++++++++-\n drivers/net/cnxk/cn9k_ethdev.c      |   6 ++\n drivers/net/cnxk/cn9k_ethdev_sec.c  |   2 +-\n drivers/net/cnxk/cnxk_ethdev.h      |   3 +-\n drivers/net/cnxk/cnxk_ethdev_sec.c  |  30 +++++---\n drivers/net/cnxk/cnxk_flow.c        |   1 +\n drivers/net/cnxk/meson.build        |   2 +\n drivers/net/cnxk/rte_pmd_cnxk.h     |  94 ++++++++++++++++++++++++\n drivers/net/cnxk/version.map        |   6 ++\n 11 files changed, 240 insertions(+), 15 deletions(-)\n create mode 100644 drivers/net/cnxk/rte_pmd_cnxk.h",
    "diff": "diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md\nindex 4245b9635c..8f9564ee84 100644\n--- a/doc/api/doxy-api-index.md\n+++ b/doc/api/doxy-api-index.md\n@@ -56,7 +56,8 @@ The public API headers are grouped by topics:\n   [dpaa2_qdma]         (@ref rte_pmd_dpaa2_qdma.h),\n   [crypto_scheduler]   (@ref rte_cryptodev_scheduler.h),\n   [dlb2]               (@ref rte_pmd_dlb2.h),\n-  [ifpga]              (@ref rte_pmd_ifpga.h)\n+  [ifpga]              (@ref rte_pmd_ifpga.h),\n+  [cnxk]               (@ref rte_pmd_cnxk.h)\n \n - **memory**:\n   [memseg]             (@ref rte_memory.h),\ndiff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in\nindex db2ca9b6ed..b49942412d 100644\n--- a/doc/api/doxy-api.conf.in\n+++ b/doc/api/doxy-api.conf.in\n@@ -12,6 +12,7 @@ INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \\\n                           @TOPDIR@/drivers/net/ark \\\n                           @TOPDIR@/drivers/net/bnxt \\\n                           @TOPDIR@/drivers/net/bonding \\\n+                          @TOPDIR@/drivers/net/cnxk \\\n                           @TOPDIR@/drivers/net/dpaa \\\n                           @TOPDIR@/drivers/net/dpaa2 \\\n                           @TOPDIR@/drivers/net/i40e \\\ndiff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c\nindex 87bb691ab4..60ae5d7d99 100644\n--- a/drivers/net/cnxk/cn10k_ethdev_sec.c\n+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c\n@@ -6,6 +6,7 @@\n #include <rte_eventdev.h>\n #include <rte_security.h>\n #include <rte_security_driver.h>\n+#include <rte_pmd_cnxk.h>\n \n #include <cn10k_ethdev.h>\n #include <cnxk_security.h>\n@@ -502,7 +503,7 @@ cn10k_eth_sec_session_create(void *device,\n \t\t\t\t  ROC_NIX_INL_OT_IPSEC_OUTB_SW_RSVD);\n \n \t\t/* Alloc an sa index */\n-\t\trc = cnxk_eth_outb_sa_idx_get(dev, &sa_idx);\n+\t\trc = cnxk_eth_outb_sa_idx_get(dev, &sa_idx, ipsec->spi);\n \t\tif (rc)\n \t\t\tgoto mempool_put;\n \n@@ -657,6 +658,109 @@ cn10k_eth_sec_capabilities_get(void *device __rte_unused)\n \treturn cn10k_eth_sec_capabilities;\n }\n \n+static int\n+cn10k_eth_sec_session_update(void *device, struct rte_security_session *sess,\n+\t\t\t     struct rte_security_session_conf *conf)\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);\n+\tstruct roc_ot_ipsec_inb_sa *inb_sa_dptr;\n+\tstruct rte_security_ipsec_xform *ipsec;\n+\tstruct rte_crypto_sym_xform *crypto;\n+\tstruct cnxk_eth_sec_sess *eth_sec;\n+\tbool inbound;\n+\tint rc;\n+\n+\tif (conf->action_type != RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL ||\n+\t    conf->protocol != RTE_SECURITY_PROTOCOL_IPSEC)\n+\t\treturn -ENOENT;\n+\n+\tipsec = &conf->ipsec;\n+\tcrypto = conf->crypto_xform;\n+\tinbound = !!(ipsec->direction == RTE_SECURITY_IPSEC_SA_DIR_INGRESS);\n+\n+\teth_sec = cnxk_eth_sec_sess_get_by_sess(dev, sess);\n+\tif (!eth_sec)\n+\t\treturn -ENOENT;\n+\n+\teth_sec->spi = conf->ipsec.spi;\n+\n+\tif (inbound) {\n+\t\tinb_sa_dptr = (struct roc_ot_ipsec_inb_sa *)dev->inb.sa_dptr;\n+\t\tmemset(inb_sa_dptr, 0, sizeof(struct roc_ot_ipsec_inb_sa));\n+\n+\t\trc = cnxk_ot_ipsec_inb_sa_fill(inb_sa_dptr, ipsec, crypto,\n+\t\t\t\t\t       true);\n+\t\tif (rc)\n+\t\t\treturn -EINVAL;\n+\n+\t\trc = roc_nix_inl_ctx_write(&dev->nix, inb_sa_dptr, eth_sec->sa,\n+\t\t\t\t\t   eth_sec->inb,\n+\t\t\t\t\t   sizeof(struct roc_ot_ipsec_inb_sa));\n+\t\tif (rc)\n+\t\t\treturn -EINVAL;\n+\t} else {\n+\t\tstruct roc_ot_ipsec_outb_sa *outb_sa_dptr;\n+\n+\t\toutb_sa_dptr = (struct roc_ot_ipsec_outb_sa *)dev->outb.sa_dptr;\n+\t\tmemset(outb_sa_dptr, 0, sizeof(struct roc_ot_ipsec_outb_sa));\n+\n+\t\trc = cnxk_ot_ipsec_outb_sa_fill(outb_sa_dptr, ipsec, crypto);\n+\t\tif (rc)\n+\t\t\treturn -EINVAL;\n+\t\trc = roc_nix_inl_ctx_write(&dev->nix, outb_sa_dptr, eth_sec->sa,\n+\t\t\t\t\t   eth_sec->inb,\n+\t\t\t\t\t   sizeof(struct roc_ot_ipsec_outb_sa));\n+\t\tif (rc)\n+\t\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_pmd_cnxk_hw_sa_read(void *device, struct rte_security_session *sess,\n+\t\t\tvoid *data, uint32_t len)\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);\n+\tstruct cnxk_eth_sec_sess *eth_sec;\n+\tint rc;\n+\n+\teth_sec = cnxk_eth_sec_sess_get_by_sess(dev, sess);\n+\tif (eth_sec == NULL)\n+\t\treturn -EINVAL;\n+\n+\trc = roc_nix_inl_sa_sync(&dev->nix, eth_sec->sa, eth_sec->inb,\n+\t\t\t    ROC_NIX_INL_SA_OP_FLUSH);\n+\tif (rc)\n+\t\treturn -EINVAL;\n+\trte_delay_ms(1);\n+\tmemcpy(data, eth_sec->sa, len);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess,\n+\t\t\t void *data, uint32_t len)\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);\n+\tstruct cnxk_eth_sec_sess *eth_sec;\n+\tint rc = -EINVAL;\n+\n+\teth_sec = cnxk_eth_sec_sess_get_by_sess(dev, sess);\n+\tif (eth_sec == NULL)\n+\t\treturn rc;\n+\trc = roc_nix_inl_ctx_write(&dev->nix, data, eth_sec->sa, eth_sec->inb,\n+\t\t\t\t   len);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\treturn 0;\n+}\n+\n void\n cn10k_eth_sec_ops_override(void)\n {\n@@ -670,4 +774,5 @@ cn10k_eth_sec_ops_override(void)\n \tcnxk_eth_sec_ops.session_create = cn10k_eth_sec_session_create;\n \tcnxk_eth_sec_ops.session_destroy = cn10k_eth_sec_session_destroy;\n \tcnxk_eth_sec_ops.capabilities_get = cn10k_eth_sec_capabilities_get;\n+\tcnxk_eth_sec_ops.session_update = cn10k_eth_sec_session_update;\n }\ndiff --git a/drivers/net/cnxk/cn9k_ethdev.c b/drivers/net/cnxk/cn9k_ethdev.c\nindex eda33dc8c5..d6d02c2cad 100644\n--- a/drivers/net/cnxk/cn9k_ethdev.c\n+++ b/drivers/net/cnxk/cn9k_ethdev.c\n@@ -739,6 +739,12 @@ cn9k_nix_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)\n \t/* Update HW erratas */\n \tif (roc_model_is_cn96_a0() || roc_model_is_cn95_a0())\n \t\tdev->cq_min_4k = 1;\n+\n+\tif (dev->nix.custom_sa_action) {\n+\t\tdev->nix.custom_sa_action = 0;\n+\t\tplt_info(\"WARNING: Custom SA action is enabled. It's not supported\"\n+\t\t\t \" on cn9k device. Disabling it\");\n+\t}\n \treturn 0;\n }\n \ndiff --git a/drivers/net/cnxk/cn9k_ethdev_sec.c b/drivers/net/cnxk/cn9k_ethdev_sec.c\nindex fa72424b4b..4dd0b6185e 100644\n--- a/drivers/net/cnxk/cn9k_ethdev_sec.c\n+++ b/drivers/net/cnxk/cn9k_ethdev_sec.c\n@@ -262,7 +262,7 @@ cn9k_eth_sec_session_create(void *device,\n \t\t\t\t  ROC_NIX_INL_ONF_IPSEC_OUTB_SW_RSVD);\n \n \t\t/* Alloc an sa index */\n-\t\trc = cnxk_eth_outb_sa_idx_get(dev, &sa_idx);\n+\t\trc = cnxk_eth_outb_sa_idx_get(dev, &sa_idx, 0);\n \t\tif (rc)\n \t\t\tgoto mempool_put;\n \ndiff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h\nindex ccdf496860..b21011a6d0 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.h\n+++ b/drivers/net/cnxk/cnxk_ethdev.h\n@@ -628,7 +628,8 @@ int cnxk_ethdev_parse_devargs(struct rte_devargs *devargs,\n int cnxk_nix_dev_get_reg(struct rte_eth_dev *eth_dev,\n \t\t\t struct rte_dev_reg_info *regs);\n /* Security */\n-int cnxk_eth_outb_sa_idx_get(struct cnxk_eth_dev *dev, uint32_t *idx_p);\n+int cnxk_eth_outb_sa_idx_get(struct cnxk_eth_dev *dev, uint32_t *idx_p,\n+\t\t\t     uint32_t spi);\n int cnxk_eth_outb_sa_idx_put(struct cnxk_eth_dev *dev, uint32_t idx);\n int cnxk_nix_lookup_mem_sa_base_set(struct cnxk_eth_dev *dev);\n int cnxk_nix_lookup_mem_sa_base_clear(struct cnxk_eth_dev *dev);\ndiff --git a/drivers/net/cnxk/cnxk_ethdev_sec.c b/drivers/net/cnxk/cnxk_ethdev_sec.c\nindex 7351ab0dc5..d01ebb4c96 100644\n--- a/drivers/net/cnxk/cnxk_ethdev_sec.c\n+++ b/drivers/net/cnxk/cnxk_ethdev_sec.c\n@@ -29,7 +29,8 @@ bitmap_ctzll(uint64_t slab)\n }\n \n int\n-cnxk_eth_outb_sa_idx_get(struct cnxk_eth_dev *dev, uint32_t *idx_p)\n+cnxk_eth_outb_sa_idx_get(struct cnxk_eth_dev *dev, uint32_t *idx_p,\n+\t\t\t uint32_t spi)\n {\n \tuint32_t pos, idx;\n \tuint64_t slab;\n@@ -42,17 +43,24 @@ cnxk_eth_outb_sa_idx_get(struct cnxk_eth_dev *dev, uint32_t *idx_p)\n \tslab = 0;\n \t/* Scan from the beginning */\n \tplt_bitmap_scan_init(dev->outb.sa_bmap);\n-\t/* Scan bitmap to get the free sa index */\n-\trc = plt_bitmap_scan(dev->outb.sa_bmap, &pos, &slab);\n-\t/* Empty bitmap */\n-\tif (rc == 0) {\n-\t\tplt_err(\"Outbound SA' exhausted, use 'ipsec_out_max_sa' \"\n-\t\t\t\"devargs to increase\");\n-\t\treturn -ERANGE;\n-\t}\n \n-\t/* Get free SA index */\n-\tidx = pos + bitmap_ctzll(slab);\n+\tif (dev->nix.custom_sa_action) {\n+\t\tif (spi > dev->outb.max_sa)\n+\t\t\treturn -ENOTSUP;\n+\t\tidx = spi;\n+\t} else {\n+\t\t/* Scan bitmap to get the free sa index */\n+\t\trc = plt_bitmap_scan(dev->outb.sa_bmap, &pos, &slab);\n+\t\t/* Empty bitmap */\n+\t\tif (rc == 0) {\n+\t\t\tplt_err(\"Outbound SA' exhausted, use 'ipsec_out_max_sa' \"\n+\t\t\t\t\"devargs to increase\");\n+\t\t\treturn -ERANGE;\n+\t\t}\n+\n+\t\t/* Get free SA index */\n+\t\tidx = pos + bitmap_ctzll(slab);\n+\t}\n \tplt_bitmap_clear(dev->outb.sa_bmap, idx);\n \t*idx_p = idx;\n \treturn 0;\ndiff --git a/drivers/net/cnxk/cnxk_flow.c b/drivers/net/cnxk/cnxk_flow.c\nindex 8763ca63d6..2d902489e0 100644\n--- a/drivers/net/cnxk/cnxk_flow.c\n+++ b/drivers/net/cnxk/cnxk_flow.c\n@@ -205,6 +205,7 @@ cnxk_map_actions(struct rte_eth_dev *eth_dev, const struct rte_flow_attr *attr,\n \n \t\tcase RTE_FLOW_ACTION_TYPE_SECURITY:\n \t\t\tin_actions[i].type = ROC_NPC_ACTION_TYPE_SEC;\n+\t\t\tin_actions[i].conf = actions->conf;\n \t\t\tbreak;\n \t\tcase RTE_FLOW_ACTION_TYPE_OF_POP_VLAN:\n \t\t\tin_actions[i].type = ROC_NPC_ACTION_TYPE_VLAN_STRIP;\ndiff --git a/drivers/net/cnxk/meson.build b/drivers/net/cnxk/meson.build\nindex 016a79b2a8..f347e98fce 100644\n--- a/drivers/net/cnxk/meson.build\n+++ b/drivers/net/cnxk/meson.build\n@@ -192,3 +192,5 @@ foreach flag: extra_flags\n         cflags += flag\n     endif\n endforeach\n+\n+headers = files('rte_pmd_cnxk.h')\ndiff --git a/drivers/net/cnxk/rte_pmd_cnxk.h b/drivers/net/cnxk/rte_pmd_cnxk.h\nnew file mode 100644\nindex 0000000000..8770425dfb\n--- /dev/null\n+++ b/drivers/net/cnxk/rte_pmd_cnxk.h\n@@ -0,0 +1,94 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2022 Marvell.\n+ */\n+\n+/**\n+ * @file rte_pmd_cnxk.h\n+ * CNXK PMD specific functions.\n+ *\n+ **/\n+\n+#ifndef _PMD_CNXK_H_\n+#define _PMD_CNXK_H_\n+\n+#include <rte_compat.h>\n+#include <rte_ethdev.h>\n+#include <rte_ether.h>\n+#include <rte_security.h>\n+\n+/** Algorithm type to be used with security action to\n+ * calculate SA_index\n+ */\n+enum rte_pmd_cnxk_sec_action_alg {\n+\t/** No swizzling of SPI bits into SA index.\n+\t * SA_index is from SA_XOR if enabled.\n+\t */\n+\tRTE_PMD_CNXK_SEC_ACTION_ALG0,\n+\t/** SPI<31:28> has 4 upper bits which segment the sequence number space.\n+\t * Initial SA_index is from SA_XOR if enabled.\n+\t * SA_alg = { 4'b0, SA_mcam[27:0] + SPI[31:28]}\n+\t */\n+\tRTE_PMD_CNXK_SEC_ACTION_ALG1,\n+\t/** SPI<27:25> segment the sequence number space.\n+\t *  Initial SA_index is from SA_XOR if enabled.\n+\t *  SA_alg = { 7'b0, SA_mcam[24:0] + SPI[27:25]}\n+\t */\n+\tRTE_PMD_CNXK_SEC_ACTION_ALG2,\n+\t/** The inbound SPI maybe \"random\", therefore we want the MCAM to be\n+\t * capable of remapping the SPI to an arbitrary SA_index.\n+\t * SPI to SA is done using a lookup in NIX/NPC cam entry with key as\n+\t * SPI, MATCH_ID, LFID.\n+\t */\n+\tRTE_PMD_CNXK_SEC_ACTION_ALG3,\n+};\n+\n+struct rte_pmd_cnxk_sec_action {\n+\t/** Used as lookup result for ALG3 */\n+\tuint32_t sa_index;\n+\t/** When true XOR initial SA_INDEX with SA_HI/SA_LO to get SA_MCAM */\n+\tbool sa_xor;\n+\t/** SA_hi and SA_lo values for xor */\n+\tuint16_t sa_hi, sa_lo;\n+\t/** Determines alg to be applied post SA_MCAM computation with/without\n+\t * XOR.\n+\t */\n+\tenum rte_pmd_cnxk_sec_action_alg alg;\n+};\n+\n+/**\n+ * Read HW SA context from session.\n+ *\n+ * @param device\n+ *   Port identifier of Ethernet device.\n+ * @param sess\n+ *   Handle of the security session.\n+ * @param[out] data\n+ *   Destination pointer to copy SA context for application.\n+ * @param len\n+ *   Length of SA context to copy into data parameter.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise.\n+ */\n+__rte_experimental\n+int rte_pmd_cnxk_hw_sa_read(void *device, struct rte_security_session *sess,\n+\t\t\t    void *data, uint32_t len);\n+/**\n+ * Write HW SA context to session.\n+ *\n+ * @param device\n+ *   Port identifier of Ethernet device.\n+ * @param sess\n+ *   Handle of the security session.\n+ * @param[in] data\n+ *   Source data pointer from application to copy SA context into session.\n+ * @param len\n+ *   Length of SA context to copy from data parameter.\n+ *\n+ * @return\n+ *   0 on success, a negative errno value otherwise.\n+ */\n+__rte_experimental\n+int rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess,\n+\t\t\t     void *data, uint32_t len);\n+#endif /* _PMD_CNXK_H_ */\ndiff --git a/drivers/net/cnxk/version.map b/drivers/net/cnxk/version.map\nindex b9da6b1506..2efd7f2b20 100644\n--- a/drivers/net/cnxk/version.map\n+++ b/drivers/net/cnxk/version.map\n@@ -6,3 +6,9 @@ INTERNAL {\n \tglobal:\n \tcnxk_nix_inb_mode_set;\n };\n+\n+EXPERIMENTAL {\n+\tglobal:\n+\trte_pmd_cnxk_hw_sa_read;\n+\trte_pmd_cnxk_hw_sa_write;\n+};\n",
    "prefixes": [
        "3/3"
    ]
}