Re: [PATCH rdma-next v3 09/13] RDMA/nldev: Allow optional-counter status configuration through RDMA netlink

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

 



On Wed, Oct 06, 2021 at 12:52:12PM +0300, Leon Romanovsky wrote:

> @@ -1986,11 +2030,13 @@ static int nldev_stat_set_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
>  		goto end;
>  	}
>  
> -	if (!tb[RDMA_NLDEV_ATTR_STAT_MODE]) {
> +	if (tb[RDMA_NLDEV_ATTR_STAT_MODE])
> +		ret = nldev_stat_set_mode_doit(skb, nlh, extack, tb, device,
> +					       port);
> +	else if (tb[RDMA_NLDEV_ATTR_STAT_HWCOUNTER_DYNAMIC])
> +		ret = nldev_stat_set_counter_dynamic_doit(tb, device, port);
> +	else
>  		ret = -EINVAL;
> -		goto end;
> -	}

I missed this before.. Why is this exclusive?

If userspace sends both inputs then both should be set.

And shouldn't this reject NL attributes it doesn't support - eg
shouldn't this have a stat_set policy to check that?

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