Skip to contentSkip to conversation

libibumad/umad.c: In resolve_ca_port, skip ethernet link layer ports

PATCH In review Hal Rosenstock 3 participants 5 messages Feb 21, 2013 4 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libibumad/umad.c: In resolve_ca_port, skip ethernet link layer ports

---

src/umad.c +8 -0
index 8f817d2..8ab5e80 100644
@@ -256,6 +256,11 @@ static int resolve_ca_port(char *ca_name, int *port)
 			ret = -1;
 			goto Exit;
 		}
+		if (strcmp(ca.ports[*port]->link_layer, "InfiniBand") &&
+		    strcmp(ca.ports[*port]->link_layer, "IB")) {
+			ret = -1;
+			goto Exit;
+		}
 		if (ca.ports[*port]->state == 4) {
 			ret = 1;
 			goto Exit;
@@ -270,6 +275,9 @@ static int resolve_ca_port(char *ca_name, int *port)
 		DEBUG("checking port %d", i);
 		if (!ca.ports[i])
 			continue;
+		if (strcmp(ca.ports[i]->link_layer, "InfiniBand") &&
+		    strcmp(ca.ports[i]->link_layer, "IB"))
+			continue;
 		if (up < 0 && ca.ports[i]->phys_state == 5)
 			up = *port = i;
 		if (ca.ports[i]->state == 4) {

--
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

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

What about QP1? It was my understanding that CM was still required for RoCE.

Ira

Quoted 33 lines · On Thu, 21 Feb 2013 14:01:51 -0500 Hal Rosenstock…

---

src/umad.c +8 -1
index 8f817d2..8ab5e80 100644
@@ -256,6 +256,11 @@ static int resolve_ca_port(char *ca_name, int *port)
 			ret = -1;
 			goto Exit;
 		}
+		if (strcmp(ca.ports[*port]->link_layer, "InfiniBand") &&
+		    strcmp(ca.ports[*port]->link_layer, "IB")) {
+			ret = -1;
+			goto Exit;
+		}
 		if (ca.ports[*port]->state == 4) {
 			ret = 1;
 			goto Exit;
@@ -270,6 +275,9 @@ static int resolve_ca_port(char *ca_name, int *port)
 		DEBUG("checking port %d", i);
 		if (!ca.ports[i])
 			continue;
+		if (strcmp(ca.ports[i]->link_layer, "InfiniBand") &&
+		    strcmp(ca.ports[i]->link_layer, "IB"))
+			continue;
 		if (up < 0 && ca.ports[i]->phys_state == 5)
 			up = *port = i;
 		if (ca.ports[i]->state == 4) {
--

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

Signature · 9 lines
Ira Weiny
Member of Technical Staff
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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

A message that is not in the archive (sent off-list or not yet received): 20130221114427.0b82d4054d46a0920dda104e-i2BcT+NCU+M@public.gmane.org

#4 lore raw
Quoted 1 line · Ira Weiny

What about QP1? It was my understanding that CM was still required for RoCE.

Yes, RoCE requires CM support but AFAIK CM doesn't use/require these interfaces to get send or receive it's MADs.

RoCE is a weird animal in terms of IB management as SM/QP0 is not used/deprecated and QP1 is only required for CM with most other QP1 things beyond the spec with the exception of SA which is also not used/deprecated.

-- Hal

Quoted 3 lines

Ira

--
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

A message that is not in the archive (sent off-list or not yet received): 51267C8D.7030002-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#6 lore raw
Quoted 10 lines · Ira Weiny
Quoted 1 line

What about QP1? It was my understanding that CM was still required for RoCE.

Yes, RoCE requires CM support but AFAIK CM doesn't use/require these interfaces to get send or receive it's MADs.

RoCE is a weird animal in terms of IB management as SM/QP0 is not used/deprecated and QP1 is only required for CM with most other QP1 things beyond the spec with the exception of SA which is also not used/deprecated.

Does the kernel expose QP1 for RoCE to user space?
--
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

A message that is not in the archive (sent off-list or not yet received): 1828884A29C6694DAF28B7E6B8A823736F35242C-P5GAC/[email protected]

#8 lore raw
Quoted 6 lines · Sean
Quoted 6 lines · Ira Weiny
Quoted 1 line

What about QP1? It was my understanding that CM was still required for RoCE.

Yes, RoCE requires CM support but AFAIK CM doesn't use/require these interfaces to get send or receive it's MADs.

Quoted 6 lines
Quoted 4 lines

RoCE is a weird animal in terms of IB management as SM/QP0 is not used/deprecated and QP1 is only required for CM with most other QP1 things beyond the spec with the exception of SA which is also not used/deprecated.

Does the kernel expose QP1 for RoCE to user space?

kernel MAD does not create QP0 for ethernet link layer ports but it does create QP1. There's no link layer specific code in kernel user MAD so I presume that QP1 is exposed to user space.
--
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