From: Andrew Lunn <andrew@lunn.ch>
To: Rami Rosen <roszenrami@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Alexander Loktionov <Alexander.Loktionov@aquantia.com>,
Netdev <netdev@vger.kernel.org>,
David VomLehn <vomlehn@texas.net>,
"David S . Miller" <davem@davemloft.net>,
Simon Edelhaus <Simon.Edelhaus@aquantia.com>,
Dmitrii Tarakanov <Dmitrii.Tarakanov@aquantia.com>,
Pavel Belous <Pavel.Belous@aquantia.com>,
Dmitry Bezrukov <Dmitry.Bezrukov@aquantia.com>
Subject: Re: [PATCH v5 05/13] net: ethernet: aquantia: Support for NIC-specific code
Date: Sun, 15 Jan 2017 02:15:47 +0100 [thread overview]
Message-ID: <20170115011547.GA5643@lunn.ch> (raw)
In-Reply-To: <CAKoUArkh3gyVSrX1GWRQsrFFBg8B59LjtXK=yG6JWMHan7fW7A@mail.gmail.com>
On Sun, Jan 15, 2017 at 12:55:02AM +0200, Rami Rosen wrote:
> Hi, Florian,
>
> > +}
> > +
> > +static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
> > +{
> > + struct aq_nic_s *aq_nic = (struct aq_nic_s *)netdev_priv(ndev);
> > + int err = 0;
> > +
> > + if (new_mtu == ndev->mtu) {
> > + err = 0;
> > + goto err_exit;
> > + }
> > + if (new_mtu < 68) {
> > + err = -EINVAL;
> > + goto err_exit;
> > + }
Actually, the core will already impose min/max of ETH_MIN_MTU and
ETH_DATA_LEN. See
commit a52ad514fdf3b8a57ca4322c92d2d8d5c6182485
Author: Jarod Wilson <jarod@redhat.com>
Date: Fri Oct 7 22:04:34 2016 -0400
net: deprecate eth_change_mtu, remove usage
With centralized MTU checking, there's nothing productive done by
eth_change_mtu that isn't already done in dev_set_mtu, so mark it as
deprecated and remove all usage of it in the kernel. All callers have been
audited for calls to alloc_etherdev* or ether_setup directly, which means
they all have a valid dev->min_mtu and dev->max_mtu. Now eth_change_mtu
prints out a netdev_warn about being deprecated, for the benefit of
out-of-tree drivers that might be utilizing it.
Of note, dvb_net.c actually had dev->mtu = 4096, while using
eth_change_mtu, meaning that if you ever tried changing it's mtu, you
couldn't set it above 1500 anymore. It's now getting dev->max_mtu also set
to 4096 to remedy that.
Andrew
next prev parent reply other threads:[~2017-01-15 1:15 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-13 5:02 [PATCH v5 00/13] net: ethernet: aquantia: Add AQtion 2.5/5 GB NIC driver Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 01/13] net: ethernet: aquantia: Make and configuration files Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 02/13] net: ethernet: aquantia: Common functions and definitions Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 03/13] net: ethernet: aquantia: Add ring support code Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 04/13] net: ethernet: aquantia: Low-level hardware interfaces Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 05/13] net: ethernet: aquantia: Support for NIC-specific code Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 06/13] net: ethernet: aquantia: Atlantic A0 and B0 specific functions Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 07/13] net: ethernet: aquantia: Vector operations Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 08/13] net: ethernet: aquantia: PCI operations Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 09/13] net: ethernet: aquantia: Atlantic hardware abstraction layer Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 10/13] net: ethernet: aquantia: Hardware interface and utility functions Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 11/13] net: ethernet: aquantia: Ethtool support Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 12/13] net: ethernet: aquantia: Receive side scaling Alexander Loktionov
2017-01-13 5:02 ` [PATCH v5 13/13] net: ethernet: aquantia: Integrate AQtion 2.5/5 GB NIC driver Alexander Loktionov
2017-01-14 1:47 ` [PATCH v5 11/13] net: ethernet: aquantia: Ethtool support Florian Fainelli
2017-01-14 1:48 ` [PATCH v5 08/13] net: ethernet: aquantia: PCI operations Florian Fainelli
2017-01-14 2:00 ` [PATCH v5 05/13] net: ethernet: aquantia: Support for NIC-specific code Florian Fainelli
2017-01-14 22:55 ` Rami Rosen
2017-01-15 1:15 ` Andrew Lunn [this message]
2017-01-14 1:32 ` [PATCH v5 02/13] net: ethernet: aquantia: Common functions and definitions David Miller
2017-01-13 5:06 ` [PATCH v5 01/13] net: ethernet: aquantia: Make and configuration files Joe Perches
2017-01-13 5:24 ` David VomLehn
2017-01-13 5:59 ` Joe Perches
2017-01-13 6:57 ` David VomLehn
2017-01-13 7:28 ` Joe Perches
2017-01-14 2:01 ` Florian Fainelli
2017-01-14 18:39 ` Florian Fainelli
2017-01-14 18:42 ` David VomLehn
2017-01-14 18:48 ` Florian Fainelli
2017-01-14 19:04 ` David VomLehn
2017-01-14 1:38 ` [PATCH v5 00/13] net: ethernet: aquantia: Add AQtion 2.5/5 GB NIC driver Florian Fainelli
2017-01-14 3:41 ` David VomLehn
2017-01-14 2:05 ` Florian Fainelli
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=20170115011547.GA5643@lunn.ch \
--to=andrew@lunn.ch \
--cc=Alexander.Loktionov@aquantia.com \
--cc=Dmitrii.Tarakanov@aquantia.com \
--cc=Dmitry.Bezrukov@aquantia.com \
--cc=Pavel.Belous@aquantia.com \
--cc=Simon.Edelhaus@aquantia.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=roszenrami@gmail.com \
--cc=vomlehn@texas.net \
/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).