get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109829,
    "url": "http://patchwork.dpdk.org/api/patches/109829/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220419055921.10566-24-ndabilpuram@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": "<20220419055921.10566-24-ndabilpuram@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220419055921.10566-24-ndabilpuram@marvell.com",
    "date": "2022-04-19T05:59:21",
    "name": "[24/24] net/cnxk: add support for flow control for outbound inline",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "16e0e6d2500860c154ace6e90851df45e651894f",
    "submitter": {
        "id": 1202,
        "url": "http://patchwork.dpdk.org/api/people/1202/?format=api",
        "name": "Nithin Dabilpuram",
        "email": "ndabilpuram@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patchwork.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220419055921.10566-24-ndabilpuram@marvell.com/mbox/",
    "series": [
        {
            "id": 22546,
            "url": "http://patchwork.dpdk.org/api/series/22546/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=22546",
            "date": "2022-04-19T05:58:58",
            "name": "[01/24] common/cnxk: add multi channel support for SDP send queues",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/22546/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/109829/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/109829/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 2750CA00C3;\n\tTue, 19 Apr 2022 08:02:52 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7911A42834;\n\tTue, 19 Apr 2022 08:01: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 D1AC4427EB\n for <dev@dpdk.org>; Tue, 19 Apr 2022 08:01:04 +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 ESMTP id\n 23INPJQ7009958\n for <dev@dpdk.org>; Mon, 18 Apr 2022 23:01:04 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3ffwap261r-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 18 Apr 2022 23:01:04 -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 Mon, 18 Apr 2022 23:01:02 -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; Mon, 18 Apr 2022 23:01:02 -0700",
            "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id 9E1B15B6922;\n Mon, 18 Apr 2022 23:00:59 -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=cqHCMoiYx6idJy3XJtvq0mW8w9EX4BAlGa6+t0ZzAUo=;\n b=BCDp3bxjyZZBnZ5mARZqSaa5rVa3rTj+9woVo4P2qpHD4hztBxeOdfXKNRRX+qjFDPrS\n WNbyPF99NeJFIxKnk21cDNsrkDmZzPa4UPcD22498fBaUNwBvG4gnt1CvwUH91JpS0Nm\n nSMetSbZIAstig/UErUOwRJgLtBdsf9MPYaYapu20LW6O7FBAvC2Cr6Bf3CPLx2Q8rp0\n abfPoxE5yFAnTUfrXyGNFhxOZ+9guMWReAD+MGH/q02VPMl6XeYXmhWvM1Vz8zCT2TCA\n iAyHZsrfNgsIieGGfm/0NSLBYe+UedEsXIcCDtxtV8j4Cp0A1RHLrU5YZ4C+J/mRCkXc 0w==",
        "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>",
        "Subject": "[PATCH 24/24] net/cnxk: add support for flow control for outbound\n inline",
        "Date": "Tue, 19 Apr 2022 11:29:21 +0530",
        "Message-ID": "<20220419055921.10566-24-ndabilpuram@marvell.com>",
        "X-Mailer": "git-send-email 2.8.4",
        "In-Reply-To": "<20220419055921.10566-1-ndabilpuram@marvell.com>",
        "References": "<20220419055921.10566-1-ndabilpuram@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "8E2VQldbQszFoDnJ5YGDk2zFhJodoP9O",
        "X-Proofpoint-ORIG-GUID": "8E2VQldbQszFoDnJ5YGDk2zFhJodoP9O",
        "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-19_02,2022-04-15_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": "Add support for flow control in outbound inline path using\nfc updates from CPT.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\n---\n drivers/net/cnxk/cn10k_ethdev.c |  3 +++\n drivers/net/cnxk/cn10k_ethdev.h |  1 +\n drivers/net/cnxk/cn10k_tx.h     | 37 ++++++++++++++++++++++++++++++++++++-\n drivers/net/cnxk/cnxk_ethdev.c  | 13 +++++++++++++\n drivers/net/cnxk/cnxk_ethdev.h  |  3 +++\n 5 files changed, 56 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c\nindex d04b9eb..de688f0 100644\n--- a/drivers/net/cnxk/cn10k_ethdev.c\n+++ b/drivers/net/cnxk/cn10k_ethdev.c\n@@ -204,6 +204,9 @@ cn10k_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,\n \n \t\ttxq->cpt_io_addr = inl_lf->io_addr;\n \t\ttxq->cpt_fc = inl_lf->fc_addr;\n+\t\ttxq->cpt_fc_sw = (int32_t *)((uintptr_t)dev->outb.fc_sw_mem +\n+\t\t\t\t\t     crypto_qid * RTE_CACHE_LINE_SIZE);\n+\n \t\ttxq->cpt_desc = inl_lf->nb_desc * 0.7;\n \t\ttxq->sa_base = (uint64_t)dev->outb.sa_base;\n \t\ttxq->sa_base |= eth_dev->data->port_id;\ndiff --git a/drivers/net/cnxk/cn10k_ethdev.h b/drivers/net/cnxk/cn10k_ethdev.h\nindex c8666ce..acfdbb6 100644\n--- a/drivers/net/cnxk/cn10k_ethdev.h\n+++ b/drivers/net/cnxk/cn10k_ethdev.h\n@@ -19,6 +19,7 @@ struct cn10k_eth_txq {\n \tuint64_t sa_base;\n \tuint64_t *cpt_fc;\n \tuint16_t cpt_desc;\n+\tint32_t *cpt_fc_sw;\n \tuint64_t lso_tun_fmt;\n \tuint64_t ts_mem;\n \tuint64_t mark_flag : 8;\ndiff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h\nindex c482352..762586f 100644\n--- a/drivers/net/cnxk/cn10k_tx.h\n+++ b/drivers/net/cnxk/cn10k_tx.h\n@@ -209,6 +209,37 @@ cn10k_nix_tx_skeleton(struct cn10k_eth_txq *txq, uint64_t *cmd,\n }\n \n static __rte_always_inline void\n+cn10k_nix_sec_fc_wait(struct cn10k_eth_txq *txq, uint16_t nb_pkts)\n+{\n+\tint32_t nb_desc, val, newval;\n+\tint32_t *fc_sw;\n+\tvolatile uint64_t *fc;\n+\n+\t/* Check if there is any CPT instruction to submit */\n+\tif (!nb_pkts)\n+\t\treturn;\n+\n+again:\n+\tfc_sw = txq->cpt_fc_sw;\n+\tval = __atomic_sub_fetch(fc_sw, nb_pkts, __ATOMIC_RELAXED);\n+\tif (likely(val >= 0))\n+\t\treturn;\n+\n+\tnb_desc = txq->cpt_desc;\n+\tfc = txq->cpt_fc;\n+\twhile (true) {\n+\t\tnewval = nb_desc - __atomic_load_n(fc, __ATOMIC_RELAXED);\n+\t\tnewval -= nb_pkts;\n+\t\tif (newval >= 0)\n+\t\t\tbreak;\n+\t}\n+\n+\tif (!__atomic_compare_exchange_n(fc_sw, &val, newval, false,\n+\t\t\t\t\t __ATOMIC_RELAXED, __ATOMIC_RELAXED))\n+\t\tgoto again;\n+}\n+\n+static __rte_always_inline void\n cn10k_nix_sec_steorl(uintptr_t io_addr, uint32_t lmt_id, uint8_t lnum,\n \t\t     uint8_t loff, uint8_t shft)\n {\n@@ -995,6 +1026,7 @@ cn10k_nix_xmit_pkts(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pkts,\n \tif (flags & NIX_TX_OFFLOAD_SECURITY_F) {\n \t\t/* Reduce pkts to be sent to CPT */\n \t\tburst -= ((c_lnum << 1) + c_loff);\n+\t\tcn10k_nix_sec_fc_wait(txq, (c_lnum << 1) + c_loff);\n \t\tcn10k_nix_sec_steorl(c_io_addr, c_lmt_id, c_lnum, c_loff,\n \t\t\t\t     c_shft);\n \t}\n@@ -1138,6 +1170,7 @@ cn10k_nix_xmit_pkts_mseg(void *tx_queue, uint64_t *ws,\n \tif (flags & NIX_TX_OFFLOAD_SECURITY_F) {\n \t\t/* Reduce pkts to be sent to CPT */\n \t\tburst -= ((c_lnum << 1) + c_loff);\n+\t\tcn10k_nix_sec_fc_wait(txq, (c_lnum << 1) + c_loff);\n \t\tcn10k_nix_sec_steorl(c_io_addr, c_lmt_id, c_lnum, c_loff,\n \t\t\t\t     c_shft);\n \t}\n@@ -2682,9 +2715,11 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,\n \tleft -= burst;\n \n \t/* Submit CPT instructions if any */\n-\tif (flags & NIX_TX_OFFLOAD_SECURITY_F)\n+\tif (flags & NIX_TX_OFFLOAD_SECURITY_F) {\n+\t\tcn10k_nix_sec_fc_wait(txq, (c_lnum << 1) + c_loff);\n \t\tcn10k_nix_sec_steorl(c_io_addr, c_lmt_id, c_lnum, c_loff,\n \t\t\t\t     c_shft);\n+\t}\n \n \t/* Trigger LMTST */\n \tif (lnum > 16) {\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c\nindex e1b1e16..12ff30f 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.c\n+++ b/drivers/net/cnxk/cnxk_ethdev.c\n@@ -155,9 +155,19 @@ nix_security_setup(struct cnxk_eth_dev *dev)\n \t\tdev->outb.sa_base = roc_nix_inl_outb_sa_base_get(nix);\n \t\tdev->outb.sa_bmap_mem = mem;\n \t\tdev->outb.sa_bmap = bmap;\n+\n+\t\tdev->outb.fc_sw_mem = plt_zmalloc(dev->outb.nb_crypto_qs *\n+\t\t\t\t\t\t\t  RTE_CACHE_LINE_SIZE,\n+\t\t\t\t\t\t  RTE_CACHE_LINE_SIZE);\n+\t\tif (!dev->outb.fc_sw_mem) {\n+\t\t\tplt_err(\"Outbound fc sw mem alloc failed\");\n+\t\t\tgoto sa_bmap_free;\n+\t\t}\n \t}\n \treturn 0;\n \n+sa_bmap_free:\n+\tplt_free(dev->outb.sa_bmap_mem);\n sa_dptr_free:\n \tif (dev->inb.sa_dptr)\n \t\tplt_free(dev->inb.sa_dptr);\n@@ -253,6 +263,9 @@ nix_security_release(struct cnxk_eth_dev *dev)\n \t\t\tplt_free(dev->outb.sa_dptr);\n \t\t\tdev->outb.sa_dptr = NULL;\n \t\t}\n+\n+\t\tplt_free(dev->outb.fc_sw_mem);\n+\t\tdev->outb.fc_sw_mem = NULL;\n \t}\n \n \tdev->inb.inl_dev = false;\ndiff --git a/drivers/net/cnxk/cnxk_ethdev.h b/drivers/net/cnxk/cnxk_ethdev.h\nindex 7c7e013..28fc937 100644\n--- a/drivers/net/cnxk/cnxk_ethdev.h\n+++ b/drivers/net/cnxk/cnxk_ethdev.h\n@@ -321,6 +321,9 @@ struct cnxk_eth_dev_sec_outb {\n \t/* Crypto queues => CPT lf count */\n \tuint16_t nb_crypto_qs;\n \n+\t/* FC sw mem */\n+\tuint64_t *fc_sw_mem;\n+\n \t/* Active sessions */\n \tuint16_t nb_sess;\n \n",
    "prefixes": [
        "24/24"
    ]
}