Commit c116004d authored by David S. Miller's avatar David S. Miller

Merge branch 'hv_netvsc-Add-init-of-send-table-and-var-renames'

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 5dc87425 6b0cbe31
......@@ -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;
......
......@@ -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
......
......@@ -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) {
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment