Author: mw
Date: Thu May 30 13:13:15 2019
New Revision: 348390
URL: https://svnweb.freebsd.org/changeset/base/348390

Log:
  Trigger reset in ENA if there are too many Rx descriptors
  
  Whenever the driver will receive too many descriptors from the device,
  it should trigger the device reset, as it is indicating that the device
  is in invalid state.
  
  Submitted by:  Michal Krawczyk <m...@semihalf.com>
  Obtained from: Semihalf
  Sponsored by:  Amazon, Inc.

Modified:
  head/sys/dev/ena/ena.c

Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c      Thu May 30 13:12:14 2019        (r348389)
+++ head/sys/dev/ena/ena.c      Thu May 30 13:13:15 2019        (r348390)
@@ -1717,7 +1717,12 @@ ena_rx_cleanup(struct ena_ring *rx_ring)
 
 error:
        counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1);
-       return (RX_BUDGET - budget);
+
+       /* Too many desc from the device. Trigger reset */
+       adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS;
+       adapter->trigger_reset = true;
+
+       return (0);
 }
 
 /*********************************************************************
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to