Subject: Re: [PATCH net-next v8 03/16] net: Add lease info to queue-get response

From: Jakub Kicinski <[email-masked]>
Date: Sat, 31 Jan 2026 15:43:38 -0800

On Thu, 29 Jan 2026 23:28:17 +0100 Daniel Borkmann wrote:
> Populate nested lease info to the queue-get response that returns the
> ifindex, queue id with type and optionally netns id if the device
> resides in a different netns.

> +enum netif_lease_dir {
> +	NETIF_VIRT_TO_PHYS,
> +	NETIF_PHYS_TO_VIRT,
> +};
> +
> +struct netdev_rx_queue *
> +__netif_get_rx_queue_lease(struct net_device **dev, unsigned int *rxq,
> +			   enum netif_lease_dir dir);

dev.h

>  #endif /* _LINUX_NETDEV_RX_QUEUE_H */
> diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
> index a0b4a9197b91..7d073894ca74 100644
> --- a/net/core/netdev-genl.c
> +++ b/net/core/netdev-genl.c
> @@ -391,8 +391,11 @@ netdev_nl_queue_fill_one(struct sk_buff *rsp, struct net_device *netdev,
>  			 u32 q_idx, u32 q_type, const struct genl_info *info)
>  {
>  	struct pp_memory_provider_params *params;
> +	struct net_device *orig_netdev = netdev;
> +	struct nlattr *nest_lease, *nest_queue;
>  	struct netdev_rx_queue *rxq;
>  	struct netdev_queue *txq;
> +	u32 lease_q_idx = q_idx;

No need to init this, no?

>  	void *hdr;
>  
>  	hdr = genlmsg_iput(rsp, info);
> @@ -410,6 +413,37 @@ netdev_nl_queue_fill_one(struct sk_buff *rsp, struct net_device *netdev,
>  		if (nla_put_napi_id(rsp, rxq->napi))
>  			goto nla_put_failure;
>  
> +		if (netif_rx_queue_lease_get_owner(&netdev, &lease_q_idx)) {

Does it work if we factored this out to a helper?

Also apparently the words lessee and lessor are legit English words.

I wonder if using those would make the code quite a bit easier to
follow when we have to refer to the lease in a specific direction.