Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2018 15:05:57 +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-12@freebsd.org
Subject:   svn commit: r342311 - stable/12/sys/dev/sfxge/common
Message-ID:  <201812211505.wBLF5vHc036187@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Fri Dec 21 15:05:56 2018
New Revision: 342311
URL: https://svnweb.freebsd.org/changeset/base/342311

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/12/sys/dev/sfxge/common/ef10_ev.c
  stable/12/sys/dev/sfxge/common/ef10_rx.c
  stable/12/sys/dev/sfxge/common/ef10_tx.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/sfxge/common/ef10_ev.c
==============================================================================
--- stable/12/sys/dev/sfxge/common/ef10_ev.c	Fri Dec 21 15:05:01 2018	(r342310)
+++ stable/12/sys/dev/sfxge/common/ef10_ev.c	Fri Dec 21 15:05:56 2018	(r342311)
@@ -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/12/sys/dev/sfxge/common/ef10_rx.c
==============================================================================
--- stable/12/sys/dev/sfxge/common/ef10_rx.c	Fri Dec 21 15:05:01 2018	(r342310)
+++ stable/12/sys/dev/sfxge/common/ef10_rx.c	Fri Dec 21 15:05:56 2018	(r342311)
@@ -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/12/sys/dev/sfxge/common/ef10_tx.c
==============================================================================
--- stable/12/sys/dev/sfxge/common/ef10_tx.c	Fri Dec 21 15:05:01 2018	(r342310)
+++ stable/12/sys/dev/sfxge/common/ef10_tx.c	Fri Dec 21 15:05:56 2018	(r342311)
@@ -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?201812211505.wBLF5vHc036187>