提交 31cd840e 编写于 作者: S Shannon Nelson 提交者: Jeff Kirsher

i40e: remove hardcode of stats struct size in ethtool

Base the queue stats length on the queue stats struct rather than
assuming it is 2 fields.  This is in prep for adding data fields
which are configuration dependent.

Change-ID: I937f471f389d2e0f8cec733960c5d9a06b14f3ec
Signed-off-by: NShannon Nelson <shannon.nelson@intel.com>
Tested-by: NKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 32f5f54a
......@@ -122,8 +122,9 @@ static struct i40e_stats i40e_gstrings_stats[] = {
};
#define I40E_QUEUE_STATS_LEN(n) \
((((struct i40e_netdev_priv *)netdev_priv((n)))->vsi->num_queue_pairs + \
((struct i40e_netdev_priv *)netdev_priv((n)))->vsi->num_queue_pairs) * 2)
(((struct i40e_netdev_priv *)netdev_priv((n)))->vsi->num_queue_pairs \
* 2 /* Tx and Rx together */ \
* (sizeof(struct i40e_queue_stats) / sizeof(u64)))
#define I40E_GLOBAL_STATS_LEN ARRAY_SIZE(i40e_gstrings_stats)
#define I40E_NETDEV_STATS_LEN ARRAY_SIZE(i40e_gstrings_net_stats)
#define I40E_VSI_STATS_LEN(n) (I40E_NETDEV_STATS_LEN + \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册