Skip to content

Commit ab81836

Browse files
TaeheeYooJakub Kicinski
authored andcommitted
net: use rhashtable_lookup() instead of rhashtable_lookup_fast()
rhashtable_lookup_fast() internally calls rcu_read_lock() then, calls rhashtable_lookup(). So if rcu_read_lock() is already held, rhashtable_lookup() is enough. Signed-off-by: Taehee Yoo <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3a06ee3 commit ab81836

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

drivers/infiniband/hw/hfi1/sdma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,8 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd,
881881

882882
cpu_id = smp_processor_id();
883883
rcu_read_lock();
884-
rht_node = rhashtable_lookup_fast(dd->sdma_rht, &cpu_id,
885-
sdma_rht_params);
884+
rht_node = rhashtable_lookup(dd->sdma_rht, &cpu_id,
885+
sdma_rht_params);
886886

887887
if (rht_node && rht_node->map[vl]) {
888888
struct sdma_rht_map_elem *map = rht_node->map[vl];

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3876,7 +3876,7 @@ int mlx5e_delete_flower(struct net_device *dev, struct mlx5e_priv *priv,
38763876
int err;
38773877

38783878
rcu_read_lock();
3879-
flow = rhashtable_lookup_fast(tc_ht, &f->cookie, tc_ht_params);
3879+
flow = rhashtable_lookup(tc_ht, &f->cookie, tc_ht_params);
38803880
if (!flow || !same_flow_direction(flow, flags)) {
38813881
err = -EINVAL;
38823882
goto errout;

drivers/net/ethernet/netronome/nfp/bpf/offload.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ int nfp_bpf_event_output(struct nfp_app_bpf *bpf, const void *data,
458458
return -EINVAL;
459459

460460
rcu_read_lock();
461-
record = rhashtable_lookup_fast(&bpf->maps_neutral, &map_id,
462-
nfp_bpf_maps_neutral_params);
461+
record = rhashtable_lookup(&bpf->maps_neutral, &map_id,
462+
nfp_bpf_maps_neutral_params);
463463
if (!record || map_id_full > U32_MAX) {
464464
rcu_read_unlock();
465465
cmsg_warn(bpf, "perf event: map id %lld (0x%llx) not recognized, dropping event\n",

net/tipc/socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2880,7 +2880,7 @@ static struct tipc_sock *tipc_sk_lookup(struct net *net, u32 portid)
28802880
struct tipc_sock *tsk;
28812881

28822882
rcu_read_lock();
2883-
tsk = rhashtable_lookup_fast(&tn->sk_rht, &portid, tsk_rht_params);
2883+
tsk = rhashtable_lookup(&tn->sk_rht, &portid, tsk_rht_params);
28842884
if (tsk)
28852885
sock_hold(&tsk->sk);
28862886
rcu_read_unlock();

0 commit comments

Comments
 (0)