提交 e17090eb 编写于 作者: T Tan Tee Min 提交者: Tony Nguyen

igc: allow BaseTime 0 enrollment for Qbv

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: 61572d5f ("igc: Simplify TSN flags handling")
Signed-off-by: NMuhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: NTan Tee Min <tee.min.tan@linux.intel.com>
Tested-by: NNaama Meir <naamax.meir@linux.intel.com>
Signed-off-by: NTony Nguyen <anthony.l.nguyen@intel.com>
上级 3b61764f
...@@ -184,6 +184,7 @@ struct igc_adapter { ...@@ -184,6 +184,7 @@ struct igc_adapter {
ktime_t base_time; ktime_t base_time;
ktime_t cycle_time; ktime_t cycle_time;
bool qbv_enable;
/* OS defined structs */ /* OS defined structs */
struct pci_dev *pdev; struct pci_dev *pdev;
......
...@@ -6044,6 +6044,8 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter, ...@@ -6044,6 +6044,8 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
u32 start_time = 0, end_time = 0; u32 start_time = 0, end_time = 0;
size_t n; size_t n;
adapter->qbv_enable = qopt->enable;
if (!qopt->enable) if (!qopt->enable)
return igc_tsn_clear_schedule(adapter); return igc_tsn_clear_schedule(adapter);
......
...@@ -36,7 +36,7 @@ static unsigned int igc_tsn_new_flags(struct igc_adapter *adapter) ...@@ -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; 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; new_flags |= IGC_FLAG_TSN_QBV_ENABLED;
if (is_any_launchtime(adapter)) if (is_any_launchtime(adapter))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册