bnxt_en: Fix occasional ethtool -t loopback test failures
authorMichael Chan <michael.chan@broadcom.com>
Sun, 20 Feb 2022 09:05:49 +0000 (04:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:42 +0000 (19:12 +0100)
commit5f283e64a8506de4316d6756f714f16b8171ea4a
tree1f3243a5c8a04a064cf364321aecac055b481583
parent10dd26349edf901539d066b866490676cbfad73c
bnxt_en: Fix occasional ethtool -t loopback test failures

[ Upstream commit cfcab3b3b61584a02bb523ffa99564eafa761dfe ]

In the current code, we setup the port to PHY or MAC loopback mode
and then transmit a test broadcast packet for the loopback test.  This
scheme fails sometime if the port is shared with management firmware
that can also send packets.  The driver may receive the management
firmware's packet and the test will fail when the contents don't
match the test packet.

Change the test packet to use it's own MAC address as the destination
and setup the port to only receive it's own MAC address.  This should
filter out other packets sent by management firmware.

Fixes: 91725d89b97a ("bnxt_en: Add PHY loopback to ethtool self-test.")
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c