Lines Matching +full:tx +full:- +full:sec

1 // SPDX-License-Identifier: GPL-2.0
12 for (i = 0; i < adapter->num_tx_queues; i++) { in is_any_launchtime()
13 struct igc_ring *ring = adapter->tx_ring[i]; in is_any_launchtime()
15 if (ring->launchtime_enable) in is_any_launchtime()
26 for (i = 0; i < adapter->num_tx_queues; i++) { in is_cbs_enabled()
27 struct igc_ring *ring = adapter->tx_ring[i]; in is_cbs_enabled()
29 if (ring->cbs_enable) in is_cbs_enabled()
38 unsigned int new_flags = adapter->flags & ~IGC_FLAG_TSN_ANY_ENABLED; in igc_tsn_new_flags()
40 if (adapter->taprio_offload_enable) in igc_tsn_new_flags()
49 if (adapter->strict_priority_enable) in igc_tsn_new_flags()
57 struct igc_hw *hw = &adapter->hw; in igc_tsn_is_tx_mode_in_tsn()
64 struct igc_hw *hw = &adapter->hw; in igc_tsn_adjust_txtime_offset()
70 switch (adapter->link_speed) { in igc_tsn_adjust_txtime_offset()
93 struct igc_hw *hw = &adapter->hw; in igc_tsn_restore_retx_default()
102 struct igc_hw *hw = &adapter->hw; in igc_tsn_is_taprio_activated_by_user()
105 adapter->taprio_offload_enable; in igc_tsn_is_taprio_activated_by_user()
110 struct igc_hw *hw = &adapter->hw; in igc_tsn_tx_arb()
134 struct igc_hw *hw = &adapter->hw; in igc_tsn_disable_offload()
151 for (i = 0; i < adapter->num_tx_queues; i++) { in igc_tsn_disable_offload()
161 netdev_reset_tc(adapter->netdev); in igc_tsn_disable_offload()
163 /* Restore the default Tx arbitration: Priority 0 has the highest in igc_tsn_disable_offload()
168 adapter->flags &= ~IGC_FLAG_TSN_QBV_ENABLED; in igc_tsn_disable_offload()
169 adapter->flags &= ~IGC_FLAG_TSN_LEGACY_ENABLED; in igc_tsn_disable_offload()
182 struct igc_hw *hw = &adapter->hw; in igc_tsn_set_retx_qbvfullthreshold()
195 struct igc_hw *hw = &adapter->hw; in igc_tsn_enable_offload()
197 u32 sec, nsec, cycle; in igc_tsn_enable_offload() local
208 if (adapter->strict_priority_enable) { in igc_tsn_enable_offload()
211 err = netdev_set_num_tc(adapter->netdev, adapter->num_tc); in igc_tsn_enable_offload()
215 for (i = 0; i < adapter->num_tc; i++) { in igc_tsn_enable_offload()
216 err = netdev_set_tc_queue(adapter->netdev, i, 1, in igc_tsn_enable_offload()
217 adapter->queue_per_tc[i]); in igc_tsn_enable_offload()
224 adapter->queue_per_tc[i] = i; in igc_tsn_enable_offload()
229 igc_tsn_tx_arb(adapter, adapter->queue_per_tc); in igc_tsn_enable_offload()
242 for (i = 0; i < adapter->num_tx_queues; i++) { in igc_tsn_enable_offload()
243 struct igc_ring *ring = adapter->tx_ring[i]; in igc_tsn_enable_offload()
248 wr32(IGC_STQT(i), ring->start_time); in igc_tsn_enable_offload()
249 wr32(IGC_ENDQT(i), ring->end_time); in igc_tsn_enable_offload()
251 if (adapter->taprio_offload_enable) { in igc_tsn_enable_offload()
274 if (ring->launchtime_enable) in igc_tsn_enable_offload()
281 if (ring->cbs_enable) { in igc_tsn_enable_offload()
291 * value = link-speed 0x7736 * BW * 0.2 in igc_tsn_enable_offload()
292 * ---------- * ----------------- (E1) in igc_tsn_enable_offload()
295 * Note that 'link-speed' is in Mbps. in igc_tsn_enable_offload()
304 * ----------------- (E2) in igc_tsn_enable_offload()
305 * link-speed * 1000 in igc_tsn_enable_offload()
312 * value = link-speed * 0x7736 * idleSlope * 0.2 in igc_tsn_enable_offload()
313 * ------------------------------------- (E3) in igc_tsn_enable_offload()
314 * 100 * 2.5 * link-speed * 1000 in igc_tsn_enable_offload()
316 * 'link-speed' is present in both sides of the in igc_tsn_enable_offload()
321 * ----------------- (E4) in igc_tsn_enable_offload()
337 cbs_value = DIV_ROUND_UP_ULL(ring->idleslope in igc_tsn_enable_offload()
346 0x80000000 + ring->hicredit * 0x7736); in igc_tsn_enable_offload()
368 adapter->qbv_count++; in igc_tsn_enable_offload()
370 cycle = adapter->cycle_time; in igc_tsn_enable_offload()
371 base_time = adapter->base_time; in igc_tsn_enable_offload()
374 sec = rd32(IGC_SYSTIMH); in igc_tsn_enable_offload()
376 systim = ktime_set(sec, nsec); in igc_tsn_enable_offload()
387 * Tx won't hang if a GCL is already running, in igc_tsn_enable_offload()
394 sec = rd32(IGC_SYSTIMH); in igc_tsn_enable_offload()
395 systim = ktime_set(sec, nsec); in igc_tsn_enable_offload()
397 adjust_time = adapter->base_time; in igc_tsn_enable_offload()
399 hrtimer_start(&adapter->hrtimer, expires_time, HRTIMER_MODE_REL); in igc_tsn_enable_offload()
412 * is enabled and only active for re-configuration. in igc_tsn_enable_offload()
414 * "re-configuration" scenario then only set the desired base time. in igc_tsn_enable_offload()
437 adapter->flags = new_flags; in igc_tsn_reset()
453 /* Per I225/6 HW Design Section 7.5.2.1 guideline, if tx mode change in igc_tsn_offload_apply()
454 * from legacy->tsn or tsn->legacy, then reset adapter is needed. in igc_tsn_offload_apply()
456 if (netif_running(adapter->netdev) && in igc_tsn_offload_apply()
458 schedule_work(&adapter->reset_task); in igc_tsn_offload_apply()