svn commit: r247851 - stable/8/sys/dev/mxge

Andrew Gallatin gallatin at FreeBSD.org
Tue Mar 5 17:46:13 UTC 2013


Author: gallatin
Date: Tue Mar  5 17:46:12 2013
New Revision: 247851
URL: http://svnweb.freebsd.org/changeset/base/247851

Log:
  MFC r247159
    Improvements for newer mxge nics:
  
    - Some mxge nics may store the serial number in the SN2 field of the
      EEPROM.  These will also have an SN=0 field, so parse the SN2 field,
      and give it precedence.
  
    - Skip MXGEFW_CMD_UNALIGNED_TEST on mxge nics which do not require it.
      This saves roughly 10ms per port at device attach time.

Modified:
  stable/8/sys/dev/mxge/if_mxge.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/mxge/   (props changed)

Modified: stable/8/sys/dev/mxge/if_mxge.c
==============================================================================
--- stable/8/sys/dev/mxge/if_mxge.c	Tue Mar  5 16:37:20 2013	(r247850)
+++ stable/8/sys/dev/mxge/if_mxge.c	Tue Mar  5 17:46:12 2013	(r247851)
@@ -289,11 +289,12 @@ mxge_parse_strings(mxge_softc_t *sc)
 #define MXGE_NEXT_STRING(p) while(ptr < limit && *ptr++)
 
 	char *ptr, *limit;
-	int i, found_mac;
+	int i, found_mac, found_sn2;
 
 	ptr = sc->eeprom_strings;
 	limit = sc->eeprom_strings + MXGE_EEPROM_STRINGS_SIZE;
 	found_mac = 0;
+	found_sn2 = 0;
 	while (ptr < limit && *ptr != '\0') {
 		if (memcmp(ptr, "MAC=", 4) == 0) {
 			ptr += 1;
@@ -309,10 +310,16 @@ mxge_parse_strings(mxge_softc_t *sc)
 			ptr += 3;
 			strncpy(sc->product_code_string, ptr,
 				sizeof (sc->product_code_string) - 1);
-		} else if (memcmp(ptr, "SN=", 3) == 0) {
+		} else if (!found_sn2 && (memcmp(ptr, "SN=", 3) == 0)) {
 			ptr += 3;
 			strncpy(sc->serial_number_string, ptr,
 				sizeof (sc->serial_number_string) - 1);
+		} else if (memcmp(ptr, "SN2=", 4) == 0) {
+			/* SN2 takes precedence over SN */
+			ptr += 4;
+			found_sn2 = 1;
+			strncpy(sc->serial_number_string, ptr,
+				sizeof (sc->serial_number_string) - 1);
 		}
 		MXGE_NEXT_STRING(ptr);
 	}
@@ -579,9 +586,10 @@ mxge_firmware_probe(mxge_softc_t *sc)
 
 	/* 
 	 * Run a DMA test which watches for unaligned completions and
-	 * aborts on the first one seen.
+	 * aborts on the first one seen.  Not required on Z8ES or newer.
 	 */
-
+	if (pci_get_revid(sc->dev) >= MXGE_PCI_REV_Z8ES)
+		return 0;
 	status = mxge_dma_test(sc, MXGEFW_CMD_UNALIGNED_TEST);
 	if (status == 0)
 		return 0; /* keep the aligned firmware */


More information about the svn-src-all mailing list