Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3186227lqp; Tue, 26 Mar 2024 01:58:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX+EOp8dVq5Gqy3/U1yfwWkPtCLB0QQc+7WRjvRJKuu+UsmNNku1W+bikjxdh0RoOMXAowykGAQ/IMAROC9DCY86iWjyjTJa0Gz54G5zg== X-Google-Smtp-Source: AGHT+IHRowQgW+MOettLPFx9aw3gAej2pWwv9L3fXoI6IoEOtGmAJAWuuPZNjOXAailFEK10c9FJ X-Received: by 2002:a05:6402:124d:b0:56c:995:5b with SMTP id l13-20020a056402124d00b0056c0995005bmr5597459edw.11.1711443525917; Tue, 26 Mar 2024 01:58:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711443525; cv=pass; d=google.com; s=arc-20160816; b=V0hkqocN5/nwXyIM+X0kHPeOftwtQmajP6A7zkN4/DPjEyiMgQQ1e9+BnjSsYeIaPd /GsIKWFAmcf2mKb0o6QZXqIj/8SOh4no8o5TEj4KGZ3hm2VaKOaM/qGOCOq+CY56mH4N cZ/n39EU8G3NymQRKckNE0Bj6Kh9/4hgLFKs9PDdSaze4cE6mXCzGJZvm8xsxigKd9Ab uE7LmP/ledkvd7GK6CJz3nmZ96uI+N75cAEmXXpP7g39Ce13/QUsMiJlSzKxbO37l+Ml gHC6+kfb7dQTMvVObN2OlnD7dS9wPWKa1W51SF6iFfUMzhuJmKLaQ3sQeYAr10iao6FK 0szQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=2NnN3yr0wpdVoxDzh4ChyQUmMIKdzLGg6sxkzDgAI3o=; fh=o1QRfACAaH0iDCOeluNDtKcrT5o6qO5X41phgHhBI7M=; b=xamqVw+j6UmH6IkrvdCzDPM+Lmn6EKr4DIM9ldFFa636n5FEviOnUeYz2RxHJAmEES 7E1GMFqHovtObzxHKn7fs18jVaDugUJYL8A39DfE0eSSs2bKYYdl4oKOjQdCHP3A6yOC phe4qxUsxzwrW0UIb37uEbHhHXHyUHO6573Atu2lO34Qq+PSyaw+SUN5RTpB4eO/arQW uDmbZQztM9IibAMZCBIpO+8mieFiM9pGqvTqENy2iemFHAYMknTNgEUzwp4DTKSsqTEo uDREBCnaBoSlU8rwCDx50p71zhsInVnwhC+dTcs6sxpR3pK1PflrQ/vMBEqBbO3K8MIi xNoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=ZnoEPez1; arc=pass (i=1 spf=pass spfdomain=rts-flowmailer.siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of linux-kernel+bounces-118590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d15-20020a056402400f00b0056c1a64ad8fsi293531eda.244.2024.03.26.01.58.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 01:58:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=ZnoEPez1; arc=pass (i=1 spf=pass spfdomain=rts-flowmailer.siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of linux-kernel+bounces-118590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com 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 A0C221F3BF87 for ; Tue, 26 Mar 2024 08:58:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 110C543ADF; Tue, 26 Mar 2024 08:58:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=siemens.com header.i=florian.bezdeka@siemens.com header.b="ZnoEPez1" Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) (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 1742E18AEA for ; Tue, 26 Mar 2024 08:57:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.65.225 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711443487; cv=none; b=Z9C4GOaOPRrWg1tTxPhvipP9FFz/f7xP/y/eiCF0S+bD069YUH5vgsFQaxxOdDAJiv0o8EVFT4KBqNzV1nlsWsarQX/etqmhqtkUGfPqc6aoSLi+dq7W66LBeKFN5xlA/zr3mqYxEiPgPvHPyTdFHm9B6Ug5OhlrvLx5pqvMjiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711443487; c=relaxed/simple; bh=2NnN3yr0wpdVoxDzh4ChyQUmMIKdzLGg6sxkzDgAI3o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=XBuBcvCUf/fdro6uOGYd8YkGP624E04DO8mJFFNDv0wdER0cshlFDog7ep73UvvzwzD90lN6NDK9cXQ/uBldHSEhZB+yU3dU/qqbeqDph1rkkNZ1yHwrgeWWGWswAzx6V+t68r3jKWrXxEUC3MjApvjyX6ZxpGfGdIPmOrImpKY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com; dkim=pass (1024-bit key) header.d=siemens.com header.i=florian.bezdeka@siemens.com header.b=ZnoEPez1; arc=none smtp.client-ip=185.136.65.225 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=siemens.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rts-flowmailer.siemens.com Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 2024032608565660d22323bb46d4a510 for ; Tue, 26 Mar 2024 09:57:45 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=florian.bezdeka@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=2NnN3yr0wpdVoxDzh4ChyQUmMIKdzLGg6sxkzDgAI3o=; b=ZnoEPez1s9mkret+84aiVoBbI7kPnBo2K4g9LdoGjJ6Vk+54YX25G3Z0y+4eJYiwYj9198 nShsv9+TKBXTbNRidg9c/ePK/1HTATRNvXrX5F8nP9DbiWexkWFe2E3jYfd0oSnZt4QonXdX PS7EotffJHiFxuv+AOwqR675HZ0WQ=; Message-ID: Subject: Re: [PATCH iwl-next,v4 1/1] igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet From: Florian Bezdeka To: Song Yoong Siang , Jesse Brandeburg , Tony Nguyen , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Richard Cochran , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , Stanislav Fomichev , Vinicius Costa Gomes , Kurt Kanzenbach , Maciej Fijalkowski Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, xdp-hints@xdp-project.net Date: Tue, 26 Mar 2024 09:56:54 +0100 In-Reply-To: <20240325020928.1987947-1-yoong.siang.song@intel.com> References: <20240325020928.1987947-1-yoong.siang.song@intel.com> Autocrypt: =?US-ASCII?Q?addr=3Dflorian.bezdeka@siemen?= =?US-ASCII?Q?s.com;_prefer-encrypt=3Dmutual?= =?US-ASCII?Q?;_keydata=3DmQENBFwsf8QBCAC2f4AQWu92LZC4bKyUYRxWIpWqGz790s?= =?US-ASCII?Q?pcYkXO7M8kfea4iC8qMxv2hT4HT0LTncRP6WiovVN2PeoOBfN5BSa5z?= =?US-ASCII?Q?LIrZGVXh7KmbdKhwhVU+ynoTq9G5uaO2Kos7Vv7nNCuatIq8tSNILuoB?= =?US-ASCII?Q?DFTAZnJW3y1V7YOwhDCPl5gbLSYqUY3OE0yksbtCcVI5istT4ED6mjQ?= =?US-ASCII?Q?9W+3uH1LrgFeEF0oxTjrEPxO5ZYATz0f/TYC8WiM0sMrV+n0eMDntlzA?= =?US-ASCII?Q?63D6lcRi5mNp2jPsJkq3tbWqyCrAe1sKPVJB44ekFwCk0kDIuhR13Q3R?= =?US-ASCII?Q?HE4Or/9sznhMUQjYueWXvTZfzH/VsQJHABEBAAG0LUZsb3JpYW4gQmV6?= =?US-ASCII?Q?ZGVrYSA8Zmxvcmlhbi5iZXpkZWthQHNpZW1lbnMuY29tPokBVAQTAQg?= =?US-ASCII?Q?APhYhBAzL4P3jiTHdthsq4cj0O1fnOEBVBQJcLH/FAhsDBQkB4TOABQs?= =?US-ASCII?Q?JCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEMj0O1fnOEBVc6YIAJ8oO4x?= =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-ASCII?Q?4fsWOxco38e74MsazoUdfndTYP5tgaYTVE51ZhOZBl+4jYaywsmmFm9g?= =?US-ASCII?Q?6N4Tw3GiMEDB4YU1X7gQZ60fDKpYL5SnCu5qZirJ4RCV4LDA0789ir+6?= =?US-ASCII?Q?8/zfwXBTV5QoMH0+MkXB4BL+Km3f7X/GdN5oRoItAyKDBcEfGJo6afT?= =?US-ASCII?Q?PtcUdI9n7ExCSfJwb0SBvvkvUsdNppFDGOOHSioINbEHBs2VUvE43toM?= =?US-ASCII?Q?4mPLfhFIAtDcn5Byt80/kotU8v3Iyf86NYCa+0h77xTsKHcCUqe8Rvow?= =?US-ASCII?Q?bCIbig9GGbbd54TasfqQQOiAkn/WeGl33+UIVX1Q8zo7eyMJHzLJQ3I=3D?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-68982:519-21489:flowmailer On Mon, 2024-03-25 at 10:09 +0800, Song Yoong Siang wrote: > This patch adds support to per-packet Tx hardware timestamp request to > AF_XDP zero-copy packet via XDP Tx metadata framework. Please note that > user needs to enable Tx HW timestamp capability via igc_ioctl() with > SIOCSHWTSTAMP cmd before sending xsk Tx hardware timestamp request. >=20 > Same as implementation in RX timestamp XDP hints kfunc metadata, Timer 0 > (adjustable clock) is used in xsk Tx hardware timestamp. i225/i226 have > four sets of timestamping registers. *skb and *xsk_tx_buffer pointers > are used to indicate whether the timestamping register is already occupie= d. Let me make sure that I fully understand that: In my own words: With that applied I'm able to get the point in time from the device when a specific frame made it to the wire. I have to enable that functionality using the mentioned ioctl() call first, and then check the meta area (located in the umem right before the frame payload) while consuming the completion queue/ring. Correct? If so, we now have a feedback channel for meta information for/from TX. Are there any plans - or would it be possible - to support Earliest TxTime First (NET_SCHED_ETF) QDisc based on that channel? In the past we had the problem that we we're missing a feedback channel to communicate back invalid lunch times. =20 >=20 > Furthermore, a boolean variable named xsk_pending_ts is used to hold the > transmit completion until the tx hardware timestamp is ready. This is > because, for i225/i226, the timestamp notification event comes some time > after the transmit completion event. The driver will retrigger hardware i= rq > to clean the packet after retrieve the tx hardware timestamp. >=20 > Besides, xsk_meta is added into struct igc_tx_timestamp_request as a hook > to the metadata location of the transmit packet. When the Tx timestamp > interrupt is fired, the interrupt handler will copy the value of Tx hwts > into metadata location via xsk_tx_metadata_complete(). >=20 > This patch is tested with tools/testing/selftests/bpf/xdp_hw_metadata > on Intel ADL-S platform. Below are the test steps and results.