diff options
author | Chi Song <chisong@linux.microsoft.com> | 2020-07-23 21:14:26 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-24 15:18:33 -0700 |
commit | 4a062d66b5a532a9da9bdae643e498b035173794 (patch) | |
tree | 1fcf3a026227d72a2821c02c10650817033e23fc /drivers/net/hyperv | |
parent | 1b6687e31a2df9fbdb12d25c1d1d372777bf96a8 (diff) | |
download | linux-4a062d66b5a532a9da9bdae643e498b035173794.tar.bz2 |
net: hyperv: dump TX indirection table to ethtool regs
An imbalanced TX indirection table causes netvsc to have low
performance. This table is created and managed during runtime. To help
better diagnose performance issues caused by imbalanced tables, it needs
make TX indirection tables visible.
Because TX indirection table is driver specified information, so
display it via ethtool register dump.
Signed-off-by: Chi Song <chisong@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv')
-rw-r--r-- | drivers/net/hyperv/netvsc_drv.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index e0327b88732c..d27b90b4e2bb 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c @@ -1958,6 +1958,23 @@ syncvf: return ret; } +static int netvsc_get_regs_len(struct net_device *netdev) +{ + return VRSS_SEND_TAB_SIZE * sizeof(u32); +} + +static void netvsc_get_regs(struct net_device *netdev, + struct ethtool_regs *regs, void *p) +{ + struct net_device_context *ndc = netdev_priv(netdev); + u32 *regs_buff = p; + + /* increase the version, if buffer format is changed. */ + regs->version = 1; + + memcpy(regs_buff, ndc->tx_table, VRSS_SEND_TAB_SIZE * sizeof(u32)); +} + static u32 netvsc_get_msglevel(struct net_device *ndev) { struct net_device_context *ndev_ctx = netdev_priv(ndev); @@ -1974,6 +1991,8 @@ static void netvsc_set_msglevel(struct net_device *ndev, u32 val) static const struct ethtool_ops ethtool_ops = { .get_drvinfo = netvsc_get_drvinfo, + .get_regs_len = netvsc_get_regs_len, + .get_regs = netvsc_get_regs, .get_msglevel = netvsc_get_msglevel, .set_msglevel = netvsc_set_msglevel, .get_link = ethtool_op_get_link, |