mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-20 11:34:02 +08:00
bnxt: add pause frame stats
These stats are already reported in ethtool -S. Michael confirms they are equivalent to standard stats. v2: - fix sparse warning about endian by using the macro - use u64 for pointer type Signed-off-by: Jakub Kicinski <kuba@kernel.org> Reviewed-by: Saeed Mahameed <saeedm@nvidia.com> Reviewed-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
242aaf03dc
commit
423cffcf6c
@ -1778,6 +1778,22 @@ static void bnxt_get_pauseparam(struct net_device *dev,
|
||||
epause->tx_pause = !!(link_info->req_flow_ctrl & BNXT_LINK_PAUSE_TX);
|
||||
}
|
||||
|
||||
static void bnxt_get_pause_stats(struct net_device *dev,
|
||||
struct ethtool_pause_stats *epstat)
|
||||
{
|
||||
struct bnxt *bp = netdev_priv(dev);
|
||||
u64 *rx, *tx;
|
||||
|
||||
if (BNXT_VF(bp) || !(bp->flags & BNXT_FLAG_PORT_STATS))
|
||||
return;
|
||||
|
||||
rx = bp->port_stats.sw_stats;
|
||||
tx = bp->port_stats.sw_stats + BNXT_TX_PORT_STATS_BYTE_OFFSET / 8;
|
||||
|
||||
epstat->rx_pause_frames = BNXT_GET_RX_PORT_STATS64(rx, rx_pause_frames);
|
||||
epstat->tx_pause_frames = BNXT_GET_TX_PORT_STATS64(tx, tx_pause_frames);
|
||||
}
|
||||
|
||||
static int bnxt_set_pauseparam(struct net_device *dev,
|
||||
struct ethtool_pauseparam *epause)
|
||||
{
|
||||
@ -3645,6 +3661,7 @@ const struct ethtool_ops bnxt_ethtool_ops = {
|
||||
ETHTOOL_COALESCE_USE_ADAPTIVE_RX,
|
||||
.get_link_ksettings = bnxt_get_link_ksettings,
|
||||
.set_link_ksettings = bnxt_set_link_ksettings,
|
||||
.get_pause_stats = bnxt_get_pause_stats,
|
||||
.get_pauseparam = bnxt_get_pauseparam,
|
||||
.set_pauseparam = bnxt_set_pauseparam,
|
||||
.get_drvinfo = bnxt_get_drvinfo,
|
||||
|
Loading…
Reference in New Issue
Block a user