Lines Matching +full:down +full:- +full:counters
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
7 * fm10k_get_bus_info_generic - Generic set PCI bus info
22 hw->bus_caps.width = fm10k_bus_width_pcie_x1; in fm10k_get_bus_info_generic()
25 hw->bus_caps.width = fm10k_bus_width_pcie_x2; in fm10k_get_bus_info_generic()
28 hw->bus_caps.width = fm10k_bus_width_pcie_x4; in fm10k_get_bus_info_generic()
31 hw->bus_caps.width = fm10k_bus_width_pcie_x8; in fm10k_get_bus_info_generic()
34 hw->bus_caps.width = fm10k_bus_width_unknown; in fm10k_get_bus_info_generic()
40 hw->bus_caps.speed = fm10k_bus_speed_2500; in fm10k_get_bus_info_generic()
43 hw->bus_caps.speed = fm10k_bus_speed_5000; in fm10k_get_bus_info_generic()
46 hw->bus_caps.speed = fm10k_bus_speed_8000; in fm10k_get_bus_info_generic()
49 hw->bus_caps.speed = fm10k_bus_speed_unknown; in fm10k_get_bus_info_generic()
58 hw->bus_caps.payload = fm10k_bus_payload_128; in fm10k_get_bus_info_generic()
61 hw->bus_caps.payload = fm10k_bus_payload_256; in fm10k_get_bus_info_generic()
64 hw->bus_caps.payload = fm10k_bus_payload_512; in fm10k_get_bus_info_generic()
67 hw->bus_caps.payload = fm10k_bus_payload_unknown; in fm10k_get_bus_info_generic()
76 hw->bus.width = fm10k_bus_width_pcie_x1; in fm10k_get_bus_info_generic()
79 hw->bus.width = fm10k_bus_width_pcie_x2; in fm10k_get_bus_info_generic()
82 hw->bus.width = fm10k_bus_width_pcie_x4; in fm10k_get_bus_info_generic()
85 hw->bus.width = fm10k_bus_width_pcie_x8; in fm10k_get_bus_info_generic()
88 hw->bus.width = fm10k_bus_width_unknown; in fm10k_get_bus_info_generic()
94 hw->bus.speed = fm10k_bus_speed_2500; in fm10k_get_bus_info_generic()
97 hw->bus.speed = fm10k_bus_speed_5000; in fm10k_get_bus_info_generic()
100 hw->bus.speed = fm10k_bus_speed_8000; in fm10k_get_bus_info_generic()
103 hw->bus.speed = fm10k_bus_speed_unknown; in fm10k_get_bus_info_generic()
112 hw->bus.payload = fm10k_bus_payload_128; in fm10k_get_bus_info_generic()
115 hw->bus.payload = fm10k_bus_payload_256; in fm10k_get_bus_info_generic()
118 hw->bus.payload = fm10k_bus_payload_512; in fm10k_get_bus_info_generic()
121 hw->bus.payload = fm10k_bus_payload_unknown; in fm10k_get_bus_info_generic()
132 /* read in value from MSI-X capability register */ in fm10k_get_pcie_msix_count_generic()
136 /* MSI-X count is zero-based in HW */ in fm10k_get_pcie_msix_count_generic()
146 * fm10k_get_invariants_generic - Inits constant values
153 struct fm10k_mac_info *mac = &hw->mac; in fm10k_get_invariants_generic()
156 mac->dglort_map = FM10K_DGLORTMAP_NONE; in fm10k_get_invariants_generic()
158 /* record maximum number of MSI-X vectors */ in fm10k_get_invariants_generic()
159 mac->max_msix_vectors = fm10k_get_pcie_msix_count_generic(hw); in fm10k_get_invariants_generic()
165 * fm10k_start_hw_generic - Prepare hardware for Tx/Rx
174 hw->mac.tx_ready = true; in fm10k_start_hw_generic()
180 * fm10k_disable_queues_generic - Stop Tx/Rx queues
191 hw->mac.tx_ready = false; in fm10k_disable_queues_generic()
193 if (FM10K_REMOVED(hw->hw_addr)) in fm10k_disable_queues_generic()
226 time--; in fm10k_disable_queues_generic()
235 * fm10k_stop_hw_generic - Stop Tx/Rx units
241 return fm10k_disable_queues_generic(hw, hw->mac.max_queues); in fm10k_stop_hw_generic()
245 * fm10k_read_hw_stats_32b - Reads value of 32-bit registers
247 * @addr: address of register containing a 32-bit value
256 u32 delta = fm10k_read_reg(hw, addr) - stat->base_l; in fm10k_read_hw_stats_32b()
258 if (FM10K_REMOVED(hw->hw_addr)) in fm10k_read_hw_stats_32b()
259 stat->base_h = 0; in fm10k_read_hw_stats_32b()
265 * fm10k_read_hw_stats_48b - Reads value of 48-bit registers
267 * @addr: address of register containing the lower 32-bit value
270 * Function reads the content of 2 registers, combined to represent a 48-bit
273 * values stored in registers and values stored in the statistic counters.
292 delta = ((u64)(count_h - stat->base_h) << 32) + count_l; in fm10k_read_hw_stats_48b()
293 delta -= stat->base_l; in fm10k_read_hw_stats_48b()
299 * fm10k_update_hw_base_48b - Updates 48-bit statistic base value
312 delta += stat->base_l; in fm10k_update_hw_base_48b()
313 stat->base_l = (u32)delta; in fm10k_update_hw_base_48b()
316 stat->base_h += (u32)(delta >> 32); in fm10k_update_hw_base_48b()
320 * fm10k_update_hw_stats_tx_q - Updates TX queue statistics counters
325 * Function updates the TX queue statistics counters that are related to the
341 &q->tx_packets); in fm10k_update_hw_stats_tx_q()
346 &q->tx_bytes); in fm10k_update_hw_stats_tx_q()
348 /* Re-Check Owner Data */ in fm10k_update_hw_stats_tx_q()
353 /* drop non-ID bits and set VALID ID bit */ in fm10k_update_hw_stats_tx_q()
358 if (q->tx_stats_idx == id_tx) { in fm10k_update_hw_stats_tx_q()
359 q->tx_packets.count += tx_packets; in fm10k_update_hw_stats_tx_q()
360 q->tx_bytes.count += tx_bytes; in fm10k_update_hw_stats_tx_q()
364 fm10k_update_hw_base_32b(&q->tx_packets, tx_packets); in fm10k_update_hw_stats_tx_q()
365 fm10k_update_hw_base_48b(&q->tx_bytes, tx_bytes); in fm10k_update_hw_stats_tx_q()
367 q->tx_stats_idx = id_tx; in fm10k_update_hw_stats_tx_q()
371 * fm10k_update_hw_stats_rx_q - Updates RX queue statistics counters
376 * Function updates the RX queue statistics counters that are related to the
392 &q->rx_drops); in fm10k_update_hw_stats_rx_q()
395 &q->rx_packets); in fm10k_update_hw_stats_rx_q()
400 &q->rx_bytes); in fm10k_update_hw_stats_rx_q()
402 /* Re-Check Owner Data */ in fm10k_update_hw_stats_rx_q()
407 /* drop non-ID bits and set VALID ID bit */ in fm10k_update_hw_stats_rx_q()
412 if (q->rx_stats_idx == id_rx) { in fm10k_update_hw_stats_rx_q()
413 q->rx_drops.count += rx_drops; in fm10k_update_hw_stats_rx_q()
414 q->rx_packets.count += rx_packets; in fm10k_update_hw_stats_rx_q()
415 q->rx_bytes.count += rx_bytes; in fm10k_update_hw_stats_rx_q()
419 fm10k_update_hw_base_32b(&q->rx_drops, rx_drops); in fm10k_update_hw_stats_rx_q()
420 fm10k_update_hw_base_32b(&q->rx_packets, rx_packets); in fm10k_update_hw_stats_rx_q()
421 fm10k_update_hw_base_48b(&q->rx_bytes, rx_bytes); in fm10k_update_hw_stats_rx_q()
423 q->rx_stats_idx = id_rx; in fm10k_update_hw_stats_rx_q()
427 * fm10k_update_hw_stats_q - Updates queue statistics counters
433 * Function updates the queue statistics counters that are related to the
448 * fm10k_unbind_hw_stats_q - Unbind the queue counters from their queues
461 q->rx_stats_idx = 0; in fm10k_unbind_hw_stats_q()
462 q->tx_stats_idx = 0; in fm10k_unbind_hw_stats_q()
467 * fm10k_get_host_state_generic - Returns the state of the host
476 struct fm10k_mbx_info *mbx = &hw->mbx; in fm10k_get_host_state_generic()
477 struct fm10k_mac_info *mac = &hw->mac; in fm10k_get_host_state_generic()
482 mbx->ops.process(hw, mbx); in fm10k_get_host_state_generic()
484 /* If Tx is no longer enabled link should come down */ in fm10k_get_host_state_generic()
486 mac->get_host_state = true; in fm10k_get_host_state_generic()
489 if (!mac->get_host_state || !(~txdctl)) in fm10k_get_host_state_generic()
493 if (mac->tx_ready && !(txdctl & FM10K_TXDCTL_ENABLE)) { in fm10k_get_host_state_generic()
499 if (!mbx->timeout) { in fm10k_get_host_state_generic()
505 if (mbx->state != FM10K_STATE_OPEN) in fm10k_get_host_state_generic()
509 if (mac->dglort_map == FM10K_DGLORTMAP_NONE) { in fm10k_get_host_state_generic()
510 if (mac->ops.request_lport_map) in fm10k_get_host_state_generic()
511 ret_val = mac->ops.request_lport_map(hw); in fm10k_get_host_state_generic()
519 mac->get_host_state = false; in fm10k_get_host_state_generic()
522 *host_ready = !mac->get_host_state; in fm10k_get_host_state_generic()