summaryrefslogtreecommitdiffstats
path: root/drivers/net/hyperv/netvsc.c
diff options
context:
space:
mode:
authorKY Srinivasan <kys@microsoft.com>2015-12-01 16:43:05 -0800
committerDavid S. Miller <davem@davemloft.net>2015-12-02 23:43:23 -0500
commit25b85ee890530f70de850f15660ed41abbee1172 (patch)
tree27954fac1344d32af5311ee4ba994565b3ab309f /drivers/net/hyperv/netvsc.c
parent934d202255ecd03d1f48b1031a2e03cb647e73d9 (diff)
downloadop-kernel-dev-25b85ee890530f70de850f15660ed41abbee1172.zip
op-kernel-dev-25b85ee890530f70de850f15660ed41abbee1172.tar.gz
hv_netvsc: Eliminate the channel field in hv_netvsc_packet structure
Eliminate the channel field in hv_netvsc_packet structure. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/hyperv/netvsc.c')
-rw-r--r--drivers/net/hyperv/netvsc.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 51e4c0f..52533ed 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -610,6 +610,7 @@ static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
}
static void netvsc_send_completion(struct netvsc_device *net_device,
+ struct vmbus_channel *incoming_channel,
struct hv_device *device,
struct vmpacket_descriptor *packet)
{
@@ -651,7 +652,7 @@ static void netvsc_send_completion(struct netvsc_device *net_device,
if (send_index != NETVSC_INVALID_INDEX)
netvsc_free_send_slot(net_device, send_index);
q_idx = nvsc_packet->q_idx;
- channel = nvsc_packet->channel;
+ channel = incoming_channel;
nvsc_packet->send_completion(nvsc_packet->
send_completion_ctx);
}
@@ -748,7 +749,7 @@ static inline int netvsc_send_pkt(
struct netvsc_device *net_device)
{
struct nvsp_message nvmsg;
- struct vmbus_channel *out_channel = packet->channel;
+ struct vmbus_channel *out_channel = get_channel(packet, net_device);
u16 q_idx = packet->q_idx;
struct net_device *ndev = net_device->ndev;
u64 req_id;
@@ -857,13 +858,9 @@ int netvsc_send(struct hv_device *device,
if (!net_device)
return -ENODEV;
- out_channel = net_device->chn_table[q_idx];
- if (!out_channel) {
- out_channel = device->channel;
- q_idx = 0;
- packet->q_idx = 0;
- }
- packet->channel = out_channel;
+ out_channel = get_channel(packet, net_device);
+ q_idx = packet->q_idx;
+
packet->send_buf_index = NETVSC_INVALID_INDEX;
packet->cp_partial = false;
@@ -1043,7 +1040,6 @@ static void netvsc_receive(struct netvsc_device *net_device,
}
count = vmxferpage_packet->range_cnt;
- netvsc_packet->channel = channel;
/* Each range represents 1 RNDIS pkt that contains 1 ethernet frame */
for (i = 0; i < count; i++) {
@@ -1055,7 +1051,7 @@ static void netvsc_receive(struct netvsc_device *net_device,
vmxferpage_packet->ranges[i].byte_count;
/* Pass it to the upper layer */
- rndis_filter_receive(device, netvsc_packet);
+ rndis_filter_receive(device, netvsc_packet, channel);
if (netvsc_packet->status != NVSP_STAT_SUCCESS)
status = NVSP_STAT_FAIL;
@@ -1150,6 +1146,7 @@ void netvsc_channel_cb(void *context)
switch (desc->type) {
case VM_PKT_COMP:
netvsc_send_completion(net_device,
+ channel,
device, desc);
break;
OpenPOWER on IntegriCloud