get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 110892,
    "url": "https://patches.dpdk.org/api/patches/110892/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220508074839.6965-23-ndabilpuram@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20220508074839.6965-23-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220508074839.6965-23-ndabilpuram@marvell.com",
    "date": "2022-05-08T07:48:34",
    "name": "[v5,23/28] net/cnxk: support security stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c3cb41fe611d63bd12cef21745736b2c99827a25",
    "submitter": {
        "id": 1202,
        "url": "https://patches.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220508074839.6965-23-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 22839,
            "url": "https://patches.dpdk.org/api/series/22839/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22839",
            "date": "2022-05-08T07:48:12",
            "name": "[v5,01/28] common/cnxk: add multi channel support for SDP send queues",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/22839/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/110892/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/110892/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 AF696A050C;\n\tSun,  8 May 2022 09:51:06 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A2A0142840;\n\tSun,  8 May 2022 09:49:51 +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 D83B44289A\n for <dev@dpdk.org>; Sun,  8 May 2022 09:49:49 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id\n 2485QDrd023654\n for <dev@dpdk.org>; Sun, 8 May 2022 00:49:49 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3fwy5j13st-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Sun, 08 May 2022 00:49:49 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Sun, 8 May 2022 00:49:47 -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.18 via Frontend\n Transport; Sun, 8 May 2022 00:49:47 -0700",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id C02645B6929;\n Sun,  8 May 2022 00:49:44 -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-type; s=pfpt0220; bh=fxG5UQM6Ri0J6ed7j7qi8uw5lMaX0alO9lnivvtn0pc=;\n b=dkDIhE/42xfl3LdAOw2pVTFF34NzU2L/f4d0RzO5CX0+cRUwnrTBL2VwcrYRepkMSkli\n EiUHmrfvWuGu8zQigHXeBX1p3bLKSN1yPmbVyckJBC+ia+9WoQCWQNSOaRkcVquvzT0r\n 7uifRouQt5lWafNGEe6UYVIvHm6kZ4xLNIP3EsVQoWkZSQTqWkrSO/suv7qEZQnW5rCM\n ZBsn+NN3wuBgA4a87+eyWm1yeYAVhzi+4zMpouVgdIeQQqoPJeh+MII+kvOm2DQVVgL4\n SBbFqeh2WotNsYQ/SKPSxyKy3+TDr9O/9LIjTddV9o/vdb0I0nWtCl8vhcX0LFfjFn6A 7w==",
        "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>",
        "To": "<jerinj@marvell.com>, Nithin Dabilpuram <ndabilpuram@marvell.com>, \"Kiran\n Kumar K\" <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>,\n Satha Rao <skoteshwar@marvell.com>",
        "CC": "<dev@dpdk.org>, Akhil Goyal <gakhil@marvell.com>, Vamsi Attunuru\n <vattunuru@marvell.com>",
        "Subject": "[PATCH v5 23/28] net/cnxk: support security stats",
        "Date": "Sun, 8 May 2022 13:18:34 +0530",
        "Message-ID": "<20220508074839.6965-23-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20220508074839.6965-1-ndabilpuram@marvell.com>",
        "References": "<20220419055921.10566-1-ndabilpuram@marvell.com>\n <20220508074839.6965-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "T9ltjkT_M0EFXz33aHw1UuMD_onsz5P_",
        "X-Proofpoint-GUID": "T9ltjkT_M0EFXz33aHw1UuMD_onsz5P_",
        "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-05-08_02,2022-05-06_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: Akhil Goyal <gakhil@marvell.com>\n\nEnabled rte_security stats operation based on the configuration\nof SA options set while creating session.\n\nSigned-off-by: Vamsi Attunuru <vattunuru@marvell.com>\nSigned-off-by: Akhil Goyal <gakhil@marvell.com>\n---\n drivers/net/cnxk/cn10k_ethdev_sec.c | 56 ++++++++++++++++++++++++++++++++++---\n 1 file changed, 52 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/cnxk/cn10k_ethdev_sec.c b/drivers/net/cnxk/cn10k_ethdev_sec.c\nindex b535bda..3795b0c 100644\n--- a/drivers/net/cnxk/cn10k_ethdev_sec.c\n+++ b/drivers/net/cnxk/cn10k_ethdev_sec.c\n@@ -291,7 +291,7 @@ static const struct rte_security_capability cn10k_eth_sec_capabilities[] = {\n \t\t\t\t.dec_ttl = 1,\n \t\t\t\t.ip_csum_enable = 1,\n \t\t\t\t.l4_csum_enable = 1,\n-\t\t\t\t.stats = 0,\n+\t\t\t\t.stats = 1,\n \t\t\t\t.esn = 1,\n \t\t\t},\n \t\t},\n@@ -316,7 +316,7 @@ static const struct rte_security_capability cn10k_eth_sec_capabilities[] = {\n \t\t\t\t.dec_ttl = 1,\n \t\t\t\t.ip_csum_enable = 1,\n \t\t\t\t.l4_csum_enable = 1,\n-\t\t\t\t.stats = 0,\n+\t\t\t\t.stats = 1,\n \t\t\t\t.esn = 1,\n \t\t\t},\n \t\t},\n@@ -340,7 +340,7 @@ static const struct rte_security_capability cn10k_eth_sec_capabilities[] = {\n \t\t\t\t.dec_ttl = 1,\n \t\t\t\t.ip_csum_enable = 1,\n \t\t\t\t.l4_csum_enable = 1,\n-\t\t\t\t.stats = 0,\n+\t\t\t\t.stats = 1,\n \t\t\t\t.esn = 1,\n \t\t\t},\n \t\t},\n@@ -363,7 +363,7 @@ static const struct rte_security_capability cn10k_eth_sec_capabilities[] = {\n \t\t\t\t.dec_ttl = 1,\n \t\t\t\t.ip_csum_enable = 1,\n \t\t\t\t.l4_csum_enable = 1,\n-\t\t\t\t.stats = 0,\n+\t\t\t\t.stats = 1,\n \t\t\t\t.esn = 1,\n \t\t\t},\n \t\t},\n@@ -700,6 +700,11 @@ cn10k_eth_sec_session_create(void *device,\n \t\tinb_sa_dptr->w1.s.cookie =\n \t\t\trte_cpu_to_be_32(ipsec->spi & spi_mask);\n \n+\t\tif (ipsec->options.stats == 1) {\n+\t\t\t/* Enable mib counters */\n+\t\t\tinb_sa_dptr->w0.s.count_mib_bytes = 1;\n+\t\t\tinb_sa_dptr->w0.s.count_mib_pkts = 1;\n+\t\t}\n \t\t/* Prepare session priv */\n \t\tsess_priv.inb_sa = 1;\n \t\tsess_priv.sa_idx = ipsec->spi & spi_mask;\n@@ -782,6 +787,12 @@ cn10k_eth_sec_session_create(void *device,\n \t\t/* Save rlen info */\n \t\tcnxk_ipsec_outb_rlens_get(rlens, ipsec, crypto);\n \n+\t\tif (ipsec->options.stats == 1) {\n+\t\t\t/* Enable mib counters */\n+\t\t\toutb_sa_dptr->w0.s.count_mib_bytes = 1;\n+\t\t\toutb_sa_dptr->w0.s.count_mib_pkts = 1;\n+\t\t}\n+\n \t\t/* Prepare session priv */\n \t\tsess_priv.sa_idx = outb_priv->sa_idx;\n \t\tsess_priv.roundup_byte = rlens->roundup_byte;\n@@ -1001,6 +1012,42 @@ rte_pmd_cnxk_hw_sa_write(void *device, struct rte_security_session *sess,\n \treturn 0;\n }\n \n+static int\n+cn10k_eth_sec_session_stats_get(void *device, struct rte_security_session *sess,\n+\t\t\t    struct rte_security_stats *stats)\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+\n+\tstats->protocol = RTE_SECURITY_PROTOCOL_IPSEC;\n+\n+\tif (eth_sec->inb) {\n+\t\tstats->ipsec.ipackets =\n+\t\t\t((struct roc_ot_ipsec_inb_sa *)eth_sec->sa)->ctx.mib_pkts;\n+\t\tstats->ipsec.ibytes =\n+\t\t\t((struct roc_ot_ipsec_inb_sa *)eth_sec->sa)->ctx.mib_octs;\n+\t} else {\n+\t\tstats->ipsec.opackets =\n+\t\t\t((struct roc_ot_ipsec_outb_sa *)eth_sec->sa)->ctx.mib_pkts;\n+\t\tstats->ipsec.obytes =\n+\t\t\t((struct roc_ot_ipsec_outb_sa *)eth_sec->sa)->ctx.mib_octs;\n+\t}\n+\n+\treturn 0;\n+}\n+\n void\n cn10k_eth_sec_ops_override(void)\n {\n@@ -1015,4 +1062,5 @@ cn10k_eth_sec_ops_override(void)\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+\tcnxk_eth_sec_ops.session_stats_get = cn10k_eth_sec_session_stats_get;\n }\n",
    "prefixes": [
        "v5",
        "23/28"
    ]
}