diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2008-12-13 01:05:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-13 01:05:48 -0500 |
commit | 11e66966277ea8a3353ad2c2773257973553e73a (patch) | |
tree | 185c97265b2282f84a5cd7e983965003138f6a6e /drivers/net/sfc | |
parent | b45319382150008ed7cd31b7965392d55fe68967 (diff) |
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>
Diffstat (limited to 'drivers/net/sfc')
-rw-r--r-- | drivers/net/sfc/ethtool.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c index aad0d1b36e1c..eab3e5c61c7b 100644 --- a/drivers/net/sfc/ethtool.c +++ b/drivers/net/sfc/ethtool.c | |||
@@ -274,8 +274,11 @@ static void efx_fill_test(unsigned int test_index, | |||
274 | 274 | ||
275 | /* Fill string, if applicable */ | 275 | /* Fill string, if applicable */ |
276 | if (strings) { | 276 | if (strings) { |
277 | snprintf(unit_str.name, sizeof(unit_str.name), | 277 | if (strchr(unit_format, '%')) |
278 | unit_format, unit_id); | 278 | snprintf(unit_str.name, sizeof(unit_str.name), |
279 | unit_format, unit_id); | ||
280 | else | ||
281 | strcpy(unit_str.name, unit_format); | ||
279 | snprintf(test_str.name, sizeof(test_str.name), | 282 | snprintf(test_str.name, sizeof(test_str.name), |
280 | test_format, test_id); | 283 | test_format, test_id); |
281 | snprintf(strings[test_index].name, | 284 | snprintf(strings[test_index].name, |
@@ -284,7 +287,6 @@ static void efx_fill_test(unsigned int test_index, | |||
284 | } | 287 | } |
285 | } | 288 | } |
286 | 289 | ||
287 | #define EFX_PORT_NAME "port%d", 0 | ||
288 | #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel | 290 | #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel |
289 | #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue | 291 | #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue |
290 | #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue | 292 | #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, | |||
320 | } | 322 | } |
321 | efx_fill_test(test_index++, strings, data, | 323 | efx_fill_test(test_index++, strings, data, |
322 | &lb_tests->rx_good, | 324 | &lb_tests->rx_good, |
323 | EFX_PORT_NAME, | 325 | "rx", 0, |
324 | EFX_LOOPBACK_NAME(mode, "rx_good")); | 326 | EFX_LOOPBACK_NAME(mode, "rx_good")); |
325 | efx_fill_test(test_index++, strings, data, | 327 | efx_fill_test(test_index++, strings, data, |
326 | &lb_tests->rx_bad, | 328 | &lb_tests->rx_bad, |
327 | EFX_PORT_NAME, | 329 | "rx", 0, |
328 | EFX_LOOPBACK_NAME(mode, "rx_bad")); | 330 | EFX_LOOPBACK_NAME(mode, "rx_bad")); |
329 | 331 | ||
330 | return test_index; | 332 | return test_index; |
@@ -372,7 +374,7 @@ static int efx_ethtool_fill_self_tests(struct efx_nic *efx, | |||
372 | efx_fill_test(n++, strings, data, &tests->registers, | 374 | efx_fill_test(n++, strings, data, &tests->registers, |
373 | "core", 0, "registers", NULL); | 375 | "core", 0, "registers", NULL); |
374 | efx_fill_test(n++, strings, data, &tests->phy, | 376 | efx_fill_test(n++, strings, data, &tests->phy, |
375 | EFX_PORT_NAME, "phy", NULL); | 377 | "phy", 0, "bist", NULL); |
376 | 378 | ||
377 | /* Loopback tests */ | 379 | /* Loopback tests */ |
378 | for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) { | 380 | for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) { |