svn commit: r296088 - head/sys/dev/hyperv/netvsc
Sepherosa Ziehau
sephe at FreeBSD.org
Fri Feb 26 09:45:50 UTC 2016
Author: sephe
Date: Fri Feb 26 09:45:48 2016
New Revision: 296088
URL: https://svnweb.freebsd.org/changeset/base/296088
Log:
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
Modified:
head/sys/dev/hyperv/netvsc/hv_net_vsc.c
head/sys/dev/hyperv/netvsc/hv_net_vsc.h
Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:41:00 2016 (r296087)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Feb 26 09:45:48 2016 (r296088)
@@ -117,7 +117,7 @@ hv_nv_get_inbound_net_device(struct hv_d
* 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
/* 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
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
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,
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);
}
Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:41:00 2016 (r296087)
+++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Feb 26 09:45:48 2016 (r296088)
@@ -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;
More information about the svn-src-head
mailing list