hyperv/hn: Remove the useless num_outstanding_sends
We rely on taskqueue draining now. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5456
This commit is contained in:
parent
3f919777b6
commit
c10a0b9e69
@ -117,7 +117,7 @@ hv_nv_get_inbound_net_device(struct hv_device *device)
|
||||
* permit incoming packets if and only if there
|
||||
* are outstanding sends.
|
||||
*/
|
||||
if (net_dev->destroy && net_dev->num_outstanding_sends == 0) {
|
||||
if (net_dev->destroy) {
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -723,11 +723,6 @@ hv_nv_on_device_remove(struct hv_device *device, boolean_t destroy_channel)
|
||||
/* Stop outbound traffic ie sends and receives completions */
|
||||
net_dev->destroy = TRUE;
|
||||
|
||||
/* Wait for all send completions */
|
||||
while (net_dev->num_outstanding_sends) {
|
||||
DELAY(100);
|
||||
}
|
||||
|
||||
hv_nv_disconnect_from_vsp(net_dev);
|
||||
|
||||
/* At this point, no one should be accessing net_dev except in here */
|
||||
@ -805,8 +800,6 @@ hv_nv_on_send_completion(netvsc_dev *net_dev,
|
||||
net_vsc_pkt->compl.send.send_completion_context);
|
||||
|
||||
}
|
||||
|
||||
atomic_subtract_int(&net_dev->num_outstanding_sends, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -818,14 +811,9 @@ hv_nv_on_send_completion(netvsc_dev *net_dev,
|
||||
int
|
||||
hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt)
|
||||
{
|
||||
netvsc_dev *net_dev;
|
||||
nvsp_msg send_msg;
|
||||
int ret;
|
||||
|
||||
net_dev = hv_nv_get_outbound_net_device(device);
|
||||
if (!net_dev)
|
||||
return (ENODEV);
|
||||
|
||||
send_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt;
|
||||
if (pkt->is_data_pkt) {
|
||||
/* 0 is RMC_DATA */
|
||||
@ -851,10 +839,6 @@ hv_nv_on_send(struct hv_device *device, netvsc_packet *pkt)
|
||||
HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
|
||||
}
|
||||
|
||||
/* Record outstanding send only if send_packet() succeeded */
|
||||
if (ret == 0)
|
||||
atomic_add_int(&net_dev->num_outstanding_sends, 1);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
@ -893,7 +893,6 @@ typedef struct nvsp_msg_ {
|
||||
*/
|
||||
typedef struct netvsc_dev_ {
|
||||
struct hv_device *dev;
|
||||
int num_outstanding_sends;
|
||||
|
||||
/* Send buffer allocated by us but manages by NetVSP */
|
||||
void *send_buf;
|
||||
|
Loading…
x
Reference in New Issue
Block a user