Re: [PATCH v4 bpf-next 01/22] xsk: prepare 'options' in xdp_desc for multi-buffer use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 22, 2023 at 03:02:21PM -0400, Benjamin Poirier wrote:
> On 2023-06-15 19:25 +0200, Maciej Fijalkowski wrote:
> > From: Tirthendu Sarkar <tirthendu.sarkar@xxxxxxxxx>
> > 
> > Use the 'options' field in xdp_desc as a packet continuity marker. Since
> > 'options' field was unused till now and was expected to be set to 0, the
> > 'eop' descriptor will have it set to 0, while the non-eop descriptors
> > will have to set it to 1. This ensures legacy applications continue to
> > work without needing any change for single-buffer packets.
> > 
> > Add helper functions and extend xskq_prod_reserve_desc() to use the
> > 'options' field.
> > 
> > Signed-off-by: Tirthendu Sarkar <tirthendu.sarkar@xxxxxxxxx>
> > ---
> >  include/uapi/linux/if_xdp.h |  7 +++++++
> >  net/xdp/xsk.c               |  8 ++++----
> >  net/xdp/xsk_queue.h         | 12 +++++++++---
> >  3 files changed, 20 insertions(+), 7 deletions(-)
> > 
> [...]
> > diff --git a/net/xdp/xsk_queue.h b/net/xdp/xsk_queue.h
> > index 6d40a77fccbe..ad81b19e6fdf 100644
> > --- a/net/xdp/xsk_queue.h
> > +++ b/net/xdp/xsk_queue.h
> > @@ -130,6 +130,11 @@ static inline bool xskq_cons_read_addr_unchecked(struct xsk_queue *q, u64 *addr)
> >  	return false;
> >  }
> >  
> > +static inline bool xp_unused_options_set(u16 options)
>                                             ^
> To match struct xdp_desc, this should be u32, no?

Of course. Good catch. It's going to be fixed in next revision.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux