strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
}
+static void netvsc_get_channels(struct net_device *net,
+ struct ethtool_channels *channel)
+{
+ struct net_device_context *net_device_ctx = netdev_priv(net);
+ struct hv_device *dev = net_device_ctx->device_ctx;
+ struct netvsc_device *nvdev = hv_get_drvdata(dev);
+
+ if (nvdev) {
+ channel->max_combined = nvdev->max_chn;
+ channel->combined_count = nvdev->num_chn;
+ }
+}
+
static int netvsc_change_mtu(struct net_device *ndev, int mtu)
{
struct net_device_context *ndevctx = netdev_priv(ndev);
static const struct ethtool_ops ethtool_ops = {
.get_drvinfo = netvsc_get_drvinfo,
.get_link = ethtool_op_get_link,
+ .get_channels = netvsc_get_channels,
};
static const struct net_device_ops device_ops = {
/* 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;
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)
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: