From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Ruslan Bilovol <ruslan.bilovol@gmail.com>, oneukum@suse.de
Cc: netdev@vger.kernel.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: usb: allow MTU that is a multiple of USB packet size
Date: Thu, 07 May 2015 16:24:27 +0300 [thread overview]
Message-ID: <554B678B.7090103@cogentembedded.com> (raw)
In-Reply-To: <1430992159-27783-1-git-send-email-ruslan.bilovol@gmail.com>
Hello.
On 5/7/2015 12:49 PM, Ruslan Bilovol wrote:
> Current usbnet driver rejects setting MTU that is a multiple
> of USB endpoint's wMaxPacketSize size. However, it may only
> lead to possible performance degradation but is not so
> critical that its using should be prohibited. So allow it
> but also warn user about possible issue.
> Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
> ---
> drivers/net/usb/usbnet.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 733f4fe..09dc848 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -382,9 +382,11 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
>
> if (new_mtu <= 0)
> return -EINVAL;
> - // no second zero-length packet read wanted after mtu-sized packets
> + /* warn about second zero-length packet read after mtu-sized packets */
> if ((ll_mtu % dev->maxpacket) == 0)
> - return -EDOM;
> + netdev_warn(dev->net, "MTU %d is a multiple of USB wMaxPacketSize (%d),"
> + " consider possible performance degradation\n",
Please do not wrap the kernel messages, it impedes grepping for them.
scripts/checkpatch.pl is aware of this rule.
WBR, Sergei
prev parent reply other threads:[~2015-05-07 13:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-07 9:49 [PATCH] net: usb: allow MTU that is a multiple of USB packet size Ruslan Bilovol
2015-05-07 10:11 ` Oliver Neukum
2015-05-07 10:51 ` Ruslan Bilovol
2015-05-07 11:07 ` Oliver Neukum
2015-05-07 16:19 ` David Laight
2015-05-07 13:24 ` Sergei Shtylyov [this message]
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=554B678B.7090103@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=ruslan.bilovol@gmail.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