[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B182DC6.5030800@gmail.com>
Date: Thu, 03 Dec 2009 22:29:42 +0100
From: Eric Dumazet <eric.dumazet@...il.com>
To: Jarek Poplawski <jarkao2@...il.com>
CC: David Miller <davem@...emloft.net>, mchan@...adcom.com,
kaber@...sh.net, netdev@...r.kernel.org
Subject: Re: [PATCH v4] net: Introduce realloc_netdev_mq()
Jarek Poplawski a écrit :
> On Thu, Dec 03, 2009 at 06:05:39PM +0100, Eric Dumazet wrote:
>> Jarek Poplawski a écrit :
>>> On Thu, Dec 03, 2009 at 05:36:40PM +0100, Jarek Poplawski wrote:
>>>> On Thu, Dec 03, 2009 at 04:17:43PM +0100, Eric Dumazet wrote:
>>>>> if (realloc_netdev_mq(dev, real_queues))
>>>>> dev->real_num_tx_queues = real_queues;
>>>>>
>>>>> In this case the memory error is not fatal.
>>>> Good point! We can consider doing this inside the function too?
>>> Hmm... Of course, not exactly this - I mean using min().
>> Sure, allowing to reduce the count in case new allocation failed.
>>
>> And report an error if caller wanted to increase number of queues and allocation failed.
>
> Hmm... After re-thinking it looks a bit too complex to me. I think,
> there is no reason to not report this error since in most cases it
> shouldn't be fatal. That's why I skipped this check in the changelog
> example. Unless I miss something?
>
> Thanks,
> Jarek P.
> ---------------> (take 4)
>
> This patch separates allocation of TX subqueues from alloc_netdev_mq()
> to realloc_netdev_mq() to allow for resizing like in this example:
>
> some_nic_probe()
> {
> ...
> dev = alloc_etherdev_mq(sizeof(*bp), 1)
> ...
> if (MSI-X_available && device_supports_MSI-X_and_multiqueue)
> realloc_netdev_mq(dev, TX_MAX_RINGS)
> register_netdev(dev)
> ...
> }
>
> Alternatively, it can be done in reverse order: starting from the
> highest queue_count and reallocating with a lower one.
>
> The main difference is to hold in num_tx_queues something that is
> really available, instead of max possible value for all configs, in
> case of drivers allocating net_device at the beginning of the probe.
>
> The description of alloc_netdev_mq() is fixed btw.
>
> Reported-by: Eric Dumazet <eric.dumazet@...il.com>
> Signed-off-by: Jarek Poplawski <jarkao2@...il.com>
> Cc: Eric Dumazet <eric.dumazet@...il.com>
Nice patch, thanks :)
Acked-by: Eric Dumazet <eric.dumazet@...il.com>
--
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