Skip to content

Commit 57ffee7

Browse files
IronShendavem330
authored andcommitted
net: hns3: Fix an error macro definition of HNS3_TQP_STAT
The member "stats_offset" was designed to indicate the offset of each member of struct ring_stats in struct hns3_enet_ring, but forgot to add the offset of the member in struct ring_stats. Fixes: 496d03e ("net: hns3: Add Ethtool support to HNS3 driver") Signed-off-by: Jian Shen <[email protected]> Signed-off-by: Peng Li <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 94bfaaf commit 57ffee7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ struct hns3_stats {
2323
#define HNS3_TQP_STAT(_string, _member) { \
2424
.stats_string = _string, \
2525
.stats_size = FIELD_SIZEOF(struct ring_stats, _member), \
26-
.stats_offset = offsetof(struct hns3_enet_ring, stats), \
26+
.stats_offset = offsetof(struct hns3_enet_ring, stats) +\
27+
offsetof(struct ring_stats, _member), \
2728
} \
2829

2930
static const struct hns3_stats hns3_txq_stats[] = {

0 commit comments

Comments
 (0)