mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-31 23:27:20 +00:00

The driver supports many hw statistics. This patch supports dump statistics through ethtool_ops and ndo.get_stats64(). The type of hw statistics register is u32, To prevent the statistics register from overflowing, the driver dump the statistics every 30 seconds. in a scheduled task. Signed-off-by: Jijie Shao <shaojijie@huawei.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
16 lines
469 B
C
16 lines
469 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/* Copyright (c) 2024 Hisilicon Limited. */
|
|
|
|
#ifndef __HBG_ETHTOOL_H
|
|
#define __HBG_ETHTOOL_H
|
|
|
|
#include <linux/netdevice.h>
|
|
|
|
#define HBG_STATS_FIELD_OFF(f) (offsetof(struct hbg_stats, f))
|
|
#define HBG_STATS_R(p, offset) (*(u64 *)((u8 *)(p) + (offset)))
|
|
#define HBG_STATS_U(p, offset, val) (HBG_STATS_R(p, offset) += (val))
|
|
|
|
void hbg_ethtool_set_ops(struct net_device *netdev);
|
|
void hbg_update_stats(struct hbg_priv *priv);
|
|
|
|
#endif
|