diff mbox series

[iproute2-next] rdma: Add driver QP type string

Message ID 20190804080756.58364-1-galpress@amazon.com (mailing list archive)
State Not Applicable
Headers show
Series [iproute2-next] rdma: Add driver QP type string | expand

Commit Message

Gal Pressman Aug. 4, 2019, 8:07 a.m. UTC
RDMA resource tracker now tracks driver QPs as well, add driver QP type
string to qp_types_to_str function.

Signed-off-by: Gal Pressman <galpress@amazon.com>
---
 rdma/res.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Leon Romanovsky Aug. 4, 2019, 9:52 a.m. UTC | #1
On Sun, Aug 04, 2019 at 11:07:56AM +0300, Gal Pressman wrote:
> RDMA resource tracker now tracks driver QPs as well, add driver QP type
> string to qp_types_to_str function.
>
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
>  rdma/res.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
David Ahern Aug. 5, 2019, 7:08 p.m. UTC | #2
On 8/4/19 2:07 AM, Gal Pressman wrote:
> 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?

> 
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
>  rdma/res.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/rdma/res.c b/rdma/res.c
> index ef863f142eca..97a7b9640185 100644
> --- a/rdma/res.c
> +++ b/rdma/res.c
> @@ -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";
>  }
>
Gal Pressman Aug. 6, 2019, 6:41 a.m. UTC | #3
On 05/08/2019 22:08, David Ahern wrote:
> On 8/4/19 2:07 AM, Gal Pressman wrote:
>> 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).
Leon Romanovsky Aug. 6, 2019, 6:54 a.m. UTC | #4
On Tue, Aug 06, 2019 at 09:41:37AM +0300, Gal Pressman wrote:
> On 05/08/2019 22:08, David Ahern wrote:
> > On 8/4/19 2:07 AM, Gal Pressman wrote:
> >> 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
David Ahern Aug. 7, 2019, 7:07 p.m. UTC | #5
On 8/4/19 2:07 AM, Gal Pressman wrote:
> RDMA resource tracker now tracks driver QPs as well, add driver QP type
> string to qp_types_to_str function.
> 
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
>  rdma/res.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 

applied to iproute2-next. Thanks
diff mbox series

Patch

diff --git a/rdma/res.c b/rdma/res.c
index ef863f142eca..97a7b9640185 100644
--- a/rdma/res.c
+++ b/rdma/res.c
@@ -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";
 }