mbox series

[bpf-next,v8,00/17] xdp: hints via kfuncs

Message ID 20230119221536.3349901-1-sdf@google.com (mailing list archive)
Headers show
Series xdp: hints via kfuncs | expand

Message

Stanislav Fomichev Jan. 19, 2023, 10:15 p.m. UTC
Please see the first patch in the series for the overall
design and use-cases.

See the following email from Toke for the per-packet metadata overhead:
https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798

Recent changes:
- Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)

- Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)

- Clarify xdp_buff vs 'XDP frame' (Jesper)

- Explicitly mention that AF_XDP RX descriptor lacks metadata size (Jesper)

- Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
  of ifname (due to recent xsk.h refactoring)

Prior art (to record pros/cons for different approaches):

- Stable UAPI approach:
  https://lore.kernel.org/bpf/20220628194812.1453059-1-alexandr.lobakin@intel.com/
- Metadata+BTF_ID appoach:
  https://lore.kernel.org/bpf/166256538687.1434226.15760041133601409770.stgit@firesoul/
- v7:
  https://lore.kernel.org/bpf/20230112003230.3779451-1-sdf@google.com/
- v6:
  https://lore.kernel.org/bpf/20230104215949.529093-1-sdf@google.com/
- v5:
  https://lore.kernel.org/bpf/20221220222043.3348718-1-sdf@google.com/
- v4:
  https://lore.kernel.org/bpf/20221213023605.737383-1-sdf@google.com/
- v3:
  https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/
- v2:
  https://lore.kernel.org/bpf/20221121182552.2152891-1-sdf@google.com/
- v1:
  https://lore.kernel.org/bpf/20221115030210.3159213-1-sdf@google.com/
- kfuncs v2 RFC:
  https://lore.kernel.org/bpf/20221027200019.4106375-1-sdf@google.com/
- kfuncs v1 RFC:
  https://lore.kernel.org/bpf/20221104032532.1615099-1-sdf@google.com/

Cc: John Fastabend <john.fastabend@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: Alexander Lobakin <alexandr.lobakin@intel.com>
Cc: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: Maryam Tahhan <mtahhan@redhat.com>
Cc: xdp-hints@xdp-project.net
Cc: netdev@vger.kernel.org

Stanislav Fomichev (13):
  bpf: Document XDP RX metadata
  bpf: Rename bpf_{prog,map}_is_dev_bound to is_offloaded
  bpf: Move offload initialization into late_initcall
  bpf: Reshuffle some parts of bpf/offload.c
  bpf: Introduce device-bound XDP programs
  selftests/bpf: Update expected test_offload.py messages
  bpf: XDP metadata RX kfuncs
  veth: Introduce veth_xdp_buff wrapper for xdp_buff
  veth: Support RX XDP metadata
  selftests/bpf: Verify xdp_metadata xdp->af_xdp path
  net/mlx4_en: Introduce wrapper for xdp_buff
  net/mlx4_en: Support RX XDP metadata
  selftests/bpf: Simple program to dump XDP RX metadata

Toke Høiland-Jørgensen (4):
  bpf: Support consuming XDP HW metadata from fext programs
  xsk: Add cb area to struct xdp_buff_xsk
  net/mlx5e: Introduce wrapper for xdp_buff
  net/mlx5e: Support RX XDP metadata

 Documentation/networking/index.rst            |   1 +
 Documentation/networking/xdp-rx-metadata.rst  | 110 +++++
 drivers/net/ethernet/mellanox/mlx4/en_clock.c |  13 +-
 .../net/ethernet/mellanox/mlx4/en_netdev.c    |   6 +
 drivers/net/ethernet/mellanox/mlx4/en_rx.c    |  63 ++-
 drivers/net/ethernet/mellanox/mlx4/mlx4_en.h  |   5 +
 drivers/net/ethernet/mellanox/mlx5/core/en.h  |   5 +-
 .../net/ethernet/mellanox/mlx5/core/en/txrx.h |   5 +
 .../net/ethernet/mellanox/mlx5/core/en/xdp.c  |  31 +-
 .../net/ethernet/mellanox/mlx5/core/en/xdp.h  |  10 +-
 .../ethernet/mellanox/mlx5/core/en/xsk/rx.c   |  47 +-
 .../ethernet/mellanox/mlx5/core/en/xsk/rx.h   |   2 +
 .../net/ethernet/mellanox/mlx5/core/en_main.c |   1 +
 .../net/ethernet/mellanox/mlx5/core/en_rx.c   |  99 ++--
 drivers/net/netdevsim/bpf.c                   |   4 -
 drivers/net/veth.c                            |  87 ++--
 include/linux/bpf.h                           |  61 ++-
 include/linux/netdevice.h                     |   8 +
 include/net/xdp.h                             |  21 +
 include/net/xsk_buff_pool.h                   |   5 +
 include/uapi/linux/bpf.h                      |   5 +
 kernel/bpf/core.c                             |  12 +-
 kernel/bpf/offload.c                          | 425 ++++++++++++------
 kernel/bpf/syscall.c                          |  34 +-
 kernel/bpf/verifier.c                         |  44 +-
 net/bpf/test_run.c                            |   3 +
 net/core/dev.c                                |   9 +-
 net/core/filter.c                             |   2 +-
 net/core/xdp.c                                |  64 +++
 tools/include/uapi/linux/bpf.h                |   5 +
 tools/testing/selftests/bpf/.gitignore        |   1 +
 tools/testing/selftests/bpf/Makefile          |   9 +-
 .../selftests/bpf/prog_tests/xdp_metadata.c   | 410 +++++++++++++++++
 .../selftests/bpf/progs/xdp_hw_metadata.c     |  81 ++++
 .../selftests/bpf/progs/xdp_metadata.c        |  64 +++
 .../selftests/bpf/progs/xdp_metadata2.c       |  23 +
 tools/testing/selftests/bpf/test_offload.py   |  10 +-
 tools/testing/selftests/bpf/xdp_hw_metadata.c | 403 +++++++++++++++++
 tools/testing/selftests/bpf/xdp_metadata.h    |  15 +
 39 files changed, 1910 insertions(+), 293 deletions(-)
 create mode 100644 Documentation/networking/xdp-rx-metadata.rst
 create mode 100644 tools/testing/selftests/bpf/prog_tests/xdp_metadata.c
 create mode 100644 tools/testing/selftests/bpf/progs/xdp_hw_metadata.c
 create mode 100644 tools/testing/selftests/bpf/progs/xdp_metadata.c
 create mode 100644 tools/testing/selftests/bpf/progs/xdp_metadata2.c
 create mode 100644 tools/testing/selftests/bpf/xdp_hw_metadata.c
 create mode 100644 tools/testing/selftests/bpf/xdp_metadata.h

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 23, 2023, 6:50 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Thu, 19 Jan 2023 14:15:19 -0800 you wrote:
> Please see the first patch in the series for the overall
> design and use-cases.
> 
> See the following email from Toke for the per-packet metadata overhead:
> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
> 
> Recent changes:
> - Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)
> 
> [...]

Here is the summary with links:
  - [bpf-next,v8,01/17] bpf: Document XDP RX metadata
    (no matching commit)
  - [bpf-next,v8,02/17] bpf: Rename bpf_{prog,map}_is_dev_bound to is_offloaded
    (no matching commit)
  - [bpf-next,v8,03/17] bpf: Move offload initialization into late_initcall
    (no matching commit)
  - [bpf-next,v8,04/17] bpf: Reshuffle some parts of bpf/offload.c
    (no matching commit)
  - [bpf-next,v8,05/17] bpf: Introduce device-bound XDP programs
    (no matching commit)
  - [bpf-next,v8,06/17] selftests/bpf: Update expected test_offload.py messages
    (no matching commit)
  - [bpf-next,v8,07/17] bpf: XDP metadata RX kfuncs
    (no matching commit)
  - [bpf-next,v8,08/17] bpf: Support consuming XDP HW metadata from fext programs
    (no matching commit)
  - [bpf-next,v8,09/17] veth: Introduce veth_xdp_buff wrapper for xdp_buff
    (no matching commit)
  - [bpf-next,v8,10/17] veth: Support RX XDP metadata
    (no matching commit)
  - [bpf-next,v8,11/17] selftests/bpf: Verify xdp_metadata xdp->af_xdp path
    (no matching commit)
  - [bpf-next,v8,12/17] net/mlx4_en: Introduce wrapper for xdp_buff
    (no matching commit)
  - [bpf-next,v8,13/17] net/mlx4_en: Support RX XDP metadata
    (no matching commit)
  - [bpf-next,v8,14/17] xsk: Add cb area to struct xdp_buff_xsk
    (no matching commit)
  - [bpf-next,v8,15/17] net/mlx5e: Introduce wrapper for xdp_buff
    https://git.kernel.org/bpf/bpf-next/c/384a13ca8a5d
  - [bpf-next,v8,16/17] net/mlx5e: Support RX XDP metadata
    https://git.kernel.org/bpf/bpf-next/c/bc8d405b1ba9
  - [bpf-next,v8,17/17] selftests/bpf: Simple program to dump XDP RX metadata
    (no matching commit)

You are awesome, thank you!
Martin KaFai Lau Jan. 23, 2023, 6:53 p.m. UTC | #2
On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
> Please see the first patch in the series for the overall
> design and use-cases.
> 
> See the following email from Toke for the per-packet metadata overhead:
> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
> 
> Recent changes:
> - Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)
> 
> - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
> 
> - Clarify xdp_buff vs 'XDP frame' (Jesper)
> 
> - Explicitly mention that AF_XDP RX descriptor lacks metadata size (Jesper)
> 
> - Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
>    of ifname (due to recent xsk.h refactoring)

Applied with the minor changes in the selftests discussed in patch 11 and 17. 
Thanks!
Stanislav Fomichev Jan. 23, 2023, 6:55 p.m. UTC | #3
On Mon, Jan 23, 2023 at 10:53 AM Martin KaFai Lau <martin.lau@linux.dev> wrote:
>
> On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
> > Please see the first patch in the series for the overall
> > design and use-cases.
> >
> > See the following email from Toke for the per-packet metadata overhead:
> > https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
> >
> > Recent changes:
> > - Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)
> >
> > - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
> >
> > - Clarify xdp_buff vs 'XDP frame' (Jesper)
> >
> > - Explicitly mention that AF_XDP RX descriptor lacks metadata size (Jesper)
> >
> > - Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
> >    of ifname (due to recent xsk.h refactoring)
>
> Applied with the minor changes in the selftests discussed in patch 11 and 17.
> Thanks!

Awesome, thanks! I was gonna resend around Wed, but thank you for
taking care of that!
Alexander Lobakin Jan. 24, 2023, 11:17 a.m. UTC | #4
From: Stanislav Fomichev <sdf@google.com>
Date: Mon, 23 Jan 2023 10:55:52 -0800

> On Mon, Jan 23, 2023 at 10:53 AM Martin KaFai Lau <martin.lau@linux.dev> wrote:
>>
>> On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
>>> Please see the first patch in the series for the overall
>>> design and use-cases.
>>>
>>> See the following email from Toke for the per-packet metadata overhead:
>>> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
>>>
>>> Recent changes:
>>> - Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)
>>>
>>> - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
>>>
>>> - Clarify xdp_buff vs 'XDP frame' (Jesper)
>>>
>>> - Explicitly mention that AF_XDP RX descriptor lacks metadata size (Jesper)
>>>
>>> - Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
>>>    of ifname (due to recent xsk.h refactoring)
>>
>> Applied with the minor changes in the selftests discussed in patch 11 and 17.
>> Thanks!
> 
> Awesome, thanks! I was gonna resend around Wed, but thank you for
> taking care of that!
Great stuff, congrats! :)

Olek
Toke Høiland-Jørgensen Jan. 24, 2023, 11:49 a.m. UTC | #5
Alexander Lobakin <alexandr.lobakin@intel.com> writes:

> From: Stanislav Fomichev <sdf@google.com>
> Date: Mon, 23 Jan 2023 10:55:52 -0800
>
>> On Mon, Jan 23, 2023 at 10:53 AM Martin KaFai Lau <martin.lau@linux.dev> wrote:
>>>
>>> On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
>>>> Please see the first patch in the series for the overall
>>>> design and use-cases.
>>>>
>>>> See the following email from Toke for the per-packet metadata overhead:
>>>> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
>>>>
>>>> Recent changes:
>>>> - Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)
>>>>
>>>> - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
>>>>
>>>> - Clarify xdp_buff vs 'XDP frame' (Jesper)
>>>>
>>>> - Explicitly mention that AF_XDP RX descriptor lacks metadata size (Jesper)
>>>>
>>>> - Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
>>>>    of ifname (due to recent xsk.h refactoring)
>>>
>>> Applied with the minor changes in the selftests discussed in patch 11 and 17.
>>> Thanks!
>> 
>> Awesome, thanks! I was gonna resend around Wed, but thank you for
>> taking care of that!
> Great stuff, congrats! :)

Yeah! Thanks for carrying this forward, Stanislav! :)

-Toke
Jesper Dangaard Brouer Jan. 24, 2023, 12:23 p.m. UTC | #6
On 24/01/2023 12.49, Toke Høiland-Jørgensen wrote:
> Alexander Lobakin <alexandr.lobakin@intel.com> writes:
> 
>> From: Stanislav Fomichev <sdf@google.com>
>> Date: Mon, 23 Jan 2023 10:55:52 -0800
>>
>>> On Mon, Jan 23, 2023 at 10:53 AM Martin KaFai Lau <martin.lau@linux.dev> wrote:
>>>>
>>>> On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
>>>>> Please see the first patch in the series for the overall
>>>>> design and use-cases.
>>>>>
>>>>> See the following email from Toke for the per-packet metadata overhead:
>>>>> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
>>>>>
>>>>> Recent changes:
>>>>> - Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)
>>>>>
>>>>> - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
>>>>>
>>>>> - Clarify xdp_buff vs 'XDP frame' (Jesper)
>>>>>
>>>>> - Explicitly mention that AF_XDP RX descriptor lacks metadata size (Jesper)
>>>>>
>>>>> - Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
>>>>>     of ifname (due to recent xsk.h refactoring)
>>>>
>>>> Applied with the minor changes in the selftests discussed in patch 11 and 17.
>>>> Thanks!
>>>
>>> Awesome, thanks! I was gonna resend around Wed, but thank you for
>>> taking care of that!
>> Great stuff, congrats! :)
> 
> Yeah! Thanks for carrying this forward, Stanislav! :)

+1000 -- great work everybody! :-)

To Alexander (Cc Jesse and Tony), do you think someone from Intel could
look at extending drivers:

  drivers/net/ethernet/intel/igb/ - chip i210
  drivers/net/ethernet/intel/igc/ - chip i225
  drivers/net/ethernet/stmicro/stmmac - for CPU integrated LAN ports

We have a customer that have been eager to get hardware RX-timestamping
for their AF_XDP use-case (PoC code[1] use software timestamping via
bpf_ktime_get_ns() today).  Getting driver support will qualify this
hardware as part of their HW solution.

--Jesper
[1] 
https://github.com/xdp-project/bpf-examples/blob/master/AF_XDP-interaction/af_xdp_kern.c#L77
Stanislav Fomichev Jan. 24, 2023, 5:35 p.m. UTC | #7
On Tue, Jan 24, 2023 at 4:23 AM Jesper Dangaard Brouer
<jbrouer@redhat.com> wrote:
>
>
> On 24/01/2023 12.49, Toke Høiland-Jørgensen wrote:
> > Alexander Lobakin <alexandr.lobakin@intel.com> writes:
> >
> >> From: Stanislav Fomichev <sdf@google.com>
> >> Date: Mon, 23 Jan 2023 10:55:52 -0800
> >>
> >>> On Mon, Jan 23, 2023 at 10:53 AM Martin KaFai Lau <martin.lau@linux.dev> wrote:
> >>>>
> >>>> On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
> >>>>> Please see the first patch in the series for the overall
> >>>>> design and use-cases.
> >>>>>
> >>>>> See the following email from Toke for the per-packet metadata overhead:
> >>>>> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
> >>>>>
> >>>>> Recent changes:
> >>>>> - Keep new functions in en/xdp.c, do 'extern mlx5_xdp_metadata_ops' (Tariq)
> >>>>>
> >>>>> - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
> >>>>>
> >>>>> - Clarify xdp_buff vs 'XDP frame' (Jesper)
> >>>>>
> >>>>> - Explicitly mention that AF_XDP RX descriptor lacks metadata size (Jesper)
> >>>>>
> >>>>> - Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
> >>>>>     of ifname (due to recent xsk.h refactoring)
> >>>>
> >>>> Applied with the minor changes in the selftests discussed in patch 11 and 17.
> >>>> Thanks!
> >>>
> >>> Awesome, thanks! I was gonna resend around Wed, but thank you for
> >>> taking care of that!
> >> Great stuff, congrats! :)
> >
> > Yeah! Thanks for carrying this forward, Stanislav! :)

Thank you all as well for the valuable feedback and reviews!

> +1000 -- great work everybody! :-)
>
> To Alexander (Cc Jesse and Tony), do you think someone from Intel could
> look at extending drivers:
>
>   drivers/net/ethernet/intel/igb/ - chip i210
>   drivers/net/ethernet/intel/igc/ - chip i225
>   drivers/net/ethernet/stmicro/stmmac - for CPU integrated LAN ports
>
> We have a customer that have been eager to get hardware RX-timestamping
> for their AF_XDP use-case (PoC code[1] use software timestamping via
> bpf_ktime_get_ns() today).  Getting driver support will qualify this
> hardware as part of their HW solution.
>
> --Jesper
> [1]
> https://github.com/xdp-project/bpf-examples/blob/master/AF_XDP-interaction/af_xdp_kern.c#L77
>
Alexander Lobakin Feb. 2, 2023, 3:08 p.m. UTC | #8
From: Jesper Dangaard Brouer <jbrouer@redhat.com>
Date: Tue, 24 Jan 2023 13:23:49 +0100

> 
> On 24/01/2023 12.49, Toke Høiland-Jørgensen wrote:
>> Alexander Lobakin <alexandr.lobakin@intel.com> writes:
>>
>>> From: Stanislav Fomichev <sdf@google.com>
>>> Date: Mon, 23 Jan 2023 10:55:52 -0800
>>>
>>>> On Mon, Jan 23, 2023 at 10:53 AM Martin KaFai Lau
>>>> <martin.lau@linux.dev> wrote:
>>>>>
>>>>> On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
>>>>>> Please see the first patch in the series for the overall
>>>>>> design and use-cases.
>>>>>>
>>>>>> See the following email from Toke for the per-packet metadata
>>>>>> overhead:
>>>>>> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.com/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
>>>>>>
>>>>>> Recent changes:
>>>>>> - Keep new functions in en/xdp.c, do 'extern
>>>>>> mlx5_xdp_metadata_ops' (Tariq)
>>>>>>
>>>>>> - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
>>>>>>
>>>>>> - Clarify xdp_buff vs 'XDP frame' (Jesper)
>>>>>>
>>>>>> - Explicitly mention that AF_XDP RX descriptor lacks metadata size
>>>>>> (Jesper)
>>>>>>
>>>>>> - Drop libbpf_flags/xdp_flags from selftests and use ifindex instead
>>>>>>     of ifname (due to recent xsk.h refactoring)
>>>>>
>>>>> Applied with the minor changes in the selftests discussed in patch
>>>>> 11 and 17.
>>>>> Thanks!
>>>>
>>>> Awesome, thanks! I was gonna resend around Wed, but thank you for
>>>> taking care of that!
>>> Great stuff, congrats! :)
>>
>> Yeah! Thanks for carrying this forward, Stanislav! :)
> 
> +1000 -- great work everybody! :-)
> 
> To Alexander (Cc Jesse and Tony), do you think someone from Intel could
> look at extending drivers:
> 
>  drivers/net/ethernet/intel/igb/ - chip i210
>  drivers/net/ethernet/intel/igc/ - chip i225
>  drivers/net/ethernet/stmicro/stmmac - for CPU integrated LAN ports

Sorry, just noticed :s

I work with ice only, but seems like the responsible teams started some
work already. At least for i225. They may write some follow-ups soon.

> 
> We have a customer that have been eager to get hardware RX-timestamping
> for their AF_XDP use-case (PoC code[1] use software timestamping via
> bpf_ktime_get_ns() today).  Getting driver support will qualify this
> hardware as part of their HW solution.
> 
> --Jesper
> [1]
> https://github.com/xdp-project/bpf-examples/blob/master/AF_XDP-interaction/af_xdp_kern.c#L77
>

Thanks,
Olek
Song, Yoong Siang Feb. 2, 2023, 3:52 p.m. UTC | #9
>
>From: Jesper Dangaard Brouer <jbrouer@redhat.com>
>Date: Tue, 24 Jan 2023 13:23:49 +0100
>
>>
>> On 24/01/2023 12.49, Toke Høiland-Jørgensen wrote:
>>> Alexander Lobakin <alexandr.lobakin@intel.com> writes:
>>>
>>>> From: Stanislav Fomichev <sdf@google.com>
>>>> Date: Mon, 23 Jan 2023 10:55:52 -0800
>>>>
>>>>> On Mon, Jan 23, 2023 at 10:53 AM Martin KaFai Lau
>>>>> <martin.lau@linux.dev> wrote:
>>>>>>
>>>>>> On 1/19/23 2:15 PM, Stanislav Fomichev wrote:
>>>>>>> Please see the first patch in the series for the overall design
>>>>>>> and use-cases.
>>>>>>>
>>>>>>> See the following email from Toke for the per-packet metadata
>>>>>>> overhead:
>>>>>>> https://lore.kernel.org/bpf/20221206024554.3826186-1-sdf@google.c
>>>>>>> om/T/#m49d48ea08d525ec88360c7d14c4d34fb0e45e798
>>>>>>>
>>>>>>> Recent changes:
>>>>>>> - Keep new functions in en/xdp.c, do 'extern
>>>>>>> mlx5_xdp_metadata_ops' (Tariq)
>>>>>>>
>>>>>>> - Remove mxbuf pointer and use xsk_buff_to_mxbuf (Tariq)
>>>>>>>
>>>>>>> - Clarify xdp_buff vs 'XDP frame' (Jesper)
>>>>>>>
>>>>>>> - Explicitly mention that AF_XDP RX descriptor lacks metadata
>>>>>>> size
>>>>>>> (Jesper)
>>>>>>>
>>>>>>> - Drop libbpf_flags/xdp_flags from selftests and use ifindex
>>>>>>> instead
>>>>>>>     of ifname (due to recent xsk.h refactoring)
>>>>>>
>>>>>> Applied with the minor changes in the selftests discussed in patch
>>>>>> 11 and 17.
>>>>>> Thanks!
>>>>>
>>>>> Awesome, thanks! I was gonna resend around Wed, but thank you for
>>>>> taking care of that!
>>>> Great stuff, congrats! :)
>>>
>>> Yeah! Thanks for carrying this forward, Stanislav! :)
>>
>> +1000 -- great work everybody! :-)
>>
>> To Alexander (Cc Jesse and Tony), do you think someone from Intel
>> could look at extending drivers:
>>
>>  drivers/net/ethernet/intel/igb/ - chip i210
>>  drivers/net/ethernet/intel/igc/ - chip i225
>>  drivers/net/ethernet/stmicro/stmmac - for CPU integrated LAN ports
>
>Sorry, just noticed :s
>
>I work with ice only, but seems like the responsible teams started some work
>already. At least for i225. They may write some follow-ups soon.
>
Hi Jesper,

FYI, me and my team will enable Rx metadata on stmmac and igc for Rx HWTS.
Will submit the patches for review after done.
>>
>> We have a customer that have been eager to get hardware
>> RX-timestamping for their AF_XDP use-case (PoC code[1] use software
>> timestamping via
>> bpf_ktime_get_ns() today).  Getting driver support will qualify this
>> hardware as part of their HW solution.
>>
>> --Jesper
>> [1]
>> https://github.com/xdp-project/bpf-examples/blob/master/AF_XDP-interac
>> tion/af_xdp_kern.c#L77
>>
>
>Thanks,
>Olek

Thanks & Regards
Siang