Skip to content

Commit d1ac339

Browse files
cjubrankuba-moo
authored andcommitted
net/mlx5e: Disable loopback self-test on multi-PF netdev
In Multi-PF (Socket Direct) configurations, when a loopback packet is sent through one of the secondary devices, it will always be received on the primary device. This causes the loopback layer to fail in identifying the loopback packet as the devices are different. To avoid false test failures, disable the loopback self-test in Multi-PF configurations. Fixes: ed29705 ("net/mlx5: Enable SD feature") Signed-off-by: Carolina Jubran <cjubran@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Link: https://patch.msgid.link/20241107183527.676877-8-tariqt@nvidia.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent e99c687 commit d1ac339

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "en.h"
3737
#include "en/port.h"
3838
#include "eswitch.h"
39+
#include "lib/mlx5.h"
3940

4041
static int mlx5e_test_health_info(struct mlx5e_priv *priv)
4142
{
@@ -247,6 +248,9 @@ static int mlx5e_cond_loopback(struct mlx5e_priv *priv)
247248
if (is_mdev_switchdev_mode(priv->mdev))
248249
return -EOPNOTSUPP;
249250

251+
if (mlx5_get_sd(priv->mdev))
252+
return -EOPNOTSUPP;
253+
250254
return 0;
251255
}
252256

0 commit comments

Comments
 (0)