Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit7b2ee50

Browse files
shemmingerdavem330
authored andcommitted
hv_netvsc: common detach logic
Make common function for detaching internals of deviceduring changes to MTU and RSS. Make sure no more packetsare transmitted and all packets have been received beforedoing device teardown.Change the wait logic to be common and use usleep_range().Changes transmit enabling logic so that transmit queues are disabledduring the period when lower device is being changed. And enabledonly after sub channels are setup. This avoids issue where it couldbe that a packet was being sent while subchannel was not initialized.Fixes:8195b13 ("hv_netvsc: fix deadlock on hotplug")Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent0ef58b0 commit7b2ee50

File tree

4 files changed

+173
-143
lines changed

4 files changed

+173
-143
lines changed

‎drivers/net/hyperv/hyperv_net.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ void netvsc_channel_cb(void *context);
212212
intnetvsc_poll(structnapi_struct*napi,intbudget);
213213

214214
voidrndis_set_subchannel(structwork_struct*w);
215-
boolrndis_filter_opened(conststructnetvsc_device*nvdev);
216215
intrndis_filter_open(structnetvsc_device*nvdev);
217216
intrndis_filter_close(structnetvsc_device*nvdev);
218217
structnetvsc_device*rndis_filter_device_add(structhv_device*dev,

‎drivers/net/hyperv/netvsc.c‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,6 @@ void netvsc_device_remove(struct hv_device *device)
555555
=rtnl_dereference(net_device_ctx->nvdev);
556556
inti;
557557

558-
cancel_work_sync(&net_device->subchan_work);
559-
560558
netvsc_revoke_buf(device,net_device);
561559

562560
RCU_INIT_POINTER(net_device_ctx->nvdev,NULL);
@@ -643,14 +641,18 @@ static void netvsc_send_tx_complete(struct netvsc_device *net_device,
643641
queue_sends=
644642
atomic_dec_return(&net_device->chan_table[q_idx].queue_sends);
645643

646-
if (net_device->destroy&&queue_sends==0)
647-
wake_up(&net_device->wait_drain);
644+
if (unlikely(net_device->destroy)) {
645+
if (queue_sends==0)
646+
wake_up(&net_device->wait_drain);
647+
}else {
648+
structnetdev_queue*txq=netdev_get_tx_queue(ndev,q_idx);
648649

649-
if (netif_tx_queue_stopped(netdev_get_tx_queue(ndev,q_idx))&&
650-
(hv_ringbuf_avail_percent(&channel->outbound)>RING_AVAIL_PERCENT_HIWATER||
651-
queue_sends<1)) {
652-
netif_tx_wake_queue(netdev_get_tx_queue(ndev,q_idx));
653-
ndev_ctx->eth_stats.wake_queue++;
650+
if (netif_tx_queue_stopped(txq)&&
651+
(hv_ringbuf_avail_percent(&channel->outbound)>RING_AVAIL_PERCENT_HIWATER||
652+
queue_sends<1)) {
653+
netif_tx_wake_queue(txq);
654+
ndev_ctx->eth_stats.wake_queue++;
655+
}
654656
}
655657
}
656658

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp