diff options
author | Edward Cree <ecree@solarflare.com> | 2013-09-25 12:32:09 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2013-10-04 18:56:31 -0400 |
commit | 568d7a001bd5612a280e1026cce7e6e2e16b7687 (patch) | |
tree | 7d4ec5b5b132b77dccd20516cfb24cd1537a58f6 | |
parent | 2ca10a75d897c6cd3cfcf87567551d775c9b10bb (diff) |
sfc: Add PM and RXDP drop counters to ethtool stats
Recognise the new Packet Memory and RX Data Path counters.
The following counters are added:
rx_pm_{trunc,discard}_bb_overflow - burst buffer overflowed. This should not
occur if BB correctly configured.
rx_pm_{trunc,discard}_vfifo_full - not enough space in packet memory. May
indicate RX performance problems.
rx_pm_{trunc,discard}_qbb - dropped by 802.1Qbb early discard mechanism.
Since Qbb is not supported at present, this should not occur.
rx_pm_discard_mapping - 802.1p priority configured to be dropped. This should
not occur in normal operation.
rx_dp_q_disabled_packets - packet was to be delivered to a queue but queue is
disabled. May indicate misconfiguration by the driver.
rx_dp_di_dropped_packets - parser-dispatcher indicated that a packet should be
dropped.
rx_dp_streaming_packets - packet was sent to the RXDP streaming bus, ie. a
filter directed the packet to the MCPU.
rx_dp_emerg_{fetch,wait} - RX datapath had to wait for descriptors to be
loaded. Indicates performance problems but not drops.
These are only provided if the MC firmware has the
PM_AND_RXDP_COUNTERS capability. Otherwise, mask them out.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 35 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/nic.h | 12 |
2 files changed, 47 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index c00a5d69c94a..21f9ad6392e9 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -444,6 +444,18 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = { | |||
444 | EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS), | 444 | EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS), |
445 | EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS), | 445 | EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS), |
446 | EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS), | 446 | EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS), |
447 | EF10_DMA_STAT(rx_pm_trunc_bb_overflow, PM_TRUNC_BB_OVERFLOW), | ||
448 | EF10_DMA_STAT(rx_pm_discard_bb_overflow, PM_DISCARD_BB_OVERFLOW), | ||
449 | EF10_DMA_STAT(rx_pm_trunc_vfifo_full, PM_TRUNC_VFIFO_FULL), | ||
450 | EF10_DMA_STAT(rx_pm_discard_vfifo_full, PM_DISCARD_VFIFO_FULL), | ||
451 | EF10_DMA_STAT(rx_pm_trunc_qbb, PM_TRUNC_QBB), | ||
452 | EF10_DMA_STAT(rx_pm_discard_qbb, PM_DISCARD_QBB), | ||
453 | EF10_DMA_STAT(rx_pm_discard_mapping, PM_DISCARD_MAPPING), | ||
454 | EF10_DMA_STAT(rx_dp_q_disabled_packets, RXDP_Q_DISABLED_PKTS), | ||
455 | EF10_DMA_STAT(rx_dp_di_dropped_packets, RXDP_DI_DROPPED_PKTS), | ||
456 | EF10_DMA_STAT(rx_dp_streaming_packets, RXDP_STREAMING_PKTS), | ||
457 | EF10_DMA_STAT(rx_dp_emerg_fetch, RXDP_EMERGENCY_FETCH_CONDITIONS), | ||
458 | EF10_DMA_STAT(rx_dp_emerg_wait, RXDP_EMERGENCY_WAIT_CONDITIONS), | ||
447 | }; | 459 | }; |
448 | 460 | ||
449 | #define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \ | 461 | #define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \ |
@@ -498,15 +510,38 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = { | |||
498 | #define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \ | 510 | #define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \ |
499 | (1ULL << EF10_STAT_rx_length_error)) | 511 | (1ULL << EF10_STAT_rx_length_error)) |
500 | 512 | ||
513 | /* These statistics are only provided if the firmware supports the | ||
514 | * capability PM_AND_RXDP_COUNTERS. | ||
515 | */ | ||
516 | #define HUNT_PM_AND_RXDP_STAT_MASK ( \ | ||
517 | (1ULL << EF10_STAT_rx_pm_trunc_bb_overflow) | \ | ||
518 | (1ULL << EF10_STAT_rx_pm_discard_bb_overflow) | \ | ||
519 | (1ULL << EF10_STAT_rx_pm_trunc_vfifo_full) | \ | ||
520 | (1ULL << EF10_STAT_rx_pm_discard_vfifo_full) | \ | ||
521 | (1ULL << EF10_STAT_rx_pm_trunc_qbb) | \ | ||
522 | (1ULL << EF10_STAT_rx_pm_discard_qbb) | \ | ||
523 | (1ULL << EF10_STAT_rx_pm_discard_mapping) | \ | ||
524 | (1ULL << EF10_STAT_rx_dp_q_disabled_packets) | \ | ||
525 | (1ULL << EF10_STAT_rx_dp_di_dropped_packets) | \ | ||
526 | (1ULL << EF10_STAT_rx_dp_streaming_packets) | \ | ||
527 | (1ULL << EF10_STAT_rx_dp_emerg_fetch) | \ | ||
528 | (1ULL << EF10_STAT_rx_dp_emerg_wait)) | ||
529 | |||
501 | static u64 efx_ef10_raw_stat_mask(struct efx_nic *efx) | 530 | static u64 efx_ef10_raw_stat_mask(struct efx_nic *efx) |
502 | { | 531 | { |
503 | u64 raw_mask = HUNT_COMMON_STAT_MASK; | 532 | u64 raw_mask = HUNT_COMMON_STAT_MASK; |
504 | u32 port_caps = efx_mcdi_phy_get_caps(efx); | 533 | u32 port_caps = efx_mcdi_phy_get_caps(efx); |
534 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | ||
505 | 535 | ||
506 | if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) | 536 | if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) |
507 | raw_mask |= HUNT_40G_EXTRA_STAT_MASK; | 537 | raw_mask |= HUNT_40G_EXTRA_STAT_MASK; |
508 | else | 538 | else |
509 | raw_mask |= HUNT_10G_ONLY_STAT_MASK; | 539 | raw_mask |= HUNT_10G_ONLY_STAT_MASK; |
540 | |||
541 | if (nic_data->datapath_caps & | ||
542 | (1 << MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN)) | ||
543 | raw_mask |= HUNT_PM_AND_RXDP_STAT_MASK; | ||
544 | |||
510 | return raw_mask; | 545 | return raw_mask; |
511 | } | 546 | } |
512 | 547 | ||
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h index fda29d39032f..890bbbe8320e 100644 --- a/drivers/net/ethernet/sfc/nic.h +++ b/drivers/net/ethernet/sfc/nic.h | |||
@@ -386,6 +386,18 @@ enum { | |||
386 | EF10_STAT_rx_align_error, | 386 | EF10_STAT_rx_align_error, |
387 | EF10_STAT_rx_length_error, | 387 | EF10_STAT_rx_length_error, |
388 | EF10_STAT_rx_nodesc_drops, | 388 | EF10_STAT_rx_nodesc_drops, |
389 | EF10_STAT_rx_pm_trunc_bb_overflow, | ||
390 | EF10_STAT_rx_pm_discard_bb_overflow, | ||
391 | EF10_STAT_rx_pm_trunc_vfifo_full, | ||
392 | EF10_STAT_rx_pm_discard_vfifo_full, | ||
393 | EF10_STAT_rx_pm_trunc_qbb, | ||
394 | EF10_STAT_rx_pm_discard_qbb, | ||
395 | EF10_STAT_rx_pm_discard_mapping, | ||
396 | EF10_STAT_rx_dp_q_disabled_packets, | ||
397 | EF10_STAT_rx_dp_di_dropped_packets, | ||
398 | EF10_STAT_rx_dp_streaming_packets, | ||
399 | EF10_STAT_rx_dp_emerg_fetch, | ||
400 | EF10_STAT_rx_dp_emerg_wait, | ||
389 | EF10_STAT_COUNT | 401 | EF10_STAT_COUNT |
390 | }; | 402 | }; |
391 | 403 | ||