From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: kuba@kernel.org, edumazet@google.com,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
bcm-kernel-feedback-list@broadcom.com (open list:BROADCOM
SYSTEMPORT ETHERNET DRIVER),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next] net: systemport: Do not block interrupts in TX reclaim
Date: Fri, 24 Jan 2020 15:59:30 -0800 [thread overview]
Message-ID: <20200124235930.640-1-f.fainelli@gmail.com> (raw)
There is no need to disable interrupts with a spin_lock_irqsave() in
bcm_sysport_tx_poll() since we are in softIRQ context already. Leave
interrupts enabled, thus giving a chance for the RX interrupts to be
processed.
This now makes bcm_sysport_tx_reclaim() equivalent to
bcm_sysport_tx_clean(), thus remove the former, and make
bcm_sysport_tx_reclaim_all() to use the latter.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 30 ++++++----------------
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index f07ac0e0af59..dfff0657ce8f 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -925,26 +925,6 @@ static unsigned int __bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,
return pkts_compl;
}
-/* Locked version of the per-ring TX reclaim routine */
-static unsigned int bcm_sysport_tx_reclaim(struct bcm_sysport_priv *priv,
- struct bcm_sysport_tx_ring *ring)
-{
- struct netdev_queue *txq;
- unsigned int released;
- unsigned long flags;
-
- txq = netdev_get_tx_queue(priv->netdev, ring->index);
-
- spin_lock_irqsave(&ring->lock, flags);
- released = __bcm_sysport_tx_reclaim(priv, ring);
- if (released)
- netif_tx_wake_queue(txq);
-
- spin_unlock_irqrestore(&ring->lock, flags);
-
- return released;
-}
-
/* Locked version of the per-ring TX reclaim, but does not wake the queue */
static void bcm_sysport_tx_clean(struct bcm_sysport_priv *priv,
struct bcm_sysport_tx_ring *ring)
@@ -960,9 +940,15 @@ static int bcm_sysport_tx_poll(struct napi_struct *napi, int budget)
{
struct bcm_sysport_tx_ring *ring =
container_of(napi, struct bcm_sysport_tx_ring, napi);
+ struct bcm_sysport_priv *priv = ring->priv;
unsigned int work_done = 0;
- work_done = bcm_sysport_tx_reclaim(ring->priv, ring);
+ spin_lock(&ring->lock);
+ work_done = __bcm_sysport_tx_reclaim(priv, ring);
+ if (work_done)
+ netif_tx_wake_queue(netdev_get_tx_queue(priv->netdev,
+ ring->index));
+ spin_unlock(&ring->lock);
if (work_done == 0) {
napi_complete(napi);
@@ -984,7 +970,7 @@ static void bcm_sysport_tx_reclaim_all(struct bcm_sysport_priv *priv)
unsigned int q;
for (q = 0; q < priv->netdev->num_tx_queues; q++)
- bcm_sysport_tx_reclaim(priv, &priv->tx_rings[q]);
+ bcm_sysport_tx_clean(priv, &priv->tx_rings[q]);
}
static int bcm_sysport_poll(struct napi_struct *napi, int budget)
--
2.17.1
next reply other threads:[~2020-01-24 23:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 23:59 Florian Fainelli [this message]
2020-01-25 1:35 ` [PATCH net-next] net: systemport: Do not block interrupts in TX reclaim Eric Dumazet
2020-01-25 1:42 ` 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=20200124235930.640-1-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox