get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134927,
    "url": "http://patches.dpdk.org/api/patches/134927/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231207134651.1718457-1-rkudurumalla@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": "<20231207134651.1718457-1-rkudurumalla@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231207134651.1718457-1-rkudurumalla@marvell.com",
    "date": "2023-12-07T13:46:50",
    "name": "[v2,1/2] common/cnxk: support to dump debug info to file",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fee091baca7b81c8acec57e63831e59453bb85d6",
    "submitter": {
        "id": 2289,
        "url": "http://patches.dpdk.org/api/people/2289/?format=api",
        "name": "Rakesh Kudurumalla",
        "email": "rkudurumalla@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/20231207134651.1718457-1-rkudurumalla@marvell.com/mbox/",
    "series": [
        {
            "id": 30477,
            "url": "http://patches.dpdk.org/api/series/30477/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30477",
            "date": "2023-12-07T13:46:50",
            "name": "[v2,1/2] common/cnxk: support to dump debug info to file",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/30477/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/134927/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/134927/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 B9BDF43699;\n\tThu,  7 Dec 2023 14:47:00 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 42D4740278;\n\tThu,  7 Dec 2023 14:47:00 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id D798440270\n for <dev@dpdk.org>; Thu,  7 Dec 2023 14:46:58 +0100 (CET)",
            "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 3B76M9B5017113 for <dev@dpdk.org>; Thu, 7 Dec 2023 05:46:57 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3uu8qe9d49-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 07 Dec 2023 05:46:57 -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.48;\n Thu, 7 Dec 2023 05:46:55 -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.48 via Frontend\n Transport; Thu, 7 Dec 2023 05:46:55 -0800",
            "from localhost.localdomain (unknown [10.28.36.154])\n by maili.marvell.com (Postfix) with ESMTP id 785563F7051;\n Thu,  7 Dec 2023 05:46:53 -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 : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=Rnf86JhhT6y0gG5u0xFC/NG0yAB9N3sK1/VDFr9sYgo=;\n b=YLExnjkW9F0MT2rzCAVSqdD8pmhoSc1RNr94RSXJ+QR3Heej54vRAlZ899cWavSDI9KE\n L43ZEaE78dxqx5C/5OsZ2u5fMAKRG+2VaVvbKRsG1RTKosewRRzsRszuCVCXzYfz4oS+\n eGKsn3mRRCYSy+Ah6iEyaIezctfA0kbj9kY6O0+g9o1H/bQLxzzJcLi471odxjFEa1S/\n ce2bORk4lOhCYZzyTfBsTIMuExIX5E43VJmPYq1BIsxiuOOayuIw64DWy3kGQrzuH+Cb\n JnVWV4YY21Obyk5hAQQFzhqZ0byqatoPwlRtSeNCK0326H/dDikbbcZHtMLKQP9afXw8 eA==",
        "From": "Rakesh Kudurumalla <rkudurumalla@marvell.com>",
        "To": "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": "<dev@dpdk.org>, <jerinj@marvell.com>, Rakesh Kudurumalla\n <rkudurumalla@marvell.com>",
        "Subject": "[PATCH v2 1/2] common/cnxk: support to dump debug info to file",
        "Date": "Thu, 7 Dec 2023 19:16:50 +0530",
        "Message-ID": "<20231207134651.1718457-1-rkudurumalla@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20231205094539.1377142-1-rkudurumalla@marvell.com>",
        "References": "<20231205094539.1377142-1-rkudurumalla@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "HfStj2v_95dvA4-AoMJv3B46Tw4Rj0z_",
        "X-Proofpoint-ORIG-GUID": "HfStj2v_95dvA4-AoMJv3B46Tw4Rj0z_",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-12-07_11,2023-12-07_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": "This patch dumps contents of receviced packet descriptor from CQ\nfor debug to file\n\nSigned-off-by: Rakesh Kudurumalla <rkudurumalla@marvell.com>\n---\n\nV2: Resolve Warnings\n drivers/common/cnxk/roc_cpt.h       |  2 +-\n drivers/common/cnxk/roc_cpt_debug.c | 56 +++++++++++++++++------------\n drivers/common/cnxk/roc_nix.h       |  2 +-\n drivers/common/cnxk/roc_nix_debug.c |  3 +-\n 4 files changed, 36 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/drivers/common/cnxk/roc_cpt.h b/drivers/common/cnxk/roc_cpt.h\nindex 787bccb27d..523a5964a3 100644\n--- a/drivers/common/cnxk/roc_cpt.h\n+++ b/drivers/common/cnxk/roc_cpt.h\n@@ -191,7 +191,7 @@ void __roc_api roc_cpt_iq_enable(struct roc_cpt_lf *lf);\n int __roc_api roc_cpt_lmtline_init(struct roc_cpt *roc_cpt,\n \t\t\t\t   struct roc_cpt_lmtline *lmtline, int lf_id);\n \n-void __roc_api roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth);\n+void __roc_api roc_cpt_parse_hdr_dump(FILE *file, const struct cpt_parse_hdr_s *cpth);\n int __roc_api roc_cpt_ctx_write(struct roc_cpt_lf *lf, void *sa_dptr,\n \t\t\t\tvoid *sa_cptr, uint16_t sa_len);\n \ndiff --git a/drivers/common/cnxk/roc_cpt_debug.c b/drivers/common/cnxk/roc_cpt_debug.c\nindex dce3638507..8e69b0a0e5 100644\n--- a/drivers/common/cnxk/roc_cpt_debug.c\n+++ b/drivers/common/cnxk/roc_cpt_debug.c\n@@ -5,38 +5,48 @@\n #include \"roc_api.h\"\n #include \"roc_priv.h\"\n \n+#define cpt_dump(file, fmt, ...) do {                                           \\\n+\tif ((file) == NULL)\t\t\t\t\t\t\t\\\n+\t\tplt_dump(fmt, ##__VA_ARGS__);\t\t\t\t\t\\\n+\telse\t\t\t\t\t\t\t\t\t\\\n+\t\tfprintf(file, fmt \"\\n\", ##__VA_ARGS__);\t\t\t\t\\\n+} while (0)\n+\n void\n-roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth)\n+roc_cpt_parse_hdr_dump(FILE *file, const struct cpt_parse_hdr_s *cpth)\n {\n \tstruct cpt_frag_info_s *frag_info;\n \tuint32_t offset;\n \tuint64_t *slot;\n \n-\tplt_print(\"CPT_PARSE \\t0x%p:\", cpth);\n+\tcpt_dump(file, \"CPT_PARSE \\t0x%p:\", cpth);\n \n \t/* W0 */\n-\tplt_print(\"W0: cookie \\t0x%x\\t\\tmatch_id \\t0x%04x\\t\\terr_sum \\t%u \\t\",\n-\t\t  cpth->w0.cookie, cpth->w0.match_id, cpth->w0.err_sum);\n-\tplt_print(\"W0: reas_sts \\t0x%x\\t\\tet_owr \\t%u\\t\\tpkt_fmt \\t%u \\t\",\n+\tcpt_dump(file, \"W0: cookie \\t0x%x\\t\\tmatch_id \\t0x%04x \\t\",\n+\t\t  cpth->w0.cookie, cpth->w0.match_id);\n+\tcpt_dump(file, \"W0: err_sum \\t%u \\t\", cpth->w0.err_sum);\n+\tcpt_dump(file, \"W0: reas_sts \\t0x%x\\t\\tet_owr \\t%u\\t\\tpkt_fmt \\t%u \\t\",\n \t\t  cpth->w0.reas_sts, cpth->w0.et_owr, cpth->w0.pkt_fmt);\n-\tplt_print(\"W0: pad_len \\t%u\\t\\tnum_frags \\t%u\\t\\tpkt_out \\t%u \\t\",\n+\tcpt_dump(file, \"W0: pad_len \\t%u\\t\\tnum_frags \\t%u\\t\\tpkt_out \\t%u \\t\",\n \t\t  cpth->w0.pad_len, cpth->w0.num_frags, cpth->w0.pkt_out);\n \n \t/* W1 */\n-\tplt_print(\"W1: wqe_ptr \\t0x%016lx\\t\", plt_be_to_cpu_64(cpth->wqe_ptr));\n+\tcpt_dump(file, \"W1: wqe_ptr \\t0x%016lx\\t\",\n+\t\t\tplt_be_to_cpu_64(cpth->wqe_ptr));\n \n \t/* W2 */\n-\tplt_print(\"W2: frag_age \\t0x%x\\t\\torig_pf_func \\t0x%04x\",\n+\tcpt_dump(file, \"W2: frag_age \\t0x%x\\t\\torig_pf_func \\t0x%04x\",\n \t\t  cpth->w2.frag_age, cpth->w2.orig_pf_func);\n-\tplt_print(\"W2: il3_off \\t0x%x\\t\\tfi_pad \\t0x%x\\t\\tfi_offset \\t0x%x \\t\",\n-\t\t  cpth->w2.il3_off, cpth->w2.fi_pad, cpth->w2.fi_offset);\n+\tcpt_dump(file, \"W2: il3_off \\t0x%x\\t\\tfi_pad \\t0x%x \\t\",\n+\t\t  cpth->w2.il3_off, cpth->w2.fi_pad);\n+\tcpt_dump(file, \"W2: fi_offset \\t0x%x \\t\", cpth->w2.fi_offset);\n \n \t/* W3 */\n-\tplt_print(\"W3: hw_ccode \\t0x%x\\t\\tuc_ccode \\t0x%x\\t\\tspi \\t0x%08x\",\n+\tcpt_dump(file, \"W3: hw_ccode \\t0x%x\\t\\tuc_ccode \\t0x%x\\t\\tspi \\t0x%08x\",\n \t\t  cpth->w3.hw_ccode, cpth->w3.uc_ccode, cpth->w3.spi);\n \n \t/* W4 */\n-\tplt_print(\"W4: esn \\t%\" PRIx64 \" \\t OR frag1_wqe_ptr \\t0x%\" PRIx64,\n+\tcpt_dump(file, \"W4: esn \\t%\" PRIx64 \" \\t OR frag1_wqe_ptr \\t0x%\" PRIx64,\n \t\t  cpth->esn, plt_be_to_cpu_64(cpth->frag1_wqe_ptr));\n \n \t/* offset of 0 implies 256B, otherwise it implies offset*8B */\n@@ -44,24 +54,24 @@ roc_cpt_parse_hdr_dump(const struct cpt_parse_hdr_s *cpth)\n \toffset = (((offset - 1) & 0x1f) + 1) * 8;\n \tfrag_info = PLT_PTR_ADD(cpth, offset);\n \n-\tplt_print(\"CPT Fraginfo \\t0x%p:\", frag_info);\n+\tcpt_dump(file, \"CPT Fraginfo \\t0x%p:\", frag_info);\n \n \t/* W0 */\n-\tplt_print(\"W0: f0.info \\t0x%x\", frag_info->w0.f0.info);\n-\tplt_print(\"W0: f1.info \\t0x%x\", frag_info->w0.f1.info);\n-\tplt_print(\"W0: f2.info \\t0x%x\", frag_info->w0.f2.info);\n-\tplt_print(\"W0: f3.info \\t0x%x\", frag_info->w0.f3.info);\n+\tcpt_dump(file, \"W0: f0.info \\t0x%x\", frag_info->w0.f0.info);\n+\tcpt_dump(file, \"W0: f1.info \\t0x%x\", frag_info->w0.f1.info);\n+\tcpt_dump(file, \"W0: f2.info \\t0x%x\", frag_info->w0.f2.info);\n+\tcpt_dump(file, \"W0: f3.info \\t0x%x\", frag_info->w0.f3.info);\n \n \t/* W1 */\n-\tplt_print(\"W1: frag_size0 \\t0x%x\", frag_info->w1.frag_size0);\n-\tplt_print(\"W1: frag_size1 \\t0x%x\", frag_info->w1.frag_size1);\n-\tplt_print(\"W1: frag_size2 \\t0x%x\", frag_info->w1.frag_size2);\n-\tplt_print(\"W1: frag_size3 \\t0x%x\", frag_info->w1.frag_size3);\n+\tcpt_dump(file, \"W1: frag_size0 \\t0x%x\", frag_info->w1.frag_size0);\n+\tcpt_dump(file, \"W1: frag_size1 \\t0x%x\", frag_info->w1.frag_size1);\n+\tcpt_dump(file, \"W1: frag_size2 \\t0x%x\", frag_info->w1.frag_size2);\n+\tcpt_dump(file, \"W1: frag_size3 \\t0x%x\", frag_info->w1.frag_size3);\n \n \tslot = (uint64_t *)(frag_info + 1);\n-\tplt_print(\"Frag Slot2:  WQE ptr \\t%p\",\n+\tcpt_dump(file, \"Frag Slot2:  WQE ptr \\t%p\",\n \t\t  (void *)plt_be_to_cpu_64(slot[0]));\n-\tplt_print(\"Frag Slot3:  WQE ptr \\t%p\",\n+\tcpt_dump(file, \"Frag Slot3:  WQE ptr \\t%p\",\n \t\t  (void *)plt_be_to_cpu_64(slot[1]));\n }\n \ndiff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h\nindex cc650124ed..82997c38ce 100644\n--- a/drivers/common/cnxk/roc_nix.h\n+++ b/drivers/common/cnxk/roc_nix.h\n@@ -549,7 +549,7 @@ int __roc_api roc_nix_rx_drop_re_set(struct roc_nix *roc_nix, bool ena);\n int __roc_api roc_nix_lf_get_reg_count(struct roc_nix *roc_nix);\n int __roc_api roc_nix_lf_reg_dump(struct roc_nix *roc_nix, uint64_t *data);\n int __roc_api roc_nix_queues_ctx_dump(struct roc_nix *roc_nix, FILE *file);\n-void __roc_api roc_nix_cqe_dump(const struct nix_cqe_hdr_s *cq);\n+void __roc_api roc_nix_cqe_dump(FILE *file, const struct nix_cqe_hdr_s *cq);\n void __roc_api roc_nix_rq_dump(struct roc_nix_rq *rq, FILE *file);\n void __roc_api roc_nix_cq_dump(struct roc_nix_cq *cq, FILE *file);\n void __roc_api roc_nix_sq_dump(struct roc_nix_sq *sq, FILE *file);\ndiff --git a/drivers/common/cnxk/roc_nix_debug.c b/drivers/common/cnxk/roc_nix_debug.c\nindex 8c7d902f1e..8962a76097 100644\n--- a/drivers/common/cnxk/roc_nix_debug.c\n+++ b/drivers/common/cnxk/roc_nix_debug.c\n@@ -808,9 +808,8 @@ roc_nix_queues_ctx_dump(struct roc_nix *roc_nix, FILE *file)\n \n /* Dumps struct nix_cqe_hdr_s and union nix_rx_parse_u */\n void\n-roc_nix_cqe_dump(const struct nix_cqe_hdr_s *cq)\n+roc_nix_cqe_dump(FILE *file, const struct nix_cqe_hdr_s *cq)\n {\n-\tFILE *file = NULL;\n \tconst union nix_rx_parse_u *rx =\n \t\t(const union nix_rx_parse_u *)((const uint64_t *)cq + 1);\n \tconst uint64_t *sgs = (const uint64_t *)(rx + 1);\n",
    "prefixes": [
        "v2",
        "1/2"
    ]
}