[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200911155827.373fcfb2@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Fri, 11 Sep 2020 15:58:27 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Michael Chan <michael.chan@...adcom.com>
Cc: David Miller <davem@...emloft.net>,
Netdev <netdev@...r.kernel.org>, mkubecek@...e.cz,
tariqt@...dia.com, saeedm@...dia.com,
Alexander Duyck <alexander.duyck@...il.com>,
Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH net-next 5/8] bnxt: add pause frame stats
On Fri, 11 Sep 2020 15:53:24 -0700 Michael Chan wrote:
> > > This will work, but the types on the 2 sides don't match. On the
> > > right hand side, since you are casting to the hardware struct
> > > rx_port_stats and tx_port_stats, the types are __le64.
> > >
> > > If rx_stats and tx_stats are *u64 and you use these macros:
> > >
> > > BNXT_GET_RX_PORT_STATS64(rx_stats, rx_pause_frames)
> > > BNXT_GET_TX_PORT_STATS64(tx_stats, tx_pause_frames)
> > >
> > > the results will be the same with native CPU u64 types.
> >
> > Thanks! My build bot just poked me about this as well.
> >
> > I don't see any byte swaps in bnxt_get_ethtool_stats() -
> > are they not needed there? I'm slightly confused.
>
> No, swapping is not needed since we are referencing the sw_stats.
> Every counter has already been swapped when we did the copy and
> overflow check from the hw struct to sw_stats. sw_stats is exactly
> the same as the hw struct except that every counter is already swapped
> into native CPU u64 and properly adjusted for overflow.
I see, I'll change the pointer types to u64 * as well. Thanks!
Powered by blists - more mailing lists