From: Jakub Kicinski <kuba@kernel.org>
To: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
decui@microsoft.com, andrew+netdev@lunn.ch, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, longli@microsoft.com,
kotaranov@microsoft.com, horms@kernel.org,
shradhagupta@linux.microsoft.com, ssengar@linux.microsoft.com,
dipayanroy@linux.microsoft.com, shirazsaleem@microsoft.com,
rosenp@gmail.com, linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rdma@vger.kernel.org
Subject: Re: [PATCH net-next v2 2/2] net: mana: Add standard counter rx_missed_errors
Date: Fri, 31 Oct 2025 16:17:23 -0700 [thread overview]
Message-ID: <20251031161723.057e4770@kernel.org> (raw)
In-Reply-To: <1761734272-32055-3-git-send-email-ernis@linux.microsoft.com>
On Wed, 29 Oct 2025 03:37:52 -0700 Erni Sri Satya Vennela wrote:
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 009e869ef296..48df44889f05 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -494,6 +494,11 @@ static void mana_get_stats64(struct net_device *ndev,
>
> netdev_stats_to_stats64(st, &ndev->stats);
>
> + if (apc->ac->hwc_timeout_occurred)
> + netdev_warn_once(ndev, "HWC timeout occurred\n");
I don't think there's much value in this print.
> +#define MANA_GF_STATS_PERIOD (2 * HZ)
> +
> +static void mana_gf_stats_work_handler(struct work_struct *work)
> +{
> + struct mana_context *ac =
> + container_of(to_delayed_work(work), struct mana_context, gf_stats_work);
> + int err;
> +
> + err = mana_query_gf_stats(ac);
> + if (err == -ETIMEDOUT) {
> + /* HWC timeout detected - reset stats and stop rescheduling */
> + ac->hwc_timeout_occurred = true;
> + memset(&ac->hc_stats, 0, sizeof(ac->hc_stats));
Not sure I've seen another device using this approach but I can't
really tell what's the best strategy. The device is unusable if it
can't provide stats..
> + return;
> + }
> + queue_delayed_work(ac->gf_stats_wq, &ac->gf_stats_work, MANA_GF_STATS_PERIOD);
> +}
> +
> int mana_probe(struct gdma_dev *gd, bool resuming)
> {
> struct gdma_context *gc = gd->gdma_context;
> @@ -3478,6 +3503,15 @@ int mana_probe(struct gdma_dev *gd, bool resuming)
> }
>
> err = add_adev(gd, "eth");
> + ac->gf_stats_wq = create_singlethread_workqueue("mana_gf_stats");
Why are you creating a workqueue? You can use system queues.
> + queue_delayed_work(ac->gf_stats_wq, &ac->gf_stats_work, MANA_GF_STATS_PERIOD);
ls wrap long lines at 80 chars.
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_ethtool.c b/drivers/net/ethernet/microsoft/mana/mana_ethtool.c
> index 3dfd96146424..99e811208683 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_ethtool.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_ethtool.c
> @@ -213,8 +213,6 @@ static void mana_get_ethtool_stats(struct net_device *ndev,
>
> if (!apc->port_is_up)
> return;
> - /* we call mana function to update stats from GDMA */
> - mana_query_gf_stats(apc->ac);
Why delete this? We can get fresh stats for the user in this context.
next prev parent reply other threads:[~2025-10-31 23:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 10:37 [PATCH net-next v2 0/2] net: mana: Refactor GF stats handling and add rx_missed_errors counter Erni Sri Satya Vennela
2025-10-29 10:37 ` [PATCH net-next v2 1/2] net: mana: Refactor GF stats to use global mana_context Erni Sri Satya Vennela
2025-10-31 23:06 ` Jakub Kicinski
2025-11-11 4:01 ` Erni Sri Satya Vennela
2025-10-29 10:37 ` [PATCH net-next v2 2/2] net: mana: Add standard counter rx_missed_errors Erni Sri Satya Vennela
2025-10-31 23:17 ` Jakub Kicinski [this message]
2025-11-11 4:03 ` Erni Sri Satya Vennela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251031161723.057e4770@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=dipayanroy@linux.microsoft.com \
--cc=edumazet@google.com \
--cc=ernis@linux.microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=horms@kernel.org \
--cc=kotaranov@microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=longli@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rosenp@gmail.com \
--cc=shirazsaleem@microsoft.com \
--cc=shradhagupta@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=wei.liu@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.