From: "Thierry Reding" <thierry.reding@gmail.com>
To: "Serge Semin" <fancer.lancer@gmail.com>
Cc: "Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Jose Abreu" <joabreu@synopsys.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>, <netdev@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH net-next v2 3/3] net: stmmac: Configure AXI on Tegra234 MGBE
Date: Tue, 13 Feb 2024 16:51:34 +0100 [thread overview]
Message-ID: <CZ42KOP6ECUC.EEIHWA147NV9@gmail.com> (raw)
In-Reply-To: <uzzzxx3mv6yoslijhhzdzyossvcvi52jgbulza54uqh2wrm5kd@ddd5o56b2dhu>
[-- Attachment #1: Type: text/plain, Size: 3315 bytes --]
On Mon Feb 5, 2024 at 1:44 AM CET, Serge Semin wrote:
> On Fri, Feb 02, 2024 at 12:53:35PM +0100, Thierry Reding wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > Allow the device to use bursts and increase the maximum number of
> > outstanding requests to improve performance. Measurements show an
> > increase in throughput of around 5x on a 1 Gbps link.
> >
> > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > ---
> > drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> > index bab57d1675df..b6bfa48f279d 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c
> > @@ -199,6 +199,12 @@ static void mgbe_uphy_lane_bringup_serdes_down(struct net_device *ndev, void *mg
> > writel(value, mgbe->xpcs + XPCS_WRAP_UPHY_RX_CONTROL);
> > }
> >
> > +static const struct stmmac_axi tegra234_mgbe_axi = {
> > + .axi_wr_osr_lmt = 63,
> > + .axi_rd_osr_lmt = 63,
> > + .axi_blen = { 256, },
> > +};
> > +
> > static int tegra_mgbe_probe(struct platform_device *pdev)
> > {
> > struct plat_stmmacenet_data *plat;
> > @@ -284,6 +290,9 @@ static int tegra_mgbe_probe(struct platform_device *pdev)
> > if (err < 0)
> > goto disable_clks;
> >
> > + /* setup default AXI configuration */
> > + res.axi = &tegra234_mgbe_axi;
> > +
> > plat = devm_stmmac_probe_config_dt(pdev, &res);
> > if (IS_ERR(plat)) {
> > err = PTR_ERR(plat);
>
> The entire series can be converted to just a few lines of change:
Sorry for the delay, I missed this reply.
> plat = devm_stmmac_probe_config_dt(pdev, res.mac);
> if (IS_ERR(plat)) {
> err = PTR_ERR(plat);
> goto disable_clks;
> }
> +
> + if (IS_ERR_OR_NULL(plat->axi)) {
> + plat->axi = devm_kzalloc(&pdev->dev, sizeof(*axi), GFP_KERNEL);
> + if (!plat->axi) {
> + ret = -ENOMEM;
> + goto disable_clks;
> + }
> + } /* else memset plat->axi with zeros if you wish */
> +
> + plat->axi->axi_wr_osr_lmt = 63;
> + plat->axi->axi_rd_osr_lmt = 63;
> + plat->axi->axi_blen[0] = 256;
>
> plat->has_xgmac = 1;
> plat->flags |= STMMAC_FLAG_TSO_EN;
> plat->pmt = 1;
>
> Please don't overcomplicate the already overcomplicated driver with a
> functionality which can be reached by the default one. In this case
> the easiest way is to let the generic code work and then
> override/replace/fix/etc the retrieved values. Thus there won't be
> need in adding the redundant functionality and keep the generic
> DT-platform code a bit simpler to read.
I'm not sure I understand how this is overcomplicating things. The code
is pretty much unchanged, except that the AXI configuration can now have
driver-specified defaults before the DT is parsed. Perhaps I need to add
comments to make that a bit clearer?
While your version is certainly simpler it has the drawback that it no
longer allows the platform defaults to be overridden in device tree. I
would prefer if the defaults can be derived from the compatible string
but if need be for those defaults to still be overridable from device
tree.
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2024-02-13 15:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 11:53 [PATCH net-next v2 0/3] net: stmmac: Allow driver-specific AXI configuration Thierry Reding
2024-02-02 11:53 ` [PATCH net-next v2 1/3] net: stmmac: Pass resources to DT parsing code Thierry Reding
2024-02-02 11:53 ` [PATCH net-next v2 2/3] net: stmmac: Allow drivers to provide a default AXI configuration Thierry Reding
2024-02-04 14:15 ` Simon Horman
2024-02-02 11:53 ` [PATCH net-next v2 3/3] net: stmmac: Configure AXI on Tegra234 MGBE Thierry Reding
2024-02-05 0:44 ` Serge Semin
2024-02-13 15:51 ` Thierry Reding [this message]
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=CZ42KOP6ECUC.EEIHWA147NV9@gmail.com \
--to=thierry.reding@gmail.com \
--cc=alexandre.torgue@foss.st.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fancer.lancer@gmail.com \
--cc=joabreu@synopsys.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-tegra@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).