Re: [PATCH rdma-next v1 07/13] RDMA/core: Allow drivers to disable restrack DB

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

 



On Thu, Sep 03, 2020 at 11:02:02AM -0300, Jason Gunthorpe wrote:
> On Sun, Aug 30, 2020 at 01:14:30PM +0300, Leon Romanovsky wrote:
> > diff --git a/include/rdma/restrack.h b/include/rdma/restrack.h
> > index 10bfed0fcd32..d52f7ad6641f 100644
> > +++ b/include/rdma/restrack.h
> > @@ -68,6 +68,14 @@ struct rdma_restrack_entry {
> >  	 * As an example for that, see mlx5 QPs with type MLX5_IB_QPT_HW_GSI
> >  	 */
> >  	bool			valid;
> > +	/**
> > +	 * @no_track: don't add this entry to restrack DB
> > +	 *
> > +	 * This field is used to mark an entry that doesn't need to be added to
> > +	 * internal restrack DB and presented later to the users at the nldev
> > +	 * query stage.
> > +	 */
> > +	u8			no_track : 1;
> >  	/*
> >  	 * @kref: Protect destroy of the resource
> >  	 */
>
> The valid may as well be changed to a bitfield too

I will delete "valid" later in this series.

>
>
> > +/**
> > + * rdma_restrack_no_track() - don't add resource to the DB
> > + * @res: resource entry
> > + *
> > + * Every user of thie API should be cross examined.
> > + * Probaby you don't need to use this function.
> > + */
> > +static inline void rdma_restrack_no_track(struct rdma_restrack_entry *res)
> > +{
> > +	res->no_track = true;
> > +}
> > +static inline bool rdma_restrack_is_tracked(struct rdma_restrack_entry *res)
> > +{
> > +	return !res->no_track;
> > +}
>
> Are these wrappers really necessary?

I don't like them either, added them to make same interface for all
restrack operations.

>
> Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux