From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mail.toke.dk (Postfix) with ESMTPS id F08E69DD0D6 for ; Thu, 12 Jan 2023 22:09:23 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fWJpOBRN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673557762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OtMX1ypL33CpzjPOX/8X9kL3gQ8SvW1s3a4SzHnjJSg=; b=fWJpOBRNyjrPMXloWRswEjspQNpelJX1IlEzopWYIq9JKju2q8U6xDc7cnM4OBHbtDWJwF UjRLvB+YE3n+LOoMPAVmXYCjPPdywcCBvM6gMIiyxYbp07PGamGQV1Qm0RiBVrPBhVsx1s Snflv+lEF3BVezA4dGTvS3Tm4dPrtDY= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-341-kI6e4R-dN56TwIk5WhsnLQ-1; Thu, 12 Jan 2023 16:09:20 -0500 X-MC-Unique: kI6e4R-dN56TwIk5WhsnLQ-1 Received: by mail-ed1-f69.google.com with SMTP id f15-20020a056402354f00b00485864db618so13210974edd.13 for ; Thu, 12 Jan 2023 13:09:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qRZmqvXhb2nF8oyfgDRdsPHD4BOhp1E6vlAaM7IvjKQ=; b=7tTl7PbxSMK0bSR13/cIbeKDqmw4S3iRD0z7D7GwpNwKASSKigTtYu6FPu76tRm0uj 4CxtTyXd2RVrDzSHkshDzY24SeiZVE3uUZ5qdvJkCny9z84qk2DpRFaeDtBvKbo0dA5Q EadnsLeIPnAyvrrdiC+opwGkb5laUc1pr+ntTbOD1zqbbeFWFxz1ZN7UacE+sDxEB0YJ Wns/zAp+1j9XEWKI6GfqJRK0AqdY2ekAuCA28r9yhG4T9yHYQySgmT3j6URV1i4obUB3 f6sXId3e37gB6iQLlYGkm7kBtzkZMHb/Ja0gIpDv6Xve6UjHfDmG7LXttumVijNlte+O rixA== X-Gm-Message-State: AFqh2koZpQEs7CHL3sHtKrF/34e5EF1H6kmDLZQxHEUHMnWuXcNBwdmz aFRLEzI+ri9/3hgoDHnuVWZo81v1SZio86TvJcwMyfq7aqxNQ2sKOqfVGCY6/D+19zWbZYBEYEy XPGdVDQnkwNE8J5aLKCv1 X-Received: by 2002:a17:907:a788:b0:7fd:ec83:b8b8 with SMTP id vx8-20020a170907a78800b007fdec83b8b8mr68328457ejc.19.1673557759237; Thu, 12 Jan 2023 13:09:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXvnI2Xp7NQNgDDqPzkdNmTMwZjxoSIACaNZJ4Kh+MujVfoi7pKt8VZYEZWPa/tk3CaBBUxymw== X-Received: by 2002:a17:907:a788:b0:7fd:ec83:b8b8 with SMTP id vx8-20020a170907a78800b007fdec83b8b8mr68328433ejc.19.1673557758922; Thu, 12 Jan 2023 13:09:18 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id s17-20020a1709060c1100b0084d21db0691sm7846755ejf.179.2023.01.12.13.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 13:09:18 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id 940CE90071B; Thu, 12 Jan 2023 22:09:17 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Stanislav Fomichev , Tariq Toukan In-Reply-To: References: <20230112003230.3779451-1-sdf@google.com> <20230112003230.3779451-16-sdf@google.com> X-Clacks-Overhead: GNU Terry Pratchett Date: Thu, 12 Jan 2023 22:09:17 +0100 Message-ID: <87k01rfojm.fsf@toke.dk> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6CT5Z3ZDXEMM3FOY3VOOLXQETQDLBR6J X-Message-ID-Hash: 6CT5Z3ZDXEMM3FOY3VOOLXQETQDLBR6J X-MailFrom: toke@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header 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, Tariq Toukan , Saeed Mahameed , David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v7 15/17] net/mlx5e: Introduce wrapper for xdp_buff List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Stanislav Fomichev writes: > On Thu, Jan 12, 2023 at 12:07 AM Tariq Toukan w= rote: >> >> >> >> On 12/01/2023 2:32, Stanislav Fomichev wrote: >> > From: Toke H=C3=B8iland-J=C3=B8rgensen >> > >> > Preparation for implementing HW metadata kfuncs. No functional change. >> > >> > Cc: Tariq Toukan >> > Cc: Saeed Mahameed >> > Cc: John Fastabend >> > Cc: David Ahern >> > Cc: Martin KaFai Lau >> > Cc: Jakub Kicinski >> > Cc: Willem de Bruijn >> > Cc: Jesper Dangaard Brouer >> > Cc: Anatoly Burakov >> > Cc: Alexander Lobakin >> > Cc: Magnus Karlsson >> > Cc: Maryam Tahhan >> > Cc: xdp-hints@xdp-project.net >> > Cc: netdev@vger.kernel.org >> > Signed-off-by: Toke H=C3=B8iland-J=C3=B8rgensen >> > Signed-off-by: Stanislav Fomichev >> > --- >> > 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/ne= t/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