Skip to contentSkip to conversation

rdma: Add driver QP type string

PATCH Applied Gal Pressman 3 participants 6 messages Aug 4, 2019 – Aug 7, 2019

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

PATCH 1/1 rdma: Add driver QP type string

RDMA resource tracker now tracks driver QPs as well, add driver QP type string to qp_types_to_str function.

---
 rdma/res.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
rdma/res.c +4 -2
index ef863f142eca..97a7b9640185 100644
@@ -148,9 +148,11 @@ const char *qp_types_to_str(uint8_t idx)
 						     "UC", "UD", "RAW_IPV6",
 						     "RAW_ETHERTYPE",
 						     "UNKNOWN", "RAW_PACKET",
-						     "XRC_INI", "XRC_TGT" };
+						     "XRC_INI", "XRC_TGT",
+						     [0xFF] = "DRIVER",
+	};
 
-	if (idx < ARRAY_SIZE(qp_types_str))
+	if (idx < ARRAY_SIZE(qp_types_str) && qp_types_str[idx])
 		return qp_types_str[idx];
 	return "UNKNOWN";
 }
Signature · 1 line
2.22.0
#2 lore raw
In reply to Gal Pressman
Quoted 2 lines · Gal Pressman

RDMA resource tracker now tracks driver QPs as well, add driver QP type string to qp_types_to_str function.

"now" means which kernel release? Leon: should this be in master or -next?

Quoted 25 lines
---
 rdma/res.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
rdma/res.c +4 -2
index ef863f142eca..97a7b9640185 100644
@@ -148,9 +148,11 @@ const char *qp_types_to_str(uint8_t idx)
 						     "UC", "UD", "RAW_IPV6",
 						     "RAW_ETHERTYPE",
 						     "UNKNOWN", "RAW_PACKET",
-						     "XRC_INI", "XRC_TGT" };
+						     "XRC_INI", "XRC_TGT",
+						     [0xFF] = "DRIVER",
+	};
 
-	if (idx < ARRAY_SIZE(qp_types_str))
+	if (idx < ARRAY_SIZE(qp_types_str) && qp_types_str[idx])
 		return qp_types_str[idx];
 	return "UNKNOWN";
 }
#3 lore raw
Quoted 5 lines · David Ahern
Quoted 2 lines · Gal Pressman

RDMA resource tracker now tracks driver QPs as well, add driver QP type string to qp_types_to_str function.

"now" means which kernel release? Leon: should this be in master or -next?

Now means the patch is merged to RDMA's for-rc branch (5.3).

#4 lore raw
Quoted 8 lines · Gal Pressman
Quoted 5 lines · David Ahern
Quoted 2 lines · Gal Pressman

RDMA resource tracker now tracks driver QPs as well, add driver QP type string to qp_types_to_str function.

"now" means which kernel release? Leon: should this be in master or -next?

Now means the patch is merged to RDMA's for-rc branch (5.3).

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/infiniband?id=52e0a118a20308dd6aa531e20a5ab5907d2264c8

David,

I think that it is better to apply this patch to iproute2-rc just to be on the same page with kernel patch.

Thanks