[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87k01rfojm.fsf@toke.dk>
Date: Thu, 12 Jan 2023 22:09:17 +0100
From: Toke Høiland-Jørgensen <toke@...hat.com>
To: Stanislav Fomichev <sdf@...gle.com>,
Tariq Toukan <ttoukan.linux@...il.com>
Cc: bpf@...r.kernel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, martin.lau@...ux.dev, song@...nel.org,
yhs@...com, john.fastabend@...il.com, kpsingh@...nel.org,
haoluo@...gle.com, jolsa@...nel.org,
Tariq Toukan <tariqt@...dia.com>,
Saeed Mahameed <saeedm@...dia.com>,
David Ahern <dsahern@...il.com>,
Jakub Kicinski <kuba@...nel.org>,
Willem de Bruijn <willemb@...gle.com>,
Jesper Dangaard Brouer <brouer@...hat.com>,
Anatoly Burakov <anatoly.burakov@...el.com>,
Alexander Lobakin <alexandr.lobakin@...el.com>,
Magnus Karlsson <magnus.karlsson@...il.com>,
Maryam Tahhan <mtahhan@...hat.com>, xdp-hints@...-project.net,
netdev@...r.kernel.org
Subject: Re: [xdp-hints] Re: [PATCH bpf-next v7 15/17] net/mlx5e: Introduce
wrapper for xdp_buff
Stanislav Fomichev <sdf@...gle.com> writes:
> On Thu, Jan 12, 2023 at 12:07 AM Tariq Toukan <ttoukan.linux@...il.com> wrote:
>>
>>
>>
>> On 12/01/2023 2:32, Stanislav Fomichev wrote:
>> > From: Toke Høiland-Jørgensen <toke@...hat.com>
>> >
>> > Preparation for implementing HW metadata kfuncs. No functional change.
>> >
>> > Cc: Tariq Toukan <tariqt@...dia.com>
>> > Cc: Saeed Mahameed <saeedm@...dia.com>
>> > Cc: John Fastabend <john.fastabend@...il.com>
>> > Cc: David Ahern <dsahern@...il.com>
>> > Cc: Martin KaFai Lau <martin.lau@...ux.dev>
>> > Cc: Jakub Kicinski <kuba@...nel.org>
>> > Cc: Willem de Bruijn <willemb@...gle.com>
>> > Cc: Jesper Dangaard Brouer <brouer@...hat.com>
>> > Cc: Anatoly Burakov <anatoly.burakov@...el.com>
>> > Cc: Alexander Lobakin <alexandr.lobakin@...el.com>
>> > Cc: Magnus Karlsson <magnus.karlsson@...il.com>
>> > Cc: Maryam Tahhan <mtahhan@...hat.com>
>> > Cc: xdp-hints@...-project.net
>> > Cc: netdev@...r.kernel.org
>> > Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
>> > Signed-off-by: Stanislav Fomichev <sdf@...gle.com>
>> > ---
>> > drivers/net/ethernet/mellanox/mlx5/core/en.h | 1 +
>> > .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 3 +-
>> > .../net/ethernet/mellanox/mlx5/core/en/xdp.h | 6 +-
>> > .../ethernet/mellanox/mlx5/core/en/xsk/rx.c | 25 ++++----
>> > .../net/ethernet/mellanox/mlx5/core/en_rx.c | 58 +++++++++----------
>> > 5 files changed, 50 insertions(+), 43 deletions(-)
>> >
>> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h
>> > index 2d77fb8a8a01..af663978d1b4 100644
>> > --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
>> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
>> > @@ -469,6 +469,7 @@ struct mlx5e_txqsq {
>> > union mlx5e_alloc_unit {
>> > struct page *page;
>> > struct xdp_buff *xsk;
>> > + struct mlx5e_xdp_buff *mxbuf;
>>
>> In XSK files below you mix usage of both alloc_units[page_idx].mxbuf and
>> alloc_units[page_idx].xsk, while both fields share the memory of a union.
>>
>> As struct mlx5e_xdp_buff wraps struct xdp_buff, I think that you just
>> need to change the existing xsk field type from struct xdp_buff *xsk
>> into struct mlx5e_xdp_buff *xsk and align the usage.
>
> Hmmm, good point. I'm actually not sure how it works currently.
> mlx5e_alloc_unit.mxbuf doesn't seem to be initialized anywhere? Toke,
> am I missing something?
It's initialised piecemeal in different places; but yeah, we're mixing
things a bit...
> I'm thinking about something like this:
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h
> b/drivers/net/ethernet/mellanox/mlx5/core/en.h
> index af663978d1b4..2d77fb8a8a01 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h
> @@ -469,7 +469,6 @@ struct mlx5e_txqsq {
> union mlx5e_alloc_unit {
> struct page *page;
> struct xdp_buff *xsk;
> - struct mlx5e_xdp_buff *mxbuf;
> };
Hmm, for consistency with the non-XSK path we should rather go the other
direction and lose the xsk member, moving everything to mxbuf? Let me
give that a shot...
-Toke
Powered by blists - more mailing lists