Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2019 13:13:15 +0000 (UTC)
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r348390 - head/sys/dev/ena
Message-ID:  <201905301313.x4UDDFrs060862@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <mk@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);
 }
 
 /*********************************************************************



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905301313.x4UDDFrs060862>