From: Alexey.Brodkin@synopsys.com (Alexey Brodkin)
To: linux-snps-arc@lists.infradead.org
Subject: [PATCH 1/1] net: nps_enet: Disable interrupts before napi reschedule
Date: Thu, 26 May 2016 17:53:29 +0000 [thread overview]
Message-ID: <1464285174.4578.36.camel@synopsys.com> (raw)
In-Reply-To: <1464264006-26627-1-git-send-email-eladkan@mellanox.com>
Hi Elad,
On Thu, 2016-05-26@15:00 +0300, Elad Kanfi wrote:
> From: Elad Kanfi <eladkan at mellanox.com>
>
> Since NAPI works by shutting down event interrupts when theres
> work and turning them on when theres none, the net driver must
> make sure that interrupts are disabled when it reschedules polling.
> By calling napi_reschedule, the driver switches to polling mode,
> therefor there should be no interrupt interference.
> Any received packets will be handled in nps_enet_poll by polling the HW
> indication of received packet until all packets are handled.
>
> Signed-off-by: Elad Kanfi <eladkan at mellanox.com>
> Acked-by: Noam Camus <noamca at mellanox.com>
> ---
> ?drivers/net/ethernet/ezchip/nps_enet.c |????4 +++-
> ?1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
> index 085f912..06f0317 100644
> --- a/drivers/net/ethernet/ezchip/nps_enet.c
> +++ b/drivers/net/ethernet/ezchip/nps_enet.c
> @@ -205,8 +205,10 @@ static int nps_enet_poll(struct napi_struct *napi, int budget)
> ? ?* re-adding ourselves to the poll list.
> ? ?*/
> ?
> - if (priv->tx_skb && !tx_ctrl_ct)
> + if (priv->tx_skb && !tx_ctrl_ct) {
> + nps_enet_reg_set(priv, NPS_ENET_REG_BUF_INT_ENABLE, 0);
> ? napi_reschedule(napi);
> + }
> ? }
> ?
> ? return work_done;
We just bumped into the same problem (data exchange hangs on the very first "ping")
with released Linux v4.6 and linux-next on our nSIM OSCI virtual platform.
I believe it was commit?05c00d82f4d1 ("net: nps_enet: bug fix - handle lost tx interrupts")
that introduced the problem. At least reverting it I got networking working.
And indeed that patch fixes mentioned issue.
In other words...
Tested-by: Alexey Brodkin <abrodkin at synopsys.com>
P.S. Given my observation is correct please add following to your commit
message if you ever do a respin:
------------------>8---------------
Fixes: 05c00d82f4d1 ("net: nps_enet: bug fix - handle lost tx interrupts")
Cc: <stable at vger.kernel.org> # 4.6.x
------------------>8---------------
WARNING: multiple messages have this Message-ID (diff)
From: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
To: "eladkan@mellanox.com" <eladkan@mellanox.com>
Cc: "linux-snps-arc@lists.infradead.org"
<linux-snps-arc@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"noamca@mellanox.com" <noamca@mellanox.com>,
Anton Kolesov <Anton.Kolesov@synopsys.com>,
"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH 1/1] net: nps_enet: Disable interrupts before napi reschedule
Date: Thu, 26 May 2016 17:53:29 +0000 [thread overview]
Message-ID: <1464285174.4578.36.camel@synopsys.com> (raw)
In-Reply-To: <1464264006-26627-1-git-send-email-eladkan@mellanox.com>
Hi Elad,
On Thu, 2016-05-26 at 15:00 +0300, Elad Kanfi wrote:
> From: Elad Kanfi <eladkan@mellanox.com>
>
> Since NAPI works by shutting down event interrupts when theres
> work and turning them on when theres none, the net driver must
> make sure that interrupts are disabled when it reschedules polling.
> By calling napi_reschedule, the driver switches to polling mode,
> therefor there should be no interrupt interference.
> Any received packets will be handled in nps_enet_poll by polling the HW
> indication of received packet until all packets are handled.
>
> Signed-off-by: Elad Kanfi <eladkan@mellanox.com>
> Acked-by: Noam Camus <noamca@mellanox.com>
> ---
> drivers/net/ethernet/ezchip/nps_enet.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
> index 085f912..06f0317 100644
> --- a/drivers/net/ethernet/ezchip/nps_enet.c
> +++ b/drivers/net/ethernet/ezchip/nps_enet.c
> @@ -205,8 +205,10 @@ static int nps_enet_poll(struct napi_struct *napi, int budget)
> * re-adding ourselves to the poll list.
> */
>
> - if (priv->tx_skb && !tx_ctrl_ct)
> + if (priv->tx_skb && !tx_ctrl_ct) {
> + nps_enet_reg_set(priv, NPS_ENET_REG_BUF_INT_ENABLE, 0);
> napi_reschedule(napi);
> + }
> }
>
> return work_done;
We just bumped into the same problem (data exchange hangs on the very first "ping")
with released Linux v4.6 and linux-next on our nSIM OSCI virtual platform.
I believe it was commit 05c00d82f4d1 ("net: nps_enet: bug fix - handle lost tx interrupts")
that introduced the problem. At least reverting it I got networking working.
And indeed that patch fixes mentioned issue.
In other words...
Tested-by: Alexey Brodkin <abrodkin@synopsys.com>
P.S. Given my observation is correct please add following to your commit
message if you ever do a respin:
------------------>8---------------
Fixes: 05c00d82f4d1 ("net: nps_enet: bug fix - handle lost tx interrupts")
Cc: <stable@vger.kernel.org> # 4.6.x
------------------>8---------------
next prev parent reply other threads:[~2016-05-26 17:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-26 12:00 [PATCH 1/1] net: nps_enet: Disable interrupts before napi reschedule Elad Kanfi
2016-05-26 17:53 ` Alexey Brodkin [this message]
2016-05-26 17:53 ` Alexey Brodkin
2016-05-27 4:07 ` Vineet Gupta
2016-05-27 4:07 ` Vineet Gupta
2016-05-30 5:35 ` David Miller
2016-06-02 10:13 ` Vineet Gupta
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=1464285174.4578.36.camel@synopsys.com \
--to=alexey.brodkin@synopsys.com \
--cc=linux-snps-arc@lists.infradead.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.