aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/rndis_filter.c
diff options
context:
space:
mode:
authorAndrew Schwartzmeyer <andrew@schwartzmeyer.com>2015-02-26 16:27:14 -0800
committerDavid S. Miller <davem@davemloft.net>2015-02-28 16:51:36 -0500
commit59995370dbca7636c105ddadc0447fab86ad3887 (patch)
tree99f9469b129665f94333926f397f4288bf1aacbf /drivers/net/hyperv/rndis_filter.c
parentMerge branch 'tcp-tso' (diff)
downloadlinux-dev-59995370dbca7636c105ddadc0447fab86ad3887.tar.xz
linux-dev-59995370dbca7636c105ddadc0447fab86ad3887.zip
hyperv: Implement netvsc_get_channels() ethool op
This adds support for reporting the actual and maximum combined channels count of the hv_netvsc driver via 'ethtool --show-channels'. This required adding 'max_chn' to 'struct netvsc_device', and assigning it 'rsscap.num_recv_que' in 'rndis_filter_device_add'. Now we can access the combined maximum channel count via 'struct netvsc_device' in the ethtool callback. Signed-off-by: Andrew Schwartzmeyer <andrew@schwartzmeyer.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/hyperv/rndis_filter.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
index 7816d98bdddc..ca81de04bc76 100644
--- a/drivers/net/hyperv/rndis_filter.c
+++ b/drivers/net/hyperv/rndis_filter.c
@@ -1027,6 +1027,7 @@ int rndis_filter_device_add(struct hv_device *dev,
/* Initialize the rndis device */
net_device = hv_get_drvdata(dev);
+ net_device->max_chn = 1;
net_device->num_chn = 1;
net_device->extension = rndis_device;
@@ -1094,6 +1095,7 @@ int rndis_filter_device_add(struct hv_device *dev,
if (ret || rsscap.num_recv_que < 2)
goto out;
+ net_device->max_chn = rsscap.num_recv_que;
net_device->num_chn = (num_online_cpus() < rsscap.num_recv_que) ?
num_online_cpus() : rsscap.num_recv_que;
if (net_device->num_chn == 1)
@@ -1140,8 +1142,10 @@ int rndis_filter_device_add(struct hv_device *dev,
ret = rndis_filter_set_rss_param(rndis_device, net_device->num_chn);
out:
- if (ret)
+ if (ret) {
+ net_device->max_chn = 1;
net_device->num_chn = 1;
+ }
return 0; /* return 0 because primary channel can be used alone */
err_dev_remv: