net/mlx5: Rename kfree_rcu() to kfree_rcu_mightsleep()
authorUladzislau Rezki (Sony) <urezki@gmail.com>
Wed, 1 Feb 2023 15:08:14 +0000 (16:08 +0100)
committerJoel Fernandes (Google) <joel@joelfernandes.org>
Wed, 5 Apr 2023 13:48:04 +0000 (13:48 +0000)
The kfree_rcu() and kvfree_rcu() macros' single-argument forms are
deprecated.  Therefore switch to the new kfree_rcu_mightsleep() and
kvfree_rcu_mightsleep() variants. The goal is to avoid accidental use
of the single-argument forms, which can introduce functionality bugs in
atomic contexts and latency bugs in non-atomic contexts.

Cc: Ariel Levkovich <lariel@nvidia.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>
Cc: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/int_port.c
drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c

index ca834bbcb44f1953b42c9a1e6db21856aa2d5aa5..8afcec0c5d3cafda3f00bbc5b7a99d815c58a9b4 100644 (file)
@@ -242,7 +242,7 @@ mlx5e_int_port_remove(struct mlx5e_tc_int_port_priv *priv,
                mlx5_del_flow_rules(int_port->rx_rule);
        mapping_remove(ctx, int_port->mapping);
        mlx5e_int_port_metadata_free(priv, int_port->match_metadata);
-       kfree_rcu(int_port);
+       kfree_rcu_mightsleep(int_port);
        priv->num_ports--;
 }
 
index 08d0929e82603679709d4d425d50a8ff3a95bdc9..b811dad7370a0fc00d98dde8103f07c5bf1ec5f4 100644 (file)
@@ -670,7 +670,7 @@ static int mlx5e_macsec_del_txsa(struct macsec_context *ctx)
 
        mlx5e_macsec_cleanup_sa(macsec, tx_sa, true);
        mlx5_destroy_encryption_key(macsec->mdev, tx_sa->enc_key_id);
-       kfree_rcu(tx_sa);
+       kfree_rcu_mightsleep(tx_sa);
        macsec_device->tx_sa[assoc_num] = NULL;
 
 out:
@@ -849,7 +849,7 @@ static void macsec_del_rxsc_ctx(struct mlx5e_macsec *macsec, struct mlx5e_macsec
        xa_erase(&macsec->sc_xarray, rx_sc->sc_xarray_element->fs_id);
        metadata_dst_free(rx_sc->md_dst);
        kfree(rx_sc->sc_xarray_element);
-       kfree_rcu(rx_sc);
+       kfree_rcu_mightsleep(rx_sc);
 }
 
 static int mlx5e_macsec_del_rxsc(struct macsec_context *ctx)