Commit c8b1ee95 authored by Vitaly Kuznetsov's avatar Vitaly Kuznetsov Committed by Kamal Mostafa

hv_netvsc: move subchannel existence check to netvsc_select_queue()

BugLink: http://bugs.launchpad.net/bugs/1583357Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
(cherry picked from commit 8b9fbe1a)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
Acked-by: default avatarBrad Figg <brad.figg@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 9a1c5125
......@@ -1272,19 +1272,4 @@ struct rndis_message {
#define TRANSPORT_INFO_IPV6_TCP ((INFO_IPV6 << 16) | INFO_TCP)
#define TRANSPORT_INFO_IPV6_UDP ((INFO_IPV6 << 16) | INFO_UDP)
static inline struct vmbus_channel *get_channel(struct hv_netvsc_packet *packet,
struct netvsc_device *net_device)
{
struct vmbus_channel *out_channel;
out_channel = net_device->chn_table[packet->q_idx];
if (!out_channel) {
out_channel = net_device->dev->channel;
packet->q_idx = 0;
}
return out_channel;
}
#endif /* _HYPERV_NET_H */
......@@ -749,8 +749,8 @@ static inline int netvsc_send_pkt(
struct netvsc_device *net_device)
{
struct nvsp_message nvmsg;
struct vmbus_channel *out_channel = get_channel(packet, net_device);
u16 q_idx = packet->q_idx;
struct vmbus_channel *out_channel = net_device->chn_table[q_idx];
struct net_device *ndev = net_device->ndev;
u64 req_id;
int ret;
......@@ -859,8 +859,7 @@ int netvsc_send(struct hv_device *device,
if (!net_device)
return -ENODEV;
out_channel = get_channel(packet, net_device);
q_idx = packet->q_idx;
out_channel = net_device->chn_table[q_idx];
packet->send_buf_index = NETVSC_INVALID_INDEX;
packet->cp_partial = false;
......
......@@ -217,6 +217,9 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb,
q_idx = nvsc_dev->send_table[hash % VRSS_SEND_TAB_SIZE] %
ndev->real_num_tx_queues;
if (!nvsc_dev->chn_table[q_idx])
q_idx = 0;
return q_idx;
}
......
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