All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jarek Poplawski <jarkao2@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	mchan@broadcom.com, kaber@trash.net, netdev@vger.kernel.org
Subject: Re: [PATCH v4] net: Introduce realloc_netdev_mq()
Date: Thu, 03 Dec 2009 22:29:42 +0100	[thread overview]
Message-ID: <4B182DC6.5030800@gmail.com> (raw)
In-Reply-To: <20091203202937.GA11436@ami.dom.local>

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@gmail.com>
> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
> Cc: Eric Dumazet <eric.dumazet@gmail.com>

Nice patch, thanks :)

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>



  reply	other threads:[~2009-12-03 21:29 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-08  7:18 [RFC] multiqueue changes Eric Dumazet
2009-10-08  9:03 ` Jarek Poplawski
2009-10-08 12:00   ` Jarek Poplawski
2009-10-08 12:13     ` Eric Dumazet
2009-10-08 12:53       ` Jarek Poplawski
2009-10-09  7:58       ` David Miller
2009-10-28 17:27     ` Patrick McHardy
2009-10-28 21:23       ` Jarek Poplawski
2009-10-29 16:37         ` Patrick McHardy
2009-10-29 21:15           ` Jarek Poplawski
2009-10-29 22:12             ` Patrick McHardy
2009-10-30 10:00               ` Jarek Poplawski
2009-10-31 17:25                 ` Michael Chan
2009-11-01 13:20                   ` Jarek Poplawski
2009-11-02 11:35                     ` David Miller
2009-11-02 12:30                       ` Jarek Poplawski
2009-11-02 12:39                         ` David Miller
2009-11-02 13:02                           ` Jarek Poplawski
2009-11-02 13:03                             ` Eric Dumazet
2009-11-02 13:09                               ` Jarek Poplawski
2009-12-03 14:10                           ` [PATCH] net: Introduce realloc_netdev_mq() Jarek Poplawski
2009-12-03 14:39                           ` [PATCH v2] " Jarek Poplawski
2009-12-03 15:17                             ` Eric Dumazet
2009-12-03 16:36                               ` Jarek Poplawski
2009-12-03 16:54                                 ` Jarek Poplawski
2009-12-03 17:05                                   ` Eric Dumazet
2009-12-03 19:04                                     ` [PATCH v3] " Jarek Poplawski
2009-12-03 20:29                                     ` [PATCH v4] " Jarek Poplawski
2009-12-03 21:29                                       ` Eric Dumazet [this message]
2009-12-03 21:31                                         ` David Miller
2009-12-03 21:32                                           ` Eric Dumazet
2009-12-03 21:51                                           ` Eric Dumazet
2009-12-03 22:47                                             ` Jarek Poplawski
2009-12-03 23:04                                               ` Eric Dumazet
2009-12-04  7:48                                                 ` Jarek Poplawski
2009-12-04 10:51                                                   ` Peter P Waskiewicz Jr
2009-12-04 11:41                                                     ` Jarek Poplawski
2009-12-04 13:01                                                 ` Jarek Poplawski
2009-12-04 13:49                                                   ` Jarek Poplawski
2010-01-16 22:50                                                     ` Michael Chan
2010-01-17  0:36                                                       ` Jarek Poplawski
2010-01-17 16:56                                                         ` Michael Chan
2010-01-17 22:57                                                           ` Jarek Poplawski
2010-01-18 18:29                                                             ` Michael Chan
2010-01-18 19:41                                                               ` Jarek Poplawski
2009-10-09  8:51   ` [RFC] multiqueue changes Jarek Poplawski
2009-10-09  9:40     ` Jarek Poplawski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B182DC6.5030800@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=jarkao2@gmail.com \
    --cc=kaber@trash.net \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.