All of lore.kernel.org
 help / color / mirror / Atom feed
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-next 4/8] igc: recalculate Qbv end_time by considering cycle time
Date: Mon,  5 Dec 2022 13:24:10 -0800	[thread overview]
Message-ID: <20221205212414.3197525-5-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20221205212414.3197525-1-anthony.l.nguyen@intel.com>

From: Tan Tee Min <tee.min.tan@linux.intel.com>

Qbv users can specify a cycle time that is not equal to the total GCL
intervals. Hence, recalculation is necessary here to exclude the time
interval that exceeds the cycle time. As those GCL which exceeds the
cycle time will be truncated.

According to IEEE Std. 802.1Q-2018 section 8.6.9.2, once the end of
the list is reached, it will switch to the END_OF_CYCLE state and
leave the gates in the same state until the next cycle is started.

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>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 35c473703950..5aa72eac2a35 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -5952,6 +5952,21 @@ static int igc_save_qbv_schedule(struct igc_adapter *adapter,
 
 		end_time += e->interval;
 
+		/* If any of the conditions below are true, we need to manually
+		 * control the end time of the cycle.
+		 * 1. Qbv users can specify a cycle time that is not equal
+		 * to the total GCL intervals. Hence, recalculation is
+		 * necessary here to exclude the time interval that
+		 * exceeds the cycle time.
+		 * 2. According to IEEE Std. 802.1Q-2018 section 8.6.9.2,
+		 * once the end of the list is reached, it will switch
+		 * to the END_OF_CYCLE state and leave the gates in the
+		 * same state until the next cycle is started.
+		 */
+		if (end_time > adapter->cycle_time ||
+		    n + 1 == qopt->num_entries)
+			end_time = adapter->cycle_time;
+
 		for (i = 0; i < adapter->num_tx_queues; i++) {
 			struct igc_ring *ring = adapter->tx_ring[i];
 
-- 
2.35.1


  parent reply	other threads:[~2022-12-05 21:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 21:24 [PATCH net-next 0/8][pull request] Intel Wired LAN Driver Updates 2022-12-05 (igc) Tony Nguyen
2022-12-05 21:24 ` [PATCH net-next 1/8] igc: allow BaseTime 0 enrollment for Qbv Tony Nguyen
2022-12-05 21:24 ` [PATCH net-next 2/8] igc: remove I226 Qbv BaseTime restriction Tony Nguyen
2022-12-08 12:28   ` Kurt Kanzenbach
2022-12-09  1:50     ` Zulkifli, Muhammad Husaini
2022-12-05 21:24 ` [PATCH net-next 3/8] igc: Add checking for basetime less than zero Tony Nguyen
2022-12-05 21:24 ` Tony Nguyen [this message]
2022-12-05 21:24 ` [PATCH net-next 5/8] igc: enable Qbv configuration for 2nd GCL Tony Nguyen
2022-12-05 21:24 ` [PATCH net-next 6/8] igc: Set Qbv start_time and end_time to end_time if not being configured in GCL Tony Nguyen
2022-12-05 21:24 ` [PATCH net-next 7/8] igc: Use strict cycles for Qbv scheduling Tony Nguyen
2022-12-05 21:24 ` [PATCH net-next 8/8] igc: Enhance Qbv scheduling by using first flag bit Tony Nguyen
2022-12-07  7:46 ` [PATCH net-next 0/8][pull request] Intel Wired LAN Driver Updates 2022-12-05 (igc) Leon Romanovsky
2022-12-08  0:10 ` Jakub Kicinski

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=20221205212414.3197525-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.