Thread (18 messages) flat view 18 messages, 3 authors, 2014-08-08

Re: [PATCH net-next 1/2] xen-netback: Using a new state bit instead of carrier

From: Zoltan Kiss <hidden>
Date: 2014-08-06 18:25:08
Also in: lkml

On 05/08/14 13:45, Wei Liu wrote:
On Mon, Aug 04, 2014 at 04:20:57PM +0100, Zoltan Kiss wrote:
quoted
This patch introduces a new state bit VIF_STATUS_CONNECTED to track whether the
vif is in a connected state. Using carrier will not work with the next patch
in this series, which aims to turn the carrier temporarily off if the guest
doesn't seem to be able to receive packets.

Signed-off-by: Zoltan Kiss <redacted>
Signed-off-by: David Vrabel <redacted>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: xen-devel@lists.xenproject.org

v2:
- rename the bitshift type to "enum state_bit_shift" here, not in the next patch
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 28c9822..4a92fc1 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -198,6 +198,11 @@ struct xenvif_queue { /* Per-queue data for xenvif */
  	struct xenvif_stats stats;
  };

+enum state_bit_shift {
+	/* This bit marks that the vif is connected */
+	VIF_STATUS_CONNECTED
This bit shift applies to vif.  In the following patch you introduce two
more bits specifically for queues. IMHO we should avoid mixing things
up. What about having two enums

   enum vif_state_bit_shift {}
   enum queue_state_bit_shift {}
I think it would be a bit overdoing it, this enum type is never used in 
declaration.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help