[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200717104348.epj54vr3evmullol@liuwe-devbox-debian-v2>
Date: Fri, 17 Jul 2020 10:43:48 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Chi Song <Song.Chi@...rosoft.com>
Cc: KY Srinivasan <kys@...rosoft.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>
Subject: Re: [PATCH net-next] net: hyperv: Add attributes to show RX/TX
indirection table
Hi Chi
Thanks for your patch. A few things need to be fixed before it can be
accepted upstream.
On Fri, Jul 17, 2020 at 06:04:31AM +0000, Chi Song wrote:
> The network is observed with low performance, if TX indirection table
> is imbalance. But the table is in memory and set in runtime, it's
> hard to know. Add them to attributes can help on troubleshooting.
Missing Signed-off-by here. I assume you wrote this patch so please add
Signed-off-by: Chi Song <song.chi@...rosoft.com>
If there are other authors, please add their SoBs too.
Please wrap the commit message to around 72 to 80 columns wide.
I notice you only talked about TX table but in the code your also added
support for RX table.
I would also suggest changing the commit message a bit to:
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, add
device attributes to show the content of TX and RX indirection tables.
Perhaps RX table causes low performance as well? If so, the above
message needs further adjustment to account for that too.
I will leave reviewing the code to Haiyang and Stephen.
Wei.
> ---
> drivers/net/hyperv/netvsc_drv.c | 46 +++++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
> index 6267f706e8ee..cd6fe96e10c1 100644
> --- a/drivers/net/hyperv/netvsc_drv.c
> +++ b/drivers/net/hyperv/netvsc_drv.c
> @@ -2370,6 +2370,51 @@ static int netvsc_unregister_vf(struct net_device *vf_netdev)
> return NOTIFY_OK;
> }
>
> +static ssize_t tx_indirection_table_show(struct device *dev,
> + struct device_attribute *dev_attr,
> + char *buf)
> +{
> + struct net_device *ndev = to_net_dev(dev);
> + struct net_device_context *ndc = netdev_priv(ndev);
> + int i = 0;
> + ssize_t offset = 0;
> +
> + for (i = 0; i < VRSS_SEND_TAB_SIZE; i++)
> + offset += sprintf(buf + offset, "%u ", ndc->tx_table[i]);
> + buf[offset - 1] = '\n';
> +
> + return offset;
> +}
> +static DEVICE_ATTR_RO(tx_indirection_table);
> +
> +static ssize_t rx_indirection_table_show(struct device *dev,
> + struct device_attribute *dev_attr,
> + char *buf)
> +{
> + struct net_device *ndev = to_net_dev(dev);
> + struct net_device_context *ndc = netdev_priv(ndev);
> + int i = 0;
> + ssize_t offset = 0;
> +
> + for (i = 0; i < ITAB_NUM; i++)
> + offset += sprintf(buf + offset, "%u ", ndc->rx_table[i]);
> + buf[offset - 1] = '\n';
> +
> + return offset;
> +}
> +static DEVICE_ATTR_RO(rx_indirection_table);
> +
> +static struct attribute *netvsc_dev_attrs[] = {
> + &dev_attr_tx_indirection_table.attr,
> + &dev_attr_rx_indirection_table.attr,
> + NULL
> +};
> +
> +const struct attribute_group netvsc_dev_group = {
> + .name = NULL,
> + .attrs = netvsc_dev_attrs,
> +};
> +
> static int netvsc_probe(struct hv_device *dev,
> const struct hv_vmbus_device_id *dev_id)
> {
> @@ -2410,6 +2455,7 @@ static int netvsc_probe(struct hv_device *dev,
>
> net->netdev_ops = &device_ops;
> net->ethtool_ops = ðtool_ops;
> + net->sysfs_groups[0] = &netvsc_dev_group;
> SET_NETDEV_DEV(net, &dev->device);
>
> /* We always need headroom for rndis header */
> --
> 2.25.1
Powered by blists - more mailing lists