get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 119924,
    "url": "http://patches.dpdk.org/api/patches/119924/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221117072558.3582292-1-asekhar@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": "<20221117072558.3582292-1-asekhar@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221117072558.3582292-1-asekhar@marvell.com",
    "date": "2022-11-17T07:25:56",
    "name": "[v1,1/3] net/cnxk: rework no-fast-free offload handling",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "668a53acb4a564a5366ab4afeb1486064100a28e",
    "submitter": {
        "id": 2125,
        "url": "http://patches.dpdk.org/api/people/2125/?format=api",
        "name": "Ashwin Sekhar T K",
        "email": "asekhar@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/20221117072558.3582292-1-asekhar@marvell.com/mbox/",
    "series": [
        {
            "id": 25794,
            "url": "http://patches.dpdk.org/api/series/25794/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25794",
            "date": "2022-11-17T07:25:56",
            "name": "[v1,1/3] net/cnxk: rework no-fast-free offload handling",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/25794/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/119924/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/119924/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 DCC26A00C2;\n\tThu, 17 Nov 2022 08:26:08 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 80C8340DDC;\n\tThu, 17 Nov 2022 08:26:08 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 8857C40DDA\n for <dev@dpdk.org>; Thu, 17 Nov 2022 08:26:07 +0100 (CET)",
            "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 2AH6pSaB025126 for <dev@dpdk.org>; Wed, 16 Nov 2022 23:26:06 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3kwg2b02yx-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Wed, 16 Nov 2022 23:26:06 -0800",
            "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 Wed, 16 Nov 2022 23:26:04 -0800",
            "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; Wed, 16 Nov 2022 23:26:04 -0800",
            "from localhost.localdomain (unknown [10.28.36.142])\n by maili.marvell.com (Postfix) with ESMTP id 1D31D5B6928;\n Wed, 16 Nov 2022 23:26:00 -0800 (PST)"
        ],
        "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=oLPMgpsRApDYvxW1WnlDmxZJWSQoOZuoQCGyl7TZhBQ=;\n b=fnvZi+7SdkImaxTqk0GBagcmHnIeGGtAJMJFqg/9G+XWKzlWeF2PcpJxDWdOUSXY5bK5\n 3JHCnJEQp/M9Q8pu3Kw/ySOJS0rQB/TDRFAs0w8cZkS5HjZCd7fg6X5tSmvSdFEk+SXS\n gHGn0RgY7Xupos+AU9xboOEPtsDCJgR2itB/nllZZm+l18Ink7hDukUepH22NirdtOcN\n KSgFR61oouKYSzTNJO8yF00TpdaGXcl5KWOc2FwVvkXbvSdIa2cKrISR2sVCrADpyfjm\n etZZJ4OgPqqSAw/lxuPk8uPmyBfirkg2HMZvRkhBGCIkvlZ3erxkU181Grt5e29UEvG4 KA==",
        "From": "Ashwin Sekhar T K <asekhar@marvell.com>",
        "To": "<dev@dpdk.org>, Nithin Dabilpuram <ndabilpuram@marvell.com>, Kiran Kumar K\n <kirankumark@marvell.com>, Sunil Kumar Kori <skori@marvell.com>, Satha Rao\n <skoteshwar@marvell.com>",
        "CC": "<jerinj@marvell.com>, <pbhagavatula@marvell.com>, <psatheesh@marvell.com>,\n <asekhar@marvell.com>, <anoobj@marvell.com>, <gakhil@marvell.com>,\n <hkalra@marvell.com>",
        "Subject": "[PATCH v1 1/3] net/cnxk: rework no-fast-free offload handling",
        "Date": "Thu, 17 Nov 2022 12:55:56 +0530",
        "Message-ID": "<20221117072558.3582292-1-asekhar@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "LMzP2FoAxNw6PDRcrA9159CrCXrm5oPP",
        "X-Proofpoint-ORIG-GUID": "LMzP2FoAxNw6PDRcrA9159CrCXrm5oPP",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-11-17_04,2022-11-16_01,2022-06-22_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 a separate routine to handle no-fast-free offload\nin vector Tx path for multisegmented packets.\n\nSigned-off-by: Ashwin Sekhar T K <asekhar@marvell.com>\n---\n drivers/net/cnxk/cn10k_tx.h | 124 +++++++++++++++++-------------------\n 1 file changed, 59 insertions(+), 65 deletions(-)",
    "diff": "diff --git a/drivers/net/cnxk/cn10k_tx.h b/drivers/net/cnxk/cn10k_tx.h\nindex 815cd2ff1f..a4c578354c 100644\n--- a/drivers/net/cnxk/cn10k_tx.h\n+++ b/drivers/net/cnxk/cn10k_tx.h\n@@ -956,6 +956,14 @@ cn10k_nix_prepare_mseg(struct rte_mbuf *m, uint64_t *cmd, const uint16_t flags)\n \trte_io_wmb();\n #endif\n \tm->next = NULL;\n+\n+\t/* Quickly handle single segmented packets. With this if-condition\n+\t * compiler will completely optimize out the below do-while loop\n+\t * from the Tx handler when NIX_TX_MULTI_SEG_F offload is not set.\n+\t */\n+\tif (!(flags & NIX_TX_MULTI_SEG_F))\n+\t\tgoto done;\n+\n \tm = m_next;\n \tif (!m)\n \t\tgoto done;\n@@ -1360,6 +1368,30 @@ cn10k_nix_prepare_tso(struct rte_mbuf *m, union nix_send_hdr_w1_u *w1,\n \t}\n }\n \n+static __rte_always_inline uint16_t\n+cn10k_nix_prepare_mseg_vec_noff(struct rte_mbuf *m, uint64_t *cmd,\n+\t\t\t\tuint64x2_t *cmd0, uint64x2_t *cmd1,\n+\t\t\t\tuint64x2_t *cmd2, uint64x2_t *cmd3,\n+\t\t\t\tconst uint32_t flags)\n+{\n+\tuint16_t segdw;\n+\n+\tvst1q_u64(cmd, *cmd0); /* Send hdr */\n+\tif (flags & NIX_TX_NEED_EXT_HDR) {\n+\t\tvst1q_u64(cmd + 2, *cmd2); /* ext hdr */\n+\t\tvst1q_u64(cmd + 4, *cmd1); /* sg */\n+\t} else {\n+\t\tvst1q_u64(cmd + 2, *cmd1); /* sg */\n+\t}\n+\n+\tsegdw = cn10k_nix_prepare_mseg(m, cmd, flags);\n+\n+\tif (flags & NIX_TX_OFFLOAD_TSTAMP_F)\n+\t\tvst1q_u64(cmd + segdw * 2 - 2, *cmd3);\n+\n+\treturn segdw;\n+}\n+\n static __rte_always_inline void\n cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,\n \t\t\t\tunion nix_send_hdr_w0_u *sh,\n@@ -1389,17 +1421,6 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,\n \n \tnb_segs = m->nb_segs - 1;\n \tm_next = m->next;\n-\n-\t/* Set invert df if buffer is not to be freed by H/W */\n-\tif (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)\n-\t\tsg_u |= (cnxk_nix_prefree_seg(m) << 55);\n-\t\t/* Mark mempool object as \"put\" since it is freed by NIX */\n-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n-\tif (!(sg_u & (1ULL << 55)))\n-\t\tRTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);\n-\trte_io_wmb();\n-#endif\n-\n \tm->next = NULL;\n \tm = m_next;\n \t/* Fill mbuf segments */\n@@ -1409,16 +1430,6 @@ cn10k_nix_prepare_mseg_vec_list(struct rte_mbuf *m, uint64_t *cmd,\n \t\tlen -= dlen;\n \t\tsg_u = sg_u | ((uint64_t)dlen << (i << 4));\n \t\t*slist = rte_mbuf_data_iova(m);\n-\t\t/* Set invert df if buffer is not to be freed by H/W */\n-\t\tif (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F)\n-\t\t\tsg_u |= (cnxk_nix_prefree_seg(m) << (i + 55));\n-\t\t\t/* Mark mempool object as \"put\" since it is freed by NIX\n-\t\t\t */\n-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n-\t\tif (!(sg_u & (1ULL << (i + 55))))\n-\t\t\tRTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);\n-\t\trte_io_wmb();\n-#endif\n \t\tslist++;\n \t\ti++;\n \t\tnb_segs--;\n@@ -1456,21 +1467,8 @@ cn10k_nix_prepare_mseg_vec(struct rte_mbuf *m, uint64_t *cmd, uint64x2_t *cmd0,\n \tunion nix_send_hdr_w0_u sh;\n \tunion nix_send_sg_s sg;\n \n-\tif (m->nb_segs == 1) {\n-\t\tif (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {\n-\t\t\tsg.u = vgetq_lane_u64(cmd1[0], 0);\n-\t\t\tsg.u |= (cnxk_nix_prefree_seg(m) << 55);\n-\t\t\tcmd1[0] = vsetq_lane_u64(sg.u, cmd1[0], 0);\n-\t\t}\n-\n-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n-\t\tsg.u = vgetq_lane_u64(cmd1[0], 0);\n-\t\tif (!(sg.u & (1ULL << 55)))\n-\t\t\tRTE_MEMPOOL_CHECK_COOKIES(m->pool, (void **)&m, 1, 0);\n-\t\trte_io_wmb();\n-#endif\n+\tif (m->nb_segs == 1)\n \t\treturn;\n-\t}\n \n \tsh.u = vgetq_lane_u64(cmd0[0], 0);\n \tsg.u = vgetq_lane_u64(cmd1[0], 0);\n@@ -1491,16 +1489,32 @@ cn10k_nix_prep_lmt_mseg_vector(struct rte_mbuf **mbufs, uint64x2_t *cmd0,\n \t\t\t       uint64_t *lmt_addr, __uint128_t *data128,\n \t\t\t       uint8_t *shift, const uint16_t flags)\n {\n-\tuint8_t j, off, lmt_used;\n+\tuint8_t j, off, lmt_used = 0;\n+\n+\tif (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {\n+\t\toff = 0;\n+\t\tfor (j = 0; j < NIX_DESCS_PER_LOOP; j++) {\n+\t\t\tif (off + segdw[j] > 8) {\n+\t\t\t\t*data128 |= ((__uint128_t)off - 1) << *shift;\n+\t\t\t\t*shift += 3;\n+\t\t\t\tlmt_used++;\n+\t\t\t\tlmt_addr += 16;\n+\t\t\t\toff = 0;\n+\t\t\t}\n+\t\t\toff += cn10k_nix_prepare_mseg_vec_noff(mbufs[j],\n+\t\t\t\t\tlmt_addr + off * 2, &cmd0[j], &cmd1[j],\n+\t\t\t\t\t&cmd2[j], &cmd3[j], flags);\n+\t\t}\n+\t\t*data128 |= ((__uint128_t)off - 1) << *shift;\n+\t\t*shift += 3;\n+\t\tlmt_used++;\n+\t\treturn lmt_used;\n+\t}\n \n \tif (!(flags & NIX_TX_NEED_EXT_HDR) &&\n \t    !(flags & NIX_TX_OFFLOAD_TSTAMP_F)) {\n \t\t/* No segments in 4 consecutive packets. */\n \t\tif ((segdw[0] + segdw[1] + segdw[2] + segdw[3]) <= 8) {\n-\t\t\tfor (j = 0; j < NIX_DESCS_PER_LOOP; j++)\n-\t\t\t\tcn10k_nix_prepare_mseg_vec(mbufs[j], NULL,\n-\t\t\t\t\t\t\t   &cmd0[j], &cmd1[j],\n-\t\t\t\t\t\t\t   segdw[j], flags);\n \t\t\tvst1q_u64(lmt_addr, cmd0[0]);\n \t\t\tvst1q_u64(lmt_addr + 2, cmd1[0]);\n \t\t\tvst1q_u64(lmt_addr + 4, cmd0[1]);\n@@ -1517,18 +1531,10 @@ cn10k_nix_prep_lmt_mseg_vector(struct rte_mbuf **mbufs, uint64x2_t *cmd0,\n \t\t}\n \t}\n \n-\tlmt_used = 0;\n \tfor (j = 0; j < NIX_DESCS_PER_LOOP;) {\n \t\t/* Fit consecutive packets in same LMTLINE. */\n \t\tif ((segdw[j] + segdw[j + 1]) <= 8) {\n \t\t\tif (flags & NIX_TX_OFFLOAD_TSTAMP_F) {\n-\t\t\t\tcn10k_nix_prepare_mseg_vec(mbufs[j], NULL,\n-\t\t\t\t\t\t\t   &cmd0[j], &cmd1[j],\n-\t\t\t\t\t\t\t   segdw[j], flags);\n-\t\t\t\tcn10k_nix_prepare_mseg_vec(mbufs[j + 1], NULL,\n-\t\t\t\t\t\t\t   &cmd0[j + 1],\n-\t\t\t\t\t\t\t   &cmd1[j + 1],\n-\t\t\t\t\t\t\t   segdw[j + 1], flags);\n \t\t\t\t/* TSTAMP takes 4 each, no segs. */\n \t\t\t\tvst1q_u64(lmt_addr, cmd0[j]);\n \t\t\t\tvst1q_u64(lmt_addr + 2, cmd2[j]);\n@@ -1643,23 +1649,11 @@ cn10k_nix_xmit_store(struct rte_mbuf *mbuf, uint8_t segdw, uintptr_t laddr,\n {\n \tuint8_t off;\n \n-\t/* Handle no fast free when security is enabled without mseg */\n-\tif ((flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) &&\n-\t    (flags & NIX_TX_OFFLOAD_SECURITY_F) &&\n-\t    !(flags & NIX_TX_MULTI_SEG_F)) {\n-\t\tunion nix_send_sg_s sg;\n-\n-\t\tsg.u = vgetq_lane_u64(cmd1, 0);\n-\t\tsg.u |= (cnxk_nix_prefree_seg(mbuf) << 55);\n-\t\tcmd1 = vsetq_lane_u64(sg.u, cmd1, 0);\n-\n-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n-\t\tsg.u = vgetq_lane_u64(cmd1, 0);\n-\t\tif (!(sg.u & (1ULL << 55)))\n-\t\t\tRTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1,\n-\t\t\t\t\t\t0);\n-\t\trte_io_wmb();\n-#endif\n+\tif (flags & NIX_TX_OFFLOAD_MBUF_NOFF_F) {\n+\t\tcn10k_nix_prepare_mseg_vec_noff(mbuf, LMT_OFF(laddr, 0, 0),\n+\t\t\t\t\t\t&cmd0, &cmd1, &cmd2, &cmd3,\n+\t\t\t\t\t\tflags);\n+\t\treturn;\n \t}\n \tif (flags & NIX_TX_MULTI_SEG_F) {\n \t\tif ((flags & NIX_TX_NEED_EXT_HDR) &&\n",
    "prefixes": [
        "v1",
        "1/3"
    ]
}