get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124022,
    "url": "http://patches.dpdk.org/api/patches/124022/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230216003010.3439881-19-mingxia.liu@intel.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": "<20230216003010.3439881-19-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230216003010.3439881-19-mingxia.liu@intel.com",
    "date": "2023-02-16T00:30:07",
    "name": "[v7,18/21] net/cpfl: add HW statistics",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2d48af78a6484d947548c8687f5e36fd3b36a8a0",
    "submitter": {
        "id": 2514,
        "url": "http://patches.dpdk.org/api/people/2514/?format=api",
        "name": "Liu, Mingxia",
        "email": "mingxia.liu@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230216003010.3439881-19-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 27030,
            "url": "http://patches.dpdk.org/api/series/27030/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27030",
            "date": "2023-02-16T00:29:49",
            "name": "add support for cpfl PMD in DPDK",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/27030/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/124022/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/124022/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 16D8741CA9;\n\tThu, 16 Feb 2023 02:29:58 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4199342DAB;\n\tThu, 16 Feb 2023 02:28:22 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id 2686542D81\n for <dev@dpdk.org>; Thu, 16 Feb 2023 02:28:15 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Feb 2023 17:28:14 -0800",
            "from dpdk-mingxial-01.sh.intel.com ([10.67.119.167])\n by fmsmga002.fm.intel.com with ESMTP; 15 Feb 2023 17:28:13 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1676510895; x=1708046895;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=PdszsbDl3Wqo3ZqI7Fmp6wM+un3Tx6DWV5rcVYgXicU=;\n b=PyB5psJAAHo10JZMHDWzMcCDbyIxeC3nGiUB6/DKQSwFpB1r5ab8aCnn\n rMTCVJt0U23lTuFmPajkUkKx/PvXvbSsOPVQboh/HGDqcp5afRQ2pmc2E\n nZdW1251P/8c31HbqOULDYhdyZ74jNXMQGYhe1kzBsWAW1yCYEJ0d77Qz\n Pj+2gI3dCqZhA5zMBTMV1Xf1dSlQnBXou3NAnReYlTXH7SvCR3lGPB2iE\n H6bbsq/WQepTgdyG5ZxK2QRm81JFHKa4/umyrOqsrkQhYUFCcdqYCWgKe\n Nx4/35nb4CuNSFy4gNJR0v7hYSfmwF/++Rz/MKHLg5+iZJkM11c+ekf/g g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10622\"; a=\"329315485\"",
            "E=Sophos;i=\"5.97,301,1669104000\"; d=\"scan'208\";a=\"329315485\"",
            "E=McAfee;i=\"6500,9779,10622\"; a=\"779166318\"",
            "E=Sophos;i=\"5.97,301,1669104000\"; d=\"scan'208\";a=\"779166318\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingxia Liu <mingxia.liu@intel.com>",
        "To": "dev@dpdk.org,\n\tbeilei.xing@intel.com,\n\tyuying.zhang@intel.com",
        "Cc": "Mingxia Liu <mingxia.liu@intel.com>",
        "Subject": "[PATCH v7 18/21] net/cpfl: add HW statistics",
        "Date": "Thu, 16 Feb 2023 00:30:07 +0000",
        "Message-Id": "<20230216003010.3439881-19-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230216003010.3439881-1-mingxia.liu@intel.com>",
        "References": "<20230213021956.2953088-1-mingxia.liu@intel.com>\n <20230216003010.3439881-1-mingxia.liu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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 add hardware packets/bytes statistics.\n\nSigned-off-by: Mingxia Liu <mingxia.liu@intel.com>\n---\n drivers/net/cpfl/cpfl_ethdev.c | 86 ++++++++++++++++++++++++++++++++++\n 1 file changed, 86 insertions(+)",
    "diff": "diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c\nindex 1e40f3e55c..0fb9f0455b 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.c\n+++ b/drivers/net/cpfl/cpfl_ethdev.c\n@@ -178,6 +178,87 @@ cpfl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused)\n \treturn ptypes;\n }\n \n+static uint64_t\n+cpfl_get_mbuf_alloc_failed_stats(struct rte_eth_dev *dev)\n+{\n+\tuint64_t mbuf_alloc_failed = 0;\n+\tstruct idpf_rx_queue *rxq;\n+\tint i = 0;\n+\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\trxq = dev->data->rx_queues[i];\n+\t\tmbuf_alloc_failed += __atomic_load_n(&rxq->rx_stats.mbuf_alloc_failed,\n+\t\t\t\t\t\t     __ATOMIC_RELAXED);\n+\t}\n+\n+\treturn mbuf_alloc_failed;\n+}\n+\n+static int\n+cpfl_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n+{\n+\tstruct idpf_vport *vport =\n+\t\t(struct idpf_vport *)dev->data->dev_private;\n+\tstruct virtchnl2_vport_stats *pstats = NULL;\n+\tint ret;\n+\n+\tret = idpf_vc_stats_query(vport, &pstats);\n+\tif (ret == 0) {\n+\t\tuint8_t crc_stats_len = (dev->data->dev_conf.rxmode.offloads &\n+\t\t\t\t\t RTE_ETH_RX_OFFLOAD_KEEP_CRC) ? 0 :\n+\t\t\t\t\t RTE_ETHER_CRC_LEN;\n+\n+\t\tidpf_vport_stats_update(&vport->eth_stats_offset, pstats);\n+\t\tstats->ipackets = pstats->rx_unicast + pstats->rx_multicast +\n+\t\t\t\tpstats->rx_broadcast - pstats->rx_discards;\n+\t\tstats->opackets = pstats->tx_broadcast + pstats->tx_multicast +\n+\t\t\t\t\t\tpstats->tx_unicast;\n+\t\tstats->imissed = pstats->rx_discards;\n+\t\tstats->oerrors = pstats->tx_errors + pstats->tx_discards;\n+\t\tstats->ibytes = pstats->rx_bytes;\n+\t\tstats->ibytes -= stats->ipackets * crc_stats_len;\n+\t\tstats->obytes = pstats->tx_bytes;\n+\n+\t\tdev->data->rx_mbuf_alloc_failed = cpfl_get_mbuf_alloc_failed_stats(dev);\n+\t\tstats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;\n+\t} else {\n+\t\tPMD_DRV_LOG(ERR, \"Get statistics failed\");\n+\t}\n+\treturn ret;\n+}\n+\n+static void\n+cpfl_reset_mbuf_alloc_failed_stats(struct rte_eth_dev *dev)\n+{\n+\tstruct idpf_rx_queue *rxq;\n+\tint i;\n+\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\trxq = dev->data->rx_queues[i];\n+\t\t__atomic_store_n(&rxq->rx_stats.mbuf_alloc_failed, 0, __ATOMIC_RELAXED);\n+\t}\n+}\n+\n+static int\n+cpfl_dev_stats_reset(struct rte_eth_dev *dev)\n+{\n+\tstruct idpf_vport *vport =\n+\t\t(struct idpf_vport *)dev->data->dev_private;\n+\tstruct virtchnl2_vport_stats *pstats = NULL;\n+\tint ret;\n+\n+\tret = idpf_vc_stats_query(vport, &pstats);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\t/* set stats offset base on current values */\n+\tvport->eth_stats_offset = *pstats;\n+\n+\tcpfl_reset_mbuf_alloc_failed_stats(dev);\n+\n+\treturn 0;\n+}\n+\n static int\n cpfl_init_rss(struct idpf_vport *vport)\n {\n@@ -365,6 +446,9 @@ cpfl_dev_start(struct rte_eth_dev *dev)\n \t\tgoto err_vport;\n \t}\n \n+\tif (cpfl_dev_stats_reset(dev))\n+\t\tPMD_DRV_LOG(ERR, \"Failed to reset stats\");\n+\n \tvport->stopped = 0;\n \n \treturn 0;\n@@ -766,6 +850,8 @@ static const struct eth_dev_ops cpfl_eth_dev_ops = {\n \t.tx_queue_release\t\t= cpfl_dev_tx_queue_release,\n \t.mtu_set\t\t\t= cpfl_dev_mtu_set,\n \t.dev_supported_ptypes_get\t= cpfl_dev_supported_ptypes_get,\n+\t.stats_get\t\t\t= cpfl_dev_stats_get,\n+\t.stats_reset\t\t\t= cpfl_dev_stats_reset,\n };\n \n static uint16_t\n",
    "prefixes": [
        "v7",
        "18/21"
    ]
}