]> git.baikalelectronics.ru Git - kernel.git/commit
mlxbf_gige: clear valid_polarity upon open
authorDavid Thompson <davthompson@nvidia.com>
Wed, 15 Sep 2021 18:08:48 +0000 (14:08 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Sep 2021 13:31:58 +0000 (14:31 +0100)
commitd1208209f7152bd017b0c111e1acc6acc08d7a0c
tree790bd1b127b2221a338d811193d93ff591c3ff5f
parent725cb3dad6ee52d5263162b7517f157ab7b686df
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: 1239c1f29b29 ("Add Mellanox BlueField Gigabit Ethernet driver")
Reviewed-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: David Thompson <davthompson@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c