From: David Brownell <david-b@pacbell.net>
To: Steve Glendinning <steve.glendinning@smsc.com>
Cc: netdev@vger.kernel.org, Ian Saturley <ian.saturley@smsc.com>,
Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH] SMSC LAN9500 USB2.0 10/100 ethernet adapter driver
Date: Mon, 8 Sep 2008 11:54:05 -0700 [thread overview]
Message-ID: <200809081154.05512.david-b@pacbell.net> (raw)
In-Reply-To: <1220881350-4043-1-git-send-email-steve.glendinning@smsc.com>
On Monday 08 September 2008, Steve Glendinning wrote:
> +
> +#define SMSC_WARNING(msg, args...) \
> + printk(KERN_WARNING "%s: WARNING: " msg "\n", __func__, ## args)
> +
> +#ifdef USE_DEBUG
> +#define SMSC_TRACE(debug_bit, msg, args...) \
> + if (debug_mode & debug_bit) { \
> + printk(KERN_WARNING "%s: " msg "\n", __func__, ## args); \
> + }
> +#else
> +#define SMSC_TRACE(dbgBit, msg, args...) ({ do {} while (0); 0; })
> +#endif
Standard feedback for such stuff:
- avoid printk() for diagnostics, use dev_*() driver model calls
- ... or in this case, pr_warning() if you really must
- provide better messages and avoid passing __func__
- use inline functions instead of CPP macros
- make dead code elimination remove debug code, not #ifdefs
And specific to network devices:
- use the ethtool message level flags not private debug_mode
> +int turbo_mode = true;
> +module_param(turbo_mode, bool, 0);
> +MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
I'm curious ... does this actually improve things on Linux?
My understanding is that on MS-Windows the costs of sending
a transaction through the USB stack are so high that their
APIs encourage such batching, and this has in some cases
extended down to wire protocols and (as seems true here)
even to hardware.
The approach Linux prefers is just to ensure that a queue
of transactions works efficiently ... so that for example
each Ethernet frame maps directly to one URB, and there's
no time wasted batching/unbatching. (Neither in Linux,
nor in the peripheral.)
Last time I had any measurements on such issues, the
Linux stack outperformed MS-Windows in terms of per-packet
latency and also throughput, indicating that batching was
not necessary for performance on most network loads. But
maybe that's not the case with your particular hardware,
or in certain significant/common use cases?
- Dave
next prev parent reply other threads:[~2008-09-08 19:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-08 13:42 [PATCH] SMSC LAN9500 USB2.0 10/100 ethernet adapter driver Steve Glendinning
2008-09-08 18:54 ` David Brownell [this message]
2008-09-10 8:15 ` Steve.Glendinning
2008-09-10 16:47 ` David Brownell
-- strict thread matches above, loose matches on Subject: below --
2008-09-05 10:51 Steve Glendinning
2008-09-08 10:52 ` Masakazu Mokuno
2008-09-08 13:17 ` Steve.Glendinning
2008-09-08 18:36 ` David Brownell
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=200809081154.05512.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=catalin.marinas@arm.com \
--cc=ian.saturley@smsc.com \
--cc=netdev@vger.kernel.org \
--cc=steve.glendinning@smsc.com \
/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).