From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
edumazet@google.com
Cc: Tan Tee Min <tee.min.tan@linux.intel.com>,
netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
sasha.neftin@intel.com,
Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>,
Naama Meir <naamax.meir@linux.intel.com>
Subject: [PATCH net 4/6] igc: allow BaseTime 0 enrollment for Qbv
Date: Thu, 15 Dec 2022 15:07:56 -0800 [thread overview]
Message-ID: <20221215230758.3595578-5-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20221215230758.3595578-1-anthony.l.nguyen@intel.com>
From: Tan Tee Min <tee.min.tan@linux.intel.com>
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: 61572d5f8f91 ("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>
---
drivers/net/ethernet/intel/igc/igc.h | 1 +
drivers/net/ethernet/intel/igc/igc_main.c | 2 ++
drivers/net/ethernet/intel/igc/igc_tsn.c | 2 +-
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igc/igc.h b/drivers/net/ethernet/intel/igc/igc.h
index 66a57636d329..df3e26c0cf01 100644
--- a/drivers/net/ethernet/intel/igc/igc.h
+++ b/drivers/net/ethernet/intel/igc/igc.h
@@ -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;
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 6ed12329ae80..6c98f3402f8c 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6044,6 +6044,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);
diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
index 684aedd4d088..bb10d7b65232 100644
--- a/drivers/net/ethernet/intel/igc/igc_tsn.c
+++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
@@ -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))
--
2.35.1
next prev parent reply other threads:[~2022-12-15 23:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 23:07 [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2022-12-15 (igc) Tony Nguyen
2022-12-15 23:07 ` [PATCH net 1/6] igc: Enhance Qbv scheduling by using first flag bit Tony Nguyen
2022-12-15 23:07 ` [PATCH net 2/6] igc: Use strict cycles for Qbv scheduling Tony Nguyen
2022-12-15 23:07 ` [PATCH net 3/6] igc: Add checking for basetime less than zero Tony Nguyen
2022-12-15 23:07 ` Tony Nguyen [this message]
2022-12-15 23:07 ` [PATCH net 5/6] igc: recalculate Qbv end_time by considering cycle time Tony Nguyen
2022-12-15 23:07 ` [PATCH net 6/6] igc: Set Qbv start_time and end_time to end_time if not being configured in GCL Tony Nguyen
2022-12-18 21:10 ` [PATCH net 0/6][pull request] Intel Wired LAN Driver Updates 2022-12-15 (igc) patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221215230758.3595578-5-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=muhammad.husaini.zulkifli@intel.com \
--cc=naamax.meir@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sasha.neftin@intel.com \
--cc=tee.min.tan@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox