From: Marcin Wojtas <mw@semihalf.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"Russell King - ARM Linux" <linux@arm.linux.org.uk>,
"Sebastian Hesselbarth" <sebastian.hesselbarth@gmail.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Jason Cooper" <jason@lakedaemon.net>,
"Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
"Gregory Clément" <gregory.clement@free-electrons.com>,
nadavh@marvell.com, "Lior Amsalem" <alior@marvell.com>,
"Sebastian Careba" <nitroshift@yahoo.com>,
"Marcin Wojtas" <mw@semihalf.com>,
"Grzegorz Jaszczyk" <jaz@semihalf.com>
Subject: Re: [PATCH] net: mvneta: fix changing MTU when using per-cpu processing
Date: Fri, 1 Apr 2016 15:22:54 +0200 [thread overview]
Message-ID: <CAPv3WKfLXibDQbr71p3H4Okh-o7pv_BhjoL_T6mtHcPRQmu1Jg@mail.gmail.com> (raw)
In-Reply-To: <1459516878-2802-1-git-send-email-mw@semihalf.com>
Hi David,
I've just realized I forgot to add an information, that this patch is
intended for 'net' tree.
Best regards,
Marcin
2016-04-01 15:21 GMT+02:00 Marcin Wojtas <mw@semihalf.com>:
> After enabling per-cpu processing it appeared that under heavy load
> changing MTU can result in blocking all port's interrupts and transmitting
> data is not possible after the change.
>
> This commit fixes above issue by disabling percpu interrupts for the
> time, when TXQs and RXQs are reconfigured.
>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> ---
> drivers/net/ethernet/marvell/mvneta.c | 30 ++++++++++++++++--------------
> 1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index fee6a91..a433de9 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -3083,6 +3083,20 @@ static int mvneta_check_mtu_valid(struct net_device *dev, int mtu)
> return mtu;
> }
>
> +static void mvneta_percpu_enable(void *arg)
> +{
> + struct mvneta_port *pp = arg;
> +
> + enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE);
> +}
> +
> +static void mvneta_percpu_disable(void *arg)
> +{
> + struct mvneta_port *pp = arg;
> +
> + disable_percpu_irq(pp->dev->irq);
> +}
> +
> /* Change the device mtu */
> static int mvneta_change_mtu(struct net_device *dev, int mtu)
> {
> @@ -3107,6 +3121,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
> * reallocation of the queues
> */
> mvneta_stop_dev(pp);
> + on_each_cpu(mvneta_percpu_disable, pp, true);
>
> mvneta_cleanup_txqs(pp);
> mvneta_cleanup_rxqs(pp);
> @@ -3130,6 +3145,7 @@ static int mvneta_change_mtu(struct net_device *dev, int mtu)
> return ret;
> }
>
> + on_each_cpu(mvneta_percpu_enable, pp, true);
> mvneta_start_dev(pp);
> mvneta_port_up(pp);
>
> @@ -3283,20 +3299,6 @@ static void mvneta_mdio_remove(struct mvneta_port *pp)
> pp->phy_dev = NULL;
> }
>
> -static void mvneta_percpu_enable(void *arg)
> -{
> - struct mvneta_port *pp = arg;
> -
> - enable_percpu_irq(pp->dev->irq, IRQ_TYPE_NONE);
> -}
> -
> -static void mvneta_percpu_disable(void *arg)
> -{
> - struct mvneta_port *pp = arg;
> -
> - disable_percpu_irq(pp->dev->irq);
> -}
> -
> /* Electing a CPU must be done in an atomic way: it should be done
> * after or before the removal/insertion of a CPU and this function is
> * not reentrant.
> --
> 1.8.3.1
>
next prev parent reply other threads:[~2016-04-01 13:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 13:21 Marcin Wojtas
2016-04-01 13:22 ` Marcin Wojtas [this message]
2016-04-01 19:18 ` 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=CAPv3WKfLXibDQbr71p3H4Okh-o7pv_BhjoL_T6mtHcPRQmu1Jg@mail.gmail.com \
--to=mw@semihalf.com \
--cc=alior@marvell.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=gregory.clement@free-electrons.com \
--cc=jason@lakedaemon.net \
--cc=jaz@semihalf.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nadavh@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=nitroshift@yahoo.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=thomas.petazzoni@free-electrons.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
all inboxes | Powered by JetHome®