From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by mail.toke.dk (Postfix) with ESMTPS id E4DEEA1B163 for ; Thu, 20 Jul 2023 17:15:06 +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=oRS5aKZc Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2b74310566cso13949551fa.2 for ; Thu, 20 Jul 2023 08:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689866104; x=1690470904; 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=P1l5TEs8O2Bmwb7N0EKATA/T4FRIfe+wkS7cFTHp0KM=; b=oRS5aKZcfXVjCO7ZDsB5uEJ8T9TgkgPinbYgMwGtd6jcRjrRzBnA+oJgYuOsWxk1Js 8hqrBFM9EcNaGhzZgFziWlqCOc7inL61Qvinauw2G54bFJSSmlmPY9oPS9K7lOi1rMgV wiceWcw5gJI4MVuvjC2v45ZljaYc2XzHmTe3LGxUVN0DqR21kIQJqmCLlBXEzROSkGzJ asfxqboqmfxdKbYyhV+KElm4VxB6LwZfjTk0Ogjrk66A5VGoLvT25oVDJ6MDu6zgGuvH 1kN+/e4NchMZc6QGOZIs031TSN53JgZJhxM5Cc8xmp0+FsRgT6fE3+wxTA8aNNJr4srY nOMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689866104; x=1690470904; 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=P1l5TEs8O2Bmwb7N0EKATA/T4FRIfe+wkS7cFTHp0KM=; b=FoPDR4YTXOK/fzrSLhh4dzErzdkMKOrR56RWYHFt7wgz6mkL6bAx1y6b38g5ss977B vSwmPlI1QM713LlvypbMZshUCfMKdXOVFSMuM/XC/SHz4oP6OdXmfnUzS9IQyD6Q8ne+ YJan8U+E4+zAOROtXL86wndr57n/VasSPY3svqd9G6tTgyH6PGlzn7VquAP3fnShd4eS bvsaN0n/t7fMv9WUqjqYtNr5wMi/2z2bKxKLHeOh3cRrcNQT+5jzGCQMF2sRchLVLyaE krhcqxYslum+wBTq/kCG4WQZolc/nY3/Zcya2jnnXbEVW7L62ZqBqDX0E4day2gIiz/q ZjlA== X-Gm-Message-State: ABy/qLYeKurIZkDSn8HEES4T9qYdB9P+X9tLDbRc/20CmgN69mfBfyNE QY8wHmUK4hKJ1s2sWI/iX61HbYJYHblxERJTZ8A= X-Google-Smtp-Source: APBJJlGjV4ErpFCLAKQauNQbw4vr8ehpjn3LJbPIuBAZy8S/+6jqmNPLQ4fok1WXhYuSL3eRuUCe585RyimQLDsDmDA= X-Received: by 2002:a2e:8e85:0:b0:2b6:e13f:cfd7 with SMTP id z5-20020a2e8e85000000b002b6e13fcfd7mr2781587ljk.4.1689866103479; Thu, 20 Jul 2023 08:15:03 -0700 (PDT) MIME-Version: 1.0 References: <20230719183734.21681-1-larysa.zaremba@intel.com> <20230719183734.21681-14-larysa.zaremba@intel.com> <20230719185930.6adapqctxfdsfmye@macbook-pro-8.dhcp.thefacebook.com> <64b85ad52d012_2849c1294df@willemb.c.googlers.com.notmuch> In-Reply-To: From: Alexei Starovoitov Date: Thu, 20 Jul 2023 08:14:52 -0700 Message-ID: To: "Zaremba, Larysa" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WSNVKAJKSUNAT2XTWAXUGNTSX4AO3WLC X-Message-ID-Hash: WSNVKAJKSUNAT2XTWAXUGNTSX4AO3WLC 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: Willem de Bruijn , "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 , "Brouer, Jesper" , "Burakov, Anatoly" , "Lobakin, Aleksander" , Magnus Karlsson , "Tahhan, Maryam" , "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: On Thu, Jul 20, 2023 at 2:47=E2=80=AFAM Zaremba, Larysa wrote: > > On Wed, Jul 19, 2023 at 05:51:17PM -0400, Willem de Bruijn wrote: > > 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/driver= s/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 xd= p_md *ctx, u16 *vlan_tci, > > > > return 0; > > > > } > > > > > > > > +/** > > > > + * ice_xdp_rx_csum_lvl - Get level, at which HW has checked the ch= ecksum > > > > + * @ctx: XDP buff pointer > > > > + * @csum_status: destination address > > > > + * @csum_info: destination address > > > > + * > > > > + * Copy HW checksum level (if was checked) to the destination addr= ess. > > > > + */ > > > > +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 =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_NONE) > > > > + return -ENODATA; > > > > + > > > > + *csum_status =3D 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. > > > > Yes, correct, current ice HW cannot produce complete checksum, > so only CHECKSUM_UNNECESSARY for known protocols, CHECKSUM_NONE otherwise= , > nothing to initialize csum_info with in either case. > > xdp_csum_info is initialized in veth implementation though, but only > csum_start/offset, so complete XDP checksum has no users in this patchset= . > Is this a problem? > > In previous version I had CHECKSUM_UNNECESSARY-only kfunc, but I think ev= eryone > has agreed, csum hint kfunc should give more comprehensive output. csum kfunc supposed to be generic. If for ICE it fills in one argument and for veth another then the whole idea of generic api is not working.