[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGI3mP2k/751xAhm@lincoln>
Date: Mon, 15 May 2023 15:46:00 +0200
From: Larysa Zaremba <larysa.zaremba@...el.com>
To: Stanislav Fomichev <sdf@...gle.com>
CC: <bpf@...r.kernel.org>, Alexei Starovoitov <ast@...nel.org>, "Daniel
Borkmann" <daniel@...earbox.net>, Andrii Nakryiko <andrii@...nel.org>, "Jakub
Kicinski" <kuba@...nel.org>, Martin KaFai Lau <martin.lau@...ux.dev>, "Song
Liu" <song@...nel.org>, Yonghong Song <yhs@...com>, John Fastabend
<john.fastabend@...il.com>, KP Singh <kpsingh@...nel.org>, Jiri Olsa
<jolsa@...nel.org>, Jesse Brandeburg <jesse.brandeburg@...el.com>, "Tony
Nguyen" <anthony.l.nguyen@...el.com>, Anatoly Burakov
<anatoly.burakov@...el.com>, Jesper Dangaard Brouer <brouer@...hat.com>,
Alexander Lobakin <alexandr.lobakin@...el.com>, Magnus Karlsson
<magnus.karlsson@...il.com>, Maryam Tahhan <mtahhan@...hat.com>,
<xdp-hints@...-project.net>, <netdev@...r.kernel.org>,
<intel-wired-lan@...ts.osuosl.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND bpf-next 07/15] ice: Support RX hash XDP hint
On Fri, May 12, 2023 at 11:22:05AM -0700, Stanislav Fomichev wrote:
> On 05/12, Larysa Zaremba wrote:
> > RX hash XDP hint requests both hash value and type.
> > Type is XDP-specific, so we need a separate way to map
> > these values to the hardware ptypes, so create a lookup table.
> >
> > Instead of creating a new long list, reuse contents
> > of ice_decode_rx_desc_ptype[] through preprocessor.
> >
> > Current hash type enum does not contain ICMP packet type,
> > but ice devices support it, so also add a new type into core code.
> >
> > Then use previously refactored code and create a function
> > that allows XDP code to read RX hash.
> >
> > Signed-off-by: Larysa Zaremba <larysa.zaremba@...el.com>
> > ---
> > .../net/ethernet/intel/ice/ice_lan_tx_rx.h | 412 +++++++++---------
> > drivers/net/ethernet/intel/ice/ice_txrx_lib.c | 72 +++
> > include/net/xdp.h | 3 +
> > 3 files changed, 283 insertions(+), 204 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
> > index 89f986a75cc8..d384ddfcb83e 100644
> > --- a/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
> > +++ b/drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h
> > @@ -673,6 +673,212 @@ struct ice_tlan_ctx {
> > * Use the enum ice_rx_l2_ptype to decode the packet type
> > * ENDIF
> > */
> > +#define ICE_PTYPES \
> > + /* L2 Packet types */ \
> > + ICE_PTT_UNUSED_ENTRY(0), \
> > + ICE_PTT(1, L2, NONE, NOF, NONE, NONE, NOF, NONE, PAY2), \
> > + ICE_PTT_UNUSED_ENTRY(2), \
[...]
> > + * @eop_desc: End of Packet descriptor
> > + */
> > +static enum xdp_rss_hash_type
> > +ice_xdp_rx_hash_type(union ice_32b_rx_flex_desc *eop_desc)
> > +{
> > + u16 ptype = ice_get_ptype(eop_desc);
> > +
> > + if (unlikely(ptype >= ICE_NUM_DEFINED_PTYPES))
> > + return 0;
> > +
> > + return ice_ptype_to_xdp_hash[ptype];
> > +}
> > +
> > +/**
> > + * ice_xdp_rx_hash - RX hash XDP hint handler
> > + * @ctx: XDP buff pointer
> > + * @hash: hash destination address
> > + * @rss_type: XDP hash type destination address
> > + *
> > + * Copy RX hash (if available) and its type to the destination address.
> > + */
> > +static int ice_xdp_rx_hash(const struct xdp_md *ctx, u32 *hash,
> > + enum xdp_rss_hash_type *rss_type)
> > +{
> > + const struct ice_xdp_buff *xdp_ext = (void *)ctx;
> > +
> > + *rss_type = ice_xdp_rx_hash_type(xdp_ext->eop_desc);
> > + if (!ice_copy_rx_hash_from_desc(xdp_ext->eop_desc, hash))
> > + return -EOPNOTSUPP;
>
> Same here? See the following for the context:
> https://lore.kernel.org/bpf/167940675120.2718408.8176058626864184420.stgit@firesoul/
Thanks! Will fix.
Powered by blists - more mailing lists