* [PATCH net-next] nfp: add support for .get_pauseparam()
@ 2022-06-16 13:33 Simon Horman
2022-06-16 19:24 ` Andrew Lunn
2022-06-18 3:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Simon Horman @ 2022-06-16 13:33 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni
Cc: netdev, oss-drivers, Yinjun Zhang, Simon Horman
From: Yinjun Zhang <yinjun.zhang@corigine.com>
Show correct pause frame parameters for nfp. These parameters cannot
be configured, so .set_pauseparam() is not implemented. With this
change:
#ethtool --show-pause enp1s0np0
Pause parameters for enp1s0np0:
Autonegotiate: off
RX: on
TX: on
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
.../ethernet/netronome/nfp/nfp_net_ethtool.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
index df0afd271a21..15e9cf71a8e2 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
@@ -1460,6 +1460,23 @@ static int nfp_net_set_channels(struct net_device *netdev,
return nfp_net_set_num_rings(nn, total_rx, total_tx);
}
+static void nfp_port_get_pauseparam(struct net_device *netdev,
+ struct ethtool_pauseparam *pause)
+{
+ struct nfp_eth_table_port *eth_port;
+ struct nfp_port *port;
+
+ port = nfp_port_from_netdev(netdev);
+ eth_port = nfp_port_get_eth_port(port);
+ if (!eth_port)
+ return;
+
+ /* Currently pause frame support is fixed */
+ pause->autoneg = AUTONEG_DISABLE;
+ pause->rx_pause = 1;
+ pause->tx_pause = 1;
+}
+
static const struct ethtool_ops nfp_net_ethtool_ops = {
.supported_coalesce_params = ETHTOOL_COALESCE_USECS |
ETHTOOL_COALESCE_MAX_FRAMES |
@@ -1492,6 +1509,7 @@ static const struct ethtool_ops nfp_net_ethtool_ops = {
.set_link_ksettings = nfp_net_set_link_ksettings,
.get_fecparam = nfp_port_get_fecparam,
.set_fecparam = nfp_port_set_fecparam,
+ .get_pauseparam = nfp_port_get_pauseparam,
};
const struct ethtool_ops nfp_port_ethtool_ops = {
@@ -1509,6 +1527,7 @@ const struct ethtool_ops nfp_port_ethtool_ops = {
.set_link_ksettings = nfp_net_set_link_ksettings,
.get_fecparam = nfp_port_get_fecparam,
.set_fecparam = nfp_port_set_fecparam,
+ .get_pauseparam = nfp_port_get_pauseparam,
};
void nfp_net_set_ethtool_ops(struct net_device *netdev)
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] nfp: add support for .get_pauseparam()
2022-06-16 13:33 [PATCH net-next] nfp: add support for .get_pauseparam() Simon Horman
@ 2022-06-16 19:24 ` Andrew Lunn
2022-06-18 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2022-06-16 19:24 UTC (permalink / raw)
To: Simon Horman
Cc: David Miller, Jakub Kicinski, Paolo Abeni, netdev, oss-drivers,
Yinjun Zhang
On Thu, Jun 16, 2022 at 03:33:57PM +0200, Simon Horman wrote:
> From: Yinjun Zhang <yinjun.zhang@corigine.com>
>
> Show correct pause frame parameters for nfp. These parameters cannot
> be configured, so .set_pauseparam() is not implemented. With this
> change:
>
> #ethtool --show-pause enp1s0np0
> Pause parameters for enp1s0np0:
> Autonegotiate: off
> RX: on
> TX: on
>
> Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] nfp: add support for .get_pauseparam()
2022-06-16 13:33 [PATCH net-next] nfp: add support for .get_pauseparam() Simon Horman
2022-06-16 19:24 ` Andrew Lunn
@ 2022-06-18 3:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-18 3:20 UTC (permalink / raw)
To: Simon Horman; +Cc: davem, kuba, pabeni, netdev, oss-drivers, yinjun.zhang
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 16 Jun 2022 15:33:57 +0200 you wrote:
> From: Yinjun Zhang <yinjun.zhang@corigine.com>
>
> Show correct pause frame parameters for nfp. These parameters cannot
> be configured, so .set_pauseparam() is not implemented. With this
> change:
>
> #ethtool --show-pause enp1s0np0
> Pause parameters for enp1s0np0:
> Autonegotiate: off
> RX: on
> TX: on
>
> [...]
Here is the summary with links:
- [net-next] nfp: add support for .get_pauseparam()
https://git.kernel.org/netdev/net-next/c/382f99c442b3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-18 3:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 13:33 [PATCH net-next] nfp: add support for .get_pauseparam() Simon Horman
2022-06-16 19:24 ` Andrew Lunn
2022-06-18 3:20 ` patchwork-bot+netdevbpf
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).