mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
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 <ap420073@gmail.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
This commit is contained in:
parent
3a06ee3396
commit
ab818362c9
4 changed files with 6 additions and 6 deletions
|
@ -881,8 +881,8 @@ struct sdma_engine *sdma_select_user_engine(struct hfi1_devdata *dd,
|
||||||
|
|
||||||
cpu_id = smp_processor_id();
|
cpu_id = smp_processor_id();
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
rht_node = rhashtable_lookup_fast(dd->sdma_rht, &cpu_id,
|
rht_node = rhashtable_lookup(dd->sdma_rht, &cpu_id,
|
||||||
sdma_rht_params);
|
sdma_rht_params);
|
||||||
|
|
||||||
if (rht_node && rht_node->map[vl]) {
|
if (rht_node && rht_node->map[vl]) {
|
||||||
struct sdma_rht_map_elem *map = rht_node->map[vl];
|
struct sdma_rht_map_elem *map = rht_node->map[vl];
|
||||||
|
|
|
@ -3876,7 +3876,7 @@ int mlx5e_delete_flower(struct net_device *dev, struct mlx5e_priv *priv,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
flow = rhashtable_lookup_fast(tc_ht, &f->cookie, tc_ht_params);
|
flow = rhashtable_lookup(tc_ht, &f->cookie, tc_ht_params);
|
||||||
if (!flow || !same_flow_direction(flow, flags)) {
|
if (!flow || !same_flow_direction(flow, flags)) {
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto errout;
|
goto errout;
|
||||||
|
|
|
@ -458,8 +458,8 @@ int nfp_bpf_event_output(struct nfp_app_bpf *bpf, const void *data,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
record = rhashtable_lookup_fast(&bpf->maps_neutral, &map_id,
|
record = rhashtable_lookup(&bpf->maps_neutral, &map_id,
|
||||||
nfp_bpf_maps_neutral_params);
|
nfp_bpf_maps_neutral_params);
|
||||||
if (!record || map_id_full > U32_MAX) {
|
if (!record || map_id_full > U32_MAX) {
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
cmsg_warn(bpf, "perf event: map id %lld (0x%llx) not recognized, dropping event\n",
|
cmsg_warn(bpf, "perf event: map id %lld (0x%llx) not recognized, dropping event\n",
|
||||||
|
|
|
@ -2880,7 +2880,7 @@ static struct tipc_sock *tipc_sk_lookup(struct net *net, u32 portid)
|
||||||
struct tipc_sock *tsk;
|
struct tipc_sock *tsk;
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
tsk = rhashtable_lookup_fast(&tn->sk_rht, &portid, tsk_rht_params);
|
tsk = rhashtable_lookup(&tn->sk_rht, &portid, tsk_rht_params);
|
||||||
if (tsk)
|
if (tsk)
|
||||||
sock_hold(&tsk->sk);
|
sock_hold(&tsk->sk);
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue