From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net [185.136.64.226]) (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 931AA1B947 for ; Tue, 26 Mar 2024 09:08:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.136.64.226 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711444110; cv=none; b=tRwT7LEm8r/4nzvxJB/XMF0tFxbVQzL496m4gacxqz9BF/BmtqUPanghNa3EgXqZ9YOKaflBgWGkORCEbReWUuW5qOguwSPT1/pCuUzfbzYVbbCnsy6j8B48ANGbZZXoRZiMLdAxx3+TvQlktJDBO9gu8PNy5g6+ul6dD3b3Xww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711444110; c=relaxed/simple; bh=2NnN3yr0wpdVoxDzh4ChyQUmMIKdzLGg6sxkzDgAI3o=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=D8Ma9nnnidTI+t7A4Y+NGTyu5WIvDCU5ea3db+NeKpIkQb4uL7IRhFkqWjLfxXRPOh+H3qOnOiEfnA94PTQZxL79Np9TNNsc9jMiLuT1MdefWCtcnRR0OxPBv1xV5jbUazNjuP2Lhvu3G42bvMAAXpzLgiow8CRqSTbwZ77cdIw= 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.64.226 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 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: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 20240326085656295efde5880dc4a6de for ; Tue, 26 Mar 2024 09:57:56 +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=3D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l33+UIVX1Q8zo7eyMJHzLJQ3I=3D?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: netdev@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.