Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751622AbbEGNYe (ORCPT ); Thu, 7 May 2015 09:24:34 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:33042 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750776AbbEGNYb (ORCPT ); Thu, 7 May 2015 09:24:31 -0400 Message-ID: <554B678B.7090103@cogentembedded.com> Date: Thu, 07 May 2015 16:24:27 +0300 From: Sergei Shtylyov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Ruslan Bilovol , 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 References: <1430992159-27783-1-git-send-email-ruslan.bilovol@gmail.com> In-Reply-To: <1430992159-27783-1-git-send-email-ruslan.bilovol@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1516 Lines: 40 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 > --- > 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/