Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3171d026 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller
Browse files

net: Add netif_copy_real_num_queues() for use by virtual net drivers



This sets the active numbers of queues on a net device to match another.

Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 62fe0b40
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -1699,6 +1699,18 @@ static inline int netif_set_real_num_rx_queues(struct net_device *dev,
}
}
#endif
#endif


static inline int netif_copy_real_num_queues(struct net_device *to_dev,
					     const struct net_device *from_dev)
{
	netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues);
#ifdef CONFIG_RPS
	return netif_set_real_num_rx_queues(to_dev,
					    from_dev->real_num_rx_queues);
#else
	return 0;
#endif
}

/* Use this variant when it is known for sure that it
/* Use this variant when it is known for sure that it
 * is executing from hardware interrupt context or with hardware interrupts
 * is executing from hardware interrupt context or with hardware interrupts
 * disabled.
 * disabled.