Skip to content

Commit c814a2d

Browse files
vcgomesanguy11
authored andcommitted
igc: Use default cycle 'start' and 'end' values for queues
Sets default values for each queue cycle start and cycle end. This allows some simplification in the handling of these configurations as most TSN features in i225 require a cycle to be configured. In i225, cycle start and end time is required to be programmed for CBS to work properly. Signed-off-by: Vinicius Costa Gomes <[email protected]> Signed-off-by: Aravindhan Gunasekaran <[email protected]> Signed-off-by: Mallikarjuna Chilakala <[email protected]> Tested-by: Dvora Fuxbrumer <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 4baf0e0 commit c814a2d

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5749,25 +5749,13 @@ static int igc_save_launchtime_params(struct igc_adapter *adapter, int queue,
57495749
bool enable)
57505750
{
57515751
struct igc_ring *ring;
5752-
int i;
57535752

57545753
if (queue < 0 || queue >= adapter->num_tx_queues)
57555754
return -EINVAL;
57565755

57575756
ring = adapter->tx_ring[queue];
57585757
ring->launchtime_enable = enable;
57595758

5760-
if (adapter->base_time)
5761-
return 0;
5762-
5763-
adapter->cycle_time = NSEC_PER_SEC;
5764-
5765-
for (i = 0; i < adapter->num_tx_queues; i++) {
5766-
ring = adapter->tx_ring[i];
5767-
ring->start_time = 0;
5768-
ring->end_time = NSEC_PER_SEC;
5769-
}
5770-
57715759
return 0;
57725760
}
57735761

@@ -5840,16 +5828,31 @@ static int igc_tsn_enable_launchtime(struct igc_adapter *adapter,
58405828
return igc_tsn_offload_apply(adapter);
58415829
}
58425830

5831+
static int igc_tsn_clear_schedule(struct igc_adapter *adapter)
5832+
{
5833+
int i;
5834+
5835+
adapter->base_time = 0;
5836+
adapter->cycle_time = NSEC_PER_SEC;
5837+
5838+
for (i = 0; i < adapter->num_tx_queues; i++) {
5839+
struct igc_ring *ring = adapter->tx_ring[i];
5840+
5841+
ring->start_time = 0;
5842+
ring->end_time = NSEC_PER_SEC;
5843+
}
5844+
5845+
return 0;
5846+
}
5847+
58435848
static int igc_save_qbv_schedule(struct igc_adapter *adapter,
58445849
struct tc_taprio_qopt_offload *qopt)
58455850
{
58465851
u32 start_time = 0, end_time = 0;
58475852
size_t n;
58485853

5849-
if (!qopt->enable) {
5850-
adapter->base_time = 0;
5851-
return 0;
5852-
}
5854+
if (!qopt->enable)
5855+
return igc_tsn_clear_schedule(adapter);
58535856

58545857
if (adapter->base_time)
58555858
return -EALREADY;
@@ -6339,6 +6342,8 @@ static int igc_probe(struct pci_dev *pdev,
63396342

63406343
igc_ptp_init(adapter);
63416344

6345+
igc_tsn_clear_schedule(adapter);
6346+
63426347
/* reset the hardware with the new settings */
63436348
igc_reset(adapter);
63446349

drivers/net/ethernet/intel/igc/igc_tsn.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ static int igc_tsn_disable_offload(struct igc_adapter *adapter)
4141
wr32(IGC_TQAVCTRL, tqavctrl);
4242

4343
for (i = 0; i < adapter->num_tx_queues; i++) {
44-
struct igc_ring *ring = adapter->tx_ring[i];
45-
46-
ring->start_time = 0;
47-
ring->end_time = 0;
48-
ring->launchtime_enable = false;
49-
5044
wr32(IGC_TXQCTL(i), 0);
5145
wr32(IGC_STQT(i), 0);
5246
wr32(IGC_ENDQT(i), NSEC_PER_SEC);

0 commit comments

Comments
 (0)