Skip to content

Commit

Permalink
igc: Set Qbv start_time and end_time to end_time if not being configu…
Browse files Browse the repository at this point in the history
…red in GCL

[ Upstream commit 72abeed ]

The default setting of end_time minus start_time is whole 1 second.
Thus, if it's not being configured in any GCL entry then it will be
staying at original 1 second.

This patch is changing the start_time and end_time to be end_time as
if setting zero will be having weird HW behavior where the gate will
not be fully closed.

Fixes: ec50a9d ("igc: Add support for taprio offloading")
Signed-off-by: Tan Tee Min <tee.min.tan@linux.intel.com>
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Tested-by: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Tan Tee Min authored and Sasha Levin committed Dec 30, 2022
1 parent 53199ec commit 188aacd
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion drivers/net/ethernet/intel/igc/igc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6036,6 +6036,7 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
bool queue_configured[IGC_MAX_TX_QUEUES] = { };
u32 start_time = 0, end_time = 0;
size_t n;
int i;

adapter->qbv_enable = qopt->enable;

Expand All @@ -6056,7 +6057,6 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,

for (n = 0; n < qopt->num_entries; n++) {
struct tc_taprio_sched_entry *e = &qopt->entries[n];
int i;

end_time += e->interval;

Expand Down Expand Up @@ -6095,6 +6095,18 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
start_time += e->interval;
}

/* Check whether a queue gets configured.
* If not, set the start and end time to be end time.
*/
for (i = 0; i < adapter->num_tx_queues; i++) {
if (!queue_configured[i]) {
struct igc_ring *ring = adapter->tx_ring[i];

ring->start_time = end_time;
ring->end_time = end_time;
}
}

return 0;
}

Expand Down

0 comments on commit 188aacd

Please sign in to comment.