Re: [igb] add DROP_EN to each RX queue config if TX flow control is disabled

2014-09-14 Thread Adrian Chadd
On 13 September 2014 13:09, Eric Joyner ricer...@gmail.com wrote:
 This looks good to me. The only comment I have is that according to the I350
 datasheet, DROP_EN is already set on all the queues but 0 by default, but I
 haven't checked for the other adapters covered by igb.

Right, but the igb_initialize_receive_units() function actually
overrides the queue SRRCTL; it doesn't do a read-modify-write of what
the initial defaults are.


-a
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


Re: [igb] add DROP_EN to each RX queue config if TX flow control is disabled

2014-09-13 Thread Eric Joyner
This looks good to me. The only comment I have is that according to the
I350 datasheet, DROP_EN is already set on all the queues but 0 by default,
but I haven't checked for the other adapters covered by igb.

---
- Eric Joyner

On Mon, Sep 8, 2014 at 10:12 PM, Adrian Chadd adr...@freebsd.org wrote:

 Hi,

 This patch enables the DROP_EN flag to each RX queue if TX flow
 control is disabled. It (mostly) mirrors what the ixgbe driver does.

 This prevents a single full RX ring from stalling the rest of the RX rings.

 How's it look? (indenting and such aside, thanks google.)



 -a

 Index: sys/dev/e1000/if_igb.c
 ===
 --- sys/dev/e1000/if_igb.c (revision 271290)
 +++ sys/dev/e1000/if_igb.c (working copy)
 @@ -4712,6 +4712,18 @@
   rctl |= E1000_RCTL_SZ_2048;
   }

 + /*
 + * If TX flow control is disabled and there's 1 queue defined,
 + * enable DROP.
 + *
 + * This drops frames rather than hanging the RX MAC for all queues.
 + */
 + if ((adapter-num_queues  1) 
 + (adapter-fc == e1000_fc_none ||
 + adapter-fc == e1000_fc_rx_pause)) {
 +srrctl |= E1000_SRRCTL_DROP_EN;
 + }
 +
   /* Setup the Base and Length of the Rx Descriptor Rings */
   for (int i = 0; i  adapter-num_queues; i++, rxr++) {
   u64 bus_addr = rxr-rxdma.dma_paddr;
 @@ -6255,6 +6267,7 @@

   adapter-hw.fc.current_mode = adapter-hw.fc.requested_mode;
   e1000_force_mac_fc(adapter-hw);
 + /* XXX TODO: update DROP_EN on each RX queue if appropriate */
   return (error);
  }
 ___
 freebsd-net@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-net
 To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org

___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org


[igb] add DROP_EN to each RX queue config if TX flow control is disabled

2014-09-08 Thread Adrian Chadd
Hi,

This patch enables the DROP_EN flag to each RX queue if TX flow
control is disabled. It (mostly) mirrors what the ixgbe driver does.

This prevents a single full RX ring from stalling the rest of the RX rings.

How's it look? (indenting and such aside, thanks google.)



-a

Index: sys/dev/e1000/if_igb.c
===
--- sys/dev/e1000/if_igb.c (revision 271290)
+++ sys/dev/e1000/if_igb.c (working copy)
@@ -4712,6 +4712,18 @@
  rctl |= E1000_RCTL_SZ_2048;
  }

+ /*
+ * If TX flow control is disabled and there's 1 queue defined,
+ * enable DROP.
+ *
+ * This drops frames rather than hanging the RX MAC for all queues.
+ */
+ if ((adapter-num_queues  1) 
+ (adapter-fc == e1000_fc_none ||
+ adapter-fc == e1000_fc_rx_pause)) {
+srrctl |= E1000_SRRCTL_DROP_EN;
+ }
+
  /* Setup the Base and Length of the Rx Descriptor Rings */
  for (int i = 0; i  adapter-num_queues; i++, rxr++) {
  u64 bus_addr = rxr-rxdma.dma_paddr;
@@ -6255,6 +6267,7 @@

  adapter-hw.fc.current_mode = adapter-hw.fc.requested_mode;
  e1000_force_mac_fc(adapter-hw);
+ /* XXX TODO: update DROP_EN on each RX queue if appropriate */
  return (error);
 }
___
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to freebsd-net-unsubscr...@freebsd.org