netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Francois Romieu <romieu@fr.zoreil.com>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Jia-Ju Bai <baijiaju1990@163.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	netdev@vger.kernel.org, David Miller <davem@davemloft.net>,
	stephen@networkplumber.org, Neil Horman <nhorman@tuxdriver.com>
Subject: Re: Resource usages in Linux drivers
Date: Thu, 23 Apr 2015 17:40:12 -0700	[thread overview]
Message-ID: <553990EC.1030401@gmail.com> (raw)
In-Reply-To: <20150423231917.GA16450@electric-eye.fr.zoreil.com>

On 23/04/15 16:19, Francois Romieu wrote:
> Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> :
>> On 4/23/2015 1:08 PM, Jia-Ju Bai wrote:
> [...]
>>> I also find many drivers do not use these managed APIs, especially in ethernet
>>> card drivers (like e100, r8169). Is it possible to change them?
>>
>>    Patches welcome. :-)
> 
> I respectfully disagree.

Me too, most of the device managed conversions we have seen were bogus
because they were done in a semi-automated way without understanding the
peculiarities of the network devices, that is the separation between
init/open/close that most other device drivers do not have.

A typical example is this:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6892b41d9701283085b655c6086fb57a5d63fa47

> 
> If someone believes basic resouce management to be too hard or error-prone
> to handle, he should imvho seriously rise the bar and reconsider the way
> he wants to contribute to the kernel.

Well, for one, we could have a device managed register_netdev() which
cleans up resources in case of failures and calls free_netdev()
automatically, but is that adding much value?

> 
> I may hope he who reads e100.c to think about DMA api, bql or rx ring
> holes avoidance to quote a few ones. Managed API ? Mildly...
> 


-- 
Florian

  reply	other threads:[~2015-04-24  0:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5538950F.3040405@163.com>
     [not found] ` <5538B938.9060607@cogentembedded.com>
2015-04-23  9:29   ` Resource usages in Linux drivers Jia-Ju Bai
2015-04-23 10:08     ` Jia-Ju Bai
2015-04-23 10:37       ` Sergei Shtylyov
2015-04-23 23:19         ` Francois Romieu
2015-04-24  0:40           ` Florian Fainelli [this message]
2015-04-24  0:49             ` David Miller

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=553990EC.1030401@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=baijiaju1990@163.com \
    --cc=davem@davemloft.net \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=romieu@fr.zoreil.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=stephen@networkplumber.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).