Skip to contentSkip to conversation

RDMA/nes: remove unnecessary RCU lock

PATCH New [email protected] 1 participant 1 message Dec 10, 2014 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/nes: remove unnecessary RCU lock

From: Li RongQing <[email protected]>

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.

---
 drivers/infiniband/hw/nes/nes_cm.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/infiniband/hw/nes/nes_cm.c +1 -5
index 6f09a72..d9e3b4b 100644
@@ -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;
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html