* [PATCH] RDMA/nes: remove unnecessary RCU lock
@ 2014-12-10 9:24 roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w
0 siblings, 0 replies; only message in thread
From: roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w @ 2014-12-10 9:24 UTC (permalink / raw)
To: faisal.latif-ral2JQCrhuEAvxtiuMwx3w,
roland-DgEjT+Ai2ygdnm+yROfE0A, sean.hefty-ral2JQCrhuEAvxtiuMwx3w,
hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
From: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
The neigh returned from neigh_lookup has its ref added, not need
to hold RCU lock
and move neigh_release to avoid to check if neigh is NULL again.
Signed-off-by: Li RongQing <roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/hw/nes/nes_cm.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 6f09a72..d9e3b4b 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1510,7 +1510,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, netdev);
- rcu_read_lock();
if (neigh) {
if (neigh->nud_state & NUD_VALID) {
nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
@@ -1535,12 +1534,9 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
} else {
neigh_event_send(neigh, NULL);
}
- }
out:
- rcu_read_unlock();
-
- if (neigh)
neigh_release(neigh);
+ }
ip_rt_put(rt);
return rc;
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-12-10 9:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-10 9:24 [PATCH] RDMA/nes: remove unnecessary RCU lock roy.qing.li-Re5JQEeQqe8AvxtiuMwx3w
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox