stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Jesse Brandeburg <jesse.brandeburg@intel.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Simon Horman <horms@kernel.org>,
	Richard Cochran <richardcochran@gmail.com>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	Sasha Neftin <sasha.neftin@intel.com>
Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
Subject: Re: [PATCH iwl-net v2 3/3] igc: Fix qbv tx latency by setting gtxoffset
Date: Wed, 10 Jul 2024 16:48:41 -0700	[thread overview]
Message-ID: <87a5iou7ty.fsf@intel.com> (raw)
In-Reply-To: <20240707125318.3425097-4-faizal.abdul.rahim@linux.intel.com>

Faizal Rahim <faizal.abdul.rahim@linux.intel.com> writes:

> A large tx latency issue was discovered during testing when only QBV was
> enabled. The issue occurs because gtxoffset was not set when QBV is
> active, it was only set when launch time is active.
>
> The patch "igc: Correct the launchtime offset" only sets gtxoffset when
> the launchtime_enable field is set by the user. Enabling launchtime_enable
> ultimately sets the register IGC_TXQCTL_QUEUE_MODE_LAUNCHT (referred to as
> LaunchT in the SW user manual).
>
> Section 7.5.2.6 of the IGC i225/6 SW User Manual Rev 1.2.4 states:
> "The latency between transmission scheduling (launch time) and the
> time the packet is transmitted to the network is listed in Table 7-61."
>
> However, the patch misinterprets the phrase "launch time" in that section
> by assuming it specifically refers to the LaunchT register, whereas it
> actually denotes the generic term for when a packet is released from the
> internal buffer to the MAC transmit logic.
>
> This launch time, as per that section, also implicitly refers to the QBV
> gate open time, where a packet waits in the buffer for the QBV gate to
> open. Therefore, latency applies whenever QBV is in use. TSN features such
> as QBU and QAV reuse QBV, making the latency universal to TSN features.
>
> Discussed with i226 HW owner (Shalev, Avi) and we were in agreement that
> the term "launch time" used in Section 7.5.2.6 is not clear and can be
> easily misinterpreted. Avi will update this section to:
> "When TQAVCTRL.TRANSMIT_MODE = TSN, the latency between transmission
> scheduling and the time the packet is transmitted to the network is listed
> in Table 7-61."
>
> Fix this issue by using igc_tsn_is_tx_mode_in_tsn() as a condition to
> write to gtxoffset, aligning with the newly updated SW User Manual.
>
> Tested:
> 1. Enrol taprio on talker board
>    base-time 0
>    cycle-time 1000000
>    flags 0x2
>    index 0 cmd S gatemask 0x1 interval1
>    index 0 cmd S gatemask 0x1 interval2
>
>    Note:
>    interval1 = interval for a 64 bytes packet to go through
>    interval2 = cycle-time - interval1
>
> 2. Take tcpdump on listener board
>
> 3. Use udp tai app on talker to send packets to listener
>
> 4. Check the timestamp on listener via wireshark
>
> Test Result:
> 100 Mbps: 113 ~193 ns
> 1000 Mbps: 52 ~ 84 ns
> 2500 Mbps: 95 ~ 223 ns
>
> Note that the test result is similar to the patch "igc: Correct the
> launchtime offset".
>
> Fixes: 790835fcc0cb ("igc: Correct the launchtime offset")
> Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
> Reviewed-by: Simon Horman <horms@kernel.org>
> ---

Good catch.

Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>

>  drivers/net/ethernet/intel/igc/igc_tsn.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/intel/igc/igc_tsn.c b/drivers/net/ethernet/intel/igc/igc_tsn.c
> index 9fafe275f30f..efe13a9350ca 100644
> --- a/drivers/net/ethernet/intel/igc/igc_tsn.c
> +++ b/drivers/net/ethernet/intel/igc/igc_tsn.c
> @@ -61,7 +61,7 @@ void igc_tsn_adjust_txtime_offset(struct igc_adapter *adapter)
>  	struct igc_hw *hw = &adapter->hw;
>  	u16 txoffset;
>  
> -	if (!is_any_launchtime(adapter))
> +	if (!igc_tsn_is_tx_mode_in_tsn(adapter))
>  		return;
>  
>  	switch (adapter->link_speed) {
> -- 
> 2.25.1
>


Cheers,
-- 
Vinicius

  reply	other threads:[~2024-07-10 23:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-07 12:53 [PATCH iwl-net v2 0/3] igc bug fixes related to qbv_count usage Faizal Rahim
2024-07-07 12:53 ` [PATCH iwl-net v2 1/3] igc: Fix qbv_config_change_errors logics Faizal Rahim
2024-07-07 12:57   ` [Intel-wired-lan] " kernel test robot
2024-07-10 23:46   ` Vinicius Costa Gomes
2024-08-01  7:32   ` [Intel-wired-lan] " Mor Bar-Gabay
2024-07-07 12:53 ` [PATCH iwl-net v2 2/3] igc: Fix reset adapter logics when tx mode change Faizal Rahim
2024-07-10 23:44   ` Vinicius Costa Gomes
2024-07-11 11:50     ` Abdul Rahim, Faizal
2024-07-11 18:10       ` Vinicius Costa Gomes
2024-07-17  7:02         ` Abdul Rahim, Faizal
2024-07-17 22:03           ` Vinicius Costa Gomes
2024-07-22  8:25             ` [Intel-wired-lan] " Rodrigo CADORE CATALDO
2024-08-01  7:36   ` Mor Bar-Gabay
2024-07-07 12:53 ` [PATCH iwl-net v2 3/3] igc: Fix qbv tx latency by setting gtxoffset Faizal Rahim
2024-07-10 23:48   ` Vinicius Costa Gomes [this message]
2024-08-01  7:37   ` [Intel-wired-lan] " Mor Bar-Gabay

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=87a5iou7ty.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=faizal.abdul.rahim@linux.intel.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=richardcochran@gmail.com \
    --cc=sasha.neftin@intel.com \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).