Skip to content

Commit

Permalink
igc: allow BaseTime 0 enrollment for Qbv
Browse files Browse the repository at this point in the history
[ Upstream commit e17090e ]

Introduce qbv_enable flag in igc_adapter struct to store the Qbv on/off.
So this allow the BaseTime to enroll with zero value.

Fixes: 61572d5 ("igc: Simplify TSN flags handling")
Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Tan Tee Min <tee.min.tan@linux.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 gregkh committed Dec 31, 2022
1 parent c0df8e7 commit 1ef9416
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/igc/igc.h
Expand Up @@ -184,6 +184,7 @@ struct igc_adapter {

ktime_t base_time;
ktime_t cycle_time;
bool qbv_enable;

/* OS defined structs */
struct pci_dev *pdev;
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ethernet/intel/igc/igc_main.c
Expand Up @@ -5981,6 +5981,8 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
u32 start_time = 0, end_time = 0;
size_t n;

adapter->qbv_enable = qopt->enable;

if (!qopt->enable)
return igc_tsn_clear_schedule(adapter);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/igc/igc_tsn.c
Expand Up @@ -36,7 +36,7 @@ static unsigned int igc_tsn_new_flags(struct igc_adapter *adapter)
{
unsigned int new_flags = adapter->flags & ~IGC_FLAG_TSN_ANY_ENABLED;

if (adapter->base_time)
if (adapter->qbv_enable)
new_flags |= IGC_FLAG_TSN_QBV_ENABLED;

if (is_any_launchtime(adapter))
Expand Down

0 comments on commit 1ef9416

Please sign in to comment.