All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2] mlxbf_gige: clear valid_polarity upon open
@ 2021-09-15 18:08 David Thompson
  2021-09-16 13:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: David Thompson @ 2021-09-15 18:08 UTC (permalink / raw)
  To: davem, kuba
  Cc: netdev, limings, arnd, jgg, =caihuoqing, David Thompson, Asmaa Mnebhi

The network interface managed by the mlxbf_gige driver can
get into a problem state where traffic does not flow.
In this state, the interface will be up and enabled, but
will stop processing received packets.  This problem state
will happen if three specific conditions occur:
    1) driver has received more than (N * RxRingSize) packets but
       less than (N+1 * RxRingSize) packets, where N is an odd number
       Note: the command "ethtool -g <interface>" will display the
       current receive ring size, which currently defaults to 128
    2) the driver's interface was disabled via "ifconfig oob_net0 down"
       during the window described in #1.
    3) the driver's interface is re-enabled via "ifconfig oob_net0 up"

This patch ensures that the driver's "valid_polarity" field is
cleared during the open() method so that it always matches the
receive polarity used by hardware.  Without this fix, the driver
needs to be unloaded and reloaded to correct this problem state.

Fixes: f92e1869d74e ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: David Thompson <davthompson@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 3e85b17f5857..6704f5c1aa32 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -142,6 +142,13 @@ static int mlxbf_gige_open(struct net_device *netdev)
 	err = mlxbf_gige_clean_port(priv);
 	if (err)
 		goto free_irqs;
+
+	/* Clear driver's valid_polarity to match hardware,
+	 * since the above call to clean_port() resets the
+	 * receive polarity used by hardware.
+	 */
+	priv->valid_polarity = 0;
+
 	err = mlxbf_gige_rx_init(priv);
 	if (err)
 		goto free_irqs;
-- 
2.30.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net v2] mlxbf_gige: clear valid_polarity upon open
  2021-09-15 18:08 [PATCH net v2] mlxbf_gige: clear valid_polarity upon open David Thompson
@ 2021-09-16 13:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-16 13:40 UTC (permalink / raw)
  To: David Thompson
  Cc: davem, kuba, netdev, limings, arnd, jgg, =caihuoqing, asmaa

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 15 Sep 2021 14:08:48 -0400 you wrote:
> The network interface managed by the mlxbf_gige driver can
> get into a problem state where traffic does not flow.
> In this state, the interface will be up and enabled, but
> will stop processing received packets.  This problem state
> will happen if three specific conditions occur:
>     1) driver has received more than (N * RxRingSize) packets but
>        less than (N+1 * RxRingSize) packets, where N is an odd number
>        Note: the command "ethtool -g <interface>" will display the
>        current receive ring size, which currently defaults to 128
>     2) the driver's interface was disabled via "ifconfig oob_net0 down"
>        during the window described in #1.
>     3) the driver's interface is re-enabled via "ifconfig oob_net0 up"
> 
> [...]

Here is the summary with links:
  - [net,v2] mlxbf_gige: clear valid_polarity upon open
    https://git.kernel.org/netdev/net/c/ee8a9600b539

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] 2+ messages in thread

end of thread, other threads:[~2021-09-16 13:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 18:08 [PATCH net v2] mlxbf_gige: clear valid_polarity upon open David Thompson
2021-09-16 13:40 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.