Re: [PATCH 01/10] IB/uverbs: Have the core code create the uverbs_root_spec

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

 



On Mon, Aug 06, 2018 at 01:17:15PM -0600, Jason Gunthorpe wrote:
> On Mon, Aug 06, 2018 at 07:26:26AM +0300, Leon Romanovsky wrote:
> > > diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
> > > index 13744b4631b452..f86d831ee27c5d 100644
> > > +++ b/drivers/infiniband/hw/mlx5/main.c
> > > @@ -5523,37 +5523,29 @@ ADD_UVERBS_ATTRIBUTES_SIMPLE(
> > >  	UVERBS_ATTR_FLAGS_IN(MLX5_IB_ATTR_CREATE_FLOW_ACTION_FLAGS,
> > >  			     enum mlx5_ib_uapi_flow_action_flags));
> > >
> > > -#define NUM_TREES	5
> > >  static int populate_specs_root(struct mlx5_ib_dev *dev)
> > >  {
> > > -	const struct uverbs_object_tree_def *default_root[NUM_TREES + 1] = {
> > > -		uverbs_default_get_objects()};
> > > -	size_t num_trees = 1;
> > > +	const struct uverbs_object_tree_def **trees = dev->driver_trees;
> > > +	size_t num_trees = 0;
> >
> > <...>
> >
> > > +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> > > @@ -860,6 +860,7 @@ to_mcounters(struct ib_counters *ibcntrs)
> > >
> > >  struct mlx5_ib_dev {
> > >  	struct ib_device		ib_dev;
> > > +	const struct uverbs_object_tree_def *driver_trees[6];
> >
> > Isn't this need to be "5" and not "6"? You moved one tree entry to core.
>
> Not quite, one entry moved to core, but also the list had to become
> NULL terminated, so no change in count. The original code used this:
>
>   const struct uverbs_object_tree_def *default_root[NUM_TREES + 1] = {
>
> So 6 seems to be the right number..

I see, thanks

>
> Jason
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature


[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