From: Jakub Kicinski <kuba@kernel.org>
To: Lee Trager <lee@trager.us>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
alexanderduyck@fb.com, jacob.e.keller@intel.com
Subject: Re: [PATCH net-next v2 8/9] eth: fbnic: report FW uptime in health diagnose
Date: Mon, 15 Sep 2025 18:56:54 -0700 [thread overview]
Message-ID: <20250915185654.26097169@kernel.org> (raw)
In-Reply-To: <1f99551f-5037-4670-9c2d-a4ce4d5c017e@trager.us>
On Mon, 15 Sep 2025 18:35:40 -0700 Lee Trager wrote:
> > Statistics
> > ----------
> > diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_devlink.c b/drivers/net/ethernet/meta/fbnic/fbnic_devlink.c
> > index 0e8920685da6..f3f3585c0aac 100644
> > --- a/drivers/net/ethernet/meta/fbnic/fbnic_devlink.c
> > +++ b/drivers/net/ethernet/meta/fbnic/fbnic_devlink.c
> > @@ -487,6 +487,18 @@ static int fbnic_fw_reporter_dump(struct devlink_health_reporter *reporter,
> > return err;
> > }
> >
> > +static int
> > +fbnic_fw_reporter_diagnose(struct devlink_health_reporter *reporter,
> > + struct devlink_fmsg *fmsg,
> > + struct netlink_ext_ack *extack)
> > +{
> > + struct fbnic_dev *fbd = devlink_health_reporter_priv(reporter);
> > +
> > + devlink_fmsg_u32_pair_put(fmsg, "FW uptime", fbd->firmware_time);
>
> I originally added fbd->firmware_time as part of the implementation for
> logging support in D51521853. The original idea was to correlate
> firmware logs to host time. This proved to be difficult. Instead I used
> firmware time to detect firmware crashes in D52065019. Time is to set 0
> when fbnic_fw_log_write() is called in fbnic_devlink_fw_report() because
> we don't know the actual time firmware crashed.
I don't see this in my series.
> fbd->firmware_time is
> only updated with the heartbeat is received. When a crash occurs
> fbd->firmware_time is reset once firmware comes back up. Ignoring the
> crash case this should be something like fbd->firmware_time + (jiffies -
> fbd->last_heartbeat_req) * 1000.
I don't understand what you're getting at, TBH.
> Another issue is your using a u32 for fbd->firmware_time which is u64.
> Firmware returns its time by calling k_uptime_get()[1] which returns an
> s64 as its the firmware uptime in milliseconds.
Ah, good point.
> We also don't use firmware time in its raw integer form anywhere in the
> driver or firmware. Its very hard to read FBNIC_FW_LOG_FMT has the
> format used in the driver which is based on what Zephyr uses[2].
>
> IMO this doesn't really have a use case and I would just drop it.
Knowing FW uptime is very useful in multi-host systems.
NIC get into bad state and digging up when the last NIC power cycle
happened from orchestration datasets is a PITA.
next prev parent reply other threads:[~2025-09-16 1:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-15 15:53 [PATCH net-next v2 0/9] eth: fbnic: add devlink health support for FW crashes and OTP mem corruptions Jakub Kicinski
2025-09-15 15:53 ` [PATCH net-next v2 1/9] eth: fbnic: make fbnic_fw_log_write() parameter const Jakub Kicinski
2025-09-16 12:31 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 2/9] eth: fbnic: use fw uptime to detect fw crashes Jakub Kicinski
2025-09-16 12:34 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 3/9] eth: fbnic: factor out clearing the action TCAM Jakub Kicinski
2025-09-16 12:35 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 4/9] eth: fbnic: reprogram TCAMs after FW crash Jakub Kicinski
2025-09-16 12:36 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 5/9] eth: fbnic: support allocating FW completions with extra space Jakub Kicinski
2025-09-16 12:36 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 6/9] eth: fbnic: support FW communication for core dump Jakub Kicinski
2025-09-16 12:36 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 7/9] eth: fbnic: add FW health reporter Jakub Kicinski
2025-09-16 12:36 ` Simon Horman
2025-09-15 15:53 ` [PATCH net-next v2 8/9] eth: fbnic: report FW uptime in health diagnose Jakub Kicinski
2025-09-16 1:35 ` Lee Trager
2025-09-16 1:56 ` Jakub Kicinski [this message]
2025-09-15 15:53 ` [PATCH net-next v2 9/9] eth: fbnic: add OTP health reporter Jakub Kicinski
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=20250915185654.26097169@kernel.org \
--to=kuba@kernel.org \
--cc=alexanderduyck@fb.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jacob.e.keller@intel.com \
--cc=lee@trager.us \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).