lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 06 Dec 2021 12:49:28 -0800
From:   John Fastabend <john.fastabend@...il.com>
To:     Lorenzo Bianconi <lorenzo.bianconi@...hat.com>,
        John Fastabend <john.fastabend@...il.com>
Cc:     Lorenzo Bianconi <lorenzo@...nel.org>, bpf@...r.kernel.org,
        netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
        ast@...nel.org, daniel@...earbox.net, shayagr@...zon.com,
        dsahern@...nel.org, brouer@...hat.com, echaudro@...hat.com,
        jasowang@...hat.com, alexander.duyck@...il.com, saeed@...nel.org,
        maciej.fijalkowski@...el.com, magnus.karlsson@...el.com,
        tirthendu.sarkar@...el.com, toke@...hat.com
Subject: Re: [PATCH v19 bpf-next 03/23] net: mvneta: update mb bit before
 passing the xdp buffer to eBPF layer

Lorenzo Bianconi wrote:
> > Lorenzo Bianconi wrote:
> > > > Lorenzo Bianconi wrote:
> > > > > Update multi-buffer bit (mb) in xdp_buff to notify XDP/eBPF layer and
> > > > > XDP remote drivers if this is a "non-linear" XDP buffer. Access
> > > > > skb_shared_info only if xdp_buff mb is set in order to avoid possible
> > > > > cache-misses.
> > > > > 
> > > > > Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> > > > 
> > > > [...]
> > > > 
> > > > > @@ -2320,8 +2325,12 @@ mvneta_swbm_build_skb(struct mvneta_port *pp, struct page_pool *pool,
> > > > >  		      struct xdp_buff *xdp, u32 desc_status)
> > > > >  {
> > > > >  	struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp);
> > > > > -	int i, num_frags = sinfo->nr_frags;
> > > > >  	struct sk_buff *skb;
> > > > > +	u8 num_frags;
> > > > > +	int i;
> > > > > +
> > > > > +	if (unlikely(xdp_buff_is_mb(xdp)))
> > > > > +		num_frags = sinfo->nr_frags;
> > > > 
> > > > Doesn't really need a respin IMO, but rather an observation. Its not
> > > > obvious to me the unlikely/likely pair here is wanted. Seems it could
> > > > be relatively common for some applications sending jumbo frames.
> > > > 
> > > > Maybe worth some experimenting in the future.
> > > 
> > > Probably for mvneta it will not make any difference but in general I tried to
> > > avoid possible cache-misses here (accessing sinfo pointers). I will carry out
> > > some comparison to see if I can simplify the code.
> > 
> > Agree, I'll predict for mvneta it doesn't make a difference either way and
> > perhaps if you want to optimize small pkt benchmarks on a 100Gbps nic it would
> > show a win.
> > 
> 
> actually it makes a slightly difference on mvneta as well (~45-50Kpps).
> I will keep the code as it is for the moment.

OK works for me thanks for checking.

> 
> Regards,
> Lorenzo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ