From patchwork Sun Jul 7 12:53:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Abdul Rahim, Faizal" X-Patchwork-Id: 1957692 X-Patchwork-Delegate: anthony.l.nguyen@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256 header.s=default header.b=ItzRLu/9; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WH6gk3pDPz1xrJ for ; Sun, 7 Jul 2024 22:56:02 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id F33B081443; Sun, 7 Jul 2024 12:56:00 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id HMwixyy3L_el; Sun, 7 Jul 2024 12:56:00 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0BAB281490 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1720356960; bh=O9sBYVOHIy0//6nu9r1OnzH6CAnjzrkl6sIwAX2zyBQ=; h=From:To:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ItzRLu/9Y+7eBEESmt+2grHhFw/6MMC5GHeBLJ23GudosyeVNHFVJOgYOS9AJA1pA /a7YQx32F4xrDtpgtrK9V77DKwpG22JeEo8k0+nxzBSSJiTS6KOSdGTC9uyFK4MQ/F 7oq+gOHY5NWbRV6kNSos5f0irX6A7ItkYINPJ7gAI5654ZFLutmnx0ko0A3YgTPOr8 ODAoOKrlH/KlgqIoY68sL1cuxz2UaV3osT82+ThuE9lJIDvlGUd7Fo1nQPWwlWKejv GFJ8UImtF7Lmt7xteqGcB1KGd9v1rshosYowhRtYFoe+96MnLWZOMvgrE5NpJdCsxC wa+PXD/EaNJQg== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 0BAB281490; Sun, 7 Jul 2024 12:56:00 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id DDA171BF2C4 for ; Sun, 7 Jul 2024 12:55:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id CAE374064A for ; Sun, 7 Jul 2024 12:55:56 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Ya2F2UACiNBX for ; Sun, 7 Jul 2024 12:55:56 +0000 (UTC) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=198.175.65.17; helo=mgamail.intel.com; envelope-from=faizal.abdul.rahim@linux.intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org BC84740649 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BC84740649 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by smtp4.osuosl.org (Postfix) with ESMTPS id BC84740649 for ; Sun, 7 Jul 2024 12:55:55 +0000 (UTC) X-CSE-ConnectionGUID: eFPnCNhUSjOH4rXIi9pn7g== X-CSE-MsgGUID: VP2GejuVRVmhyfid+34xag== X-IronPort-AV: E=McAfee;i="6700,10204,11125"; a="17673470" X-IronPort-AV: E=Sophos;i="6.09,190,1716274800"; d="scan'208";a="17673470" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2024 05:55:55 -0700 X-CSE-ConnectionGUID: xPp/wiFMS6+0YZ9L/LZb1w== X-CSE-MsgGUID: rdCxZ3vISw62k2inJpqk0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,190,1716274800"; d="scan'208";a="47029673" Received: from linux.intel.com ([10.54.29.200]) by fmviesa006.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jul 2024 05:55:55 -0700 Received: from mohdfai2-iLBPG12-1.png.intel.com (mohdfai2-iLBPG12-1.png.intel.com [10.88.227.73]) by linux.intel.com (Postfix) with ESMTP id E556420738C7; Sun, 7 Jul 2024 05:55:50 -0700 (PDT) From: Faizal Rahim To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jesse Brandeburg , Tony Nguyen , Vinicius Costa Gomes , Simon Horman , Richard Cochran , Paul Menzel , Sasha Neftin Date: Sun, 7 Jul 2024 08:53:18 -0400 Message-Id: <20240707125318.3425097-4-faizal.abdul.rahim@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240707125318.3425097-1-faizal.abdul.rahim@linux.intel.com> References: <20240707125318.3425097-1-faizal.abdul.rahim@linux.intel.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720356956; x=1751892956; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yq9fdn79P/7uXLeqkaqvokXNESEJw6LEGZiE5haj0rk=; b=hwA0rndFL9qfbsFDksMiZ9cLIUW95MBJqaXu6vX5rTz03hrpYBwfeg4a bR75vWbo8a6nM32+foCXYXIWbfa7BZLiosw2ARKNDEyLgrekVt+pGDwab gglGxl4mO16WJUdZmYseF1ZAav2Zv52wqTCJwugugmlV2ofo7HAaR5qZc nXnsLlx5gqk6LSoP1voXioI2h5xYtmjGG1r6ETwQKPPV1Wc78gBGnmObp HfWfA0ENt7xmq5cezs0tCtGOv3t10dX40w0l5lSM4B6RtUrJlYX23Bflb DNA4ZdUzZUyn03N8Q6vyplsZBptDFYGHuUkqNRqW+N3KOd9pVUo+J3pi5 Q==; X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=none (p=none dis=none) header.from=linux.intel.com X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=hwA0rndF Subject: [Intel-wired-lan] [PATCH iwl-net v2 3/3] igc: Fix qbv tx latency by setting gtxoffset X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Faizal Rahim Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" 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 Reviewed-by: Simon Horman Acked-by: Vinicius Costa Gomes Tested-by: Mor Bar-Gabay --- 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) {