* [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too
@ 2024-04-30 10:18 Leon Romanovsky
2024-04-30 10:18 ` [PATCH iproute2-next 1/2] rdma: update uapi header Leon Romanovsky
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Leon Romanovsky @ 2024-04-30 10:18 UTC (permalink / raw)
To: David Ahern
Cc: Leon Romanovsky, Chiara Meiohas, Jason Gunthorpe, linux-netdev,
RDMA mailing list
From: Leon Romanovsky <leonro@nvidia.com>
This series is complimentary to the kernel patches that exposed to the
userspace the driver-specific QPs.
https://lore.kernel.org/all/2607bb3ddec3cae3443c2ea19e9f700825d20a98.1713268997.git.leon@kernel.org
Thanks
Chiara Meiohas (2):
rdma: update uapi header
rdma: Add an option to display driver-specific QPs in the rdma tool
rdma/include/uapi/rdma/rdma_netlink.h | 6 ++++++
rdma/res-qp.c | 15 +++++++++++++++
rdma/res.c | 5 +++++
rdma/utils.c | 1 +
4 files changed, 27 insertions(+)
--
2.44.0
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH iproute2-next 1/2] rdma: update uapi header 2024-04-30 10:18 [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too Leon Romanovsky @ 2024-04-30 10:18 ` Leon Romanovsky 2024-04-30 14:43 ` [EXTERNAL] " Subbaraya Sundeep Bhatta 2024-04-30 10:18 ` [PATCH iproute2-next 2/2] rdma: Add an option to display driver-specific QPs in the rdma tool Leon Romanovsky 2024-05-03 15:20 ` [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too patchwork-bot+netdevbpf 2 siblings, 1 reply; 5+ messages in thread From: Leon Romanovsky @ 2024-04-30 10:18 UTC (permalink / raw) To: David Ahern Cc: Chiara Meiohas, Jason Gunthorpe, linux-netdev, RDMA mailing list From: Chiara Meiohas <cmeiohas@nvidia.com> Update rdma_netlink.h file up to kernel commit e18fa0bbcedf ("RDMA/core: Add an option to display driver-specific QPs in the rdmatool") Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> --- rdma/include/uapi/rdma/rdma_netlink.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h index e8861b5e..a6c8a52d 100644 --- a/rdma/include/uapi/rdma/rdma_netlink.h +++ b/rdma/include/uapi/rdma/rdma_netlink.h @@ -558,6 +558,12 @@ enum rdma_nldev_attr { RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE, /* u8 */ + RDMA_NLDEV_ATTR_DRIVER_DETAILS, /* u8 */ + /* + * QP subtype string, used for driver QPs + */ + RDMA_NLDEV_ATTR_RES_SUBTYPE, /* string */ + /* * Always the end */ -- 2.44.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [EXTERNAL] [PATCH iproute2-next 1/2] rdma: update uapi header 2024-04-30 10:18 ` [PATCH iproute2-next 1/2] rdma: update uapi header Leon Romanovsky @ 2024-04-30 14:43 ` Subbaraya Sundeep Bhatta 0 siblings, 0 replies; 5+ messages in thread From: Subbaraya Sundeep Bhatta @ 2024-04-30 14:43 UTC (permalink / raw) To: Leon Romanovsky, David Ahern Cc: Chiara Meiohas, Jason Gunthorpe, linux-netdev, RDMA mailing list >-----Original Message----- >From: Leon Romanovsky <leon@kernel.org> >Sent: Tuesday, April 30, 2024 3:48 PM >To: David Ahern <dsahern@gmail.com> >Cc: Chiara Meiohas <cmeiohas@nvidia.com>; Jason Gunthorpe ><jgg@nvidia.com>; linux-netdev <netdev@vger.kernel.org>; RDMA mailing list ><linux-rdma@vger.kernel.org> >Subject: [EXTERNAL] [PATCH iproute2-next 1/2] rdma: update uapi header > >From: Chiara Meiohas <cmeiohas@nvidia.com> > >Update rdma_netlink.h file up to kernel commit e18fa0bbcedf >("RDMA/core: Add an option to display driver-specific QPs in the rdmatool") > >Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com> >Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com> Thanks, Sundeep >--- > rdma/include/uapi/rdma/rdma_netlink.h | 6 ++++++ > 1 file changed, 6 insertions(+) > >diff --git a/rdma/include/uapi/rdma/rdma_netlink.h >b/rdma/include/uapi/rdma/rdma_netlink.h >index e8861b5e..a6c8a52d 100644 >--- a/rdma/include/uapi/rdma/rdma_netlink.h >+++ b/rdma/include/uapi/rdma/rdma_netlink.h >@@ -558,6 +558,12 @@ enum rdma_nldev_attr { > > RDMA_NLDEV_SYS_ATTR_PRIVILEGED_QKEY_MODE, /* u8 */ > >+ RDMA_NLDEV_ATTR_DRIVER_DETAILS, /* u8 */ >+ /* >+ * QP subtype string, used for driver QPs >+ */ >+ RDMA_NLDEV_ATTR_RES_SUBTYPE, /* string */ >+ > /* > * Always the end > */ >-- >2.44.0 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH iproute2-next 2/2] rdma: Add an option to display driver-specific QPs in the rdma tool 2024-04-30 10:18 [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too Leon Romanovsky 2024-04-30 10:18 ` [PATCH iproute2-next 1/2] rdma: update uapi header Leon Romanovsky @ 2024-04-30 10:18 ` Leon Romanovsky 2024-05-03 15:20 ` [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too patchwork-bot+netdevbpf 2 siblings, 0 replies; 5+ messages in thread From: Leon Romanovsky @ 2024-04-30 10:18 UTC (permalink / raw) To: David Ahern Cc: Chiara Meiohas, Jason Gunthorpe, linux-netdev, RDMA mailing list From: Chiara Meiohas <cmeiohas@nvidia.com> Utilize the -dd flag (driver-specific details) in the rdmatool to view driver-specific QPs which are not exposed yet. The following examples show mlx5 UMR QP which is visible now: $ rdma resource show qp link ibp8s0f1 link ibp8s0f1/1 lqpn 360 type UD state RTS sq-psn 0 comm [mlx5_ib] link ibp8s0f1/1 lqpn 0 type SMI state RTS sq-psn 0 comm [ib_core] link ibp8s0f1/1 lqpn 1 type GSI state RTS sq-psn 0 comm [ib_core] $ rdma resource show qp link ibp8s0f1 -dd link ibp8s0f1/1 lqpn 360 type UD state RTS sq-psn 0 comm [mlx5_ib] link ibp8s0f1/1 lqpn 465 type DRIVER subtype REG_UMR state RTS sq-psn 0 comm [mlx5_ib] link ibp8s0f1/1 lqpn 0 type SMI state RTS sq-psn 0 comm [ib_core] link ibp8s0f1/1 lqpn 1 type GSI state RTS sq-psn 0 comm [ib_core] $ rdma resource show 0: ibp8s0f0: pd 3 cq 4 qp 3 cm_id 0 mr 0 ctx 0 srq 2 1: ibp8s0f1: pd 3 cq 4 qp 3 cm_id 0 mr 0 ctx 0 srq 2 $ rdma resource show -dd 0: ibp8s0f0: pd 3 cq 4 qp 4 cm_id 0 mr 0 ctx 0 srq 2 1: ibp8s0f1: pd 3 cq 4 qp 4 cm_id 0 mr 0 ctx 0 srq 2 Signed-off-by: Chiara Meiohas <cmeiohas@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> --- rdma/res-qp.c | 15 +++++++++++++++ rdma/res.c | 5 +++++ rdma/utils.c | 1 + 3 files changed, 21 insertions(+) diff --git a/rdma/res-qp.c b/rdma/res-qp.c index 65ff54ab..a47225df 100644 --- a/rdma/res-qp.c +++ b/rdma/res-qp.c @@ -40,6 +40,15 @@ static void print_type(uint32_t val) print_string(PRINT_ANY, "type", "type %s ", qp_types_to_str(val)); } +/* + * print the subtype only if the QPT is IB_QPT_DRIVER + */ +static void print_subtype(uint8_t type, const char *sub_type) +{ + if (type == 0xFF && sub_type) + print_string(PRINT_ANY, "subtype", "subtype %s ", sub_type); +} + static void print_state(uint32_t val) { print_string(PRINT_ANY, "state", "state %s ", qp_states_to_str(val)); @@ -81,6 +90,7 @@ static int res_qp_line(struct rd *rd, const char *name, int idx, { uint32_t lqpn, rqpn = 0, rq_psn = 0, sq_psn; uint8_t type, state, path_mig_state = 0; + const char* sub_type = NULL; uint32_t port = 0, pid = 0; uint32_t pdn = 0; char *comm = NULL; @@ -134,6 +144,10 @@ static int res_qp_line(struct rd *rd, const char *name, int idx, nla_line[RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE])) goto out; + if (nla_line[RDMA_NLDEV_ATTR_RES_SUBTYPE]) + sub_type = + mnl_attr_get_str(nla_line[RDMA_NLDEV_ATTR_RES_SUBTYPE]); + type = mnl_attr_get_u8(nla_line[RDMA_NLDEV_ATTR_RES_TYPE]); if (rd_is_string_filtered_attr(rd, "type", qp_types_to_str(type), nla_line[RDMA_NLDEV_ATTR_RES_TYPE])) @@ -164,6 +178,7 @@ static int res_qp_line(struct rd *rd, const char *name, int idx, print_rqpn(rqpn, nla_line); print_type(type); + print_subtype(type, sub_type); print_state(state); print_rqpsn(rq_psn, nla_line); diff --git a/rdma/res.c b/rdma/res.c index 3e024134..c311513a 100644 --- a/rdma/res.c +++ b/rdma/res.c @@ -99,6 +99,8 @@ int _res_send_idx_msg(struct rd *rd, uint32_t command, mnl_cb_t callback, RDMA_NLDEV_ATTR_PORT_INDEX, rd->port_idx); mnl_attr_put_u32(rd->nlh, id, idx); + mnl_attr_put_u8(rd->nlh, RDMA_NLDEV_ATTR_DRIVER_DETAILS, + rd->show_driver_details); if (command == RDMA_NLDEV_CMD_STAT_GET) mnl_attr_put_u32(rd->nlh, RDMA_NLDEV_ATTR_STAT_RES, @@ -121,6 +123,9 @@ int _res_send_msg(struct rd *rd, uint32_t command, mnl_cb_t callback) flags |= NLM_F_DUMP; rd_prepare_msg(rd, command, &seq, flags); + + mnl_attr_put_u8(rd->nlh, RDMA_NLDEV_ATTR_DRIVER_DETAILS, + rd->show_driver_details); mnl_attr_put_u32(rd->nlh, RDMA_NLDEV_ATTR_DEV_INDEX, rd->dev_idx); if (rd->port_idx) mnl_attr_put_u32(rd->nlh, diff --git a/rdma/utils.c b/rdma/utils.c index 27595a38..0f41013a 100644 --- a/rdma/utils.c +++ b/rdma/utils.c @@ -423,6 +423,7 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = { [RDMA_NLDEV_ATTR_RES_SQ_PSN] = MNL_TYPE_U32, [RDMA_NLDEV_ATTR_RES_PATH_MIG_STATE] = MNL_TYPE_U8, [RDMA_NLDEV_ATTR_RES_TYPE] = MNL_TYPE_U8, + [RDMA_NLDEV_ATTR_RES_SUBTYPE] = MNL_TYPE_NUL_STRING, [RDMA_NLDEV_ATTR_RES_STATE] = MNL_TYPE_U8, [RDMA_NLDEV_ATTR_RES_PID] = MNL_TYPE_U32, [RDMA_NLDEV_ATTR_RES_KERN_NAME] = MNL_TYPE_NUL_STRING, -- 2.44.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too 2024-04-30 10:18 [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too Leon Romanovsky 2024-04-30 10:18 ` [PATCH iproute2-next 1/2] rdma: update uapi header Leon Romanovsky 2024-04-30 10:18 ` [PATCH iproute2-next 2/2] rdma: Add an option to display driver-specific QPs in the rdma tool Leon Romanovsky @ 2024-05-03 15:20 ` patchwork-bot+netdevbpf 2 siblings, 0 replies; 5+ messages in thread From: patchwork-bot+netdevbpf @ 2024-05-03 15:20 UTC (permalink / raw) To: Leon Romanovsky; +Cc: dsahern, leonro, cmeiohas, jgg, netdev, linux-rdma Hello: This series was applied to iproute2/iproute2-next.git (main) by David Ahern <dsahern@kernel.org>: On Tue, 30 Apr 2024 13:18:18 +0300 you wrote: > From: Leon Romanovsky <leonro@nvidia.com> > > This series is complimentary to the kernel patches that exposed to the > userspace the driver-specific QPs. > > https://lore.kernel.org/all/2607bb3ddec3cae3443c2ea19e9f700825d20a98.1713268997.git.leon@kernel.org > > [...] Here is the summary with links: - [iproute2-next,1/2] rdma: update uapi header https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=e459ea4392c4 - [iproute2-next,2/2] rdma: Add an option to display driver-specific QPs in the rdma tool https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=57d7a8fd904c You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-05-03 15:20 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-04-30 10:18 [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too Leon Romanovsky 2024-04-30 10:18 ` [PATCH iproute2-next 1/2] rdma: update uapi header Leon Romanovsky 2024-04-30 14:43 ` [EXTERNAL] " Subbaraya Sundeep Bhatta 2024-04-30 10:18 ` [PATCH iproute2-next 2/2] rdma: Add an option to display driver-specific QPs in the rdma tool Leon Romanovsky 2024-05-03 15:20 ` [PATCH iproute2-next 0/2] Extend rdmatool to print driver QPs too patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).