Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1115480ybl; Fri, 24 Jan 2020 16:00:41 -0800 (PST) X-Google-Smtp-Source: APXvYqxJj2WuQzID6h9+UXx/zyXlfoWwBeLa5XlCbEZvgeS8hsYBKH+5YC9K8S6+y4ghN063oJKd X-Received: by 2002:aca:3354:: with SMTP id z81mr970820oiz.129.1579910441352; Fri, 24 Jan 2020 16:00:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579910441; cv=none; d=google.com; s=arc-20160816; b=I0OBCAjLxUBdqjMw3eC/Nt838Ua5FTarpatADBzTiEe2jTV56qDZfto9ax2w6TTdjJ YKjHbIAAJDGUVDyb3QtWa2egz8eykneQvpGCqimCjiOgSPb4Sb8gaTqlHmbj6/i2hutr AvpFjtor21NIFjefRJmLI4YoP5NUTUELUT+iAm3fh96g1rWJKRE+pqQ/SnGileqjp/np MVQ4vsKp4mtz7TRE3gxVlswSvfa9iyyRvSQyUMJ174e7Jit01oL9ytNj/+yODTRDzASa +v6QvEYK+xl372cigXuscx20FIX5hbx5seaXiO+J7mMOTxMFzLwN/IavLqbFiGdqFEey PgSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=JUzqmVJFhWwG8HFditFQcO6aapkFWx5TjN8Oa2FhIrM=; b=T4DcO81knTKnaCYOc6plk+STD0ANSiYqHKSnYyevW3VKup1IUtGfeibtOUFyf9ltzw AFIOIFdx9HyMuvWBKAnwy3i4ohLZbyLjKM4EWl88YcjiMaP663fFBaVrd9lu3h1JAN04 ilqLzNfJHvGGgRYg/8IvIVIlm5GtB/TSn2kHku96OHBQcbihsFrt2oCnZSzQuUAGPXl5 UoSgmfqfGw49h1UUIxJI6xSYrHGNU2UUQtB95Mn5/fLTkltlYfDF0jxuMYZSW4Od+IMN JHH9pWeyP67bQypOuIMxtHsgp5dqOeB32IhIy0qv7iTQjGzXqIUU6FWzT1K4xZzIDSM0 jr0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="F1e/egiv"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v76si562145oif.207.2020.01.24.16.00.28; Fri, 24 Jan 2020 16:00:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="F1e/egiv"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387475AbgAXX7h (ORCPT + 99 others); Fri, 24 Jan 2020 18:59:37 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41116 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729236AbgAXX7h (ORCPT ); Fri, 24 Jan 2020 18:59:37 -0500 Received: by mail-pg1-f196.google.com with SMTP id x8so1924508pgk.8; Fri, 24 Jan 2020 15:59:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=JUzqmVJFhWwG8HFditFQcO6aapkFWx5TjN8Oa2FhIrM=; b=F1e/egivRVdyTOIgkP8CkoPKuL7Q9M71wcKl7ClErYRfa1GDI9I76QTYf+ygljM75L A4p4dRCsSEsvQJWuYZfpg1sG5Epv1ehn08bNXuaY6ViHLqURPQ06NVfs3acqN6+CnlnF IskPUTPnGZQFmutMrOCI0T/c1mXlEQ38PK2e6XvWc7Mq60VR9Kimi40c+490PF7gB4Qo dCRNpPR7y/0YWyr5hjJcc6ibw2rY/GMTjJjbMsPf+8s9i0/vFjamNYA3iqAyIRBhE/uk nBmMoGoqF+pNZUd9xka3D5vpEB4TcVXDqmcYWzAyRd7MTBImqzHkX4qM5Xkwkxz2nnJ8 8rXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JUzqmVJFhWwG8HFditFQcO6aapkFWx5TjN8Oa2FhIrM=; b=SOgKuXsdAlOR1u9MfucYhkrBDmi/l0xCQ8OK3MDdz5YIJlGaAmCpg5QJLJ4eI2Rgki ua/xbSMctwlP7dTk9zjzDiRM1UMT6sEiBVT8ujXPswhHmgAKer3NesvLSvuJp/UlZePV ck6E/l3vc2v+U7amNLImEm+DDOJdDYdUbeHg2Zqq1ZZp2KEaimSIy5A2nwl8llSGi7bu m2qNCgLAk/a8VS3wwCNDHPIP/0k0B9XVQScG8DM89y100BS5OCVhd88YIdBoaUkOEKjX mmiIt8PPWi3njm54918yLZmCC4XmLM2fXFhvWWLeTWFJ8JyM0t8eMKjPi5vC9cJKU6y0 Fjyw== X-Gm-Message-State: APjAAAU1Xmhxr0lQMwuROYWGR2242MuJ1A1LX00kR2km3Bk0kPqDdxYj ox1iZ/rlEd/tEnuvMnigxAKP+jQ9 X-Received: by 2002:a62:1bc5:: with SMTP id b188mr5698687pfb.113.1579910375806; Fri, 24 Jan 2020 15:59:35 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id l9sm7407244pgh.34.2020.01.24.15.59.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2020 15:59:35 -0800 (PST) From: Florian Fainelli To: netdev@vger.kernel.org Cc: kuba@kernel.org, edumazet@google.com, Florian Fainelli , "David S. Miller" , 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 Message-Id: <20200124235930.640-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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