Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217334/?format=api
{ "id": 2217334, "url": "http://patchwork.ozlabs.org/api/patches/2217334/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20260327214242.4051172-3-john.cabaj@canonical.com/", "project": { "id": 15, "url": "http://patchwork.ozlabs.org/api/projects/15/?format=api", "name": "Ubuntu Kernel", "link_name": "ubuntu-kernel", "list_id": "kernel-team.lists.ubuntu.com", "list_email": "kernel-team@lists.ubuntu.com", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260327214242.4051172-3-john.cabaj@canonical.com>", "list_archive_url": null, "date": "2026-03-27T21:42:40", "name": "[SRU,Q:linux-azure,1/3] net: mana: Move hardware counter stats from per-port to per-VF context", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6057ac2493cf94bcf7355f83a6b818e24d962b7c", "submitter": { "id": 85032, "url": "http://patchwork.ozlabs.org/api/people/85032/?format=api", "name": "John Cabaj", "email": "john.cabaj@canonical.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/ubuntu-kernel/patch/20260327214242.4051172-3-john.cabaj@canonical.com/mbox/", "series": [ { "id": 497837, "url": "http://patchwork.ozlabs.org/api/series/497837/?format=api", "web_url": "http://patchwork.ozlabs.org/project/ubuntu-kernel/list/?series=497837", "date": "2026-03-27T21:42:40", "name": "[SRU,Q:linux-azure,1/3] net: mana: Move hardware counter stats from per-port to per-VF context", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497837/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217334/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217334/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<kernel-team-bounces@lists.ubuntu.com>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (4096-bit key;\n unprotected) header.d=canonical.com header.i=@canonical.com\n header.a=rsa-sha256 header.s=20251003 header.b=AHFn9Alx;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com\n (client-ip=185.125.189.65; helo=lists.ubuntu.com;\n envelope-from=kernel-team-bounces@lists.ubuntu.com;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fjDdr1T1fz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 08:42:56 +1100 (AEDT)", "from localhost ([127.0.0.1] helo=lists.ubuntu.com)\n\tby lists.ubuntu.com with esmtp (Exim 4.86_2)\n\t(envelope-from <kernel-team-bounces@lists.ubuntu.com>)\n\tid 1w6Ex7-0006zI-U2; Fri, 27 Mar 2026 21:42:49 +0000", "from smtp-relay-internal-0.internal ([10.131.114.225]\n helo=smtp-relay-internal-0.canonical.com)\n by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.86_2) (envelope-from <john.cabaj@canonical.com>)\n id 1w6Ex5-0006wr-6T\n for kernel-team@lists.ubuntu.com; Fri, 27 Mar 2026 21:42:47 +0000", "from mail-qv1-f72.google.com (mail-qv1-f72.google.com\n [209.85.219.72])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 01A983F5D7\n for <kernel-team@lists.ubuntu.com>; Fri, 27 Mar 2026 21:42:47 +0000 (UTC)", "by mail-qv1-f72.google.com with SMTP id\n 6a1803df08f44-899bef1ea49so125467466d6.1\n for <kernel-team@lists.ubuntu.com>; Fri, 27 Mar 2026 14:42:46 -0700 (PDT)", "from smtp.gmail.com\n (h208-73-92-250.mdtnwi.broadband.dynamic.tds.net. [208.73.92.250])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-89ecf95f4f9sm3448206d6.37.2026.03.27.14.42.44\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 27 Mar 2026 14:42:45 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n s=20251003; t=1774647767;\n bh=DN7MUGSZIetKp4tl50qh9mfmJoIa3Kc2r83GaFfHWlg=;\n h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n MIME-Version;\n b=AHFn9AlxxeQQCCmdEk8pmemOuz0gwVI2ufjJHM/b++WvX36DsSGE789DUgK2s/59Y\n +ryK90vWF39iVLgEBVloronfVHOlHccqfb40c5HeqEj80WPyyO8MjaBcPaRWRcP62S\n jtGRAhvfYq2kcYf2U5vMC4J4kFSXotG7D79nVvfr/ewQmwvDEVfhjg+xuqGfpxpRUA\n AIGSm2PT7gS+OnQ/jziJp1ovl/6XOKFUjrlTeGVvdN1OW3UX1YbFMsfp5IMd3Iy6Ad\n Yh4efEpeRjMadb02bRX+zPk3IVCo5uGat/F+IwzG5ur8537V/wK5uEMVbf/Z1nsz96\n 8TwaXnaNnE93ihyPzxzBbFmQEB2bRx+6r6YimWBf4sjCF2yROa7M/K7c7zU6HYFuwr\n otl1zfaM4YI8juQZTjI4a6VcodAkZVsUQPojuct5346ZnT/JPan4f6CLymH0kLE98W\n 4y+MQ1IybhNy13PwKDqFE4Y8VBTpzU++G8hSTCYPaP+ldWrTNt2JiRxJuoYTrvrF3A\n Ss0UCjc6FRbZ1SAAWiIe8FxyScr3fMkk9CKQGmr2RlijOKor/Wtcu2YM/9RDLWXw0c\n D4EWTaGtOpUOPamIozP3eOmPykY+vKEm8IKL121oa/zexm48X5p8fM45Wgzzk8LTxk\n SXZ7x7dr7UFho72XDZROACrg=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774647766; x=1775252566;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=DN7MUGSZIetKp4tl50qh9mfmJoIa3Kc2r83GaFfHWlg=;\n b=jkMU5BBkvZePda8XVf3OzE9bufzsqAu+gsH9THbgs0JNedLtsCGyrtrf9j/xFygaqB\n RwteD3+0QRH3PEuxd9aHZ4uo3vEAeWHM52h+9ezYtiedPmz3OtToz1C5umNd3fdQP8bW\n Hz3vzssRMQWBcvlvYgCbxjaD9LltKDMYmyZe/CMBSxU4077dl3qbIl4In+uytmuNXFlY\n ypBQQ4fJPgytzafTT55+N3+n1WsI67RkCOtz/aPa7E5MGqIrkEH8no8oKi4eLQKo9uRk\n 7v58Xy9M50LhujFdEy4zIQPJAZmE8+b0B6jqLO5JBXTT3GqspY2ClAMOgaDgsI3t1Hgf\n iaoA==", "X-Gm-Message-State": "AOJu0YxhOtJO6iJ3KcfVGvBJT3QClBiR2786OxQCJMUQs1OgnGcavMFa\n PI6MyIeSVuQR/J6Zk1QltgVs4+4UxHt2dY1ZZJzBgPwe244SPscXhuoekMevqBvnNSko0PYa+3t\n FtH7icJ1gzVsV6M78kmTyrPRgTCmjyS+Exx6YrNBOGgmoZTb3rnD/8qfvT+0xuIY2SG4SaPnoym\n 5Um/SvhQ2Bm98u5g==", "X-Gm-Gg": "ATEYQzy3cGqgbOOA5ZPZjy3U4gZY2G7cKKY3Pd/4yx42l8u1XPymgs0GDZ/j147VR+B\n cj5ZAGjyr/Ox9az7p33a3nxBTGfFCqCAyKsV4u0UN+7/wm7aKzvJgOU6yRLLsIg/+x8L4NAcWvc\n owykwJzPhn+PZqvCXOFm/SXH39mEfJcnJtW8O7ub29nYndZ03FfiQEu70DpxIGkFXRBZRBlDGhZ\n /sCWU1ZVQnbZdC3q5jk2xpTGqUNpGPLcCfqM8xOPFFDj9iRuFdDlIOvOgS7rU/PLNpcxhBxt8L3\n AZsM7fhnq3KGfySTBfxD8IKVj0UbrG4s3NYNFDuJjOoTRnMbN5nWFOEgh+a4X+jvAyViSgywWoh\n bpLqzcSg941O8mU3pzS2FKiuMHDaUgI1rWpCcSURRcPRlG6C8a/Mt+AA6JAxVbSPXKg2uhfkk42\n bbdpa9INDYtA==", "X-Received": [ "by 2002:a05:6214:4789:b0:89c:c680:d773 with SMTP id\n 6a1803df08f44-89ce8d15e0cmr50917616d6.21.1774647765976;\n Fri, 27 Mar 2026 14:42:45 -0700 (PDT)", "by 2002:a05:6214:4789:b0:89c:c680:d773 with SMTP id\n 6a1803df08f44-89ce8d15e0cmr50917436d6.21.1774647765549;\n Fri, 27 Mar 2026 14:42:45 -0700 (PDT)" ], "From": "John Cabaj <john.cabaj@canonical.com>", "To": "kernel-team@lists.ubuntu.com", "Subject": "[SRU][Q:linux-azure][PATCH 1/3] net: mana: Move hardware counter\n stats from per-port to per-VF context", "Date": "Fri, 27 Mar 2026 16:42:40 -0500", "Message-ID": "<20260327214242.4051172-3-john.cabaj@canonical.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260327214242.4051172-1-john.cabaj@canonical.com>", "References": "<20260327214242.4051172-1-john.cabaj@canonical.com>", "MIME-Version": "1.0", "X-BeenThere": "kernel-team@lists.ubuntu.com", "X-Mailman-Version": "2.1.20", "Precedence": "list", "List-Id": "Kernel team discussions <kernel-team.lists.ubuntu.com>", "List-Unsubscribe": "<https://lists.ubuntu.com/mailman/options/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=unsubscribe>", "List-Archive": "<https://lists.ubuntu.com/archives/kernel-team>", "List-Post": "<mailto:kernel-team@lists.ubuntu.com>", "List-Help": "<mailto:kernel-team-request@lists.ubuntu.com?subject=help>", "List-Subscribe": "<https://lists.ubuntu.com/mailman/listinfo/kernel-team>,\n <mailto:kernel-team-request@lists.ubuntu.com?subject=subscribe>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "kernel-team-bounces@lists.ubuntu.com", "Sender": "\"kernel-team\" <kernel-team-bounces@lists.ubuntu.com>" }, "content": "From: Erni Sri Satya Vennela <ernis@linux.microsoft.com>\n\nBugLink: https://bugs.launchpad.net/bugs/2146601\n\nMove hardware counter (HC) statistics from mana_port_context to\nmana_context to enable sharing stats across multiple network ports\non the same MANA VF. Previously, each network port queried\nhardware counters independently using MANA_QUERY_GF_STAT command\n(GF = Generic Function stats from GDMA hardware), resulting in\nredundant queries when multiple ports existed on the same device.\n\nIsolate hardware counter stats by introducing mana_ethtool_hc_stats\nin mana_context and update the code to ensure all stats are properly\nreported via ethtool -S <interface>, maintaining consistency with\nprevious behavior.\n\nSigned-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>\nReviewed-by: Haiyang Zhang <haiyangz@microsoft.com>\nLink: https://patch.msgid.link/1763120599-6331-2-git-send-email-ernis@linux.microsoft.com\nSigned-off-by: Jakub Kicinski <kuba@kernel.org>\n(cherry picked from commit e275d9091c01b3b46f3ec534ce4ac77cffc9e3ae)\nSigned-off-by: John Cabaj <john.cabaj@canonical.com>\n---\n drivers/net/ethernet/microsoft/mana/mana_en.c | 67 ++++++++-------\n .../ethernet/microsoft/mana/mana_ethtool.c | 85 ++++++++++---------\n include/net/mana/mana.h | 14 +--\n 3 files changed, 90 insertions(+), 76 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c\nindex 67bab34c1582..f0f6e0544663 100644\n--- a/drivers/net/ethernet/microsoft/mana/mana_en.c\n+++ b/drivers/net/ethernet/microsoft/mana/mana_en.c\n@@ -2870,11 +2870,12 @@ int mana_config_rss(struct mana_port_context *apc, enum TRI_STATE rx,\n \treturn 0;\n }\n \n-void mana_query_gf_stats(struct mana_port_context *apc)\n+void mana_query_gf_stats(struct mana_context *ac)\n {\n+\tstruct gdma_context *gc = ac->gdma_dev->gdma_context;\n \tstruct mana_query_gf_stat_resp resp = {};\n \tstruct mana_query_gf_stat_req req = {};\n-\tstruct net_device *ndev = apc->ndev;\n+\tstruct device *dev = gc->dev;\n \tint err;\n \n \tmana_gd_init_req_hdr(&req.hdr, MANA_QUERY_GF_STAT,\n@@ -2908,52 +2909,52 @@ void mana_query_gf_stats(struct mana_port_context *apc)\n \t\t\tSTATISTICS_FLAGS_HC_TX_BCAST_BYTES |\n \t\t\tSTATISTICS_FLAGS_TX_ERRORS_GDMA_ERROR;\n \n-\terr = mana_send_request(apc->ac, &req, sizeof(req), &resp,\n+\terr = mana_send_request(ac, &req, sizeof(req), &resp,\n \t\t\t\tsizeof(resp));\n \tif (err) {\n-\t\tnetdev_err(ndev, \"Failed to query GF stats: %d\\n\", err);\n+\t\tdev_err(dev, \"Failed to query GF stats: %d\\n\", err);\n \t\treturn;\n \t}\n \terr = mana_verify_resp_hdr(&resp.hdr, MANA_QUERY_GF_STAT,\n \t\t\t\t sizeof(resp));\n \tif (err || resp.hdr.status) {\n-\t\tnetdev_err(ndev, \"Failed to query GF stats: %d, 0x%x\\n\", err,\n-\t\t\t resp.hdr.status);\n+\t\tdev_err(dev, \"Failed to query GF stats: %d, 0x%x\\n\", err,\n+\t\t\tresp.hdr.status);\n \t\treturn;\n \t}\n \n-\tapc->eth_stats.hc_rx_discards_no_wqe = resp.rx_discards_nowqe;\n-\tapc->eth_stats.hc_rx_err_vport_disabled = resp.rx_err_vport_disabled;\n-\tapc->eth_stats.hc_rx_bytes = resp.hc_rx_bytes;\n-\tapc->eth_stats.hc_rx_ucast_pkts = resp.hc_rx_ucast_pkts;\n-\tapc->eth_stats.hc_rx_ucast_bytes = resp.hc_rx_ucast_bytes;\n-\tapc->eth_stats.hc_rx_bcast_pkts = resp.hc_rx_bcast_pkts;\n-\tapc->eth_stats.hc_rx_bcast_bytes = resp.hc_rx_bcast_bytes;\n-\tapc->eth_stats.hc_rx_mcast_pkts = resp.hc_rx_mcast_pkts;\n-\tapc->eth_stats.hc_rx_mcast_bytes = resp.hc_rx_mcast_bytes;\n-\tapc->eth_stats.hc_tx_err_gf_disabled = resp.tx_err_gf_disabled;\n-\tapc->eth_stats.hc_tx_err_vport_disabled = resp.tx_err_vport_disabled;\n-\tapc->eth_stats.hc_tx_err_inval_vportoffset_pkt =\n+\tac->hc_stats.hc_rx_discards_no_wqe = resp.rx_discards_nowqe;\n+\tac->hc_stats.hc_rx_err_vport_disabled = resp.rx_err_vport_disabled;\n+\tac->hc_stats.hc_rx_bytes = resp.hc_rx_bytes;\n+\tac->hc_stats.hc_rx_ucast_pkts = resp.hc_rx_ucast_pkts;\n+\tac->hc_stats.hc_rx_ucast_bytes = resp.hc_rx_ucast_bytes;\n+\tac->hc_stats.hc_rx_bcast_pkts = resp.hc_rx_bcast_pkts;\n+\tac->hc_stats.hc_rx_bcast_bytes = resp.hc_rx_bcast_bytes;\n+\tac->hc_stats.hc_rx_mcast_pkts = resp.hc_rx_mcast_pkts;\n+\tac->hc_stats.hc_rx_mcast_bytes = resp.hc_rx_mcast_bytes;\n+\tac->hc_stats.hc_tx_err_gf_disabled = resp.tx_err_gf_disabled;\n+\tac->hc_stats.hc_tx_err_vport_disabled = resp.tx_err_vport_disabled;\n+\tac->hc_stats.hc_tx_err_inval_vportoffset_pkt =\n \t\t\t\t\t resp.tx_err_inval_vport_offset_pkt;\n-\tapc->eth_stats.hc_tx_err_vlan_enforcement =\n+\tac->hc_stats.hc_tx_err_vlan_enforcement =\n \t\t\t\t\t resp.tx_err_vlan_enforcement;\n-\tapc->eth_stats.hc_tx_err_eth_type_enforcement =\n+\tac->hc_stats.hc_tx_err_eth_type_enforcement =\n \t\t\t\t\t resp.tx_err_ethtype_enforcement;\n-\tapc->eth_stats.hc_tx_err_sa_enforcement = resp.tx_err_SA_enforcement;\n-\tapc->eth_stats.hc_tx_err_sqpdid_enforcement =\n+\tac->hc_stats.hc_tx_err_sa_enforcement = resp.tx_err_SA_enforcement;\n+\tac->hc_stats.hc_tx_err_sqpdid_enforcement =\n \t\t\t\t\t resp.tx_err_SQPDID_enforcement;\n-\tapc->eth_stats.hc_tx_err_cqpdid_enforcement =\n+\tac->hc_stats.hc_tx_err_cqpdid_enforcement =\n \t\t\t\t\t resp.tx_err_CQPDID_enforcement;\n-\tapc->eth_stats.hc_tx_err_mtu_violation = resp.tx_err_mtu_violation;\n-\tapc->eth_stats.hc_tx_err_inval_oob = resp.tx_err_inval_oob;\n-\tapc->eth_stats.hc_tx_bytes = resp.hc_tx_bytes;\n-\tapc->eth_stats.hc_tx_ucast_pkts = resp.hc_tx_ucast_pkts;\n-\tapc->eth_stats.hc_tx_ucast_bytes = resp.hc_tx_ucast_bytes;\n-\tapc->eth_stats.hc_tx_bcast_pkts = resp.hc_tx_bcast_pkts;\n-\tapc->eth_stats.hc_tx_bcast_bytes = resp.hc_tx_bcast_bytes;\n-\tapc->eth_stats.hc_tx_mcast_pkts = resp.hc_tx_mcast_pkts;\n-\tapc->eth_stats.hc_tx_mcast_bytes = resp.hc_tx_mcast_bytes;\n-\tapc->eth_stats.hc_tx_err_gdma = resp.tx_err_gdma;\n+\tac->hc_stats.hc_tx_err_mtu_violation = resp.tx_err_mtu_violation;\n+\tac->hc_stats.hc_tx_err_inval_oob = resp.tx_err_inval_oob;\n+\tac->hc_stats.hc_tx_bytes = resp.hc_tx_bytes;\n+\tac->hc_stats.hc_tx_ucast_pkts = resp.hc_tx_ucast_pkts;\n+\tac->hc_stats.hc_tx_ucast_bytes = resp.hc_tx_ucast_bytes;\n+\tac->hc_stats.hc_tx_bcast_pkts = resp.hc_tx_bcast_pkts;\n+\tac->hc_stats.hc_tx_bcast_bytes = resp.hc_tx_bcast_bytes;\n+\tac->hc_stats.hc_tx_mcast_pkts = resp.hc_tx_mcast_pkts;\n+\tac->hc_stats.hc_tx_mcast_bytes = resp.hc_tx_mcast_bytes;\n+\tac->hc_stats.hc_tx_err_gdma = resp.tx_err_gdma;\n }\n \n void mana_query_phy_stats(struct mana_port_context *apc)\ndiff --git a/drivers/net/ethernet/microsoft/mana/mana_ethtool.c b/drivers/net/ethernet/microsoft/mana/mana_ethtool.c\nindex a1afa75a9463..3dfd96146424 100644\n--- a/drivers/net/ethernet/microsoft/mana/mana_ethtool.c\n+++ b/drivers/net/ethernet/microsoft/mana/mana_ethtool.c\n@@ -15,66 +15,69 @@ struct mana_stats_desc {\n static const struct mana_stats_desc mana_eth_stats[] = {\n \t{\"stop_queue\", offsetof(struct mana_ethtool_stats, stop_queue)},\n \t{\"wake_queue\", offsetof(struct mana_ethtool_stats, wake_queue)},\n-\t{\"hc_rx_discards_no_wqe\", offsetof(struct mana_ethtool_stats,\n+\t{\"tx_cq_err\", offsetof(struct mana_ethtool_stats, tx_cqe_err)},\n+\t{\"tx_cqe_unknown_type\", offsetof(struct mana_ethtool_stats,\n+\t\t\t\t\ttx_cqe_unknown_type)},\n+\t{\"rx_coalesced_err\", offsetof(struct mana_ethtool_stats,\n+\t\t\t\t\trx_coalesced_err)},\n+\t{\"rx_cqe_unknown_type\", offsetof(struct mana_ethtool_stats,\n+\t\t\t\t\trx_cqe_unknown_type)},\n+};\n+\n+static const struct mana_stats_desc mana_hc_stats[] = {\n+\t{\"hc_rx_discards_no_wqe\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t hc_rx_discards_no_wqe)},\n-\t{\"hc_rx_err_vport_disabled\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_rx_err_vport_disabled\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t hc_rx_err_vport_disabled)},\n-\t{\"hc_rx_bytes\", offsetof(struct mana_ethtool_stats, hc_rx_bytes)},\n-\t{\"hc_rx_ucast_pkts\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_rx_bytes\", offsetof(struct mana_ethtool_hc_stats, hc_rx_bytes)},\n+\t{\"hc_rx_ucast_pkts\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t hc_rx_ucast_pkts)},\n-\t{\"hc_rx_ucast_bytes\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_rx_ucast_bytes\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t hc_rx_ucast_bytes)},\n-\t{\"hc_rx_bcast_pkts\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_rx_bcast_pkts\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t hc_rx_bcast_pkts)},\n-\t{\"hc_rx_bcast_bytes\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_rx_bcast_bytes\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t hc_rx_bcast_bytes)},\n-\t{\"hc_rx_mcast_pkts\", offsetof(struct mana_ethtool_stats,\n-\t\t\thc_rx_mcast_pkts)},\n-\t{\"hc_rx_mcast_bytes\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_rx_mcast_pkts\", offsetof(struct mana_ethtool_hc_stats,\n+\t\t\t\t hc_rx_mcast_pkts)},\n+\t{\"hc_rx_mcast_bytes\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t hc_rx_mcast_bytes)},\n-\t{\"hc_tx_err_gf_disabled\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_err_gf_disabled\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t hc_tx_err_gf_disabled)},\n-\t{\"hc_tx_err_vport_disabled\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_err_vport_disabled\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t hc_tx_err_vport_disabled)},\n \t{\"hc_tx_err_inval_vportoffset_pkt\",\n-\t offsetof(struct mana_ethtool_stats,\n+\t offsetof(struct mana_ethtool_hc_stats,\n \t\t hc_tx_err_inval_vportoffset_pkt)},\n-\t{\"hc_tx_err_vlan_enforcement\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_err_vlan_enforcement\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t\thc_tx_err_vlan_enforcement)},\n \t{\"hc_tx_err_eth_type_enforcement\",\n-\t offsetof(struct mana_ethtool_stats, hc_tx_err_eth_type_enforcement)},\n-\t{\"hc_tx_err_sa_enforcement\", offsetof(struct mana_ethtool_stats,\n+\t offsetof(struct mana_ethtool_hc_stats, hc_tx_err_eth_type_enforcement)},\n+\t{\"hc_tx_err_sa_enforcement\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t hc_tx_err_sa_enforcement)},\n \t{\"hc_tx_err_sqpdid_enforcement\",\n-\t offsetof(struct mana_ethtool_stats, hc_tx_err_sqpdid_enforcement)},\n+\t offsetof(struct mana_ethtool_hc_stats, hc_tx_err_sqpdid_enforcement)},\n \t{\"hc_tx_err_cqpdid_enforcement\",\n-\t offsetof(struct mana_ethtool_stats, hc_tx_err_cqpdid_enforcement)},\n-\t{\"hc_tx_err_mtu_violation\", offsetof(struct mana_ethtool_stats,\n+\t offsetof(struct mana_ethtool_hc_stats, hc_tx_err_cqpdid_enforcement)},\n+\t{\"hc_tx_err_mtu_violation\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t hc_tx_err_mtu_violation)},\n-\t{\"hc_tx_err_inval_oob\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_err_inval_oob\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\t hc_tx_err_inval_oob)},\n-\t{\"hc_tx_err_gdma\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_err_gdma\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t hc_tx_err_gdma)},\n-\t{\"hc_tx_bytes\", offsetof(struct mana_ethtool_stats, hc_tx_bytes)},\n-\t{\"hc_tx_ucast_pkts\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_bytes\", offsetof(struct mana_ethtool_hc_stats, hc_tx_bytes)},\n+\t{\"hc_tx_ucast_pkts\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\thc_tx_ucast_pkts)},\n-\t{\"hc_tx_ucast_bytes\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_ucast_bytes\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\thc_tx_ucast_bytes)},\n-\t{\"hc_tx_bcast_pkts\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_bcast_pkts\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\thc_tx_bcast_pkts)},\n-\t{\"hc_tx_bcast_bytes\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_bcast_bytes\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\thc_tx_bcast_bytes)},\n-\t{\"hc_tx_mcast_pkts\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_mcast_pkts\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\thc_tx_mcast_pkts)},\n-\t{\"hc_tx_mcast_bytes\", offsetof(struct mana_ethtool_stats,\n+\t{\"hc_tx_mcast_bytes\", offsetof(struct mana_ethtool_hc_stats,\n \t\t\t\t\thc_tx_mcast_bytes)},\n-\t{\"tx_cq_err\", offsetof(struct mana_ethtool_stats, tx_cqe_err)},\n-\t{\"tx_cqe_unknown_type\", offsetof(struct mana_ethtool_stats,\n-\t\t\t\t\ttx_cqe_unknown_type)},\n-\t{\"rx_coalesced_err\", offsetof(struct mana_ethtool_stats,\n-\t\t\t\t\trx_coalesced_err)},\n-\t{\"rx_cqe_unknown_type\", offsetof(struct mana_ethtool_stats,\n-\t\t\t\t\trx_cqe_unknown_type)},\n };\n \n static const struct mana_stats_desc mana_phy_stats[] = {\n@@ -138,7 +141,7 @@ static int mana_get_sset_count(struct net_device *ndev, int stringset)\n \tif (stringset != ETH_SS_STATS)\n \t\treturn -EINVAL;\n \n-\treturn ARRAY_SIZE(mana_eth_stats) + ARRAY_SIZE(mana_phy_stats) +\n+\treturn ARRAY_SIZE(mana_eth_stats) + ARRAY_SIZE(mana_phy_stats) + ARRAY_SIZE(mana_hc_stats) +\n \t\t\tnum_queues * (MANA_STATS_RX_COUNT + MANA_STATS_TX_COUNT);\n }\n \n@@ -150,10 +153,12 @@ static void mana_get_strings(struct net_device *ndev, u32 stringset, u8 *data)\n \n \tif (stringset != ETH_SS_STATS)\n \t\treturn;\n-\n \tfor (i = 0; i < ARRAY_SIZE(mana_eth_stats); i++)\n \t\tethtool_puts(&data, mana_eth_stats[i].name);\n \n+\tfor (i = 0; i < ARRAY_SIZE(mana_hc_stats); i++)\n+\t\tethtool_puts(&data, mana_hc_stats[i].name);\n+\n \tfor (i = 0; i < ARRAY_SIZE(mana_phy_stats); i++)\n \t\tethtool_puts(&data, mana_phy_stats[i].name);\n \n@@ -186,6 +191,7 @@ static void mana_get_ethtool_stats(struct net_device *ndev,\n \tstruct mana_port_context *apc = netdev_priv(ndev);\n \tunsigned int num_queues = apc->num_queues;\n \tvoid *eth_stats = &apc->eth_stats;\n+\tvoid *hc_stats = &apc->ac->hc_stats;\n \tvoid *phy_stats = &apc->phy_stats;\n \tstruct mana_stats_rx *rx_stats;\n \tstruct mana_stats_tx *tx_stats;\n@@ -208,7 +214,7 @@ static void mana_get_ethtool_stats(struct net_device *ndev,\n \tif (!apc->port_is_up)\n \t\treturn;\n \t/* we call mana function to update stats from GDMA */\n-\tmana_query_gf_stats(apc);\n+\tmana_query_gf_stats(apc->ac);\n \n \t/* We call this mana function to get the phy stats from GDMA and includes\n \t * aggregate tx/rx drop counters, Per-TC(Traffic Channel) tx/rx and pause\n@@ -219,6 +225,9 @@ static void mana_get_ethtool_stats(struct net_device *ndev,\n \tfor (q = 0; q < ARRAY_SIZE(mana_eth_stats); q++)\n \t\tdata[i++] = *(u64 *)(eth_stats + mana_eth_stats[q].offset);\n \n+\tfor (q = 0; q < ARRAY_SIZE(mana_hc_stats); q++)\n+\t\tdata[i++] = *(u64 *)(hc_stats + mana_hc_stats[q].offset);\n+\n \tfor (q = 0; q < ARRAY_SIZE(mana_phy_stats); q++)\n \t\tdata[i++] = *(u64 *)(phy_stats + mana_phy_stats[q].offset);\n \ndiff --git a/include/net/mana/mana.h b/include/net/mana/mana.h\nindex 729dda01680c..9d3dce07d020 100644\n--- a/include/net/mana/mana.h\n+++ b/include/net/mana/mana.h\n@@ -375,6 +375,13 @@ struct mana_tx_qp {\n struct mana_ethtool_stats {\n \tu64 stop_queue;\n \tu64 wake_queue;\n+\tu64 tx_cqe_err;\n+\tu64 tx_cqe_unknown_type;\n+\tu64 rx_coalesced_err;\n+\tu64 rx_cqe_unknown_type;\n+};\n+\n+struct mana_ethtool_hc_stats {\n \tu64 hc_rx_discards_no_wqe;\n \tu64 hc_rx_err_vport_disabled;\n \tu64 hc_rx_bytes;\n@@ -402,10 +409,6 @@ struct mana_ethtool_stats {\n \tu64 hc_tx_mcast_pkts;\n \tu64 hc_tx_mcast_bytes;\n \tu64 hc_tx_err_gdma;\n-\tu64 tx_cqe_err;\n-\tu64 tx_cqe_unknown_type;\n-\tu64 rx_coalesced_err;\n-\tu64 rx_cqe_unknown_type;\n };\n \n struct mana_ethtool_phy_stats {\n@@ -473,6 +476,7 @@ struct mana_context {\n \tu16 num_ports;\n \tu8 bm_hostmode;\n \n+\tstruct mana_ethtool_hc_stats hc_stats;\n \tstruct mana_eq *eqs;\n \tstruct dentry *mana_eqs_debugfs;\n \n@@ -580,7 +584,7 @@ u32 mana_run_xdp(struct net_device *ndev, struct mana_rxq *rxq,\n struct bpf_prog *mana_xdp_get(struct mana_port_context *apc);\n void mana_chn_setxdp(struct mana_port_context *apc, struct bpf_prog *prog);\n int mana_bpf(struct net_device *ndev, struct netdev_bpf *bpf);\n-void mana_query_gf_stats(struct mana_port_context *apc);\n+void mana_query_gf_stats(struct mana_context *ac);\n int mana_query_link_cfg(struct mana_port_context *apc);\n int mana_set_bw_clamp(struct mana_port_context *apc, u32 speed,\n \t\t int enable_clamping);\n", "prefixes": [ "SRU", "Q:linux-azure", "1/3" ] }