public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Jitendra Vegiraju <jitendra.vegiraju@broadcom.com>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: netdev@vger.kernel.org, alexandre.torgue@foss.st.com,
	joabreu@synopsys.com,  davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,  mcoquelin.stm32@gmail.com,
	bcm-kernel-feedback-list@broadcom.com,  richardcochran@gmail.com,
	ast@kernel.org, daniel@iogearbox.net,  hawk@kernel.org,
	john.fastabend@gmail.com, rmk+kernel@armlinux.org.uk,
	 ahalaney@redhat.com, xiaolei.wang@windriver.com,
	rohan.g.thomas@intel.com,  Jianheng.Zhang@synopsys.com,
	linux-kernel@vger.kernel.org,
	 linux-stm32@st-md-mailman.stormreply.com,
	 linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org,
	andrew@lunn.ch,  linux@armlinux.org.uk, horms@kernel.org,
	florian.fainelli@broadcom.com
Subject: Re: [PATCH net-next v5 1/5] net: stmmac: Add HDMA mapping for dw25gmac support
Date: Wed, 11 Sep 2024 14:50:54 -0700	[thread overview]
Message-ID: <CAMdnO-+nPHsNmxYkB0v54LfcHm-Df92dyGiZM3Rwe_sDMmPyVQ@mail.gmail.com> (raw)
In-Reply-To: <7foqi3vdgc3kvyw5rrnqsqsakgfgcrhw5sihnqwza4okdnh5dd@pdsdjn32ya6u>

Hi Serge,
Thank you for taking the time to review the patches.

On Tue, Sep 10, 2024 at 11:37 AM Serge Semin <fancer.lancer@gmail.com> wrote:
>
> Hi Jitendra
>
> On Tue, Sep 03, 2024 at 10:48:11PM -0700, jitendra.vegiraju@broadcom.com wrote:
> > From: Jitendra Vegiraju <jitendra.vegiraju@broadcom.com>
> >
> > Add hdma configuration support in include/linux/stmmac.h file.
> > The hdma configuration includes mapping of virtual DMAs to physical DMAs.
> > Define a new data structure stmmac_hdma_cfg to provide the mapping.
> >
> > Introduce new plat_stmmacenet_data::snps_id,snps_dev_id to allow glue
> > drivers to specify synopsys ID and device id respectively.
> > These values take precedence over reading from HW register. This facility
> > provides a mechanism to use setup function from stmmac core module and yet
> > override MAC.VERSION CSR if the glue driver chooses to do so.
> >
> > Signed-off-by: Jitendra Vegiraju <jitendra.vegiraju@broadcom.com>
> > ---
> >  include/linux/stmmac.h | 48 ++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 48 insertions(+)
> >
> > diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
> > index 338991c08f00..eb8136680a7b 100644
> > --- a/include/linux/stmmac.h
> > +++ b/include/linux/stmmac.h
> > @@ -89,6 +89,51 @@ struct stmmac_mdio_bus_data {
> >       bool needs_reset;
> >  };
> >
> > +/* DW25GMAC Hyper-DMA Overview
> > + * Hyper-DMA allows support for large number of Virtual DMA(VDMA)
> > + * channels using a smaller set of physical DMA channels(PDMA).
> > + * This is supported by the mapping of VDMAs to Traffic Class(TC)
> > + * and PDMA to TC in each traffic direction as shown below.
> > + *
> > + *        VDMAs            Traffic Class      PDMA
> > + *       +--------+          +------+         +-----------+
> > + *       |VDMA0   |--------->| TC0  |-------->|PDMA0/TXQ0 |
> > + *TX     +--------+   |----->+------+         +-----------+
> > + *Host=> +--------+   |      +------+         +-----------+ => MAC
> > + *SW     |VDMA1   |---+      | TC1  |    +--->|PDMA1/TXQ1 |
> > + *       +--------+          +------+    |    +-----------+
> > + *       +--------+          +------+----+    +-----------+
> > + *       |VDMA2   |--------->| TC2  |-------->|PDMA2/TXQ1 |
> > + *       +--------+          +------+         +-----------+
> > + *            .                 .                 .
> > + *       +--------+          +------+         +-----------+
> > + *       |VDMAn-1 |--------->| TCx-1|-------->|PDMAm/TXQm |
> > + *       +--------+          +------+         +-----------+
> > + *
> > + *       +------+          +------+         +------+
> > + *       |PDMA0 |--------->| TC0  |-------->|VDMA0 |
> > + *       +------+   |----->+------+         +------+
> > + *MAC => +------+   |      +------+         +------+
> > + *RXQs   |PDMA1 |---+      | TC1  |    +--->|VDMA1 |  => Host
> > + *       +------+          +------+    |    +------+
> > + *            .                 .                 .
> > + */
> > +
>
> > +/* Hyper-DMA mapping configuration
> > + * Traffic Class associated with each VDMA/PDMA mapping
> > + * is stored in corresponding array entry.
> > + */
> > +struct stmmac_hdma_cfg {
> > +     u32 tx_vdmas;   /* TX VDMA count */
> > +     u32 rx_vdmas;   /* RX VDMA count */
> > +     u32 tx_pdmas;   /* TX PDMA count */
> > +     u32 rx_pdmas;   /* RX PDMA count */
> > +     u8 *tvdma_tc;   /* Tx VDMA to TC mapping array */
> > +     u8 *rvdma_tc;   /* Rx VDMA to TC mapping array */
> > +     u8 *tpdma_tc;   /* Tx PDMA to TC mapping array */
> > +     u8 *rpdma_tc;   /* Rx PDMA to TC mapping array */
> > +};
> > +
> >  struct stmmac_dma_cfg {
> >       int pbl;
> >       int txpbl;
> > @@ -101,6 +146,7 @@ struct stmmac_dma_cfg {
> >       bool multi_msi_en;
> >       bool dche;
> >       bool atds;
> > +     struct stmmac_hdma_cfg *hdma_cfg;
>
> Based on what you are implementing the _static_ VDMA-TC-PDMA channels
> mapping I really don't see a value of adding all of these data here.
> The whole implementation gets to be needlessly overcomplicated.
> Moreover AFAICS there are some channels left misconfigured in the
> Patch 2 code.  Please see my comments there for more details.
>
I agree, with _static_ VDMA-TC-PDMA channels, maintaining the mapping data
appears complicated.
The real need comes when adding virtualization (SRIOV) capabilities.
I am analyzing your comments in patch2 and will respond after re-evaluation.

> >  };
> >
> >  #define AXI_BLEN     7
> > @@ -303,5 +349,7 @@ struct plat_stmmacenet_data {
> >       int msi_tx_base_vec;
> >       const struct dwmac4_addrs *dwmac4_addrs;
> >       unsigned int flags;
>
> > +     u32 snps_id;
> > +     u32 snps_dev_id;
>
> Please move these fields to the head of the structure as the kind of
> crucial ones, and convert snps_dev_id to just dev_id.
>
> snps_id field name was selected based on the VERSION.SNPSVER field
> name (see SNPS prefix). Following that logic the VERSION.DEVID field
> should be converted to the dev_id name.
>
Thanks for explaining the thinking behind the field naming. That makes sense.
I was thinking of it as a prefix for synopsys fields.
Will make the change.
> -Serge(y)
>
> >  };
> >  #endif
> > --
> > 2.34.1
> >


  reply	other threads:[~2024-09-11 21:52 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  5:48 [net-next v5 0/5] net: stmmac: Add PCI driver support for BCM8958x jitendra.vegiraju
2024-09-04  5:48 ` [PATCH net-next v5 1/5] net: stmmac: Add HDMA mapping for dw25gmac support jitendra.vegiraju
2024-09-10 18:37   ` Serge Semin
2024-09-11 21:50     ` Jitendra Vegiraju [this message]
2024-09-04  5:48 ` [PATCH net-next v5 2/5] net: stmmac: Add basic dw25gmac support in stmmac core jitendra.vegiraju
2024-09-10 19:24   ` Serge Semin
2024-09-16 23:32     ` Jitendra Vegiraju
2024-10-04 16:05       ` Jitendra Vegiraju
2024-10-04 23:45         ` Serge Semin
2024-10-11  0:01         ` Serge Semin
2024-10-10 23:55       ` Serge Semin
2024-10-14 18:24         ` Jitendra Vegiraju
2024-09-04  5:48 ` [PATCH net-next v5 3/5] net: stmmac: Integrate dw25gmac into stmmac hwif handling jitendra.vegiraju
2024-09-04  5:48 ` [PATCH net-next v5 4/5] net: stmmac: Add PCI driver support for BCM8958x jitendra.vegiraju
2024-09-10 19:51   ` Serge Semin
2024-09-16 23:43     ` Jitendra Vegiraju
2024-09-04  5:48 ` [PATCH net-next v5 5/5] net: stmmac: Add BCM8958x driver to build system jitendra.vegiraju
2024-09-06 12:14 ` [net-next v5 0/5] net: stmmac: Add PCI driver support for BCM8958x Serge Semin
2024-09-10 11:29 ` Paolo Abeni
2024-09-10 11:55   ` Serge Semin

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=CAMdnO-+nPHsNmxYkB0v54LfcHm-Df92dyGiZM3Rwe_sDMmPyVQ@mail.gmail.com \
    --to=jitendra.vegiraju@broadcom.com \
    --cc=Jianheng.Zhang@synopsys.com \
    --cc=ahalaney@redhat.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fancer.lancer@gmail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=joabreu@synopsys.com \
    --cc=john.fastabend@gmail.com \
    --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=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=rohan.g.thomas@intel.com \
    --cc=xiaolei.wang@windriver.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