From patchwork Tue Feb 13 11:54:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 200406 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp481290dyb; Tue, 13 Feb 2024 03:54:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUm/z2uInPlp6gXqZUxB6pliS1rdmq0TI7Mo9ZeGoM8z3XDJp7uztiHq/JunJoyLDINzeG0+Zvk1DRssCQjA0WcVm7R7w== X-Google-Smtp-Source: AGHT+IHjoeatsq14DBWx5GAgxgq3RHXDt12x2BRCPJM3CKEd3BhvGjbig5GR1hSJid4gdVzqmpen X-Received: by 2002:a17:906:e293:b0:a3c:d850:35ec with SMTP id gg19-20020a170906e29300b00a3cd85035ecmr2756737ejb.57.1707825294272; Tue, 13 Feb 2024 03:54:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707825294; cv=pass; d=google.com; s=arc-20160816; b=K1qpEeADYoaifGHZxFkeDHfIk5vU4yzqv791lXc7WGdzkLo2jKAJH/zSBpZqsHY7Db GYMDmOHC6u8oaaX+TYa0jdbc6itb8oiZWpsI7S5e8D+1DpLqwmZKNgFZxnP0ev1wBwTz f7EmgGXO4qI5X5z6mmIDX2GSN2eu3OPDlOWFY74SGQSWJIMZPTmszsEvV3ezwo17pAe/ 9FBGe0dOt/Zw+s9YwtaVMj3tLT3GnSsT8npAhcCoKjzWWKoX9+x7WWxTclYAxBgdD7qh 2j8Aa48WWzZZ6VxSdk2rvL7OIfk0uOJ7pFHBPY+9w3YIlT3TKNkTiWP1oeHoUVD2ythc 8XUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=G6E1c5a70uX5WskRb30AYCKyrJuyjaP4ln0W8y14wHk=; fh=ltNeGRLrkdydK3JbU2GwpZ6Q/+jG/h45+hQB4k2jW04=; b=iFbl5HiU6tWZGb3v/JEnsDX7i6raFAMyh4N8PqfTuhfq7w+PtyZadCRD/fIWHy0hkY 49bTdK3uzQCQTn65Da22w6IPtFSU85889FvqBwhOBDKnUiaQwK1/Ia1vT8h+9i+LYKgb QFAbPqEydv4tTshufqZXyjq7YIBuMwt2d8bW018lnyCplFvQOYKiib2Rcr6h9TGFrxw2 Dfd1estPih6vUOyfE+LTMeLzE1loff04m2UnYDrZMbXLCjpXTev6E2FULxThk1+a3AVC GfJ6ENKbkirYHgeUj6WjS7yjN2E5D3M6J7r3vDyZUqLOObcZGDO+lA5dSdsxGZ51VpTx lmUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-63468-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63468-ouuuleilei=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVdW8U+3+BXFtfr+rFsNzpL0eQf0HnTzHMlUhMdlZMOWR/6j+5LKgL3i0snHiU7cDdnY67tiAAseoLBv+1ewMXg3LOMfg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o11-20020a1709062e8b00b00a3c2bfc9086si1123827eji.624.2024.02.13.03.54.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 03:54:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63468-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-63468-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63468-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DF3F61F21BBF for ; Tue, 13 Feb 2024 11:54:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C701138DDA; Tue, 13 Feb 2024 11:54:36 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DF6F38DD5 for ; Tue, 13 Feb 2024 11:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707825275; cv=none; b=k2xDk36krfMkTe5yQQiPLM2tfXXdnn6yxPjHIdRTGuqqaajTYFQmtbqjfgZBEY7PnkzUt4Rlir8+M+W0cH1a/wVMObDDangXnhUIWeuAlyNT18OJR3SMYKI5QJa5DTcezdC+2c01laECwytQ4w3RHG2qUVccMFZdd11cnbrwRl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707825275; c=relaxed/simple; bh=Ni7xNNrORfQyk4//WfrA8+aD1m/BPMiC7sdc0udhltU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=MMyhJ4ajQAtAmWpJwDx/mim+pOw4c3Eo0BbTqSlQmCpPNpazz6y6EfpNF84t7CoZd90PG4YiwTfDMW0sjBHdmGsrtmzuV1Q8dv9x1tEy8fZwggxii6megPnFndG/kLYcwNgXkU30TOlNioYruOS5Q0fI/HUNzCLvPtIfwxoUsIE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rZrMc-0004OR-HU; Tue, 13 Feb 2024 12:54:14 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rZrMa-000TeD-46; Tue, 13 Feb 2024 12:54:12 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rZrMa-001k76-0B; Tue, 13 Feb 2024 12:54:12 +0100 From: Oleksij Rempel To: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran Cc: Oleksij Rempel , kernel@pengutronix.de, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net v1 1/1] igb: extend PTP timestamp adjustments to i211 Date: Tue, 13 Feb 2024 12:54:10 +0100 Message-Id: <20240213115410.415573-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790784615581592903 X-GMAIL-MSGID: 1790784615581592903 The i211 requires the same PTP timestamp adjustments as the i210, according to its datasheet. To ensure consistent timestamping across different platforms, this change extends the existing adjustments to include the i211. The adjustment result are tested and comparable for i210 and i211 based systems. Fixes: 3f544d2a4d5c ("igb: adjust PTP timestamps for Tx/Rx latency") Signed-off-by: Oleksij Rempel Reviewed-by: Jacob Keller Tested-by: Pucha Himasekhar Reddy (A Contingent worker at Intel) --- drivers/net/ethernet/intel/igb/igb_ptp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index 319c544b9f04..f94570556120 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -957,7 +957,7 @@ static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter) igb_ptp_systim_to_hwtstamp(adapter, &shhwtstamps, regval); /* adjust timestamp for the TX latency based on link speed */ - if (adapter->hw.mac.type == e1000_i210) { + if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) { switch (adapter->link_speed) { case SPEED_10: adjust = IGB_I210_TX_LATENCY_10; @@ -1003,6 +1003,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va, ktime_t *timestamp) { struct igb_adapter *adapter = q_vector->adapter; + struct e1000_hw *hw = &adapter->hw; struct skb_shared_hwtstamps ts; __le64 *regval = (__le64 *)va; int adjust = 0; @@ -1022,7 +1023,7 @@ int igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void *va, igb_ptp_systim_to_hwtstamp(adapter, &ts, le64_to_cpu(regval[1])); /* adjust timestamp for the RX latency based on link speed */ - if (adapter->hw.mac.type == e1000_i210) { + if (hw->mac.type == e1000_i210 || hw->mac.type == e1000_i211) { switch (adapter->link_speed) { case SPEED_10: adjust = IGB_I210_RX_LATENCY_10;