get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 128163,
    "url": "http://patches.dpdk.org/api/patches/128163/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230606061249.833290-1-rbhansali@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": "<20230606061249.833290-1-rbhansali@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230606061249.833290-1-rbhansali@marvell.com",
    "date": "2023-06-06T06:12:49",
    "name": "net/cnxk: add atomic fc check in poll mode Tx path",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ccc6383443b6c16dc49f0b3bd7afb8a18b3c4cf6",
    "submitter": {
        "id": 2436,
        "url": "http://patches.dpdk.org/api/people/2436/?format=api",
        "name": "Rahul Bhansali",
        "email": "rbhansali@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/20230606061249.833290-1-rbhansali@marvell.com/mbox/",
    "series": [
        {
            "id": 28363,
            "url": "http://patches.dpdk.org/api/series/28363/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28363",
            "date": "2023-06-06T06:12:49",
            "name": "net/cnxk: add atomic fc check in poll mode Tx path",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/28363/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/128163/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/128163/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 9392B42C3C;\n\tTue,  6 Jun 2023 08:12:59 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2C50C40A84;\n\tTue,  6 Jun 2023 08:12:59 +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 92F8C406B7\n for <dev@dpdk.org>; Tue,  6 Jun 2023 08:12:57 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 3563hTC9023740 for <dev@dpdk.org>; Mon, 5 Jun 2023 23:12:56 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3r1kpkaaws-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 05 Jun 2023 23:12:56 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Mon, 5 Jun 2023 23:12:54 -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.48 via Frontend\n Transport; Mon, 5 Jun 2023 23:12:54 -0700",
            "from localhost.localdomain (unknown [10.28.36.158])\n by maili.marvell.com (Postfix) with ESMTP id 9F3D43F7050;\n Mon,  5 Jun 2023 23:12:52 -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 : mime-version : content-transfer-encoding :\n content-type; s=pfpt0220; bh=SwPt8N7Dl+u0fb8L319lma0GXpELuJ+zLE4FvoPDThs=;\n b=SnJtM7UdVK0x7vHs04yc4j+Oua3A+s/cMiXKrVKDK4OV/FSWyQp/iRLsxA3eBYZkGESe\n M2dpDdbuiD2gnhL03bMpQoqJ67bgpIJ4UyshI46xeun3Od6+DevhU/CA28MKxKs/2A7S\n cpCvT9LYidmnJKjFfkVC6HXrH1ns9thJH7gjlrI1+avcAnDYA02m2hilSRHzvQXos46h\n On+ggyVtRnAda5Ey90PXa4jXnwhP+G59jB9FdD6StRise0+P9JewCrHAafFKSz294xon\n eIZVz4EWkFyFvEVdRpcRHytrgLoEIn5RlraQvmg1zIlDmPufjTGM1fW/vZ8bN4LzhpWy Qw==",
        "From": "Rahul Bhansali <rbhansali@marvell.com>",
        "To": "<dev@dpdk.org>, Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>, \"Kiran\n Kumar K\" <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>,\n Satha Rao <skoteshwar@marvell.com>",
        "CC": "<jerinj@marvell.com>, Rahul Bhansali <rbhansali@marvell.com>",
        "Subject": "[PATCH] net/cnxk: add atomic fc check in poll mode Tx path",
        "Date": "Tue, 6 Jun 2023 11:42:49 +0530",
        "Message-ID": "<20230606061249.833290-1-rbhansali@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "rjIoUTJ3dYQ0AXrjS9IJ0Ldi-qGnJupF",
        "X-Proofpoint-GUID": "rjIoUTJ3dYQ0AXrjS9IJ0Ldi-qGnJupF",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26\n definitions=2023-06-06_03,2023-06-05_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": "Add a support of atomic fc check in poll mode Tx path. This atomic\ncheck is useful if multiple threads are using the same Tx queue.\nThis will be enabled when Tx offload RTE_ETH_TX_OFFLOAD_MT_LOCKFREE\nis set.\n\nSigned-off-by: Rahul Bhansali <rbhansali@marvell.com>\n---\n drivers/net/cnxk/cn10k_ethdev.c |  3 ++\n drivers/net/cnxk/cn10k_rxtx.h   |  1 +\n drivers/net/cnxk/cn10k_tx.h     | 61 ++++++++++++++++++++++++++-------\n 3 files changed, 52 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/cnxk/cn10k_ethdev.c b/drivers/net/cnxk/cn10k_ethdev.c\nindex 792c1b1970..4c4acc7cf0 100644\n--- a/drivers/net/cnxk/cn10k_ethdev.c\n+++ b/drivers/net/cnxk/cn10k_ethdev.c\n@@ -241,6 +241,9 @@ cn10k_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,\n \t\t\treturn rc;\n \t}\n \n+\t/* Set Txq flag for MT_LOCKFREE */\n+\ttxq->flag = !!(dev->tx_offloads & RTE_ETH_TX_OFFLOAD_MT_LOCKFREE);\n+\n \t/* Store lmt base in tx queue for easy access */\n \ttxq->lmt_base = nix->lmt_base;\n \ttxq->io_addr = sq->io_addr;\ndiff --git a/drivers/net/cnxk/cn10k_rxtx.h b/drivers/net/cnxk/cn10k_rxtx.h\nindex 65dd57494a..b4287e2864 100644\n--- a/drivers/net/cnxk/cn10k_rxtx.h\n+++ b/drivers/net/cnxk/cn10k_rxtx.h\n@@ -51,6 +51,7 @@ struct cn10k_eth_txq {\n \trte_iova_t io_addr;\n \tuint16_t sqes_per_sqb_log2;\n \tint16_t nb_sqb_bufs_adj;\n+\tuint8_t flag;\n \trte_iova_t cpt_io_addr;\n \tuint64_t sa_base;\n \tuint64_t *cpt_fc;\ndiff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h\nindex 4f23a8dfc3..17793493cc 100644\n--- a/drivers/net/cnxk/cn10k_tx.h\n+++ b/drivers/net/cnxk/cn10k_tx.h\n@@ -47,6 +47,47 @@\n \t\t}                                                              \\\n \t} while (0)\n \n+#define NIX_XMIT_FC_OR_RETURN_MTS(txq, pkts)                                                       \\\n+\tdo {                                                                                       \\\n+\t\tint64_t *fc_cache = &(txq)->fc_cache_pkts;                                         \\\n+\t\tuint8_t retry_count = 8;                                                           \\\n+\t\tint64_t val, newval;                                                               \\\n+\tretry:                                                                                     \\\n+\t\t/* Reduce the cached count */                                                      \\\n+\t\tval = (int64_t)__atomic_fetch_sub(fc_cache, pkts, __ATOMIC_RELAXED);               \\\n+\t\tval -= pkts;                                                                       \\\n+\t\t/* Cached value is low, Update the fc_cache_pkts */                                \\\n+\t\tif (unlikely(val < 0)) {                                                           \\\n+\t\t\t/* Multiply with sqe_per_sqb to express in pkts */                         \\\n+\t\t\tnewval = txq->nb_sqb_bufs_adj - __atomic_load_n(txq->fc_mem,               \\\n+\t\t\t\t\t\t\t\t\t__ATOMIC_RELAXED);         \\\n+\t\t\tnewval = (newval << (txq)->sqes_per_sqb_log2) - newval;                    \\\n+\t\t\tnewval -= pkts;                                                            \\\n+\t\t\tif (!__atomic_compare_exchange_n(fc_cache, &val, newval, false,            \\\n+\t\t\t\t\t\t\t __ATOMIC_RELAXED, __ATOMIC_RELAXED)) {    \\\n+\t\t\t\tif (retry_count) {                                                 \\\n+\t\t\t\t\tretry_count--;                                             \\\n+\t\t\t\t\tgoto retry;                                                \\\n+\t\t\t\t} else                                                             \\\n+\t\t\t\t\treturn 0;                                                  \\\n+\t\t\t}                                                                          \\\n+\t\t\t/* Update and check it again for the room */                               \\\n+\t\t\tif (unlikely(newval < 0))                                                  \\\n+\t\t\t\treturn 0;                                                          \\\n+\t\t}                                                                                  \\\n+\t} while (0)\n+\n+#define NIX_XMIT_FC_CHECK_RETURN(txq, pkts)                                                        \\\n+\tdo {                                                                                       \\\n+\t\tif (unlikely((txq)->flag))                                                         \\\n+\t\t\tNIX_XMIT_FC_OR_RETURN_MTS(txq, pkts);                                      \\\n+\t\telse {                                                                             \\\n+\t\t\tNIX_XMIT_FC_OR_RETURN(txq, pkts);                                          \\\n+\t\t\t/* Reduce the cached count */                                              \\\n+\t\t\ttxq->fc_cache_pkts -= pkts;                                                \\\n+\t\t}                                                                                  \\\n+\t} while (0)\n+\n /* Encoded number of segments to number of dwords macro, each value of nb_segs\n  * is encoded as 4bits.\n  */\n@@ -1174,11 +1215,9 @@ cn10k_nix_xmit_pkts(void *tx_queue, uint64_t *ws, struct rte_mbuf **tx_pkts,\n \tif (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && txq->tx_compl.ena)\n \t\thandle_tx_completion_pkts(txq, flags & NIX_TX_VWQE_F);\n \n-\tif (!(flags & NIX_TX_VWQE_F)) {\n-\t\tNIX_XMIT_FC_OR_RETURN(txq, pkts);\n-\t\t/* Reduce the cached count */\n-\t\ttxq->fc_cache_pkts -= pkts;\n-\t}\n+\tif (!(flags & NIX_TX_VWQE_F))\n+\t\tNIX_XMIT_FC_CHECK_RETURN(txq, pkts);\n+\n \t/* Get cmd skeleton */\n \tcn10k_nix_tx_skeleton(txq, cmd, flags, !(flags & NIX_TX_VWQE_F));\n \n@@ -1323,11 +1362,9 @@ cn10k_nix_xmit_pkts_mseg(void *tx_queue, uint64_t *ws,\n \tif (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F && txq->tx_compl.ena)\n \t\thandle_tx_completion_pkts(txq, flags & NIX_TX_VWQE_F);\n \n-\tif (!(flags & NIX_TX_VWQE_F)) {\n-\t\tNIX_XMIT_FC_OR_RETURN(txq, pkts);\n-\t\t/* Reduce the cached count */\n-\t\ttxq->fc_cache_pkts -= pkts;\n-\t}\n+\tif (!(flags & NIX_TX_VWQE_F))\n+\t\tNIX_XMIT_FC_CHECK_RETURN(txq, pkts);\n+\n \t/* Get cmd skeleton */\n \tcn10k_nix_tx_skeleton(txq, cmd, flags, !(flags & NIX_TX_VWQE_F));\n \n@@ -1879,11 +1916,9 @@ cn10k_nix_xmit_pkts_vector(void *tx_queue, uint64_t *ws,\n \t\thandle_tx_completion_pkts(txq, flags & NIX_TX_VWQE_F);\n \n \tif (!(flags & NIX_TX_VWQE_F)) {\n-\t\tNIX_XMIT_FC_OR_RETURN(txq, pkts);\n \t\tscalar = pkts & (NIX_DESCS_PER_LOOP - 1);\n \t\tpkts = RTE_ALIGN_FLOOR(pkts, NIX_DESCS_PER_LOOP);\n-\t\t/* Reduce the cached count */\n-\t\ttxq->fc_cache_pkts -= pkts;\n+\t\tNIX_XMIT_FC_CHECK_RETURN(txq, pkts);\n \t} else {\n \t\tscalar = pkts & (NIX_DESCS_PER_LOOP - 1);\n \t\tpkts = RTE_ALIGN_FLOOR(pkts, NIX_DESCS_PER_LOOP);\n",
    "prefixes": []
}