get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 140022,
    "url": "https://patches.dpdk.org/api/patches/140022/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240510100358.18815-3-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": "<20240510100358.18815-3-ciara.loftus@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240510100358.18815-3-ciara.loftus@intel.com",
    "date": "2024-05-10T10:03:58",
    "name": "[3/3] net/af_xdp: Fix stats reset",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "da8fa38cde4aa0be6af648ed867114af90571d2b",
    "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/20240510100358.18815-3-ciara.loftus@intel.com/mbox/",
    "series": [
        {
            "id": 31905,
            "url": "https://patches.dpdk.org/api/series/31905/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31905",
            "date": "2024-05-10T10:03:56",
            "name": "[1/3] net/af_xdp: Fix port id not set in rx mbuf",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/31905/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/140022/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/140022/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 A609E43FEF;\n\tFri, 10 May 2024 12:04:34 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8BD9A402F1;\n\tFri, 10 May 2024 12:04:34 +0200 (CEST)",
            "from mgamail.intel.com (mgamail.intel.com [198.175.65.13])\n by mails.dpdk.org (Postfix) with ESMTP id 924EE40608\n for <dev@dpdk.org>; Fri, 10 May 2024 12:04:32 +0200 (CEST)",
            "from orviesa009.jf.intel.com ([10.64.159.149])\n by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 May 2024 03:04:31 -0700",
            "from silpixa00401177.ir.intel.com (HELO vm177..) ([10.55.128.139])\n by orviesa009.jf.intel.com with ESMTP; 10 May 2024 03:04: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=1715335472; x=1746871472;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=zIvAizuWicm9DW9PVQdrTzQviVrFM+caNzUHrijUZJk=;\n b=djMWOwEaDhrFjgoLSkoAIwkekRkiNPCwWguKN1Pfu0qgZeNjdQW+YOiU\n ufUTJqirjTFHzmGEg2GZb3yGX4rffYXuo/HgnSLzF6NYFbkD+UOitNSLh\n Z4WTmSY9Ot050acSZCJstE0vKTDYpbQduwKlMbWw3rc1oOJAYKjrAoP/v\n 89mVoqFUcoEpyOp2qJDGCSbV2xcRTdXkSUpkq3P1WA0++F8pmcFtNkzs7\n lN820oXFKlMNUT1kjd5W+k81pHJssjETEEWh/9gJLHchBLWgevfnJMJ7Y\n wq1MLFTVZreTYFcv39j8b1mIGT+5H4Uh1UFMUdZoW734V1NzEENRB3dNK A==;",
        "X-CSE-ConnectionGUID": [
            "sUPoXWBST0G00X3TpV205A==",
            "Zd1cecv/TLepY/tnW0GILQ=="
        ],
        "X-CSE-MsgGUID": [
            "kaVSzxWjQdCiL5X4hIIePA==",
            "O5Zgy4WVShu/zJlXXDlZgg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6600,9927,11068\"; a=\"22460648\"",
            "E=Sophos;i=\"6.08,150,1712646000\"; d=\"scan'208\";a=\"22460648\"",
            "E=Sophos;i=\"6.08,150,1712646000\"; d=\"scan'208\";a=\"29672609\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ciara Loftus <ciara.loftus@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "stephen@networkplumber.org, Ciara Loftus <ciara.loftus@intel.com>,\n stable@dpdk.og",
        "Subject": "[PATCH 3/3] net/af_xdp: Fix stats reset",
        "Date": "Fri, 10 May 2024 10:03:58 +0000",
        "Message-Id": "<20240510100358.18815-3-ciara.loftus@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20240510100358.18815-1-ciara.loftus@intel.com>",
        "References": "<20240510100358.18815-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.og\n\nReported-by: Stephen Hemminger <stephen@networkplumber.org>\nSigned-off-by: Ciara Loftus <ciara.loftus@intel.com>\n---\n drivers/net/af_xdp/rte_eth_af_xdp.c | 19 +++++++++++++++++--\n 1 file changed, 17 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 968bbf6d45..8f25134003 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -125,6 +125,8 @@ struct rx_stats {\n \tuint64_t rx_bytes;\n \tuint64_t rx_dropped;\n \tuint64_t alloc_failed;\n+\n+\tuint64_t imissed_offset;\n };\n \n struct pkt_rx_queue {\n@@ -884,7 +886,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 +900,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": [
        "3/3"
    ]
}