bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Stanislav Fomichev <sdf@google.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, martin.lau@linux.dev, song@kernel.org,
	yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org,
	haoluo@google.com, jolsa@kernel.org, netdev@vger.kernel.org
Subject: Re: [RFC bpf-next v2 06/11] net: veth: Implement devtx timestamp kfuncs
Date: Mon, 26 Jun 2023 18:38:39 -0700	[thread overview]
Message-ID: <87y1k5ptuo.fsf@intel.com> (raw)
In-Reply-To: <CAKH8qBvnqOvCnp2C=hmPGwCcEz4UkuE9nod2N9sNmpPve9n_CQ@mail.gmail.com>

Stanislav Fomichev <sdf@google.com> writes:

> On Mon, Jun 26, 2023 at 3:00 PM Vinicius Costa Gomes
> <vinicius.gomes@intel.com> wrote:
>>
>> Stanislav Fomichev <sdf@google.com> writes:
>>
>> > On Fri, Jun 23, 2023 at 4:29 PM Vinicius Costa Gomes
>> > <vinicius.gomes@intel.com> wrote:
>> >>
>> >> Stanislav Fomichev <sdf@google.com> writes:
>> >>
>> >> > Have a software-based example for kfuncs to showcase how it
>> >> > can be used in the real devices and to have something to
>> >> > test against in the selftests.
>> >> >
>> >> > Both path (skb & xdp) are covered. Only the skb path is really
>> >> > tested though.
>> >> >
>> >> > Cc: netdev@vger.kernel.org
>> >> > Signed-off-by: Stanislav Fomichev <sdf@google.com>
>> >>
>> >> Not really related to this patch, but to how it would work with
>> >> different drivers/hardware.
>> >>
>> >> In some of our hardware (the ones handled by igc/igb, for example), the
>> >> timestamp notification comes some time after the transmit completion
>> >> event.
>> >>
>> >> From what I could gather, the idea would be for the driver to "hold" the
>> >> completion until the timestamp is ready and then signal the completion
>> >> of the frame. Is that right?
>> >
>> > Yeah, that might be the option. Do you think it could work?
>> >
>>
>> For the skb and XDP cases, yeah, just holding the completion for a while
>> seems like it's going to work.
>>
>> XDP ZC looks more complicated to me, not sure if it's only a matter of
>> adding something like:
>
> [..]
>
>> void xsk_tx_completed_one(struct xsk_buff_pool *pool, struct xdp_buff *xdp);
>>
>> Or if more changes would be needed. I am trying to think about the case
>> that the user sent a single "timestamp" packet among a bunch of
>> "non-timestamp" packets.
>
> Since you're passing xdp_buff as an argument I'm assuming that is
> suggesting out-of-order completions?
> The completion queue is a single index, we can't do ooo stuff.
> So you'd have to hold a bunch of packets until you receive the
> timestamp completion; after this event, you can complete the whole
> batch (1 packet waiting for the timestamp + a bunch that have been
> transmitted afterwards but were still unacknowleged in the queue).
>
> (lmk if I've misinterpreted)

Not at all, it was me that wasn't aware that out-of-order completions
were out of the picture.

So, yeah, what you are proposing, accumulating the pending completions
while there's a pending timestamp request, seems the only way to go.

The logic seems simple enough, but the fact that the "timestamp ready"
interrupt is not associated with any queue seems that it will make
things a bit "interesting" to get it right :-) 

But I don't have any better suggestions.


Thank you,
-- 
Vinicius

  reply	other threads:[~2023-06-27  1:38 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 17:02 [RFC bpf-next v2 00/11] bpf: Netdev TX metadata Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 01/11] bpf: Rename some xdp-metadata functions into dev-bound Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 02/11] bpf: Resolve single typedef when walking structs Stanislav Fomichev
2023-06-22  5:17   ` Alexei Starovoitov
2023-06-22 17:55     ` Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 03/11] xsk: Support XDP_TX_METADATA_LEN Stanislav Fomichev
2023-06-22  9:11   ` Jesper D. Brouer
2023-06-22 17:55     ` Stanislav Fomichev
2023-06-23 10:24       ` Jesper Dangaard Brouer
2023-06-23 17:41         ` Stanislav Fomichev
2023-06-24  9:02           ` Jesper Dangaard Brouer
2023-06-26 17:00             ` Stanislav Fomichev
2023-06-28  8:09               ` Magnus Karlsson
2023-06-28 18:49                 ` Stanislav Fomichev
2023-06-29  6:15                   ` Magnus Karlsson
2023-06-29 11:30                   ` [xdp-hints] " Toke Høiland-Jørgensen
2023-06-29 11:48                     ` Magnus Karlsson
2023-06-29 12:01                       ` Toke Høiland-Jørgensen
2023-06-29 16:21                         ` Stanislav Fomichev
2023-06-29 20:58                           ` Toke Høiland-Jørgensen
2023-06-30  6:22                         ` Magnus Karlsson
2023-06-30  9:19                           ` Toke Høiland-Jørgensen
2023-06-22 15:26   ` Simon Horman
2023-06-22 17:55     ` Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 04/11] bpf: Implement devtx hook points Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 05/11] bpf: Implement devtx timestamp kfunc Stanislav Fomichev
2023-06-22 12:07   ` Jesper D. Brouer
2023-06-22 17:55     ` Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 06/11] net: veth: Implement devtx timestamp kfuncs Stanislav Fomichev
2023-06-23 23:29   ` Vinicius Costa Gomes
2023-06-26 17:00     ` Stanislav Fomichev
2023-06-26 22:00       ` Vinicius Costa Gomes
2023-06-26 23:29         ` Stanislav Fomichev
2023-06-27  1:38           ` Vinicius Costa Gomes [this message]
2023-06-21 17:02 ` [RFC bpf-next v2 07/11] selftests/xsk: Support XDP_TX_METADATA_LEN Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 08/11] selftests/bpf: Add helper to query current netns cookie Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 09/11] selftests/bpf: Extend xdp_metadata with devtx kfuncs Stanislav Fomichev
2023-06-23 11:12   ` Jesper D. Brouer
2023-06-23 17:40     ` Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 10/11] selftests/bpf: Extend xdp_hw_metadata " Stanislav Fomichev
2023-06-21 17:02 ` [RFC bpf-next v2 11/11] net/mlx5e: Support TX timestamp metadata Stanislav Fomichev
2023-06-22 19:57   ` Alexei Starovoitov
2023-06-22 20:13     ` Stanislav Fomichev
2023-06-22 21:47       ` Alexei Starovoitov
2023-06-22 22:13         ` Stanislav Fomichev
2023-06-23  2:35           ` Alexei Starovoitov
2023-06-23 10:16             ` Maryam Tahhan
2023-06-23 16:32               ` Alexei Starovoitov
2023-06-23 17:47                 ` Maryam Tahhan
2023-06-23 17:24             ` Stanislav Fomichev
2023-06-23 18:57             ` Donald Hunter
2023-06-24  0:25               ` John Fastabend
2023-06-24  2:52                 ` Alexei Starovoitov
2023-06-24 21:38                   ` Jakub Kicinski
2023-06-25  1:12                     ` Stanislav Fomichev
2023-06-26 21:36                       ` Stanislav Fomichev
2023-06-26 22:37                         ` Alexei Starovoitov
2023-06-26 23:29                           ` Stanislav Fomichev
2023-06-27 13:35                             ` Toke Høiland-Jørgensen
2023-06-27 21:43                             ` John Fastabend
2023-06-27 22:56                               ` Stanislav Fomichev
2023-06-27 23:33                                 ` John Fastabend
2023-06-27 23:50                                   ` Alexei Starovoitov
2023-06-28 18:52                               ` Jakub Kicinski
2023-06-29 11:43                                 ` Toke Høiland-Jørgensen
2023-06-30 18:54                                   ` Stanislav Fomichev
2023-07-01  0:52                                   ` John Fastabend
2023-07-01  3:11                                     ` Jakub Kicinski
2023-07-03 18:30                                       ` John Fastabend
2023-07-03 19:33                                         ` Jakub Kicinski
2023-06-22  8:41 ` [RFC bpf-next v2 00/11] bpf: Netdev TX metadata Jesper Dangaard Brouer
2023-06-22 17:55   ` Stanislav Fomichev

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

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

  git send-email \
    --in-reply-to=87y1k5ptuo.fsf@intel.com \
    --to=vinicius.gomes@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.com \
    /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;
as well as URLs for NNTP newsgroup(s).