Răsfoiți Sursa

sfc: Specify a meaningful component for loopback RX-side and PHY tests

Our ethtool self-test result names each begin with a component name.  For
some results this is "port0", which is not very meaningful.  Change that
to "rx" or "phy" as appropriate.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings 16 ani în urmă
părinte
comite
11e6696627
1 a modificat fișierele cu 8 adăugiri și 6 ștergeri
  1. 8 6
      drivers/net/sfc/ethtool.c

+ 8 - 6
drivers/net/sfc/ethtool.c

@@ -274,8 +274,11 @@ static void efx_fill_test(unsigned int test_index,
 
 
 	/* Fill string, if applicable */
 	/* Fill string, if applicable */
 	if (strings) {
 	if (strings) {
-		snprintf(unit_str.name, sizeof(unit_str.name),
-			 unit_format, unit_id);
+		if (strchr(unit_format, '%'))
+			snprintf(unit_str.name, sizeof(unit_str.name),
+				 unit_format, unit_id);
+		else
+			strcpy(unit_str.name, unit_format);
 		snprintf(test_str.name, sizeof(test_str.name),
 		snprintf(test_str.name, sizeof(test_str.name),
 			 test_format, test_id);
 			 test_format, test_id);
 		snprintf(strings[test_index].name,
 		snprintf(strings[test_index].name,
@@ -284,7 +287,6 @@ static void efx_fill_test(unsigned int test_index,
 	}
 	}
 }
 }
 
 
-#define EFX_PORT_NAME "port%d", 0
 #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
 #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
 #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue
 #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue
 #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue
 #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue
@@ -320,11 +322,11 @@ static int efx_fill_loopback_test(struct efx_nic *efx,
 	}
 	}
 	efx_fill_test(test_index++, strings, data,
 	efx_fill_test(test_index++, strings, data,
 		      &lb_tests->rx_good,
 		      &lb_tests->rx_good,
-		      EFX_PORT_NAME,
+		      "rx", 0,
 		      EFX_LOOPBACK_NAME(mode, "rx_good"));
 		      EFX_LOOPBACK_NAME(mode, "rx_good"));
 	efx_fill_test(test_index++, strings, data,
 	efx_fill_test(test_index++, strings, data,
 		      &lb_tests->rx_bad,
 		      &lb_tests->rx_bad,
-		      EFX_PORT_NAME,
+		      "rx", 0,
 		      EFX_LOOPBACK_NAME(mode, "rx_bad"));
 		      EFX_LOOPBACK_NAME(mode, "rx_bad"));
 
 
 	return test_index;
 	return test_index;
@@ -372,7 +374,7 @@ static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
 	efx_fill_test(n++, strings, data, &tests->registers,
 	efx_fill_test(n++, strings, data, &tests->registers,
 		      "core", 0, "registers", NULL);
 		      "core", 0, "registers", NULL);
 	efx_fill_test(n++, strings, data, &tests->phy,
 	efx_fill_test(n++, strings, data, &tests->phy,
-		      EFX_PORT_NAME, "phy", NULL);
+		      "phy", 0, "bist", NULL);
 
 
 	/* Loopback tests */
 	/* Loopback tests */
 	for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) {
 	for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) {