From: Jacob Keller <jacob.e.keller@intel.com>
To: Suraj Gupta <suraj.gupta2@amd.com>, <andrew+netdev@lunn.ch>,
<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
<pabeni@redhat.com>, <michal.simek@amd.com>,
<sean.anderson@linux.dev>, <radhey.shyam.pandey@amd.com>,
<horms@kernel.org>
Cc: <netdev@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <harini.katakam@amd.com>
Subject: Re: [PATCH net next] net: axienet: Use dedicated ethtool_ops for the dmaengine path
Date: Wed, 3 Jun 2026 15:02:12 -0700 [thread overview]
Message-ID: <a46235bb-e935-4a2b-b638-6e9621640a30@intel.com> (raw)
In-Reply-To: <20260601124454.3384601-1-suraj.gupta2@amd.com>
On 6/1/2026 5:44 AM, Suraj Gupta wrote:
> The dmaengine path shares ethtool_ops with the legacy AXI DMA path,
> including .get_coalesce/.set_coalesce that poke XAXIDMA_*_CR_OFFSET
> directly. In dmaengine mode lp->dma_regs is not mapped by axienet, so
> those ethtool calls touch unmapped/unrelated memory and report values
> unrelated to the channel actually in use.
>
> .get_ringparam/.set_ringparam only touch lp->rx_bd_num/lp->tx_bd_num,
> fields used only by the legacy path for BD ring sizing. In dmaengine
> mode the descriptor ring is owned by the dmaengine provider and these
> fields are not consulted, so reporting them is misleading.
>
> No dmaengine API exists today to query or program either coalescing
> or ring size on behalf of the client, so neither can be exposed
> meaningfully in dmaengine mode.
>
> Add axienet_ethtool_dmaengine_ops without the coalesce and ringparam
> hooks. Also move the ethtool_ops assignment from early probe into the
> if/else alongside netdev_ops, so the legacy and dmaengine paths pick
> their respective ops in one place. No functional change for the
> legacy DMA path.
>
> Signed-off-by: Suraj Gupta <suraj.gupta2@amd.com>
> ---
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> .../net/ethernet/xilinx/xilinx_axienet_main.c | 27 ++++++++++++++++---
> 1 file changed, 24 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 263c4b67fd5a..fcf517069d16 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -2536,6 +2536,25 @@ static const struct ethtool_ops axienet_ethtool_ops = {
> .get_rmon_stats = axienet_ethtool_get_rmon_stats,
> };
>
> +static const struct ethtool_ops axienet_ethtool_dmaengine_ops = {
> + .get_drvinfo = axienet_ethtools_get_drvinfo,
> + .get_regs_len = axienet_ethtools_get_regs_len,
> + .get_regs = axienet_ethtools_get_regs,
> + .get_link = ethtool_op_get_link,
> + .get_pauseparam = axienet_ethtools_get_pauseparam,
> + .set_pauseparam = axienet_ethtools_set_pauseparam,
> + .get_link_ksettings = axienet_ethtools_get_link_ksettings,
> + .set_link_ksettings = axienet_ethtools_set_link_ksettings,
> + .nway_reset = axienet_ethtools_nway_reset,
> + .get_ethtool_stats = axienet_ethtools_get_ethtool_stats,
> + .get_strings = axienet_ethtools_get_strings,
> + .get_sset_count = axienet_ethtools_get_sset_count,
> + .get_pause_stats = axienet_ethtools_get_pause_stats,
> + .get_eth_mac_stats = axienet_ethtool_get_eth_mac_stats,
> + .get_eth_ctrl_stats = axienet_ethtool_get_eth_ctrl_stats,
> + .get_rmon_stats = axienet_ethtool_get_rmon_stats,
> +};
> +
> static struct axienet_local *pcs_to_axienet_local(struct phylink_pcs *pcs)
> {
> return container_of(pcs, struct axienet_local, pcs);
> @@ -2792,7 +2811,6 @@ static int axienet_probe(struct platform_device *pdev)
>
> SET_NETDEV_DEV(ndev, &pdev->dev);
> ndev->features = NETIF_F_SG;
> - ndev->ethtool_ops = &axienet_ethtool_ops;
>
> /* MTU range: 64 - 9000 */
> ndev->min_mtu = 64;
> @@ -3021,10 +3039,13 @@ static int axienet_probe(struct platform_device *pdev)
> lp->use_dmaengine = 1;
> }
>
> - if (lp->use_dmaengine)
> + if (lp->use_dmaengine) {
> ndev->netdev_ops = &axienet_netdev_dmaengine_ops;
> - else
> + ndev->ethtool_ops = &axienet_ethtool_dmaengine_ops;
> + } else {
> ndev->netdev_ops = &axienet_netdev_ops;
> + ndev->ethtool_ops = &axienet_ethtool_ops;
> + }
> /* Check for Ethernet core IRQ (optional) */
> if (lp->eth_irq <= 0)
> dev_info(&pdev->dev, "Ethernet core IRQ not defined\n");
next prev parent reply other threads:[~2026-06-03 22:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 12:44 [PATCH net next] net: axienet: Use dedicated ethtool_ops for the dmaengine path Suraj Gupta
2026-06-03 22:02 ` Jacob Keller [this message]
2026-06-04 2:30 ` patchwork-bot+netdevbpf
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=a46235bb-e935-4a2b-b638-6e9621640a30@intel.com \
--to=jacob.e.keller@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=harini.katakam@amd.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=sean.anderson@linux.dev \
--cc=suraj.gupta2@amd.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