Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Dec 2018 06:50:13 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r342412 - stable/11/sys/dev/sfxge/common
Message-ID:  <201812250650.wBP6oD8c023412@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Tue Dec 25 06:50:13 2018
New Revision: 342412
URL: https://svnweb.freebsd.org/changeset/base/342412

Log:
  MFC r340800
  
  sfxge(4): let caller know that queue is already flushed
  
  Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or
  MC reboot. Caller needs to know that the queue is already flushed to
  avoid waiting for flush done event.
  
  Submitted by:   Andy Moreton <amoreton at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18070

Modified:
  stable/11/sys/dev/sfxge/common/ef10_ev.c
  stable/11/sys/dev/sfxge/common/ef10_rx.c
  stable/11/sys/dev/sfxge/common/ef10_tx.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/sfxge/common/ef10_ev.c
==============================================================================
--- stable/11/sys/dev/sfxge/common/ef10_ev.c	Tue Dec 25 06:49:10 2018	(r342411)
+++ stable/11/sys/dev/sfxge/common/ef10_ev.c	Tue Dec 25 06:50:13 2018	(r342412)
@@ -434,7 +434,12 @@ efx_mcdi_fini_evq(
 	return (0);
 
 fail1:
-	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+	/*
+	 * EALREADY is not an error, but indicates that the MC has rebooted and
+	 * that the EVQ has already been destroyed.
+	 */
+	if (rc != EALREADY)
+		EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
 	return (rc);
 }

Modified: stable/11/sys/dev/sfxge/common/ef10_rx.c
==============================================================================
--- stable/11/sys/dev/sfxge/common/ef10_rx.c	Tue Dec 25 06:49:10 2018	(r342411)
+++ stable/11/sys/dev/sfxge/common/ef10_rx.c	Tue Dec 25 06:50:13 2018	(r342412)
@@ -130,7 +130,7 @@ efx_mcdi_fini_rxq(
 
 	efx_mcdi_execute_quiet(enp, &req);
 
-	if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+	if (req.emr_rc != 0) {
 		rc = req.emr_rc;
 		goto fail1;
 	}
@@ -138,7 +138,12 @@ efx_mcdi_fini_rxq(
 	return (0);
 
 fail1:
-	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+	/*
+	 * EALREADY is not an error, but indicates that the MC has rebooted and
+	 * that the RXQ has already been destroyed.
+	 */
+	if (rc != EALREADY)
+		EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
 	return (rc);
 }
@@ -720,7 +725,14 @@ ef10_rx_qflush(
 	return (0);
 
 fail1:
-	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+	/*
+	 * EALREADY is not an error, but indicates that the MC has rebooted and
+	 * that the RXQ has already been destroyed. Callers need to know that
+	 * the RXQ flush has completed to avoid waiting until timeout for a
+	 * flush done event that will not be delivered.
+	 */
+	if (rc != EALREADY)
+		EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
 	return (rc);
 }

Modified: stable/11/sys/dev/sfxge/common/ef10_tx.c
==============================================================================
--- stable/11/sys/dev/sfxge/common/ef10_tx.c	Tue Dec 25 06:49:10 2018	(r342411)
+++ stable/11/sys/dev/sfxge/common/ef10_tx.c	Tue Dec 25 06:50:13 2018	(r342412)
@@ -151,7 +151,7 @@ efx_mcdi_fini_txq(
 
 	efx_mcdi_execute_quiet(enp, &req);
 
-	if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) {
+	if (req.emr_rc != 0) {
 		rc = req.emr_rc;
 		goto fail1;
 	}
@@ -159,7 +159,12 @@ efx_mcdi_fini_txq(
 	return (0);
 
 fail1:
-	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+	/*
+	 * EALREADY is not an error, but indicates that the MC has rebooted and
+	 * that the TXQ has already been destroyed.
+	 */
+	if (rc != EALREADY)
+		EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
 	return (rc);
 }
@@ -690,7 +695,14 @@ ef10_tx_qpace(
 	return (0);
 
 fail1:
-	EFSYS_PROBE1(fail1, efx_rc_t, rc);
+	/*
+	 * EALREADY is not an error, but indicates that the MC has rebooted and
+	 * that the TXQ has already been destroyed. Callers need to know that
+	 * the TXQ flush has completed to avoid waiting until timeout for a
+	 * flush done event that will not be delivered.
+	 */
+	if (rc != EALREADY)
+		EFSYS_PROBE1(fail1, efx_rc_t, rc);
 
 	return (rc);
 }



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