From: Jisheng Zhang <jszhang@kernel.org>
To: Alexandre TORGUE <alexandre.torgue@foss.st.com>
Cc: "David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Giuseppe Cavallaro <peppe.cavallaro@st.com>,
Jose Abreu <joabreu@synopsys.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next v3 06/10] net: stmmac: xgmac: support per-channel irq
Date: Wed, 16 Aug 2023 23:52:53 +0800 [thread overview]
Message-ID: <ZNzw1cqmGQaKpfGi@xhacker> (raw)
In-Reply-To: <a12b6d39-0e26-7bdc-4207-c767342ebcf6@foss.st.com>
On Thu, Aug 10, 2023 at 04:52:01PM +0200, Alexandre TORGUE wrote:
> On 8/9/23 18:50, Jisheng Zhang wrote:
> > The IP supports per channel interrupt, add support for this usage case.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> > .../net/ethernet/stmicro/stmmac/dwxgmac2.h | 2 ++
> > .../ethernet/stmicro/stmmac/dwxgmac2_dma.c | 33 +++++++++++--------
> > 2 files changed, 22 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
> > index 81cbb13a101d..12e1228ccf2a 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
> > @@ -327,6 +327,8 @@
> > /* DMA Registers */
> > #define XGMAC_DMA_MODE 0x00003000
> > +#define XGMAC_INTM GENMASK(13, 12)
> > +#define XGMAC_INTM_MODE1 0x1
> > #define XGMAC_SWR BIT(0)
> > #define XGMAC_DMA_SYSBUS_MODE 0x00003004
> > #define XGMAC_WR_OSR_LMT GENMASK(29, 24)
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
> > index b5ba4e0cca55..ef25af92d6cc 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
> > @@ -31,6 +31,13 @@ static void dwxgmac2_dma_init(void __iomem *ioaddr,
> > value |= XGMAC_EAME;
> > writel(value, ioaddr + XGMAC_DMA_SYSBUS_MODE);
> > +
> > + if (dma_cfg->perch_irq_en) {
> > + value = readl(ioaddr + XGMAC_DMA_MODE);
> > + value &= ~XGMAC_INTM;
> > + value |= FIELD_PREP(XGMAC_INTM, XGMAC_INTM_MODE1);
> > + writel(value, ioaddr + XGMAC_DMA_MODE);
> > + }
> > }
> > static void dwxgmac2_dma_init_chan(struct stmmac_priv *priv,
> > @@ -365,20 +372,20 @@ static int dwxgmac2_dma_interrupt(struct stmmac_priv *priv,
> > }
> > /* TX/RX NORMAL interrupts */
> > - if (likely(intr_status & XGMAC_NIS)) {
>
> No longer need to check NIS bit ?
Hi Alexandre,
NIS is RI | TI | TBU, since we have checked these three
bits we can ignore NIS. And dwmac4 behaves similarly.
Thanks
>
> > - if (likely(intr_status & XGMAC_RI)) {
> > - u64_stats_update_begin(&rx_q->rxq_stats.syncp);
> > - rx_q->rxq_stats.rx_normal_irq_n++;
> > - u64_stats_update_end(&rx_q->rxq_stats.syncp);
> > - ret |= handle_rx;
> > - }
> > - if (likely(intr_status & (XGMAC_TI | XGMAC_TBU))) {
> > - u64_stats_update_begin(&tx_q->txq_stats.syncp);
> > - tx_q->txq_stats.tx_normal_irq_n++;
> > - u64_stats_update_end(&tx_q->txq_stats.syncp);
> > - ret |= handle_tx;
> > - }
> > + if (likely(intr_status & XGMAC_RI)) {
> > + u64_stats_update_begin(&rx_q->rxq_stats.syncp);
> > + rx_q->rxq_stats.rx_normal_irq_n++;
> > + u64_stats_update_end(&rx_q->rxq_stats.syncp);
> > + ret |= handle_rx;
> > + }
> > + if (likely(intr_status & XGMAC_TI)) {
> > + u64_stats_update_begin(&tx_q->txq_stats.syncp);
> > + tx_q->txq_stats.tx_normal_irq_n++;
> > + u64_stats_update_end(&tx_q->txq_stats.syncp);
> > + ret |= handle_tx;
> > }
> > + if (unlikely(intr_status & XGMAC_TBU))
> > + ret |= handle_tx;
> > /* Clear interrupts */
> > writel(intr_en & intr_status, ioaddr + XGMAC_DMA_CH_STATUS(chan));
>
next prev parent reply other threads:[~2023-08-16 16:05 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 16:49 [PATCH net-next v3 00/10] net: stmmac: add new features to xgmac Jisheng Zhang
2023-08-09 16:49 ` [PATCH net-next v3 01/10] net: stmmac: correct RX COE parsing for xgmac Jisheng Zhang
2023-08-10 13:45 ` Alexandre TORGUE
2023-08-09 16:49 ` [PATCH net-next v3 02/10] net: stmmac: xgmac: add more feature parsing from hw cap Jisheng Zhang
2023-08-10 13:46 ` Alexandre TORGUE
2023-08-09 16:50 ` [PATCH net-next v3 03/10] net: stmmac: mdio: enlarge the max XGMAC C22 ADDR to 31 Jisheng Zhang
2023-08-10 13:46 ` Alexandre TORGUE
2023-08-09 16:50 ` [PATCH net-next v3 04/10] net: stmmac: enlarge max rx/tx queues and channels to 16 Jisheng Zhang
2023-08-10 14:43 ` Alexandre TORGUE
2023-08-09 16:50 ` [PATCH net-next v3 05/10] net: stmmac: reflect multi irqs for tx/rx channels and mac and safety Jisheng Zhang
2023-08-10 14:50 ` Alexandre TORGUE
2023-08-10 16:02 ` Jisheng Zhang
2023-08-09 16:50 ` [PATCH net-next v3 06/10] net: stmmac: xgmac: support per-channel irq Jisheng Zhang
2023-08-10 14:52 ` Alexandre TORGUE
2023-08-16 15:52 ` Jisheng Zhang [this message]
2023-08-09 16:50 ` [PATCH net-next v3 07/10] dt-bindings: net: snps,dwmac: add safety irq support Jisheng Zhang
2023-08-15 21:09 ` Krzysztof Kozlowski
2023-08-09 16:50 ` [PATCH net-next v3 08/10] net: stmmac: platform: support parsing safety irqs from DT Jisheng Zhang
2023-08-10 14:52 ` Alexandre TORGUE
2023-08-09 16:50 ` [PATCH net-next v3 09/10] dt-bindings: net: snps,dwmac: add per channel irq support Jisheng Zhang
2023-08-09 17:38 ` Conor Dooley
2023-08-10 15:45 ` Jisheng Zhang
2023-08-09 16:50 ` [PATCH net-next v3 10/10] net: stmmac: platform: support parsing per channel irq from DT Jisheng Zhang
2023-08-10 14:57 ` Alexandre TORGUE
2023-08-10 16:09 ` Jisheng Zhang
2023-08-10 16:21 ` Jisheng Zhang
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=ZNzw1cqmGQaKpfGi@xhacker \
--to=jszhang@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=robh+dt@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;
as well as URLs for NNTP newsgroup(s).