From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by mail.toke.dk (Postfix) with ESMTPS id 5E0FFA23C3E for ; Tue, 22 Aug 2023 21:50:44 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=nEiMfxR3 Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2bcbfb3705dso36060371fa.1 for ; Tue, 22 Aug 2023 12:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692733841; x=1693338641; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uPUn8ijFL4ffACYb95xD4mkXYZWaOkbHS7F5iWlewWU=; b=nEiMfxR3Y0C8ND2xRN1ZJt5md7vqRSgJDLwfYJguubsnh77dtUt3ULM1ooox0MlrgK /9sB09LAOKqdalKgrtFVpkFl0IQMh1+nZeilEy9xdDEXd9Zj/DKC7b6FxmSMeHh+ziLC 7hkIBlJRe1QsV1VOk//PurOjV+f9DmtX9WNzKD9N1qjI4os054KveKCOmxVphKsQpT3t avgcGBWSyzFkFfAlTsWHROBV9IA0zVTDuMuXHliZ+sW/2c43Ms3bmhBHIQKgBpGA4dA4 yPjb95zLggl/dm1FrfkD90oFMsBCKOxoAiiX7zvy5g3OfTibGjTCEbsfvDmAS3hvtB2r qQZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692733841; x=1693338641; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uPUn8ijFL4ffACYb95xD4mkXYZWaOkbHS7F5iWlewWU=; b=PKSwAzp1RCKPvT7ZLnCGemQ2bLm/+Zmq9r9Ism9gdDHUDBVUjXPutfbIwWslzmae+g 3LZ4QGgo78qyKcCFQL2CzuyN29BImw/2sktBJoy2fqKBK5/eiUdqQ7sYLAaS0PiLesB0 5GaIWRDA66/7wgI/XbBaYKkkMKIwKnryRuOmOpHTIxTDs83AcOb2gNPZkbyuIsVqvFej fGGA6qerLUxTHR6AU+nhp465uOHo4Nr8FgkFLsURativF7CcDRHrvthxGU5SUplUs8Nd i5Pey8/ZFsmFnmoF0om/tNWlr+vt13iIzT8Gue31ZODbaKtZsouExeHeg/jYF07WenC0 o9Dg== X-Gm-Message-State: AOJu0Yx63jYeUi6dI0MA/WqFe4YYDbgnyUTfj/69EB9Wp3tH4+NKDda0 r97hrGyY2mixmMdYJJscDcn4AccKWmp5kvO1aYQ= X-Google-Smtp-Source: AGHT+IEJ9LuVf70FGV3AFmIOHwM9aObR3G/YtHhPhJVkI+zEwaF27USVSDtA+MMxFLMdkDCFUYkDFJTtj6/VVqkGTAg= X-Received: by 2002:a2e:8553:0:b0:2b6:c8ba:90dc with SMTP id u19-20020a2e8553000000b002b6c8ba90dcmr7587812ljj.36.1692733840758; Tue, 22 Aug 2023 12:50:40 -0700 (PDT) MIME-Version: 1.0 References: <20230811161509.19722-1-larysa.zaremba@intel.com> <20230811161509.19722-14-larysa.zaremba@intel.com> <20230817215826.sx7t6mipx7pajuzo@macbook-pro-8.dhcp.thefacebook.com> In-Reply-To: From: Alexei Starovoitov Date: Tue, 22 Aug 2023 12:50:29 -0700 Message-ID: To: Larysa Zaremba , Saeed Mahameed Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WNQWGLMPOM3BL3RTIXHG2ZIP4ZSX3D6H X-Message-ID-Hash: WNQWGLMPOM3BL3RTIXHG2ZIP4ZSX3D6H X-MailFrom: alexei.starovoitov@gmail.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 , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , David Ahern , Jakub Kicinski , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, Network Development , Willem de Bruijn , Simon Horman X-Mailman-Version: 3.3.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v5 13/21] ice: Implement checksum hint List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, Aug 22, 2023 at 2:13=E2=80=AFAM Larysa Zaremba wrote: > > On Thu, Aug 17, 2023 at 02:58:26PM -0700, Alexei Starovoitov wrote: > > On Fri, Aug 11, 2023 at 06:15:01PM +0200, Larysa Zaremba wrote: > > > Implement .xmo_rx_csum callback to allow XDP code to determine, > > > whether HW has validated any checksums. > > > > > > Signed-off-by: Larysa Zaremba > > > --- > > > drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 26 +++++++++++++++++= ++ > > > 1 file changed, 26 insertions(+) > > > > > > diff --git a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c b/drivers/= net/ethernet/intel/ice/ice_txrx_lib.c > > > index 6ae57a98a4d8..f11a245705bc 100644 > > > --- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > > +++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > > @@ -660,8 +660,34 @@ static int ice_xdp_rx_vlan_tag(const struct xdp_= md *ctx, u16 *vlan_tci, > > > return 0; > > > } > > > > > > +/** > > > + * ice_xdp_rx_csum - RX checksum XDP hint handler > > > + * @ctx: XDP buff pointer > > > + * @csum_status: status destination address > > > + * @csum: not used > > > + */ > > > +static int ice_xdp_rx_csum(const struct xdp_md *ctx, > > > + enum xdp_csum_status *csum_status, __wsum *csu= m) > > > +{ > > > + const struct ice_xdp_buff *xdp_ext =3D (void *)ctx; > > > + const union ice_32b_rx_flex_desc *eop_desc; > > > + enum ice_rx_csum_status status; > > > + u16 ptype; > > > + > > > + eop_desc =3D xdp_ext->pkt_ctx.eop_desc; > > > + ptype =3D ice_get_ptype(eop_desc); > > > + > > > + status =3D ice_get_rx_csum_status(eop_desc, ptype); > > > + if (status & ICE_RX_CSUM_FAIL) > > > + return -ENODATA; > > > + > > > + *csum_status =3D XDP_CHECKSUM_VERIFIED; > > > + return 0; > > > +} > > > + > > > const struct xdp_metadata_ops ice_xdp_md_ops =3D { > > > .xmo_rx_timestamp =3D ice_xdp_rx_hw_ts, > > > .xmo_rx_hash =3D ice_xdp_rx_hash, > > > .xmo_rx_vlan_tag =3D ice_xdp_rx_vlan_tag, > > > + .xmo_rx_csum =3D ice_xdp_rx_csum, > > > > timestamp hint is implemented by igc, mlx4, mlx5, stmmac > > hash hint is implemneted by igc, mlx4, mlx5. > > With above csum and vlan hints will be in ice only. > > I'd like to see at least one more driver to implement them as well to m= ake sure > > the proposed API works for other vendors. > > I have no other vendors on my current setup :/ > > I could send an RFC of v5 + a compile-tested implementation for some othe= r > vendor, so you can see, how it might look. compiled tested is a good step. nvidia folks would need to test it and ack it, of course.