[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 05 Oct 2010 07:35:26 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: John Fastabend <john.r.fastabend@...el.com>
Cc: bhutchings@...arflare.com, netdev@...r.kernel.org,
therbert@...gle.com
Subject: Re: [net-next-2.6 PATCH] net: netif_set_real_num_rx_queues may cap
num_rx_queues at init time
Le lundi 04 octobre 2010 à 15:00 -0700, John Fastabend a écrit :
> The logic for netif_set_real_num_rx_queues is the following,
>
> netif_set_real_num_rx_queues(dev, rxq)
> {
> ...
> if (dev->reg_state == NETREG_REGISTERED) {
> ...
> } else {
> dev->num_rx_queues = rxq;
> }
>
> dev->real_num_rx_queues = rxq;
> return 0;
> }
>
> Some drivers init path looks like the following,
>
> alloc_etherdev_mq(priv_sz, max_num_queues_ever);
> ...
> netif_set_real_num_rx_queues(dev, queues_to_use_now);
> ...
> register_netdev(dev);
> ...
>
> Because netif_set_real_num_rx_queues sets num_rx_queues if the
> reg state is not NETREG_REGISTERED we end up with the incorrect
> max number of rx queues. This patch proposes to remove the else
> clause above so this does not occur. Also just reading the
> function set_real_num it seems a bit unexpected that num_rx_queues
> gets set.
>
You dont tell why its "incorrect".
Why should we keep num_rx_queues > real_num_rx_queues ?
It creates /sys files, and Qdisc stuff for nothing...
> CC: Ben Hutchings <bhutchings@...arflare.com>
>
> Signed-off-by: John Fastabend <john.r.fastabend@...el.com>
> ---
>
> net/core/dev.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/net/core/dev.c b/net/core/dev.c
> index a313bab..f78d996 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -1592,8 +1592,6 @@ int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq)
> rxq);
> if (rc)
> return rc;
> - } else {
> - dev->num_rx_queues = rxq;
> }
>
> dev->real_num_rx_queues = rxq;
>
> --
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists