hv_netvsc: Fix the list processing for network change event
Subsystems (3)
Haiyang Zhang
maintainerPATCH 1/1 hv_netvsc: Fix the list processing for network change event
RNDIS_STATUS_NETWORK_CHANGE event is handled as two "half events" -- media disconnect & connect. The second half should be added to the list head, not to the tail. So all events are processed in normal order.
--- drivers/net/hyperv/netvsc_drv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/hyperv/netvsc_drv.c +1 -1
@@ -1125,7 +1125,7 @@ static void netvsc_link_change(struct work_struct *w)netif_tx_stop_all_queues (net); event->event =RNDIS_STATUS_MEDIA_CONNECT ;spin_lock_irqsave (&ndev_ctx->lock, flags); -list_add_tail (&event->list, &ndev_ctx->reconfig_events); +list_add (&event->list, &ndev_ctx->reconfig_events);spin_unlock_irqrestore (&ndev_ctx->lock, flags); reschedule = true; }
Signature · 1 line
1.7.4.1
Quoted 4 lines · Haiyang Zhang
RNDIS_STATUS_NETWORK_CHANGEevent is handled as two "half events" -- media disconnect & connect. The second half should be added to the list head, not to the tail. So all events are processed in normal order.
Thanks,
this matters when we get some other events in between these two halves.
Quoted 19 lines
Signed-off-by Haiyang Zhang <[email protected]>Reviewed-by K. Y. Srinivasan <[email protected]>--- drivers/net/hyperv/netvsc_drv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/net/hyperv/netvsc_drv.c +1
-1@@ -1125,7 +1125,7 @@ static void netvsc_link_change(struct work_struct *w)netif_tx_stop_all_queues (net); event->event =RNDIS_STATUS_MEDIA_CONNECT ;spin_lock_irqsave (&ndev_ctx->lock, flags); -list_add_tail (&event->list, &ndev_ctx->reconfig_events); +list_add (&event->list, &ndev_ctx->reconfig_events);spin_unlock_irqrestore (&ndev_ctx->lock, flags); reschedule = true; }
Signature · 1 line
Vitaly
From: Haiyang Zhang <[email protected]>
Date: Thu, 21 Apr 2016 16:13:01 -0700
Quoted 6 lines
RNDIS_STATUS_NETWORK_CHANGEevent is handled as two "half events" -- media disconnect & connect. The second half should be added to the list head, not to the tail. So all events are processed in normal order.Signed-off-by Haiyang Zhang <[email protected]>Reviewed-by K. Y. Srinivasan <[email protected]>
Applied, thanks.