From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by mail.toke.dk (Postfix) with ESMTPS id 99AECA22051 for ; Thu, 17 Aug 2023 23:58:32 +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=RzMjdJdC Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-26814e27a9eso210803a91.0 for ; Thu, 17 Aug 2023 14:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692309511; x=1692914311; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GINBlOUN78JQAVZLCyadtlAejrOaDZvkhNHX3xHJbIA=; b=RzMjdJdCUKJCTf7fI3fc/wIBGlIIjqaTWtwE9ycDNv2m4cNYvGJey6yihBIA3CAbkq RmJPRgQ/h1E0dGNCahy9HGSwCSUkjx5bZP1OWUD4soUUZcQ3BL8GvPQQSWmkF74+5A2n 9E2KVwJrg6JyCABiL6N7KJ8f02G6VPVD+K9sUwXcJmRe/ck+UnlkNnrXJpQN6BaAvc0M ycsNCRgH1KwYHVtqqtglQv6QR8M3QkBqWcMJi3zSe3NV3MRfx7CVo29qWqk/DQtfzsG4 LIptvRZrFGLHCByQ/VlMf3JX+6vGO/0bazj8auI1oWseGbKpn/zJqIcLVHI1e4Id4mrI wyGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692309511; x=1692914311; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GINBlOUN78JQAVZLCyadtlAejrOaDZvkhNHX3xHJbIA=; b=WqRdbVJnAft7mJ0VD7LDAMN12tLIVVlcfVSmUP8XmpXXLzk+NIVF+QAohKCZYH8oG1 vNm3pkFzPTBHw17NA2JjcATWrLu0hmDXRE1dwUCoXKKN/npI7swJfNcnDY9jip6lIGTe GVg0pPE9Ad+pqDwT8rFjbbLXNSJM7ddlEi5A/sHwkmtA5wGRK9YuhjO0lSRwJ4WF3f3c SryOe1CjNTc0fTgLKXutu6+G0hpnYK5KnH9NHaVUNgj0PT1/S5aVswKK6lc17w9kq1RZ zS/drupedQK3MBVEyMC1pUXnLRWR3CASq2QGh4UxzTCua0kOuRzbwxvsmeIIjdlTefaT zWGg== X-Gm-Message-State: AOJu0YzLeDSMn18KfVlxyCMKPP0ykfFShuvzLiWcX+qODyAwWtiQnGp+ 5q+t5+OU4/f37sB0gNQuDkU= X-Google-Smtp-Source: AGHT+IGxkIxUbdobemPAjFwPTFS1otmjb9kmh1krxv/YtvUP/c92nBH5UbW8yWyibu0MRQH+GWyjcA== X-Received: by 2002:a17:90a:2a01:b0:26b:e80:11de with SMTP id i1-20020a17090a2a0100b0026b0e8011demr734132pjd.25.1692309510832; Thu, 17 Aug 2023 14:58:30 -0700 (PDT) Received: from macbook-pro-8.dhcp.thefacebook.com ([2620:10d:c090:500::4:8d88]) by smtp.gmail.com with ESMTPSA id x14-20020a17090a6b4e00b00268320ab9f2sm1734599pjl.6.2023.08.17.14.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 14:58:30 -0700 (PDT) Date: Thu, 17 Aug 2023 14:58:26 -0700 From: Alexei Starovoitov To: Larysa Zaremba Message-ID: <20230817215826.sx7t6mipx7pajuzo@macbook-pro-8.dhcp.thefacebook.com> References: <20230811161509.19722-1-larysa.zaremba@intel.com> <20230811161509.19722-14-larysa.zaremba@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230811161509.19722-14-larysa.zaremba@intel.com> Message-ID-Hash: LTM4Y5MG5UMNAOACOVUY3SDBHSL2BT5K X-Message-ID-Hash: LTM4Y5MG5UMNAOACOVUY3SDBHSL2BT5K 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@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, 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 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 *csum) > +{ > + 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_FAIL) > + return -ENODATA; > + > + *csum_status = XDP_CHECKSUM_VERIFIED; > + return 0; > +} > + > const struct xdp_metadata_ops ice_xdp_md_ops = { > .xmo_rx_timestamp = ice_xdp_rx_hw_ts, > .xmo_rx_hash = ice_xdp_rx_hash, > .xmo_rx_vlan_tag = ice_xdp_rx_vlan_tag, > + .xmo_rx_csum = 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 make sure the proposed API works for other vendors.