Re: [xdp-hints] [PATCH bpf-next 2/2] mlx5: Support XDP RX metadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 23, 2022 at 2:29 PM Saeed Mahameed <saeed@xxxxxxxxxx> wrote:
>
> On 23 Nov 15:46, Toke Høiland-Jørgensen wrote:
> >Support RX hash and timestamp metadata kfuncs. We need to pass in the cqe
> >pointer to the mlx5e_skb_from* functions so it can be retrieved from the
> >XDP ctx to do this.
> >
> >Cc: John Fastabend <john.fastabend@xxxxxxxxx>
> >Cc: David Ahern <dsahern@xxxxxxxxx>
> >Cc: Martin KaFai Lau <martin.lau@xxxxxxxxx>
> >Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
> >Cc: Willem de Bruijn <willemb@xxxxxxxxxx>
> >Cc: Jesper Dangaard Brouer <brouer@xxxxxxxxxx>
> >Cc: Anatoly Burakov <anatoly.burakov@xxxxxxxxx>
> >Cc: Alexander Lobakin <alexandr.lobakin@xxxxxxxxx>
> >Cc: Magnus Karlsson <magnus.karlsson@xxxxxxxxx>
> >Cc: Maryam Tahhan <mtahhan@xxxxxxxxxx>
> >Cc: Stanislav Fomichev <sdf@xxxxxxxxxx>
> >Cc: xdp-hints@xxxxxxxxxxxxxxx
> >Cc: netdev@xxxxxxxxxxxxxxx
> >Signed-off-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>
> >---
> >This goes on top of Stanislav's series, obvioulsy. Verified that it works using
> >the xdp_hw_metadata utility; going to do ome benchmarking and follow up with the
> >results, but figured I'd send this out straight away in case others wanted to
> >play with it.
> >
> >Stanislav, feel free to fold it into the next version of your series if you
> >want!
> >
>
> [...]
>
> > #endif /* __MLX5_EN_XSK_RX_H__ */
> >diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> >index 14bd86e368d5..015bfe891458 100644
> >--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> >+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
> >@@ -4890,6 +4890,10 @@ const struct net_device_ops mlx5e_netdev_ops = {
> >       .ndo_tx_timeout          = mlx5e_tx_timeout,
> >       .ndo_bpf                 = mlx5e_xdp,
> >       .ndo_xdp_xmit            = mlx5e_xdp_xmit,
> >+      .ndo_xdp_rx_timestamp_supported = mlx5e_xdp_rx_timestamp_supported,
> >+      .ndo_xdp_rx_timestamp    = mlx5e_xdp_rx_timestamp,
> >+      .ndo_xdp_rx_hash_supported = mlx5e_xdp_rx_hash_supported,
> >+      .ndo_xdp_rx_hash         = mlx5e_xdp_rx_hash,
>
> I hope i am not late to the party.
> but I already expressed my feelings regarding using kfunc for xdp hints,
> @LPC and @netdevconf.
>
> I think it's wrong to use indirect calls, and for many usecases the
> overhead will be higher than just calculating the metadata on the spot.
>
> so you will need two indirect calls per packet per hint..
> some would argue on some systems calculating the hash would be much faster.
> and one major reason to have the hints is to accelerate xdp edge and
> security programs with the hw provided hints.
>
> what happened with just asking the driver to place the data in a specific
> location on the headroom?

Take a look at [0], we are resolving indirect calls. We can also
always go back to unrolling those calls as was done initially in [1].

0: https://lore.kernel.org/bpf/20221121182552.2152891-3-sdf@xxxxxxxxxx/
1: https://lore.kernel.org/bpf/20221115030210.3159213-4-sdf@xxxxxxxxxx/

kfunc approach seems more flexible than an all-or-nothing approach
with the driver pre-filling all metadata.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux