XDP hardware hints discussion mail archive
 help / color / mirror / Atom feed
From: "Song, Yoong Siang" <yoong.siang.song@intel.com>
To: Kurt Kanzenbach <kurt@linutronix.de>,
	"Bezdeka, Florian" <florian.bezdeka@siemens.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@intel.com>,
	"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@google.com>,
	"Gomes, Vinicius" <vinicius.gomes@intel.com>,
	"Fijalkowski, Maciej" <maciej.fijalkowski@intel.com>
Cc: "intel-wired-lan@lists.osuosl.org"
	<intel-wired-lan@lists.osuosl.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	"xdp-hints@xdp-project.net" <xdp-hints@xdp-project.net>
Subject: [xdp-hints] Re: [PATCH iwl-next,v4 1/1] igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet
Date: Tue, 26 Mar 2024 14:55:33 +0000	[thread overview]
Message-ID: <PH0PR11MB583028B2023E1E809B45B51DD8352@PH0PR11MB5830.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87h6gtb0p0.fsf@kurt.kurt.home>

On Tuesday, March 26, 2024 9:08 PM, Kurt Kanzenbach <kurt@linutronix.de> wrote:
>Hi Florian,
>
>On Tue Mar 26 2024, Florian Bezdeka wrote:
>> 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.
>>>
>>> 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 occupied.
>>
>> 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?

Hi Florian,

Yes, you are right. But before you pass the frame to driver, make sure
you request Tx metadata hardware timestamp feature by setting
XDP_TXMD_FLAGS_TIMESTAMP flag.
You can refer to tools/testing/selftests/bpf/xdp_hw_metadata.c
on how to do it. 

>>
>> 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.
>
>Just asking: How would that work? AFAIK XDP bypasses the Qdisc
>layer. Currently invalid Launch Times are accounted in the ETF Qdisc
>itself. Does that mean every driver has to take care of it?
>
>Thanks,
>Kurt

Florian & Kurt,

Yes, me and Stanislav are trying to add Earliest TxTime First / Launch Time to the framework.
Please refer to [1] for the patchset. The metadata framework will just pass the
Launch time value to driver, and driver need to handle the rest.
In the patchset, I am enabling it on stmmac driver only, but we need more drivers
to check whether the design is feasible for different drivers, cause each driver is
having their own limitation on launch time. Therefore, after this tx hwts patch accepted,
I will try to enable launch time on igc driver, and submit new version. 

Kurt is right that current metadata framework is lacking a way to feedback whether
the launch time is invalid or not. Maybe we can try to enable launch time without feedback,
then discuss about the status report design.

[1] https://patchwork.kernel.org/project/netdevbpf/cover/20231203165129.1740512-1-yoong.siang.song@intel.com/

Thanks & Regards
Siang

  reply	other threads:[~2024-03-26 14:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  2:09 [xdp-hints] " Song Yoong Siang
2024-03-26  2:29 ` [xdp-hints] " Vinicius Costa Gomes
2024-03-26 14:19   ` Song, Yoong Siang
2024-03-26 18:30     ` Vinicius Costa Gomes
2024-03-26  8:56 ` Florian Bezdeka
2024-03-26 13:08   ` Kurt Kanzenbach
2024-03-26 14:55     ` Song, Yoong Siang [this message]
2024-03-27 11:21       ` Florian Bezdeka
2024-03-27 14:54         ` Song, Yoong Siang
2024-03-27 15:07           ` Florian Bezdeka
2024-04-08 11:31 ` [xdp-hints] Re: [Intel-wired-lan] [PATCH iwl-next, v4 " naamax.meir

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.xdp-project.net/postorius/lists/xdp-hints.xdp-project.net/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR11MB583028B2023E1E809B45B51DD8352@PH0PR11MB5830.namprd11.prod.outlook.com \
    --to=yoong.siang.song@intel.com \
    --cc=anthony.l.nguyen@intel.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.bezdeka@siemens.com \
    --cc=hawk@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=sdf@google.com \
    --cc=vinicius.gomes@intel.com \
    --cc=xdp-hints@xdp-project.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox