From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by mail.toke.dk (Postfix) with ESMTPS id 7FCF5A1AE94 for ; Wed, 19 Jul 2023 23:51:19 +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=XmWaPZel Received: by mail-qk1-x72e.google.com with SMTP id af79cd13be357-7679d444210so14146385a.2 for ; Wed, 19 Jul 2023 14:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689803478; x=1690408278; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=I6znaKwzT2W7vgJvU/pVQCid0fljnEMc1pWgZYNykTk=; b=XmWaPZelNKumkFx7Y9x+5cV9BKFzHFOJ5Rw4EGMUCZ5Xe5tr+BiSG73d6Xo89y34sS iNAcvQtOvOXLA3bx2Yw4euTOn7VRjKEDDRXHukFkHKhAuNRXCeZPmwPL2isEUaP+Z6EG evymV5lHSfGpVtvxa89yS58xQ2n8QmUCbiHfucRhk3hy3NIJoRPmGBjCd5p1A0jRtD/o Mb9E/0pVy2SA37Tc5trL8ChgC1GKIBn5ansYPaZJokhzBgqaLVLOyQ54QQrHK1tm4vPq xrCW5j0vtNiDjreOAiZPafiWFMligRLI5hEPPhnIEcfYQNR8p7ujFACikCg3lB9rg5X9 4NlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689803478; x=1690408278; h=content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=I6znaKwzT2W7vgJvU/pVQCid0fljnEMc1pWgZYNykTk=; b=Va7a0cE6pCGH89AcDrogDbRI/OktoBVhO7kctOhykSgGY5CsqQyDl9RxNbcStQLCmD uwKNtdW6U5mMXyfV+xA+q2mWJQlal2CH8RQgPF/EFrqzBu/FaK+2lDwb78/eyNEjSSeV N+VeIERZ033/8ZtEZjDlGOPq9WZZP8C4H1lOt8cwnQI9J9SxJ49fucKgqlfruUlNbr1w 05aYunNfnuMrHo2cBiXnpVtGz68z8TVxe8+dx+QsXFggNtSwNZxH5DKQTnd4EkcphcN2 fIbmFn/Czj0L96GxIdi5K2RnI+gkXqc/8dOM6w8dZ5SuO4GhoWZjIsALdJ6kxDP/bze8 HXIg== X-Gm-Message-State: ABy/qLaN6Ei4CDn5NffGhrxbZTWdIQ+bin7K38Nvy/19uEMymdStgkC+ u2Eag3e6QJVkNidQLNLUNQU= X-Google-Smtp-Source: APBJJlHqk3S7ZpojYwSyvRrCvv1sgJVWHTPYVfGlfEacATFU0U8JXzpg0wi7I8vfifs6luEC3o70mQ== X-Received: by 2002:a05:620a:258e:b0:766:fa1f:4ea4 with SMTP id x14-20020a05620a258e00b00766fa1f4ea4mr992430qko.1.1689803477790; Wed, 19 Jul 2023 14:51:17 -0700 (PDT) Received: from localhost (172.174.245.35.bc.googleusercontent.com. [35.245.174.172]) by smtp.gmail.com with ESMTPSA id f21-20020ae9ea15000000b00767b37256ecsm1529421qkg.107.2023.07.19.14.51.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jul 2023 14:51:17 -0700 (PDT) Date: Wed, 19 Jul 2023 17:51:17 -0400 From: Willem de Bruijn To: Alexei Starovoitov , Larysa Zaremba Message-ID: <64b85ad52d012_2849c1294df@willemb.c.googlers.com.notmuch> In-Reply-To: <20230719185930.6adapqctxfdsfmye@macbook-pro-8.dhcp.thefacebook.com> References: <20230719183734.21681-1-larysa.zaremba@intel.com> <20230719183734.21681-14-larysa.zaremba@intel.com> <20230719185930.6adapqctxfdsfmye@macbook-pro-8.dhcp.thefacebook.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Message-ID-Hash: MA56PFCU4I5DIIJBZGB6TFPCS4UFOWJS X-Message-ID-Hash: MA56PFCU4I5DIIJBZGB6TFPCS4UFOWJS X-MailFrom: willemdebruijn.kernel@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@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, sdf@google.com, haoluo@google.com, jolsa@kernel.org, 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.8 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v3 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: Alexei Starovoitov wrote: > On Wed, Jul 19, 2023 at 08:37:26PM +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 | 29 +++++++++++++++++++ > > 1 file changed, 29 insertions(+) > > > > diff --git a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > index 54685d0747aa..6647a7e55ac8 100644 > > --- a/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > +++ b/drivers/net/ethernet/intel/ice/ice_txrx_lib.c > > @@ -660,8 +660,37 @@ static int ice_xdp_rx_vlan_tag(const struct xdp_md *ctx, u16 *vlan_tci, > > return 0; > > } > > > > +/** > > + * ice_xdp_rx_csum_lvl - Get level, at which HW has checked the checksum > > + * @ctx: XDP buff pointer > > + * @csum_status: destination address > > + * @csum_info: destination address > > + * > > + * Copy HW checksum level (if was checked) to the destination address. > > + */ > > +static int ice_xdp_rx_csum(const struct xdp_md *ctx, > > + enum xdp_csum_status *csum_status, > > + union xdp_csum_info *csum_info) > > +{ > > + const struct ice_xdp_buff *xdp_ext = (void *)ctx; > > + const union ice_32b_rx_flex_desc *eop_desc; > > + enum ice_rx_csum_status status; > > + u16 ptype; > > + > > + eop_desc = xdp_ext->pkt_ctx.eop_desc; > > + ptype = ice_get_ptype(eop_desc); > > + > > + status = ice_get_rx_csum_status(eop_desc, ptype); > > + if (status & ICE_RX_CSUM_NONE) > > + return -ENODATA; > > + > > + *csum_status = ice_rx_csum_lvl(status) + 1; > > + return 0; > > +} > > and xdp_csum_info from previous patch left uninitialized? > What was the point adding it then? I suppose this driver only returns CHECKSUM_NONE or CHECKSUM_UNNECESSARY? Also based on a grep of the driver dir. In general the layout makes sense to me, and +1 on supporting other drivers that do return CHECKSUM_COMPLETE or CHECKSUM_PARTIAL rigth from the start.