Subject: Re: [net-next PATCH v2 4/9] net: Move kernel helpers for queue index outside sysfs

From: Jakub Kicinski <[email-masked]>
Date: Tue, 22 Aug 2023 17:40:22 -0700

On Mon, 21 Aug 2023 16:25:31 -0700 Amritha Nambiar wrote:
> +static inline
> +unsigned int get_netdev_queue_index(struct netdev_queue *queue)
> +{
> +	struct net_device *dev = queue->dev;
> +	unsigned int i;
> +
> +	i = queue - dev->_tx;
> +	DEBUG_NET_WARN_ON_ONCE(i >= dev->num_tx_queues);
> +
> +	return i;
> +}

If this is needed let's move it to a new header -
include/net/netdev_tx_queue.h ?

>  static inline struct netdev_queue *skb_get_tx_queue(const struct net_device *dev,
>  						    const struct sk_buff *skb)
>  {
> diff --git a/include/net/netdev_rx_queue.h b/include/net/netdev_rx_queue.h
> index 66bda0dfe71c..ac58fa7c2532 100644
> --- a/include/net/netdev_rx_queue.h
> +++ b/include/net/netdev_rx_queue.h