All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Looijmans <mike.looijmans@topic.nl>
To: <linux-usb@vger.kernel.org>
Cc: <balbi@ti.com>, <gregkh@linuxfoundation.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] usb: gadget: ether: Allow changing the MTU
Date: Fri, 11 Dec 2015 11:47:18 +0100	[thread overview]
Message-ID: <566AA9B6.3010108@topic.nl> (raw)
In-Reply-To: <1448882303-6658-1-git-send-email-mike.looijmans@topic.nl>

Just a "ping" reminder, I'd like to inquire about the status of this patch...

On 30-11-15 12:18, Mike Looijmans wrote:
> The gadget ethernet driver supports changing the MTU, but only allows this
> when the USB cable is removed. The comment indicates that this is because
> the "peer won't know". Even if the network link is still down and only the
> USB link is established, the driver won't allow the change.
>
> Other network interfaces allow changing the MTU any time, and don't force
> the link to be disabled. This makes perfect sense, because in order to be
> able to negotiate the MTU, the link needs to be up.
>
> Remove the restriction so that it is now actually possible to change the
> MTU (e.g. using "ifconfig usb0 mtu 15000") without having to manually pull
> the plug or change the driver's default setting.
>
> This is especially important after commit bba787a860fa
> ("usb: gadget: ether: Allow jumbo frames")
>
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> ---
> v2: Fix commit reference (checkpatch) and unused variable 'dev' (kbuild test robot)
>
>   drivers/usb/gadget/function/u_ether.c | 18 ++++--------------
>   1 file changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
> index 6554322..637809e 100644
> --- a/drivers/usb/gadget/function/u_ether.c
> +++ b/drivers/usb/gadget/function/u_ether.c
> @@ -143,21 +143,11 @@ static inline int qlen(struct usb_gadget *gadget, unsigned qmult)
>
>   static int ueth_change_mtu(struct net_device *net, int new_mtu)
>   {
> -	struct eth_dev	*dev = netdev_priv(net);
> -	unsigned long	flags;
> -	int		status = 0;
> +	if (new_mtu <= ETH_HLEN || new_mtu > GETHER_MAX_ETH_FRAME_LEN)
> +		return -ERANGE;
> +	net->mtu = new_mtu;
>
> -	/* don't change MTU on "live" link (peer won't know) */
> -	spin_lock_irqsave(&dev->lock, flags);
> -	if (dev->port_usb)
> -		status = -EBUSY;
> -	else if (new_mtu <= ETH_HLEN || new_mtu > GETHER_MAX_ETH_FRAME_LEN)
> -		status = -ERANGE;
> -	else
> -		net->mtu = new_mtu;
> -	spin_unlock_irqrestore(&dev->lock, flags);
> -
> -	return status;
> +	return 0;
>   }
>
>   static void eth_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *p)
>



Kind regards,

Mike Looijmans
System Expert

TOPIC Embedded Products
Eindhovenseweg 32-C, NL-5683 KH Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
Telefax: +31 (0) 499 33 69 70
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail






  reply	other threads:[~2015-12-11 10:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 11:18 [PATCH v2] usb: gadget: ether: Allow changing the MTU Mike Looijmans
2015-12-11 10:47 ` Mike Looijmans [this message]
2015-12-16 16:05   ` Felipe Balbi

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=566AA9B6.3010108@topic.nl \
    --to=mike.looijmans@topic.nl \
    --cc=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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.