lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240601160410.GR491852@kernel.org>
Date: Sat, 1 Jun 2024 17:04:10 +0100
From: Simon Horman <horms@...nel.org>
To: Vadim Fedorenko <vadfed@...a.com>
Cc: Michael Chan <michael.chan@...adcom.com>,
	Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
	"David S. Miller" <davem@...emloft.net>,
	Jakub Kicinski <kuba@...nel.org>,
	Richard Cochran <richardcochran@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2] bnxt_en: add timestamping statistics support

On Thu, May 30, 2024 at 01:47:51PM -0700, Vadim Fedorenko wrote:
> The ethtool_ts_stats structure was introduced earlier this year. Now
> it's time to support this group of counters in more drivers.
> This patch adds support to bnxt driver.
> 
> Signed-off-by: Vadim Fedorenko <vadfed@...a.com>

...

> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> index 8763f8a01457..bf157f6cc042 100644
> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
> @@ -5233,6 +5233,19 @@ static void bnxt_get_rmon_stats(struct net_device *dev,
>  	*ranges = bnxt_rmon_ranges;
>  }
>  
> +static void bnxt_get_ptp_stats(struct net_device *dev,
> +			       struct ethtool_ts_stats *ts_stats)
> +{
> +	struct bnxt *bp = netdev_priv(dev);
> +	struct bnxt_ptp_cfg *ptp = bp->ptp_cfg;

Hi Vadim,

If you need to update this patch for some other reason,
please consider arranging these local variables in
reverse xmas tree order - longest line to shortest.

In this case I think that would mean separating
the declaration and assignment of ptp, like this
(completely untested!):

	struct bnxt *bp = netdev_priv(dev);
	struct bnxt_ptp_cfg *ptp;

	ptp = bp->ptp_cfg;

Edward Cree's tool can be helpful here:
https://github.com/ecree-solarflare/xmastree

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ