get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131634,
    "url": "http://patches.dpdk.org/api/patches/131634/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230919135409.2544309-3-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": "<20230919135409.2544309-3-gakhil@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230919135409.2544309-3-gakhil@marvell.com",
    "date": "2023-09-19T13:54:08",
    "name": "[v2,2/3] net/cnxk: add MACsec capability",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "816d39bb3a76f215b192443adbe477af42895093",
    "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/20230919135409.2544309-3-gakhil@marvell.com/mbox/",
    "series": [
        {
            "id": 29554,
            "url": "http://patches.dpdk.org/api/series/29554/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29554",
            "date": "2023-09-19T13:54:06",
            "name": "MACsec capability verification",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/29554/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/131634/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/131634/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 8A65142606;\n\tTue, 19 Sep 2023 15:54:33 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AFC7B40E68;\n\tTue, 19 Sep 2023 15:54:25 +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 D171C40A8B\n for <dev@dpdk.org>; Tue, 19 Sep 2023 15:54:23 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 38J64dYB022840 for <dev@dpdk.org>; Tue, 19 Sep 2023 06:54:23 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3t5bvkrmn6-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 19 Sep 2023 06:54:23 -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.48;\n Tue, 19 Sep 2023 06:54:21 -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.48 via Frontend\n Transport; Tue, 19 Sep 2023 06:54:21 -0700",
            "from localhost.localdomain (unknown [10.28.36.102])\n by maili.marvell.com (Postfix) with ESMTP id 87FE53F709C;\n Tue, 19 Sep 2023 06:54:19 -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=k1wrxmCizzeYjWYU8Tfpdr+bcO/NYDbhvdKr4FdZQdM=;\n b=N2ggV8Tiz2eiGFWcOr0urGo29bzGOnbeOWmxNB0XrMrh/kcznPdzvBhFduSv3fs3OiKM\n +HznPrbQVfcNIdHyoJJHR4rFmndFMlUuxJaEUVh4CWGHMfPTn1p2mjEmf9X9c5T44WzJ\n ltYzGfvjC+hlw/Wr0gXJOGRuWsrN/NIRiU6eB+U2Yb9J0b49A3JVHEaKLjt1u8Qt7HWI\n DrKps+Ixxl16DTzM89z3/73DdDo419L1Zo/NotjFXbmCPk2U4TxJrJIshpChetqd7LiS\n MyT3Y3xPgIhhz6U+DOhSYBgVGvwnE0Q+z/A8bW+k9LFsk1Kx3sVZttaTrZfkNfSAsZLN rg==",
        "From": "Akhil Goyal <gakhil@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<adwivedi@marvell.com>, <jerinj@marvell.com>, <vattunuru@marvell.com>,\n Akhil Goyal <gakhil@marvell.com>",
        "Subject": "[PATCH v2 2/3] net/cnxk: add MACsec capability",
        "Date": "Tue, 19 Sep 2023 19:24:08 +0530",
        "Message-ID": "<20230919135409.2544309-3-gakhil@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230919135409.2544309-1-gakhil@marvell.com>",
        "References": "<20230731034447.929506-1-gakhil@marvell.com>\n <20230919135409.2544309-1-gakhil@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "u_pQZnqtvqcnkmH7V9Sqm2VcUMFApRW0",
        "X-Proofpoint-ORIG-GUID": "u_pQZnqtvqcnkmH7V9Sqm2VcUMFApRW0",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26\n definitions=2023-09-19_06,2023-09-19_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": "From: Ankur Dwivedi <adwivedi@marvell.com>\n\nAdds the MACsec capability for CN10K-B.\n\nThe ethernet security capability structure is populated based on the\nfeature supported by the device.\n\nSigned-off-by: Ankur Dwivedi <adwivedi@marvell.com>\nAcked-by: Akhil Goyal <gakhil@marvell.com>\n---\n drivers/common/cnxk/roc_features.h  |   6 ++\n drivers/common/cnxk/roc_mcs.h       |   3 +\n drivers/net/cnxk/cn10k_ethdev_sec.c | 120 +++++++++++++++++++++++++++-\n 3 files changed, 125 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/common/cnxk/roc_features.h b/drivers/common/cnxk/roc_features.h\nindex 815f800e7a..d5d0c0c901 100644\n--- a/drivers/common/cnxk/roc_features.h\n+++ b/drivers/common/cnxk/roc_features.h\n@@ -71,4 +71,10 @@ roc_feature_bphy_has_macsec(void)\n {\n \treturn roc_model_is_cnf10kb();\n }\n+\n+static inline bool\n+roc_feature_nix_has_inl_ipsec(void)\n+{\n+\treturn !roc_model_is_cnf10kb();\n+}\n #endif\ndiff --git a/drivers/common/cnxk/roc_mcs.h b/drivers/common/cnxk/roc_mcs.h\nindex afac6c92e2..602f1cae1d 100644\n--- a/drivers/common/cnxk/roc_mcs.h\n+++ b/drivers/common/cnxk/roc_mcs.h\n@@ -7,6 +7,9 @@\n \n #define MCS_AES_GCM_256_KEYLEN 32\n \n+#define ROC_MCS_MAX_AR_WINSZ BIT_ULL(31)\n+#define ROC_MCS_MAX_MTU      (BIT_ULL(16) - 1)\n+\n struct roc_mcs_alloc_rsrc_req {\n \tuint8_t rsrc_type;\n \tuint8_t rsrc_cnt; /* Resources count */\ndiff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c\nindex b98fc9378e..a7473922af 100644\n--- a/drivers/net/cnxk/cn10k_ethdev_sec.c\n+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c\n@@ -303,7 +303,7 @@ static struct rte_cryptodev_capabilities cn10k_eth_sec_crypto_caps[] = {\n \tRTE_CRYPTODEV_END_OF_CAPABILITIES_LIST()\n };\n \n-static const struct rte_security_capability cn10k_eth_sec_capabilities[] = {\n+static const struct rte_security_capability cn10k_eth_sec_ipsec_capabilities[] = {\n \t{\t/* IPsec Inline Protocol ESP Tunnel Ingress */\n \t\t.action = RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,\n \t\t.protocol = RTE_SECURITY_PROTOCOL_IPSEC,\n@@ -401,11 +401,100 @@ static const struct rte_security_capability cn10k_eth_sec_capabilities[] = {\n \t\t.crypto_capabilities = cn10k_eth_sec_crypto_caps,\n \t\t.ol_flags = RTE_SECURITY_TX_OLOAD_NEED_MDATA\n \t},\n-\t{\n-\t\t.action = RTE_SECURITY_ACTION_TYPE_NONE\n-\t}\n };\n \n+static const struct rte_security_capability cn10k_eth_sec_macsec_capabilities[] = {\n+\t{\t/* MACsec Inline Protocol, AES-GCM-128 algo */\n+\t\t.action = RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,\n+\t\t.protocol = RTE_SECURITY_PROTOCOL_MACSEC,\n+\t\t.macsec = {\n+\t\t\t.mtu = ROC_MCS_MAX_MTU,\n+\t\t\t.alg = RTE_SECURITY_MACSEC_ALG_GCM_128,\n+\t\t\t.max_nb_sc = 128,\n+\t\t\t.max_nb_sa = 256,\n+\t\t\t.max_nb_sess = 256,\n+\t\t\t.replay_win_sz = ROC_MCS_MAX_AR_WINSZ,\n+\t\t\t.relative_sectag_insert = 1,\n+\t\t\t.fixed_sectag_insert = 1,\n+\t\t\t.icv_include_da_sa = 1,\n+\t\t\t.ctrl_port_enable = 1,\n+\t\t\t.preserve_sectag = 1,\n+\t\t\t.preserve_icv = 1,\n+\t\t\t.validate_frames = 1,\n+\t\t\t.re_key = 1,\n+\t\t\t.anti_replay = 1,\n+\t\t},\n+\t},\n+\t{\t/* MACsec Inline Protocol, AES-GCM-256 algo */\n+\t\t.action = RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,\n+\t\t.protocol = RTE_SECURITY_PROTOCOL_MACSEC,\n+\t\t.macsec = {\n+\t\t\t.mtu = ROC_MCS_MAX_MTU,\n+\t\t\t.alg = RTE_SECURITY_MACSEC_ALG_GCM_256,\n+\t\t\t.max_nb_sc = 128,\n+\t\t\t.max_nb_sa = 256,\n+\t\t\t.max_nb_sess = 256,\n+\t\t\t.replay_win_sz = ROC_MCS_MAX_AR_WINSZ,\n+\t\t\t.relative_sectag_insert = 1,\n+\t\t\t.fixed_sectag_insert = 1,\n+\t\t\t.icv_include_da_sa = 1,\n+\t\t\t.ctrl_port_enable = 1,\n+\t\t\t.preserve_sectag = 1,\n+\t\t\t.preserve_icv = 1,\n+\t\t\t.validate_frames = 1,\n+\t\t\t.re_key = 1,\n+\t\t\t.anti_replay = 1,\n+\t\t},\n+\t},\n+\t{\t/* MACsec Inline Protocol, AES-GCM-XPN-128 algo */\n+\t\t.action = RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,\n+\t\t.protocol = RTE_SECURITY_PROTOCOL_MACSEC,\n+\t\t.macsec = {\n+\t\t\t.mtu = ROC_MCS_MAX_MTU,\n+\t\t\t.alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_128,\n+\t\t\t.max_nb_sc = 128,\n+\t\t\t.max_nb_sa = 256,\n+\t\t\t.max_nb_sess = 256,\n+\t\t\t.replay_win_sz = ROC_MCS_MAX_AR_WINSZ,\n+\t\t\t.relative_sectag_insert = 1,\n+\t\t\t.fixed_sectag_insert = 1,\n+\t\t\t.icv_include_da_sa = 1,\n+\t\t\t.ctrl_port_enable = 1,\n+\t\t\t.preserve_sectag = 1,\n+\t\t\t.preserve_icv = 1,\n+\t\t\t.validate_frames = 1,\n+\t\t\t.re_key = 1,\n+\t\t\t.anti_replay = 1,\n+\t\t},\n+\t},\n+\t{\t/* MACsec Inline Protocol, AES-GCM-XPN-256 algo */\n+\t\t.action = RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,\n+\t\t.protocol = RTE_SECURITY_PROTOCOL_MACSEC,\n+\t\t.macsec = {\n+\t\t\t.mtu = ROC_MCS_MAX_MTU,\n+\t\t\t.alg = RTE_SECURITY_MACSEC_ALG_GCM_XPN_256,\n+\t\t\t.max_nb_sc = 128,\n+\t\t\t.max_nb_sa = 256,\n+\t\t\t.max_nb_sess = 256,\n+\t\t\t.replay_win_sz = ROC_MCS_MAX_AR_WINSZ,\n+\t\t\t.relative_sectag_insert = 1,\n+\t\t\t.fixed_sectag_insert = 1,\n+\t\t\t.icv_include_da_sa = 1,\n+\t\t\t.ctrl_port_enable = 1,\n+\t\t\t.preserve_sectag = 1,\n+\t\t\t.preserve_icv = 1,\n+\t\t\t.validate_frames = 1,\n+\t\t\t.re_key = 1,\n+\t\t\t.anti_replay = 1,\n+\t\t},\n+\t},\n+};\n+\n+#define SEC_CAPS_LEN (RTE_DIM(cn10k_eth_sec_ipsec_capabilities) + \\\n+\t\tRTE_DIM(cn10k_eth_sec_macsec_capabilities) + 1)\n+\n+static struct rte_security_capability cn10k_eth_sec_capabilities[SEC_CAPS_LEN];\n+\n static inline void\n cnxk_pktmbuf_free_no_cache(struct rte_mbuf *mbuf)\n {\n@@ -1093,15 +1182,38 @@ cn10k_eth_sec_session_stats_get(void *device, struct rte_security_session *sess,\n \treturn 0;\n }\n \n+static void\n+eth_sec_caps_add(struct rte_security_capability eth_sec_caps[], uint32_t *idx,\n+\t\t const struct rte_security_capability *caps, uint32_t nb_caps)\n+{\n+\tPLT_VERIFY(*idx + nb_caps < SEC_CAPS_LEN);\n+\n+\trte_memcpy(&eth_sec_caps[*idx], caps, nb_caps * sizeof(caps[0]));\n+\t*idx += nb_caps;\n+}\n+\n void\n cn10k_eth_sec_ops_override(void)\n {\n \tstatic int init_once;\n+\tuint32_t idx = 0;\n \n \tif (init_once)\n \t\treturn;\n \tinit_once = 1;\n \n+\tif (roc_feature_nix_has_inl_ipsec())\n+\t\teth_sec_caps_add(cn10k_eth_sec_capabilities, &idx,\n+\t\t\t\t cn10k_eth_sec_ipsec_capabilities,\n+\t\t\t\t RTE_DIM(cn10k_eth_sec_ipsec_capabilities));\n+\n+\tif (roc_feature_nix_has_macsec())\n+\t\teth_sec_caps_add(cn10k_eth_sec_capabilities, &idx,\n+\t\t\t\t cn10k_eth_sec_macsec_capabilities,\n+\t\t\t\t RTE_DIM(cn10k_eth_sec_macsec_capabilities));\n+\n+\tcn10k_eth_sec_capabilities[idx].action = RTE_SECURITY_ACTION_TYPE_NONE;\n+\n \t/* Update platform specific ops */\n \tcnxk_eth_sec_ops.macsec_sa_create = cnxk_eth_macsec_sa_create;\n \tcnxk_eth_sec_ops.macsec_sc_create = cnxk_eth_macsec_sc_create;\n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}