hv_netvsc: Cleanup the test for freeing skb when we use sendbuf mechanism
[deliverable/linux.git] / drivers / net / hyperv / netvsc_drv.c
index 15d82eda0baf4141465addd6207c6202f09f2543..75beb89aac9c68310f215ffea3faf1a7d41f9cac 100644 (file)
@@ -234,11 +234,10 @@ static void netvsc_xmit_completion(void *context)
        struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
        struct sk_buff *skb = (struct sk_buff *)
                (unsigned long)packet->send_completion_tid;
-       u32 index = packet->send_buf_index;
 
        kfree(packet);
 
-       if (skb && (index == NETVSC_INVALID_INDEX))
+       if (skb)
                dev_kfree_skb_any(skb);
 }
 
@@ -413,6 +412,8 @@ static int netvsc_start_xmit(struct sk_buff *skb, struct net_device *net)
                return NETDEV_TX_OK;
        }
 
+       packet->xmit_more = skb->xmit_more;
+
        packet->vlan_tci = skb->vlan_tci;
 
        packet->q_idx = skb_get_queue_mapping(skb);
@@ -687,6 +688,19 @@ static void netvsc_get_drvinfo(struct net_device *net,
        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);
@@ -760,6 +774,7 @@ static void netvsc_poll_controller(struct net_device *net)
 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 = {
This page took 0.026988 seconds and 5 git commands to generate.