All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v2] xen-netback: Fix vif->disable handling
@ 2014-08-07 12:38 Zoltan Kiss
  0 siblings, 0 replies; 4+ messages in thread
From: Zoltan Kiss @ 2014-08-07 12:38 UTC (permalink / raw)
  To: Wei Liu, Ian Campbell
  Cc: netdev, xen-devel, David Vrabel, Zoltan Kiss, linux-kernel

In the patch called "xen-netback: Turn off the carrier if the guest is not able
to receive" new branches were introduced to this if statement, risking that a
queue with non-zero id can reenable the disabled interface.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org
---
v2: fix a code style error in this "if" as well

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index aa20933..4734472 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -2025,9 +2025,15 @@ int xenvif_kthread_guest_rx(void *data)
 		 * context so we defer it here, if this thread is
 		 * associated with queue 0.
 		 */
-		if (unlikely(queue->vif->disabled && queue->id == 0))
+		if (unlikely(queue->vif->disabled && queue->id == 0)) {
 			xenvif_carrier_off(queue->vif);
-		else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT,
+		} else if (unlikely(queue->vif->disabled)) {
+			/* kthread_stop() would be called upon this thread soon,
+			 * be a bit proactive
+			 */
+			skb_queue_purge(&queue->rx_queue);
+			queue->rx_last_skb_slots = 0;
+		} else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT,
 						     &queue->status))) {
 			xenvif_rx_purge_event(queue);
 		} else if (!netif_carrier_ok(queue->vif->dev)) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] xen-netback: Fix vif->disable handling
  2014-08-07 12:38 Zoltan Kiss
  2014-08-07 23:04 ` David Miller
@ 2014-08-07 23:04 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-08-07 23:04 UTC (permalink / raw)
  To: zoltan.kiss
  Cc: wei.liu2, Ian.Campbell, david.vrabel, netdev, linux-kernel, xen-devel

From: Zoltan Kiss <zoltan.kiss@citrix.com>
Date: Thu, 7 Aug 2014 13:38:38 +0100

> In the patch called "xen-netback: Turn off the carrier if the guest is not able
> to receive" new branches were introduced to this if statement, risking that a
> queue with non-zero id can reenable the disabled interface.
> 
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: xen-devel@lists.xenproject.org
> ---
> v2: fix a code style error in this "if" as well

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] xen-netback: Fix vif->disable handling
  2014-08-07 12:38 Zoltan Kiss
@ 2014-08-07 23:04 ` David Miller
  2014-08-07 23:04 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2014-08-07 23:04 UTC (permalink / raw)
  To: zoltan.kiss
  Cc: wei.liu2, Ian.Campbell, netdev, linux-kernel, david.vrabel, xen-devel

From: Zoltan Kiss <zoltan.kiss@citrix.com>
Date: Thu, 7 Aug 2014 13:38:38 +0100

> In the patch called "xen-netback: Turn off the carrier if the guest is not able
> to receive" new branches were introduced to this if statement, risking that a
> queue with non-zero id can reenable the disabled interface.
> 
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: xen-devel@lists.xenproject.org
> ---
> v2: fix a code style error in this "if" as well

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next v2] xen-netback: Fix vif->disable handling
@ 2014-08-07 12:38 Zoltan Kiss
  2014-08-07 23:04 ` David Miller
  2014-08-07 23:04 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Zoltan Kiss @ 2014-08-07 12:38 UTC (permalink / raw)
  To: Wei Liu, Ian Campbell
  Cc: Zoltan Kiss, David Vrabel, netdev, linux-kernel, xen-devel

In the patch called "xen-netback: Turn off the carrier if the guest is not able
to receive" new branches were introduced to this if statement, risking that a
queue with non-zero id can reenable the disabled interface.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org
---
v2: fix a code style error in this "if" as well

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index aa20933..4734472 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -2025,9 +2025,15 @@ int xenvif_kthread_guest_rx(void *data)
 		 * context so we defer it here, if this thread is
 		 * associated with queue 0.
 		 */
-		if (unlikely(queue->vif->disabled && queue->id == 0))
+		if (unlikely(queue->vif->disabled && queue->id == 0)) {
 			xenvif_carrier_off(queue->vif);
-		else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT,
+		} else if (unlikely(queue->vif->disabled)) {
+			/* kthread_stop() would be called upon this thread soon,
+			 * be a bit proactive
+			 */
+			skb_queue_purge(&queue->rx_queue);
+			queue->rx_last_skb_slots = 0;
+		} else if (unlikely(test_and_clear_bit(QUEUE_STATUS_RX_PURGE_EVENT,
 						     &queue->status))) {
 			xenvif_rx_purge_event(queue);
 		} else if (!netif_carrier_ok(queue->vif->dev)) {

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-07 23:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-07 12:38 [PATCH net-next v2] xen-netback: Fix vif->disable handling Zoltan Kiss
2014-08-07 12:38 Zoltan Kiss
2014-08-07 23:04 ` David Miller
2014-08-07 23:04 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.