hyperv: Remove useless channel inbound_lock

It serves no purpose.

Reviewed by:	Hongjiang Zhang <honzhan microsoft com>
MFC after:	1 week
Sponsored by:	Microsoft OSTC
Differential Revision:	https://reviews.freebsd.org/D5450
This commit is contained in:
Sepherosa Ziehau 2016-02-26 09:17:31 +00:00
parent 3b654e081a
commit a14df6ad64
5 changed files with 0 additions and 23 deletions

View File

@ -753,8 +753,6 @@ typedef struct hv_vmbus_channel {
*/
hv_vmbus_ring_buffer_info inbound;
struct mtx inbound_lock;
struct taskqueue * rxq;
struct task channel_task;
hv_vmbus_pfn_channel_callback on_channel_callback;

View File

@ -720,9 +720,7 @@ hv_nv_on_device_remove(struct hv_device *device, boolean_t destroy_channel)
netvsc_dev *net_dev = sc->net_dev;;
/* Stop outbound traffic ie sends and receives completions */
mtx_lock(&device->channel->inbound_lock);
net_dev->destroy = TRUE;
mtx_unlock(&device->channel->inbound_lock);
/* Wait for all send completions */
while (net_dev->num_outstanding_sends) {

View File

@ -1153,9 +1153,7 @@ storvsc_detach(device_t dev)
struct hv_sgl_node *sgl_node = NULL;
int j = 0;
mtx_lock(&hv_device->channel->inbound_lock);
sc->hs_destroy = TRUE;
mtx_unlock(&hv_device->channel->inbound_lock);
/*
* At this point, all outbound traffic should be disabled. We

View File

@ -537,13 +537,7 @@ hv_vmbus_channel_close_internal(hv_vmbus_channel *channel)
*/
channel->rxq = NULL;
taskqueue_drain(rxq, &channel->channel_task);
/*
* Grab the lock to prevent race condition when a packet received
* and unloading driver is in the process.
*/
mtx_lock(&channel->inbound_lock);
channel->on_channel_callback = NULL;
mtx_unlock(&channel->inbound_lock);
/**
* Send a closing message
@ -920,12 +914,6 @@ VmbusProcessChannelEvent(void* context, int pending)
* callback to NULL. This closes the window.
*/
/*
* Disable the lock due to newly added WITNESS check in r277723.
* Will seek other way to avoid race condition.
* -- whu
*/
// mtx_lock(&channel->inbound_lock);
if (channel->on_channel_callback != NULL) {
arg = channel->channel_callback_context;
is_batched_reading = channel->batched_reading;
@ -952,5 +940,4 @@ VmbusProcessChannelEvent(void* context, int pending)
bytes_to_read = 0;
} while (is_batched_reading && (bytes_to_read != 0));
}
// mtx_unlock(&channel->inbound_lock);
}

View File

@ -140,9 +140,7 @@ hv_vmbus_allocate_channel(void)
M_DEVBUF,
M_WAITOK | M_ZERO);
mtx_init(&channel->inbound_lock, "channel inbound", NULL, MTX_DEF);
mtx_init(&channel->sc_lock, "vmbus multi channel", NULL, MTX_DEF);
TAILQ_INIT(&channel->sc_list_anchor);
return (channel);
@ -155,8 +153,6 @@ void
hv_vmbus_free_vmbus_channel(hv_vmbus_channel* channel)
{
mtx_destroy(&channel->sc_lock);
mtx_destroy(&channel->inbound_lock);
free(channel, M_DEVBUF);
}