Skip to content

Commit ee8a960

Browse files
dthompsodavem330
authored andcommitted
mlxbf_gige: clear valid_polarity upon open
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: f92e186 ("Add Mellanox BlueField Gigabit Ethernet driver") Reviewed-by: Asmaa Mnebhi <[email protected]> Signed-off-by: David Thompson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 40ee363 commit ee8a960

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@ static int mlxbf_gige_open(struct net_device *netdev)
142142
err = mlxbf_gige_clean_port(priv);
143143
if (err)
144144
goto free_irqs;
145+
146+
/* Clear driver's valid_polarity to match hardware,
147+
* since the above call to clean_port() resets the
148+
* receive polarity used by hardware.
149+
*/
150+
priv->valid_polarity = 0;
151+
145152
err = mlxbf_gige_rx_init(priv);
146153
if (err)
147154
goto free_irqs;

0 commit comments

Comments
 (0)