get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130027,
    "url": "http://patches.dpdk.org/api/patches/130027/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230809155134.539287-15-beilei.xing@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": "<20230809155134.539287-15-beilei.xing@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230809155134.539287-15-beilei.xing@intel.com",
    "date": "2023-08-09T15:51:29",
    "name": "[14/19] net/cpfl: add stats ops for representor",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "33b20cb8213e94dcde892c400954ab649985551c",
    "submitter": {
        "id": 410,
        "url": "http://patches.dpdk.org/api/people/410/?format=api",
        "name": "Xing, Beilei",
        "email": "beilei.xing@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230809155134.539287-15-beilei.xing@intel.com/mbox/",
    "series": [
        {
            "id": 29139,
            "url": "http://patches.dpdk.org/api/series/29139/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29139",
            "date": "2023-08-09T15:51:15",
            "name": "net/cpfl: support port representor",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/29139/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/130027/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/130027/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 3AF6843016;\n\tWed,  9 Aug 2023 09:34:54 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 007DB40691;\n\tWed,  9 Aug 2023 09:33:35 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [134.134.136.126])\n by mails.dpdk.org (Postfix) with ESMTP id F2CE643296\n for <dev@dpdk.org>; Wed,  9 Aug 2023 09:33:32 +0200 (CEST)",
            "from fmsmga005.fm.intel.com ([10.253.24.32])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 09 Aug 2023 00:33:32 -0700",
            "from dpdk-beileix-icelake.sh.intel.com ([10.67.116.252])\n by fmsmga005.fm.intel.com with ESMTP; 09 Aug 2023 00:33:31 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1691566413; x=1723102413;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=pIje8G3Hzd8FeZ4+pi1k5UQYrRgftdcREjKR68GkJOI=;\n b=S8YB/xRyBDaH/ynwfHhE8UU1xFKDFrFXJe7OnMNQbC0jutoVGx9VaPd1\n Sb9gFgrZwymkHztCcwde/90z4IbvdgsGyrFTAo3jYHt/0K3EqSahsJiF8\n XTiVVVA6CIB6OB+yZ9PnAcmxZhzPzQ5SkO+FKt+v87kJ+R5ARis2UmIpM\n RaKt0OfEaZTdFMeARWPh/qseq5cS5PzMd50EMy8oTo5cHH9MuvS8zqXlU\n CFRpQ7UflujhiTv5HyMa1o+sCYcLJUb9UbBnaAzcO+qJa3grMl27HBR5C\n 1tFNMEY27Bpd+E5GrHHeC0vzQX/jT1Zow8C4kepNeMZWNMX3L5gf72aWr g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,10795\"; a=\"356014515\"",
            "E=Sophos;i=\"6.01,158,1684825200\"; d=\"scan'208\";a=\"356014515\"",
            "E=McAfee;i=\"6600,9927,10795\"; a=\"1062337453\"",
            "E=Sophos;i=\"6.01,158,1684825200\"; d=\"scan'208\";a=\"1062337453\""
        ],
        "X-ExtLoop1": "1",
        "From": "beilei.xing@intel.com",
        "To": "jingjing.wu@intel.com,\n\tmingxia.liu@intel.com",
        "Cc": "dev@dpdk.org,\n\tBeilei Xing <beilei.xing@intel.com>",
        "Subject": "[PATCH 14/19] net/cpfl: add stats ops for representor",
        "Date": "Wed,  9 Aug 2023 15:51:29 +0000",
        "Message-Id": "<20230809155134.539287-15-beilei.xing@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230809155134.539287-1-beilei.xing@intel.com>",
        "References": "<20230809155134.539287-1-beilei.xing@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": "From: Beilei Xing <beilei.xing@intel.com>\n\nSupport stats_get and stats_reset ops fot port representor.\n\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\n---\n drivers/net/cpfl/cpfl_ethdev.h      |  8 +++++\n drivers/net/cpfl/cpfl_representor.c | 54 +++++++++++++++++++++++++++++\n 2 files changed, 62 insertions(+)",
    "diff": "diff --git a/drivers/net/cpfl/cpfl_ethdev.h b/drivers/net/cpfl/cpfl_ethdev.h\nindex 7813b9173e..33e810408b 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.h\n+++ b/drivers/net/cpfl/cpfl_ethdev.h\n@@ -171,15 +171,23 @@ struct cpfl_repr {\n \tbool func_up; /* If the represented function is up */\n };\n \n+struct cpfl_repr_stats {\n+\tuint64_t packets;\n+\tuint64_t bytes;\n+\tuint64_t errors;\n+};\n+\n struct cpfl_repr_rx_queue {\n \tstruct cpfl_repr *repr;\n \tstruct rte_mempool *mb_pool;\n \tstruct rte_ring *rx_ring;\n+\tstruct cpfl_repr_stats stats; /* Statistics */\n };\n \n struct cpfl_repr_tx_queue {\n \tstruct cpfl_repr *repr;\n \tstruct cpfl_tx_queue *txq;\n+\tstruct cpfl_repr_stats stats; /* Statistics */\n };\n \n struct cpfl_adapter_ext {\ndiff --git a/drivers/net/cpfl/cpfl_representor.c b/drivers/net/cpfl/cpfl_representor.c\nindex 862464602f..79cb7f76d4 100644\n--- a/drivers/net/cpfl/cpfl_representor.c\n+++ b/drivers/net/cpfl/cpfl_representor.c\n@@ -425,6 +425,58 @@ cpfl_repr_link_update(struct rte_eth_dev *ethdev,\n \treturn 0;\n }\n \n+static int\n+idpf_repr_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n+{\n+\tstruct cpfl_repr_tx_queue *txq;\n+\tstruct cpfl_repr_rx_queue *rxq;\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\ttxq = dev->data->tx_queues[i];\n+\t\tif (!txq)\n+\t\t\tcontinue;\n+\t\tstats->opackets += __atomic_load_n(&txq->stats.packets, __ATOMIC_RELAXED);\n+\t\tstats->obytes += __atomic_load_n(&txq->stats.bytes, __ATOMIC_RELAXED);\n+\t}\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\trxq = dev->data->rx_queues[i];\n+\t\tif (!rxq)\n+\t\t\tcontinue;\n+\t\tstats->ipackets += __atomic_load_n(&rxq->stats.packets, __ATOMIC_RELAXED);\n+\t\tstats->ibytes += __atomic_load_n(&rxq->stats.bytes, __ATOMIC_RELAXED);\n+\t\tstats->ierrors += __atomic_load_n(&rxq->stats.errors, __ATOMIC_RELAXED);\n+\t}\n+\tstats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;\n+\treturn 0;\n+}\n+\n+static int\n+idpf_repr_stats_reset(struct rte_eth_dev *dev)\n+{\n+\tstruct cpfl_repr_tx_queue *txq;\n+\tstruct cpfl_repr_rx_queue *rxq;\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\ttxq = dev->data->tx_queues[i];\n+\t\tif (!txq)\n+\t\t\tcontinue;\n+\t\t__atomic_store_n(&txq->stats.packets, 0, __ATOMIC_RELAXED);\n+\t\t__atomic_store_n(&txq->stats.bytes, 0, __ATOMIC_RELAXED);\n+\t\t__atomic_store_n(&txq->stats.errors, 0, __ATOMIC_RELAXED);\n+\t}\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\trxq = dev->data->rx_queues[i];\n+\t\tif (!rxq)\n+\t\t\tcontinue;\n+\t\t__atomic_store_n(&rxq->stats.packets, 0, __ATOMIC_RELAXED);\n+\t\t__atomic_store_n(&rxq->stats.bytes, 0, __ATOMIC_RELAXED);\n+\t\t__atomic_store_n(&rxq->stats.errors, 0, __ATOMIC_RELAXED);\n+\t}\n+\treturn 0;\n+}\n+\n static const struct eth_dev_ops cpfl_repr_dev_ops = {\n \t.dev_start\t\t= cpfl_repr_dev_start,\n \t.dev_stop\t\t= cpfl_repr_dev_stop,\n@@ -435,6 +487,8 @@ static const struct eth_dev_ops cpfl_repr_dev_ops = {\n \t.rx_queue_setup\t\t= cpfl_repr_rx_queue_setup,\n \t.tx_queue_setup\t\t= cpfl_repr_tx_queue_setup,\n \t.link_update\t\t= cpfl_repr_link_update,\n+\t.stats_get\t\t= idpf_repr_stats_get,\n+\t.stats_reset\t\t= idpf_repr_stats_reset,\n };\n \n static int\n",
    "prefixes": [
        "14/19"
    ]
}