Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Nov 2018 10:20:08 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340815 - head/sys/dev/sfxge/common
Message-ID:  <201811231020.wANAK8ok031477@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Fri Nov 23 10:20:08 2018
New Revision: 340815
URL: https://svnweb.freebsd.org/changeset/base/340815

Log:
  sfxge(4): simplify verify result handling
  
  Simplify verify result handling in NVRAM update finish
  
  Submitted by:   Andy Moreton <amoreton at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18085

Modified:
  head/sys/dev/sfxge/common/efx_nvram.c

Modified: head/sys/dev/sfxge/common/efx_nvram.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_nvram.c	Fri Nov 23 10:19:57 2018	(r340814)
+++ head/sys/dev/sfxge/common/efx_nvram.c	Fri Nov 23 10:20:08 2018	(r340815)
@@ -949,24 +949,23 @@ efx_mcdi_nvram_update_finish(
 		goto fail1;
 	}
 
-	if (encp->enc_fw_verified_nvram_update_required == B_FALSE) {
-		/* Report success if verified updates are not supported. */
-		result = MC_CMD_NVRAM_VERIFY_RC_SUCCESS;
-	} else {
-		/* Firmware-verified NVRAM updates are required */
-		if (req.emr_out_length_used <
-		    MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) {
+	if (req.emr_out_length_used < MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) {
+		result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN;
+		if (encp->enc_fw_verified_nvram_update_required) {
+			/* Mandatory verification result is missing */
 			rc = EMSGSIZE;
 			goto fail2;
 		}
+	} else {
 		result =
 		    MCDI_OUT_DWORD(req, NVRAM_UPDATE_FINISH_V2_OUT_RESULT_CODE);
+	}
 
-		if (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS) {
-			/* Mandatory verification failed */
-			rc = EINVAL;
-			goto fail3;
-		}
+	if ((encp->enc_fw_verified_nvram_update_required) &&
+	    (result != MC_CMD_NVRAM_VERIFY_RC_SUCCESS)) {
+		/* Mandatory verification failed */
+		rc = EINVAL;
+		goto fail3;
 	}
 
 	if (resultp != NULL)



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