get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 140050,
    "url": "https://patches.dpdk.org/api/patches/140050/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240514084155.50673-4-ciara.loftus@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20240514084155.50673-4-ciara.loftus@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240514084155.50673-4-ciara.loftus@intel.com",
    "date": "2024-05-14T08:41:54",
    "name": "[v2,3/4] net/af_xdp: fix stats reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e57528b80e868a622d9e0bb2bb7d9d36c524201d",
    "submitter": {
        "id": 144,
        "url": "https://patches.dpdk.org/api/people/144/?format=api",
        "name": "Loftus, Ciara",
        "email": "ciara.loftus@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240514084155.50673-4-ciara.loftus@intel.com/mbox/",
    "series": [
        {
            "id": 31917,
            "url": "https://patches.dpdk.org/api/series/31917/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31917",
            "date": "2024-05-14T08:41:51",
            "name": "AF_XDP PMD Bugfixes",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/31917/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/140050/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/140050/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 BABE64402A;\n\tTue, 14 May 2024 10:43:18 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id BFFE84069D;\n\tTue, 14 May 2024 10:43:08 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [192.198.163.16])\n by mails.dpdk.org (Postfix) with ESMTP id 9EB524067A;\n Tue, 14 May 2024 10:43:06 +0200 (CEST)",
            "from fmviesa006.fm.intel.com ([10.60.135.146])\n by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 14 May 2024 01:43:06 -0700",
            "from silpixa00401177.ir.intel.com (HELO vm177..) ([10.55.128.139])\n by fmviesa006.fm.intel.com with ESMTP; 14 May 2024 01:43:04 -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=1715676187; x=1747212187;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=fQdEXS6O10HbH4m1MBXY4RiFaxFsrBZ+Rv6KhP9rvQU=;\n b=ltUCOi61u9OVhNaP64lh/zkqeImt5vd5hM6b2nWZIZsSXn+VKEIY0fkD\n tCanZmqUiaVxv8pqtHD4bclmDuqN71KIS0HbU00YTImeaQEdieAOKvDqK\n rFEBtgA7sbfkAyux4Kh2Rj+9zSBqFMpIndswTELj+Mtnvs7j7fUmiqGuk\n 5gj99Z1JiizuF+YcRkXWeXUqlCDgnThDAIRBZVjpN3s6bF44TTFQtn1n1\n RCevCG/K1qaR0cqAqixdIg6cIPCUjl/6JZxP3X5gF3MZZ+V71nGBtZYCR\n m6R9PYu59+sEX1I+QyrWt8TNQ7JUzXkG4Ehovo5EJ0+bErx+U2EEIDS5+ Q==;",
        "X-CSE-ConnectionGUID": [
            "7nojnefdQfS+LRLngqEvHg==",
            "HQ9p5FXrReGNdEIwKorQfg=="
        ],
        "X-CSE-MsgGUID": [
            "mS+7Axw8SRGAT0mkNls/Iw==",
            "iJIc2F/WRxmdTxHwLfHNSg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,11072\"; a=\"11513816\"",
            "E=Sophos;i=\"6.08,159,1712646000\"; d=\"scan'208\";a=\"11513816\"",
            "E=Sophos;i=\"6.08,159,1712646000\"; d=\"scan'208\";a=\"30657439\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ciara Loftus <ciara.loftus@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Ciara Loftus <ciara.loftus@intel.com>, stable@dpdk.org,\n Stephen Hemminger <stephen@networkplumber.org>,\n Maryam Tahhan <mtahhan@redhat.com>",
        "Subject": "[PATCH v2 3/4] net/af_xdp: fix stats reset",
        "Date": "Tue, 14 May 2024 08:41:54 +0000",
        "Message-Id": "<20240514084155.50673-4-ciara.loftus@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240514084155.50673-1-ciara.loftus@intel.com>",
        "References": "<20240514084155.50673-1-ciara.loftus@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": "The imissed statistic was not properly reset because it was\nread directly from the kernel statistics. To fix this, take note\nof the kernel statistic when the stats are reset and deduct this\nvalue from the kernel statistic read during statistics get.\n\nBugzilla ID: 1430\nFixes: f1debd77efaf (\"net/af_xdp: introduce AF_XDP PMD\")\ncc: stable@dpdk.org\n\nReported-by: Stephen Hemminger <stephen@networkplumber.org>\nSigned-off-by: Ciara Loftus <ciara.loftus@intel.com>\nAcked-by: Maryam Tahhan <mtahhan@redhat.com>\n---\nv2:\n* Removed whitespace in rx_stats struct\n* Fixed typo in commit message\n\n drivers/net/af_xdp/rte_eth_af_xdp.c | 18 ++++++++++++++++--\n 1 file changed, 16 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex 9bcf971ae5..193e3576bc 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -124,6 +124,7 @@ struct rx_stats {\n \tuint64_t rx_pkts;\n \tuint64_t rx_bytes;\n \tuint64_t rx_dropped;\n+\tuint64_t imissed_offset;\n };\n \n struct pkt_rx_queue {\n@@ -884,7 +885,8 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n \t\t\tAF_XDP_LOG(ERR, \"getsockopt() failed for XDP_STATISTICS.\\n\");\n \t\t\treturn -1;\n \t\t}\n-\t\tstats->imissed += xdp_stats.rx_dropped;\n+\t\tstats->imissed +=\n+\t\t\t(xdp_stats.rx_dropped - internals->rx_queues[i].stats.imissed_offset);\n \n \t\tstats->opackets += stats->q_opackets[i];\n \t\tstats->obytes += stats->q_obytes[i];\n@@ -897,13 +899,25 @@ static int\n eth_stats_reset(struct rte_eth_dev *dev)\n {\n \tstruct pmd_internals *internals = dev->data->dev_private;\n-\tint i;\n+\tstruct pmd_process_private *process_private = dev->process_private;\n+\tstruct xdp_statistics xdp_stats;\n+\tsocklen_t optlen;\n+\tint i, ret, fd;\n \n \tfor (i = 0; i < internals->queue_cnt; i++) {\n \t\tmemset(&internals->rx_queues[i].stats, 0,\n \t\t\t\t\tsizeof(struct rx_stats));\n \t\tmemset(&internals->tx_queues[i].stats, 0,\n \t\t\t\t\tsizeof(struct tx_stats));\n+\t\tfd = process_private->rxq_xsk_fds[i];\n+\t\toptlen = sizeof(struct xdp_statistics);\n+\t\tret = fd >= 0 ? getsockopt(fd, SOL_XDP, XDP_STATISTICS,\n+\t\t\t\t\t   &xdp_stats, &optlen) : -1;\n+\t\tif (ret != 0) {\n+\t\t\tAF_XDP_LOG(ERR, \"getsockopt() failed for XDP_STATISTICS.\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\tinternals->rx_queues[i].stats.imissed_offset = xdp_stats.rx_dropped;\n \t}\n \n \treturn 0;\n",
    "prefixes": [
        "v2",
        "3/4"
    ]
}