]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'hv_netvsc-Add-init-of-send-table-and-var-renames'
authorDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2017 01:42:56 +0000 (18:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Oct 2017 01:42:56 +0000 (18:42 -0700)
Haiyang Zhang says:

====================
hv_netvsc: Add init of send table and var renames

Add initialization of send indirection table. Otherwise it may contain
old info of previous device with different number of channels.

Also, did some variable renaming for easier reading.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/netvsc_drv.c
drivers/net/hyperv/rndis_filter.c

index a81335e8ebe89befd6db53a925a6b9ba0f5f1275..4958bb6b737672405f60abbfc830e202f63f1c42 100644 (file)
@@ -179,7 +179,7 @@ struct rndis_device {
 
        u8 hw_mac_adr[ETH_ALEN];
        u8 rss_key[NETVSC_HASH_KEYLEN];
-       u16 ind_table[ITAB_NUM];
+       u16 rx_table[ITAB_NUM];
 };
 
 
@@ -731,7 +731,7 @@ struct net_device_context {
 
        u32 tx_checksum_mask;
 
-       u32 tx_send_table[VRSS_SEND_TAB_SIZE];
+       u32 tx_table[VRSS_SEND_TAB_SIZE];
 
        /* Ethtool settings */
        u8 duplex;
index 6e5194916bbeed86dc3052f7ebd55f5b297a5cd3..5bb6a20072dd724beab2c8f22f458d01018fc3d5 100644 (file)
@@ -1110,7 +1110,7 @@ static void netvsc_send_table(struct hv_device *hdev,
                      nvmsg->msg.v5_msg.send_table.offset);
 
        for (i = 0; i < count; i++)
-               net_device_ctx->tx_send_table[i] = tab[i];
+               net_device_ctx->tx_table[i] = tab[i];
 }
 
 static void netvsc_send_vf(struct net_device_context *net_device_ctx,
@@ -1255,6 +1255,9 @@ struct netvsc_device *netvsc_device_add(struct hv_device *device,
        if (!net_device)
                return ERR_PTR(-ENOMEM);
 
+       for (i = 0; i < VRSS_SEND_TAB_SIZE; i++)
+               net_device_ctx->tx_table[i] = 0;
+
        net_device->ring_size = ring_size;
 
        /* Because the device uses NAPI, all the interrupt batching and
index 44746de3dd4ca3238f1572fcdace0891b31d2264..da216ca4f2b231b2483a47c0fc249e4b0c529831 100644 (file)
@@ -252,8 +252,8 @@ static inline int netvsc_get_tx_queue(struct net_device *ndev,
        struct sock *sk = skb->sk;
        int q_idx;
 
-       q_idx = ndc->tx_send_table[netvsc_get_hash(skb, ndc) &
-                                  (VRSS_SEND_TAB_SIZE - 1)];
+       q_idx = ndc->tx_table[netvsc_get_hash(skb, ndc) &
+                             (VRSS_SEND_TAB_SIZE - 1)];
 
        /* If queue index changed record the new value */
        if (q_idx != old_idx &&
@@ -1434,7 +1434,7 @@ static int netvsc_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
        rndis_dev = ndev->extension;
        if (indir) {
                for (i = 0; i < ITAB_NUM; i++)
-                       indir[i] = rndis_dev->ind_table[i];
+                       indir[i] = rndis_dev->rx_table[i];
        }
 
        if (key)
@@ -1464,7 +1464,7 @@ static int netvsc_set_rxfh(struct net_device *dev, const u32 *indir,
                                return -EINVAL;
 
                for (i = 0; i < ITAB_NUM; i++)
-                       rndis_dev->ind_table[i] = indir[i];
+                       rndis_dev->rx_table[i] = indir[i];
        }
 
        if (!key) {
index 065b204d8e17f6bde17be931ff8d1758f529e6cc..addf9f69c58c4712d6c0962daca6c598e0bc6f23 100644 (file)
@@ -759,7 +759,7 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev,
        /* Set indirection table entries */
        itab = (u32 *)(rssp + 1);
        for (i = 0; i < ITAB_NUM; i++)
-               itab[i] = rdev->ind_table[i];
+               itab[i] = rdev->rx_table[i];
 
        /* Set hask key values */
        keyp = (u8 *)((unsigned long)rssp + rssp->kashkey_offset);
@@ -1284,8 +1284,8 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
        net_device->num_chn = min(net_device->max_chn, device_info->num_chn);
 
        for (i = 0; i < ITAB_NUM; i++)
-               rndis_device->ind_table[i] = ethtool_rxfh_indir_default(i,
-                                                       net_device->num_chn);
+               rndis_device->rx_table[i] = ethtool_rxfh_indir_default(
+                                               i, net_device->num_chn);
 
        atomic_set(&net_device->open_chn, 1);
        vmbus_set_sc_create_callback(dev->channel, netvsc_sc_open);