Subject: Re: [net-next PATCH v4 04/10] netdev-genl: Add netlink framework functions for queue

From: Jakub Kicinski <[email-masked]>
Date: Thu, 12 Oct 2023 17:36:36 -0700

On Thu, 12 Oct 2023 17:24:41 -0700 Nambiar, Amritha wrote:
> I was thinking your review comment was for the entire 
> 'netdev_nl_queue_validate' function (i.e. if the max queue-id validation 
> can be handled in the policy as a range with max value for queue-id, and 
> since max queue-id was not a constant, but varies within the kernel, ex: 
> netdev->real_num_rx_queues, I was unsure of it...). So, another option I 
> could come up with for the validation was a 'pre_doit' hook instead of 
> netdev_nl_queue_validate().

real_num can change if we're not holding rtnl_lock, and we can't hold
the lock in pre :(

> If your comment referred to the enum queue-type range alone, I see, 
> since the policy handles the max check for queue-type, I can remove the 
> default case returning EOPNOTSUPP. Correct me if I'm wrong.

Yup! I only meant the type, you can trust netlink to validate the type.