net/mlx5e: Report mlx5e_xdp_set errors
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Tue, 19 Mar 2019 16:32:37 +0000 (18:32 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 23 Apr 2019 19:09:21 +0000 (12:09 -0700)
If the channels fail to reopen after setting an XDP program, return the
error code instead of 0. A proper fix is still needed, as now any error
while reopening the channels brings the interface down. This patch only
adds error reporting.

Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 8185773a7bed8dae14dfe4b1529155cf08e108b5..a3397d5bfa76121cc4c8d9f8695899ed696c15a6 100644 (file)
@@ -4313,7 +4313,7 @@ static int mlx5e_xdp_set(struct net_device *netdev, struct bpf_prog *prog)
                mlx5e_set_rq_type(priv->mdev, &priv->channels.params);
 
        if (was_opened && reset)
-               mlx5e_open_locked(netdev);
+               err = mlx5e_open_locked(netdev);
 
        if (!test_bit(MLX5E_STATE_OPENED, &priv->state) || reset)
                goto unlock;