From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87C1DC7EE23 for ; Wed, 7 Jun 2023 21:32:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 234B140FCC; Wed, 7 Jun 2023 21:32:44 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 234B140FCC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1686173564; bh=07aZGKlkXGobb/EaeWDgqbFipV6hA7GqT2In/YJc6Bs=; h=From:To:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=VVjFYOcFjSyiL6h7mRvkIIk6PkSbJYkAhXYaGxv3BY8HCInbofxlUcB4xhKiKs+3m qvO0s8m+xyQW9Ck5OmMRdcwc+ySl35a+2WMpoReN6YdMGc9rB6br9OM7BbU1uVlcF/ +Vh83TZwwJeGdfQsfJMwMhnOclvKOIYh4BV7fo5wmSLvfqt2Nem2okHAY4RWZtd+5m 7Yq6wHMWKWNcSZjOkR/VdIrAjk1kw3tfvlQNmV0p860F9FL7OhyCPM0lCna3+DC61O rGu/xtNUJC29iBX5GG1tRJOCiKQgwq9RJw1hXnn2e7rnfFb4raezpIefm/a9mWhY5W j52hF9o5kZ7SQ== X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FVlME5p69Ixp; Wed, 7 Jun 2023 21:32:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id E84E541736; Wed, 7 Jun 2023 21:32:42 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org E84E541736 Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id A754B1BF3CD for ; Wed, 7 Jun 2023 21:32:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 8AC6C612D7 for ; Wed, 7 Jun 2023 21:32:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 8AC6C612D7 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xoaWaVsv940S for ; Wed, 7 Jun 2023 21:32:40 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5859160B36 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by smtp3.osuosl.org (Postfix) with ESMTPS id 5859160B36 for ; Wed, 7 Jun 2023 21:32:40 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="336741869" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="336741869" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 14:32:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10734"; a="742853909" X-IronPort-AV: E=Sophos;i="6.00,225,1681196400"; d="scan'208";a="742853909" Received: from adtotpal-mobl.amr.corp.intel.com (HELO vcostago-mobl3.intel.com) ([10.209.21.176]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2023 14:32:38 -0700 From: Vinicius Costa Gomes To: intel-wired-lan@lists.osuosl.org Date: Wed, 7 Jun 2023 14:32:28 -0700 Message-Id: <20230607213232.875138-1-vinicius.gomes@intel.com> X-Mailer: git-send-email 2.40.1 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=1686173560; x=1717709560; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=6iV+6S4OpkrSRaWa4Pjyg2A6iuSCRweq0rfR6NScJh0=; b=I5N4pexltt9DQlC54qM7ZkO+We5VcVBQSuiaXYEvq61WtSjPsSxRHmAw agCcvMZ7BZ7rnR4jFa6zTkgM91MXmplAEZJ446/66ELUwoypWrLnaFSwq +JBt9RD2wf606xYMjXj+O2zB2NSLoskJ1WDGX2/I4hRsom/auyU8APC8R KalHKCYJ7RgQk4G+8IxSGT5s01SCj4JCDCYqOjGNTZVVk0uE8EEdsjTZR itWL1E0EEmaZQwjK74vD4DABLv7h331yyKhGJ10zi111yH1BDKA3ibv+U iZ0M8cgw+aSOM4qXAznzYW8sa2mdV+lbJJReFc4eVseiwjPyXmEhhxVe4 w==; X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=I5N4pexl Subject: [Intel-wired-lan] [PATCH iwl-net v4 0/4] igc: TX timestamping fixes 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: vladimir.oltean@nxp.com, kurt@linutronix.de, anthony.l.nguyen@intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Hi, Changes from v3: - Improved commit message, added more details about how to trigger the hardware issue, and more details about the alternative workaround to the cover letter (Paul Menzel); Changes from v2: - Fixed possible race condition when disabling TX timestamping, added a per queue flag, should make the hot path (no timestamps enabled) a bit nicer (Jakub Kicinski); - Renamed the igc_ptp_tx_work() to something more sensible (it's no longer called in a workqueue) (Marc Kleine-Budde); - Added some numbers, from the cover letter, to the commit message itself (Paul Menzel); Changes from v1: - Squashed 3/5 into 1/5 (from v1), into 2/4 (v2) (Tony Nguyen); - Improved the commit message of 1/4 (Kurt Kanzenbach); - Added "Reviewed-by:" tags; v1 link: https://lore.kernel.org/intel-wired-lan/20230504235233.1850428-1-vinicius.gomes@intel.com/ Changes from the "for-next-queue" version: - As this is intended for the iwl/net-queue tree, removed adding support for adding the "extra" tstamp registers; - Added "Fixes:" tags to the appropriate patches (Vladimir Oltean); - Improved the check to catch the case that the skb has the SKBTX_HW_TSTAMP flag, but TX timestamping is not enabled (Vladimir Oltean); - Ony check for timestamping timeouts if TX timestamping is enabled (Vladimir Oltean); for-next-queue version link: https://lore.kernel.org/intel-wired-lan/20230228054534.1093483-1-vinicius.gomes@intel.com/ This is the fixes part of the series intended to add support for using the 4 timestamp registers present in i225/i226. Moving the timestamp handling to be inline with the interrupt handling has the advantage of improving the TX timestamping retrieval latency, here are some numbers using ntpperf: Before: $ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37 | responses | TX timestamp offset (ns) rate clients | lost invalid basic xleave | min mean max stddev 1000 100 0.00% 0.00% 0.00% 100.00% -56 +9 +52 19 1500 150 0.00% 0.00% 0.00% 100.00% -40 +30 +75 22 2250 225 0.00% 0.00% 0.00% 100.00% -11 +29 +72 15 3375 337 0.00% 0.00% 0.00% 100.00% -18 +40 +88 22 5062 506 0.00% 0.00% 0.00% 100.00% -19 +23 +77 15 7593 759 0.00% 0.00% 0.00% 100.00% +7 +47 +5168 43 11389 1138 0.00% 0.00% 0.00% 100.00% -11 +41 +5240 39 17083 1708 0.00% 0.00% 0.00% 100.00% +19 +60 +5288 50 25624 2562 0.00% 0.00% 0.00% 100.00% +1 +56 +5368 58 38436 3843 0.00% 0.00% 0.00% 100.00% -84 +12 +8847 66 57654 5765 0.00% 0.00% 100.00% 0.00% 86481 8648 0.00% 0.00% 100.00% 0.00% 129721 12972 0.00% 0.00% 100.00% 0.00% 194581 16384 0.00% 0.00% 100.00% 0.00% 291871 16384 27.35% 0.00% 72.65% 0.00% 437806 16384 50.05% 0.00% 49.95% 0.00% After: $ sudo ./ntpperf -i enp3s0 -m 10:22:22:22:22:21 -d 192.168.1.3 -s 172.18.0.0/16 -I -H -o -37 | responses | TX timestamp offset (ns) rate clients | lost invalid basic xleave | min mean max stddev 1000 100 0.00% 0.00% 0.00% 100.00% -44 +0 +61 19 1500 150 0.00% 0.00% 0.00% 100.00% -6 +39 +81 16 2250 225 0.00% 0.00% 0.00% 100.00% -22 +25 +69 15 3375 337 0.00% 0.00% 0.00% 100.00% -28 +15 +56 14 5062 506 0.00% 0.00% 0.00% 100.00% +7 +78 +143 27 7593 759 0.00% 0.00% 0.00% 100.00% -54 +24 +144 47 11389 1138 0.00% 0.00% 0.00% 100.00% -90 -33 +28 21 17083 1708 0.00% 0.00% 0.00% 100.00% -50 -2 +35 14 25624 2562 0.00% 0.00% 0.00% 100.00% -62 +7 +66 23 38436 3843 0.00% 0.00% 0.00% 100.00% -33 +30 +5395 36 57654 5765 0.00% 0.00% 100.00% 0.00% 86481 8648 0.00% 0.00% 100.00% 0.00% 129721 12972 0.00% 0.00% 100.00% 0.00% 194581 16384 19.50% 0.00% 80.50% 0.00% 291871 16384 35.81% 0.00% 64.19% 0.00% 437806 16384 55.40% 0.00% 44.60% 0.00% During this series, and to show that as is always the case, things are never easy as they should be, a hardware issue was found, and it took some time to find the workaround(s). The bug and workaround are better explained in patch 5/5. Note: the workaround has an alternative, we could use the first set of timestamp registers (TXSTMP{H/L}_0) as *only* a way to clear the interrupt, and the problem won't manifest. But that means that we would only have 3 sets of "useful" registers to store timestamps, wasting the first set. Support for these extra registers is going to added in a later series. My impression is that wasting these resources is not a good a idea, as it is already easy to request more timestamps than what can be serviced by the hardware. Also, as Marc Kleine-Budde suggested, after some consensus is reached on this series, most parts of it will be proposed for igb. Vinicius Costa Gomes (4): igc: Fix race condition in PTP tx code igc: Check if hardware TX timestamping is enabled earlier igc: Retrieve TX timestamp during interrupt handling igc: Work around HW bug causing missing timestamps drivers/net/ethernet/intel/igc/igc.h | 8 +- drivers/net/ethernet/intel/igc/igc_main.c | 14 ++- drivers/net/ethernet/intel/igc/igc_ptp.c | 146 +++++++++++++++------- 3 files changed, 119 insertions(+), 49 deletions(-) -- 2.40.1 _______________________________________________ Intel-wired-lan mailing list Intel-wired-lan@osuosl.org https://lists.osuosl.org/mailman/listinfo/intel-wired-lan