Skip to contentSkip to conversation

infiniband: check local reserved ports

PATCH In review Amerigo Wang 2 participants 7 messages Jun 3, 2010 – Jun 8, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 infiniband: check local reserved ports

Since Tetsuo's patch already got merged, now this is the missing part for local port reservation.

Cc Roland Dreier <[email protected]>
Cc Tetsuo Handa <[email protected]>

---

drivers/infiniband/core/cma.c +1 -0
index b930b81..7b89bab 100644
@@ -1978,6 +1978,7 @@ static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv)
 	rover = net_random() % remaining + low;
 retry:
 	if (last_used_port != rover &&
+	    !inet_is_reserved_local_port(rover) &&
 	    !idr_find(ps, (unsigned short) rover)) {
 		int ret = cma_alloc_port(ps, id_priv, rover);
 		/*
#1 lore raw
Quoted 13 lines

Since Tetsuo's patch already got merged, now this is the missing part for local port reservation.

Cc Roland Dreier <[email protected]>
Cc Tetsuo Handa <[email protected]>

---

drivers/infiniband/core/cma.c +0 -0
index b930b81..7b89bab 100644

drivers/infiniband/core/cma.c static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv) · line 1984

Quoted 7 lines
drivers/infiniband/core/cma.c +1 -0
@@ -1978,6 +1978,7 @@ static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv)
 	rover = net_random() % remaining + low;
 retry:
 	if (last_used_port != rover &&
+	    !inet_is_reserved_local_port(rover) &&
 	    !idr_find(ps, (unsigned short) rover)) {
 		int ret = cma_alloc_port(ps, id_priv, rover);
 		/*

Should this inet_is_reserved_local_port() test apply to all the "port spaces" that this code is handling? I honestly am ignorant of the intended semantics of the new local_reserved_ports stuff, hence my question.

- R.

Signature · 2 lines
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
author
#2 lore raw
Quoted 21 lines · Roland Dreier
Quoted 7 lines

Since Tetsuo's patch already got merged, now this is the missing part for local port reservation.

Cc Roland Dreier<[email protected]>
Cc Tetsuo Handa<[email protected]>
Quoted 13 lines

---
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index b930b81..7b89bab 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -1978,6 +1978,7 @@ static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv)
rover = net_random() % remaining + low;
retry:
if (last_used_port != rover&&
+ !inet_is_reserved_local_port(rover)&&
!idr_find(ps, (unsigned short) rover)) {
int ret = cma_alloc_port(ps, id_priv, rover);
/*

Quoted 4 lines

Should this inet_is_reserved_local_port() test apply to all the "port spaces" that this code is handling? I honestly am ignorant of the intended semantics of the new local_reserved_ports stuff, hence my question.

Yes, but I only found this case, is there any else?

Thanks!

#3 lore raw
Quoted 5 lines
Quoted 3 lines

Should this inet_is_reserved_local_port() test apply to all the "port spaces" that this code is handling? I honestly am ignorant of the intended semantics of the new local_reserved_ports stuff, hence my question.

Yes, but I only found this case, is there any else?

My question was more in the other direction: should this test apply to all the "port spaces" handled here? From looking at the code, it appears the answer is yes -- it seems that putting a port in local_reserved_ports reserves that port for IPv4 and IPv6, UDP, TCP, SCTP, DCCP, everything, so we should probably reserve all RDMA CM ports too.

Signature · 6 lines
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
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
author
#4 lore raw
Quoted 11 lines · Roland Dreier
Quoted 5 lines
Quoted 3 lines

Should this inet_is_reserved_local_port() test apply to all the "port spaces" that this code is handling? I honestly am ignorant of the intended semantics of the new local_reserved_ports stuff, hence my question.

Yes, but I only found this case, is there any else?

My question was more in the other direction: should this test apply to all the "port spaces" handled here? From looking at the code, it appears the answer is yes -- it seems that putting a port in local_reserved_ports reserves that port for IPv4 and IPv6, UDP, TCP, SCTP, DCCP, everything, so we should probably reserve all RDMA CM ports too.

Yes.

So this patch looks good for you? :)

Thanks.

#5 lore raw
Quoted 1 line

So this patch looks good for you? :)

Yes, will queue it up, thanks.

Signature · 2 lines
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
author
#6 lore raw
Quoted 3 lines · Roland Dreier
Quoted 1 line

So this patch looks good for you? :)

Yes, will queue it up, thanks.

Thanks!