From: Wolfram Sang <wsa@the-dreams.de>
To: Ulrich Hecht <uli+renesas@fpond.eu>
Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
davem@davemloft.net, sergei.shtylyov@cogentembedded.com,
niklas.soderlund@ragnatech.se, horms@verge.net.au,
magnus.damm@gmail.com, geert@glider.be
Subject: Re: [PATCH v3] ravb: implement MTU change while device is up
Date: Tue, 20 Aug 2019 21:41:29 +0200 [thread overview]
Message-ID: <20190820194129.jttuef4ghsx7rihf@katana> (raw)
In-Reply-To: <1566327686-8996-1-git-send-email-uli+renesas@fpond.eu>
[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]
Hi Uli,
thanks for the patch.
On Tue, Aug 20, 2019 at 09:01:26PM +0200, Ulrich Hecht wrote:
> Uses the same method as various other drivers: shut the device down,
> change the MTU, then bring it back up again.
>
> Tested on Renesas D3 Draak and M3-W Salvator-X boards.
>
> Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>
> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Are these reviews left from v2? If so, I'd prefer to see them given
again because the logic was changed in v3.
> ---
>
> Hi!
>
> This revision reverts the MTU change if re-opening the device fails.
>
> CU
> Uli
>
>
> drivers/net/ethernet/renesas/ravb_main.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index ef8f089..402bcec 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -1810,12 +1810,24 @@ static int ravb_do_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
>
> static int ravb_change_mtu(struct net_device *ndev, int new_mtu)
> {
> + unsigned int old_mtu = ndev->mtu;
> +
> if (netif_running(ndev))
> - return -EBUSY;
> + ravb_close(ndev);
>
> ndev->mtu = new_mtu;
> netdev_update_features(ndev);
>
> + if (netif_running(ndev)) {
> + int err = ravb_open(ndev);
> +
> + if (err) {
> + ndev->mtu = old_mtu;
> + netdev_update_features(ndev);
> + return err;
> + }
> + }
> +
> return 0;
> }
>
> --
> 2.7.4
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-08-20 19:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-20 19:01 [PATCH v3] ravb: implement MTU change while device is up Ulrich Hecht
2019-08-20 19:41 ` Wolfram Sang [this message]
2019-08-20 21:05 ` David Miller
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=20190820194129.jttuef4ghsx7rihf@katana \
--to=wsa@the-dreams.de \
--cc=davem@davemloft.net \
--cc=geert@glider.be \
--cc=horms@verge.net.au \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=uli+renesas@fpond.eu \
/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