RDMA tool driver-specific resource tracking
Subsystems (3)
cover RDMA tool driver-specific resource tracking
Hello,
This series enhances the iproute2 rdma tool to include displaying driver-specific resource attributes. It is the user-space part of the kernel driver resource tracking series that has been accepted for merging into linux-4.18 [1]
If there are no additional review comments, it can now be merged, I think.
Changes since v0/rfc:
- changed "provider" to "driver" based on kernel side changes
- updated man pages
- removed "RFC" tag
Thanks,
Steve.
[1] https://www.spinics.net/lists/linux-rdma/msg64199.html
Steve Wise (3):
rdma: update rdma_netlink.h to get driver attrs
rdma: print driver resource attributes
rdma: update man pages
man/man8/rdma-resource.8 | 29 ++++- man/man8/rdma.8 | 2 +- rdma/include/uapi/rdma/rdma_netlink.h | 37 ++++++- rdma/rdma.c | 7 +- rdma/rdma.h | 11 ++ rdma/res.c | 30 ++---- rdma/utils.c | 194 ++++++++++++++++++++++++++++++++++ 7 files changed, 284 insertions(+), 26 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/3 rdma: update rdma_netlink.h to get driver attrs
--- rdma/include/uapi/rdma/rdma_netlink.h | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
rdma/include/uapi/rdma/rdma_netlink.h +36 -1
@@ -249,10 +249,22 @@ enum rdma_nldev_command {RDMA_NLDEV_NUM_OPS }; +enum { +RDMA_NLDEV_ATTR_ENTRY_STRLEN =16 , +}; + +enum rdma_nldev_print_type { +RDMA_NLDEV_PRINT_TYPE_UNSPEC , +RDMA_NLDEV_PRINT_TYPE_HEX , +}; +enum rdma_nldev_attr {/* don't change the order or add anything between, this is ABI! */ RDMA_NLDEV_ATTR_UNSPEC , +/* Pad attribute for 64b alignment */ +RDMA_NLDEV_ATTR_PAD =RDMA_NLDEV_ATTR_UNSPEC , +/* Identifier for ib_device */ RDMA_NLDEV_ATTR_DEV_INDEX ,/* u32 */
@@ -387,8 +399,31 @@ enum rdma_nldev_attr {RDMA_NLDEV_ATTR_RES_PD_ENTRY ,/* nested table */ RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY ,/* u32 */ RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY ,/* u32 */ +/* +* driver-specific attributes. +*/ +RDMA_NLDEV_ATTR_DRIVER ,/* nested table */ +RDMA_NLDEV_ATTR_DRIVER_ENTRY ,/* nested table */ +RDMA_NLDEV_ATTR_DRIVER_STRING ,/* string */ +/* +* u8 values from enum rdma_nldev_print_type +*/ +RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE ,/* u8 */ +RDMA_NLDEV_ATTR_DRIVER_S32 ,/* s32 */ +RDMA_NLDEV_ATTR_DRIVER_U32 ,/* u32 */ +RDMA_NLDEV_ATTR_DRIVER_S64 ,/* s64 */ +RDMA_NLDEV_ATTR_DRIVER_U64 ,/* u64 */ -/* Netdev information for relevant protocols, like RoCE and iWARP */ +/* +* Provides logical name and index of netdevice which is +* connected to physical port. This information is relevant +* for RoCE and iWARP. +* +* The netdevices which are associated with containers are +* supposed to be exported together with GID table once it +* will be exposed through the netlink. Because the +* associated netdevices are properties of GIDs. +*/ RDMA_NLDEV_ATTR_NDEV_INDEX ,/* u32 */ RDMA_NLDEV_ATTR_NDEV_NAME, /* string */
Signature · 1 line
1.8.3.1
Re: [PATCH v1 iproute2-next 1/3] rdma: update rdma_netlink.h to get driver attrs
Quoted 4 lines · Steve Wise
Signed-off-by Steve Wise <[email protected]>--- rdma/include/uapi/rdma/rdma_netlink.h | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)
Please write in commit message something like: "Based on kernel commit ....", so we will be able to track changes.
Quoted 64 lines
rdma/include/uapi/rdma/rdma_netlink.h +36
-2@@ -249,10 +249,22 @@ enum rdma_nldev_command {RDMA_NLDEV_NUM_OPS }; +enum { +RDMA_NLDEV_ATTR_ENTRY_STRLEN =16 , +}; + +enum rdma_nldev_print_type { +RDMA_NLDEV_PRINT_TYPE_UNSPEC , +RDMA_NLDEV_PRINT_TYPE_HEX , +}; +enum rdma_nldev_attr {/* don't change the order or add anything between, this is ABI! */ RDMA_NLDEV_ATTR_UNSPEC , +/* Pad attribute for 64b alignment */ +RDMA_NLDEV_ATTR_PAD =RDMA_NLDEV_ATTR_UNSPEC , +/* Identifier for ib_device */ RDMA_NLDEV_ATTR_DEV_INDEX ,/* u32 */ @@ -387,8 +399,31 @@ enum rdma_nldev_attr {RDMA_NLDEV_ATTR_RES_PD_ENTRY ,/* nested table */ RDMA_NLDEV_ATTR_RES_LOCAL_DMA_LKEY ,/* u32 */ RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY ,/* u32 */ +/* +* driver-specific attributes. +*/ +RDMA_NLDEV_ATTR_DRIVER ,/* nested table */ +RDMA_NLDEV_ATTR_DRIVER_ENTRY ,/* nested table */ +RDMA_NLDEV_ATTR_DRIVER_STRING ,/* string */ +/* +* u8 values from enum rdma_nldev_print_type +*/ +RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE ,/* u8 */ +RDMA_NLDEV_ATTR_DRIVER_S32 ,/* s32 */ +RDMA_NLDEV_ATTR_DRIVER_U32 ,/* u32 */ +RDMA_NLDEV_ATTR_DRIVER_S64 ,/* s64 */ +RDMA_NLDEV_ATTR_DRIVER_U64 ,/* u64 */ -/* Netdev information for relevant protocols, like RoCE and iWARP */ +/* +* Provides logical name and index of netdevice which is +* connected to physical port. This information is relevant +* for RoCE and iWARP. +* +* The netdevices which are associated with containers are +* supposed to be exported together with GID table once it +* will be exposed through the netlink. Because the +* associated netdevices are properties of GIDs. +*/ RDMA_NLDEV_ATTR_NDEV_INDEX ,/* u32 */ RDMA_NLDEV_ATTR_NDEV_NAME, /* string */ --1.8.3.1
Re: [PATCH v1 iproute2-next 1/3] rdma: update rdma_netlink.h to get driver attrs
Quoted 7 lines · Leon Romanovsky
Quoted 4 lines · Steve Wise
Signed-off-by Steve Wise <[email protected]>--- rdma/include/uapi/rdma/rdma_netlink.h | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-)Please write in commit message something like: "Based on kernel commit ....", so we will be able to track changes.
Sure.
Thanks,
Steve.
PATCH 2/3 rdma: print driver resource attributes
In reply to Steve WiseThis enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. The print_type attribute, if present, provides a print format to use vs the standard print format for the type. For example, the default print type for a PROVIDER_S32 value is "%d ", but "0x%x " if the print_type of PRINT_TYPE_HEX is included inthe tuple.
Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80 columns, otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p
link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma]
sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0
size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00
rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0--- rdma/rdma.c | 7 ++- rdma/rdma.h | 11 ++++ rdma/res.c | 30 +++------ rdma/utils.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 221 insertions(+), 21 deletions(-)
rdma/rdma.c +6 -1
@@ -132,6 +132,7 @@ int main(int argc, char **argv)const char *batch_file =NULL ;bool pretty_output = false;bool show_details = false; +bool show_driver_details = false;bool json_output = false;bool force = false;char *filename;
@@ -152,7 +153,10 @@ int main(int argc, char **argv) pretty_output = true;break ;case 'd' : - show_details = true; +if (show_details) + show_driver_details = true; +else + show_details = true;break ;case 'j' : json_output = true;
@@ -180,6 +184,7 @@ int main(int argc, char **argv) argv += optind; rd.show_details = show_details; + rd.show_driver_details = show_driver_details; rd.json_output = json_output; rd.pretty_output = pretty_output;
rdma/rdma.h +11 -0
@@ -55,6 +55,7 @@ struct rd {char **argv;char *filename;bool show_details; +bool show_driver_details;struct list_head dev_map_list;uint32_t dev_idx;uint32_t port_idx;
@@ -115,4 +116,14 @@ int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);void rd_prepare_msg (struct rd *rd,uint32_t cmd,uint32_t *seq,uint16_t flags);int rd_dev_init_cb (const struct nlmsghdr *nlh,void *data);int rd_attr_cb (const struct nlattr *attr,void *data); +int rd_attr_check (const struct nlattr *attr,int *typep); + +/* +* Print helpers +*/ +void print_driver_table (struct rd *rd,struct nlattr *tb); +void newline (struct rd *rd); +void newline_indent (struct rd *rd); +#define MAX_LINE_LENGTH 80 +#endif /* _RDMA_TOOL_H_ */
rdma/res.c +10 -20
@@ -439,10 +439,8 @@ static int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }
@@ -678,10 +676,8 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }
@@ -804,10 +800,8 @@ static int res_cq_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }
@@ -919,10 +913,8 @@ static int res_mr_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }
@@ -1004,10 +996,8 @@ static int res_pd_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }
rdma/utils.c +194 -0
211 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
rdma/rdma.c int main(int argc, char **argv) · line 162
Quoted 12 lines · Steve Wise
rdma/rdma.c +4
-1@@ -152,7 +153,10 @@ int main(int argc, char **argv) pretty_output = true;break ;case 'd' : - show_details = true; +if (show_details) + show_driver_details = true; +else + show_details = true;break ;case 'j' : json_output = true;
The above change should be reflected in the man page.
Also, the set needs to be respun after I merged master where Stephen brought in updates to the uapi files.
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 14 lines · David Ahern
rdma/rdma.c int main(int argc, char **argv) · line 162
Quoted 12 lines · Steve Wise
rdma/rdma.c +4
-1@@ -152,7 +153,10 @@ int main(int argc, char **argv) pretty_output = true;break ;case 'd' : - show_details = true; +if (show_details) + show_driver_details = true; +else + show_details = true;break ;case 'j' : json_output = true;The above change should be reflected in the man page.
I did mention it in the man page:
-d, --details
Output detailed information. Adding a second -d includes driver-specific details.
But I wasn't sure how to show it in the syntax. Maybe this?
OPTIONS := { -V[ersion] | -d[etails] [-d[etails]] } -j[son] } -p[retty] }
Quoted 2 lines
Also, the set needs to be respun after I merged master where Stephen brought in updates to the uapi files.
Will do. Thanks for reviewing.
Steve.
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 19 lines · Steve Wise
Quoted 14 lines · David Ahern
rdma/rdma.c int main(int argc, char **argv) · line 162
Quoted 12 lines · Steve Wise
rdma/rdma.c +4
-1@@ -152,7 +153,10 @@ int main(int argc, char **argv) pretty_output = true;break ;case 'd' : - show_details = true; +if (show_details) + show_driver_details = true; +else + show_details = true;break ;case 'j' : json_output = true;The above change should be reflected in the man page.
I did mention it in the man page:
Quoted 7 lines
-d, --details
Output detailed information. Adding a second -d includes driver-specific details.But I wasn't sure how to show it in the syntax. Maybe this?
OPTIONS := { -V[ersion] | -d[etails] [-d[etails]] } -j[son] } -p[retty] }
I should have read the second patch before commenting. Didn't it have first -d = details, a second -d = driver details? That should be fine.
Quoted 9 lines
Quoted 4 lines
Also, the set needs to be respun after I merged master where Stephen brought in updates to the uapi files.
Will do. Thanks for reviewing.
Steve.
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 24 lines · David Ahern
Quoted 23 lines · Steve Wise
Quoted 14 lines · David Ahern
rdma/rdma.c int main(int argc, char **argv) · line 162
Quoted 12 lines · Steve Wise
rdma/rdma.c +4
-1@@ -152,7 +153,10 @@ int main(int argc, char **argv) pretty_output = true;break ;case 'd' : - show_details = true; +if (show_details) + show_driver_details = true; +else + show_details = true;break ;case 'j' : json_output = true;The above change should be reflected in the man page.
I did mention it in the man page:
-d, --details
Output detailed information. Adding a second -d includes driver-specific details.
Quoted 6 lines
Quoted 3 lines
But I wasn't sure how to show it in the syntax. Maybe this?
OPTIONS := { -V[ersion] | -d[etails] [-d[etails]] } -j[son] } -p[retty] }
I should have read the second patch before commenting. Didn't it have first -d = details, a second -d = driver details? That should be fine.
Yes, our idea is to require "-dd" to print such driver specific information. The level of nesting is:
* No arguments -> info usable for most of the users
* -d - pre-parsed flags and rarely used information.
* -dd - very detailed output, can be very specific to device.
Thanks
Quoted 11 lines
Quoted 10 lines
Quoted 5 lines
Also, the set needs to be respun after I merged master where Stephen brought in updates to the uapi files.
Will do. Thanks for reviewing.
Steve.
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
In reply to Steve WiseQuoted 2 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't
Double space between "." and "This".
Quoted 5 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present,
ditto
Quoted 29 lines
provides a print format to use vs the standard print format for the type. For example, the default print type for a
PROVIDER_S32value is "%d ", but "0x%x " if theprint_typeofPRINT_TYPE_HEXis included inthe tuple.Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80 columns, otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma] sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0 size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00 rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0Signed-off-by Steve Wise <[email protected]>--- rdma/rdma.c | 7 ++- rdma/rdma.h | 11 ++++ rdma/res.c | 30 +++------ rdma/utils.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 221 insertions(+), 21 deletions(-)rdma/rdma.c +0
-0
rdma/rdma.c int main(int argc, char **argv) · line 135
Quoted 4 lines
rdma/rdma.c +1
-0@@ -132,6 +132,7 @@ int main(int argc, char **argv)const char *batch_file =NULL ;bool pretty_output = false;bool show_details = false; +bool show_driver_details = false;
Reversed Christmas tree please.
Quoted 319 lines
rdma/rdma.c +5
-1bool json_output = false;bool force = false;char *filename;@@ -152,7 +153,10 @@ int main(int argc, char **argv) pretty_output = true;break ;case 'd' : - show_details = true; +if (show_details) + show_driver_details = true; +else + show_details = true;break ;case 'j' : json_output = true;@@ -180,6 +184,7 @@ int main(int argc, char **argv) argv += optind; rd.show_details = show_details; + rd.show_driver_details = show_driver_details; rd.json_output = json_output; rd.pretty_output = pretty_output;rdma/rdma.h +11
-0@@ -55,6 +55,7 @@ struct rd {char **argv;char *filename;bool show_details; +bool show_driver_details;struct list_head dev_map_list;uint32_t dev_idx;uint32_t port_idx;@@ -115,4 +116,14 @@ int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);void rd_prepare_msg (struct rd *rd,uint32_t cmd,uint32_t *seq,uint16_t flags);int rd_dev_init_cb (const struct nlmsghdr *nlh,void *data);int rd_attr_cb (const struct nlattr *attr,void *data); +int rd_attr_check (const struct nlattr *attr,int *typep); + +/* +* Print helpers +*/ +void print_driver_table (struct rd *rd,struct nlattr *tb); +void newline (struct rd *rd); +void newline_indent (struct rd *rd); +#define MAX_LINE_LENGTH 80 +#endif /* _RDMA_TOOL_H_ */ rdma/res.c +10
-20@@ -439,10 +439,8 @@ static int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -678,10 +676,8 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -804,10 +800,8 @@ static int res_cq_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -919,10 +913,8 @@ static int res_mr_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -1004,10 +996,8 @@ static int res_pd_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }rdma/utils.c +176
-0@@ -11,6 +11,7 @@#include "rdma.h" #include <ctype.h> +#include <inttypes.h> int rd_argc (struct rd *rd) {@@ -393,8 +394,32 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = { [RDMA_NLDEV_ATTR_RES_MRLEN] = MNL_TYPE_U64, [RDMA_NLDEV_ATTR_NDEV_INDEX] = MNL_TYPE_U32, [RDMA_NLDEV_ATTR_NDEV_NAME] = MNL_TYPE_NUL_STRING, + [RDMA_NLDEV_ATTR_DRIVER] = MNL_TYPE_NESTED, + [RDMA_NLDEV_ATTR_DRIVER_ENTRY] = MNL_TYPE_NESTED, + [RDMA_NLDEV_ATTR_DRIVER_STRING] = MNL_TYPE_NUL_STRING, + [RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE] = MNL_TYPE_U8, + [RDMA_NLDEV_ATTR_DRIVER_S32] = MNL_TYPE_U32, + [RDMA_NLDEV_ATTR_DRIVER_U32] = MNL_TYPE_U32, + [RDMA_NLDEV_ATTR_DRIVER_S64] = MNL_TYPE_U64, + [RDMA_NLDEV_ATTR_DRIVER_U64] = MNL_TYPE_U64, }; +int rd_attr_check (const struct nlattr *attr,int *typep) +{ +int type; + +if (mnl_attr_type_valid (attr,RDMA_NLDEV_ATTR_MAX ) <0 ) +return MNL_CB_ERROR ; + + type =mnl_attr_get_type (attr); + +if (mnl_attr_validate (attr, nldev_policy[type]) <0 ) +return MNL_CB_ERROR ; + + *typep = nldev_policy[type]; +return MNL_CB_OK ; +} +int rd_attr_cb (const struct nlattr *attr,void *data) {const struct nlattr **tb = data;@@ -660,3 +685,172 @@ struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index)free (dev_name);return dev_map; } + +#define nla_type (attr) ((attr)->nla_type & NLA_TYPE_MASK) + +void newline (struct rd *rd) +{ +if (rd->json_output) +jsonw_end_array (rd->jw); +else +pr_out ("\n" ); +} + +void newline_indent (struct rd *rd) +{ +newline (rd); +if (!rd->json_output) +pr_out (" " ); +} + +static int print_driver_string (struct rd *rd,const char *key_str, +const char *val_str) +{ +if (rd->json_output) { +jsonw_string_field (rd->jw, key_str, val_str); +return 0 ; + }else { +return pr_out ("%s %s " , key_str, val_str); + } +} + +static int print_driver_s32 (struct rd *rd,const char *key_str,int32_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %d " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%x " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_u32 (struct rd *rd,const char *key_str,uint32_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %u " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%x " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_s64 (struct rd *rd,const char *key_str,int64_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %" PRId64" " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%" PRIx64" " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_u64 (struct rd *rd,const char *key_str,uint64_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %" PRIu64" " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%" PRIx64" " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_entry (struct rd *rd,struct nlattr *key_attr, +struct nlattr *val_attr, +enum rdma_nldev_print_type print_type) +{ +const char *key_str =mnl_attr_get_str (key_attr); +int attr_type =nla_type (val_attr); + +switch (attr_type) { +case RDMA_NLDEV_ATTR_DRIVER_STRING : +return print_driver_string (rd, key_str, +mnl_attr_get_str (val_attr)); +case RDMA_NLDEV_ATTR_DRIVER_S32 : +return print_driver_s32 (rd, key_str, +mnl_attr_get_u32 (val_attr), print_type); +case RDMA_NLDEV_ATTR_DRIVER_U32 : +return print_driver_u32 (rd, key_str, +mnl_attr_get_u32 (val_attr), print_type); +case RDMA_NLDEV_ATTR_DRIVER_S64 : +return print_driver_s64 (rd, key_str, +mnl_attr_get_u64 (val_attr), print_type); +case RDMA_NLDEV_ATTR_DRIVER_U64 : +return print_driver_u64 (rd, key_str, +mnl_attr_get_u64 (val_attr), print_type); + } +return -EINVAL ; +} + +void print_driver_table (struct rd *rd,struct nlattr *tb) +{ +int print_type =RDMA_NLDEV_PRINT_TYPE_UNSPEC ; +struct nlattr *tb_entry, *key =NULL , *val; +int type, cc =0 ; + +if (!rd->show_driver_details || !tb) +return ; + +if (rd->pretty_output) +newline_indent (rd); + +/* +* Driver attrs are tuples of {key, [print-type], value}. +* The key must be a string. If print-type is present, it +* defines an alternate printf format type vs the native format +* for the attribute. And the value can be any available +* driver type. +*/ +mnl_attr_for_each_nested (tb_entry, tb) { + +if (cc >MAX_LINE_LENGTH ) { +if (rd->pretty_output) +newline_indent (rd); + cc =0 ; + } +if (rd_attr_check (tb_entry, &type) !=MNL_CB_OK )
rdma/utils.c struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index) · line 848
Quoted 10 lines
rdma/utils.c +10
-0+return ; +if (!key) { +if (type !=MNL_TYPE_NUL_STRING ) +return ; + key = tb_entry; + }else if (type ==MNL_TYPE_U8 ) { + print_type =mnl_attr_get_u8 (tb_entry); + }else { + val = tb_entry; + cc +=print_driver_entry (rd, key, val, print_type);
I stopped to read here, because of two problems:
1. print_driver_entry can return negative number, so unclear to me what will be the final result of "cc += ..".
2. The netlink design is to ignore unknown attributes and not return error. It allows to use new kernels with old applications.
Quoted 11 lines
rdma/utils.c +8
-1+if (cc <0 ) +return ; + print_type =RDMA_NLDEV_PRINT_TYPE_UNSPEC ; + key =NULL ; + } + } +return ; +} --1.8.3.1
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 11 lines · Leon Romanovsky
Quoted 2 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't
Double space between "." and "This".
Quoted 5 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present,ditto
I'll fix these.
Quoted 24 lines
Quoted 24 lines
provides a print format to use vs the standard print format for the type. For example, the default print type for a
PROVIDER_S32value is "%d ", but "0x%x " if theprint_typeofPRINT_TYPE_HEXis included inthe tuple.Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80 columns, otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma] sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0 size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00 rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0Signed-off-by Steve Wise <[email protected]>--- rdma/rdma.c | 7 ++- rdma/rdma.h | 11 ++++ rdma/res.c | 30 +++------ rdma/utils.c | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 221 insertions(+), 21 deletions(-)
Quoted 10 lines
rdma/rdma.c int main(int argc, char **argv) · line 135
Quoted 9 lines
rdma/rdma.c +1
-0@@ -132,6 +132,7 @@ int main(int argc, char **argv)const char *batch_file =NULL ;bool pretty_output = false;bool show_details = false; +bool show_driver_details = false;Reversed Christmas tree please.
Sure.
Quoted 326 lines
Quoted 326 lines
rdma/rdma.c +5
-1bool json_output = false;bool force = false;char *filename;@@ -152,7 +153,10 @@ int main(int argc, char **argv) pretty_output = true;break ;case 'd' : - show_details = true; +if (show_details) + show_driver_details = true; +else + show_details = true;break ;case 'j' : json_output = true;@@ -180,6 +184,7 @@ int main(int argc, char **argv) argv += optind; rd.show_details = show_details; + rd.show_driver_details = show_driver_details; rd.json_output = json_output; rd.pretty_output = pretty_output;rdma/rdma.h +11
-0@@ -55,6 +55,7 @@ struct rd {char **argv;char *filename;bool show_details; +bool show_driver_details;struct list_head dev_map_list;uint32_t dev_idx;uint32_t port_idx;@@ -115,4 +116,14 @@ int rd_recv_msg(struct rd *rd, mnl_cb_t callback, void *data, uint32_t seq);void rd_prepare_msg (struct rd *rd,uint32_t cmd,uint32_t *seq,uint16_t flags);int rd_dev_init_cb (const struct nlmsghdr *nlh,void *data);int rd_attr_cb (const struct nlattr *attr,void *data); +int rd_attr_check (const struct nlattr *attr,int *typep); + +/* +* Print helpers +*/ +void print_driver_table (struct rd *rd,struct nlattr *tb); +void newline (struct rd *rd); +void newline_indent (struct rd *rd); +#define MAX_LINE_LENGTH 80 +#endif /* _RDMA_TOOL_H_ */ rdma/res.c +10
-20@@ -439,10 +439,8 @@ static int res_qp_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -678,10 +676,8 @@ static int res_cm_id_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -804,10 +800,8 @@ static int res_cq_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -919,10 +913,8 @@ static int res_mr_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }@@ -1004,10 +996,8 @@ static int res_pd_parse_cb(const struct nlmsghdr *nlh, void *data)if (nla_line[RDMA_NLDEV_ATTR_RES_PID ])free (comm); -if (rd->json_output) -jsonw_end_array (rd->jw); -else -pr_out ("\n" ); +print_driver_table (rd, nla_line[RDMA_NLDEV_ATTR_DRIVER ]); +newline (rd); }return MNL_CB_OK ; }rdma/utils.c +183
-0@@ -11,6 +11,7 @@#include "rdma.h" #include <ctype.h> +#include <inttypes.h> int rd_argc (struct rd *rd) {@@ -393,8 +394,32 @@ static const enum mnl_attr_data_type nldev_policy[RDMA_NLDEV_ATTR_MAX] = { [RDMA_NLDEV_ATTR_RES_MRLEN] = MNL_TYPE_U64, [RDMA_NLDEV_ATTR_NDEV_INDEX] = MNL_TYPE_U32, [RDMA_NLDEV_ATTR_NDEV_NAME] = MNL_TYPE_NUL_STRING, + [RDMA_NLDEV_ATTR_DRIVER] = MNL_TYPE_NESTED, + [RDMA_NLDEV_ATTR_DRIVER_ENTRY] = MNL_TYPE_NESTED, + [RDMA_NLDEV_ATTR_DRIVER_STRING] = MNL_TYPE_NUL_STRING, + [RDMA_NLDEV_ATTR_DRIVER_PRINT_TYPE] = MNL_TYPE_U8, + [RDMA_NLDEV_ATTR_DRIVER_S32] = MNL_TYPE_U32, + [RDMA_NLDEV_ATTR_DRIVER_U32] = MNL_TYPE_U32, + [RDMA_NLDEV_ATTR_DRIVER_S64] = MNL_TYPE_U64, + [RDMA_NLDEV_ATTR_DRIVER_U64] = MNL_TYPE_U64, }; +int rd_attr_check (const struct nlattr *attr,int *typep) +{ +int type; + +if (mnl_attr_type_valid (attr,RDMA_NLDEV_ATTR_MAX ) <0 ) +return MNL_CB_ERROR ; + + type =mnl_attr_get_type (attr); + +if (mnl_attr_validate (attr, nldev_policy[type]) <0 ) +return MNL_CB_ERROR ; + + *typep = nldev_policy[type]; +return MNL_CB_OK ; +} +int rd_attr_cb (const struct nlattr *attr,void *data) {const struct nlattr **tb = data;@@ -660,3 +685,172 @@ struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index)free (dev_name);return dev_map; } + +#define nla_type (attr) ((attr)->nla_type & NLA_TYPE_MASK) + +void newline (struct rd *rd) +{ +if (rd->json_output) +jsonw_end_array (rd->jw); +else +pr_out ("\n" ); +} + +void newline_indent (struct rd *rd) +{ +newline (rd); +if (!rd->json_output) +pr_out (" " ); +} + +static int print_driver_string (struct rd *rd,const char *key_str, +const char *val_str) +{ +if (rd->json_output) { +jsonw_string_field (rd->jw, key_str, val_str); +return 0 ; + }else { +return pr_out ("%s %s " , key_str, val_str); + } +} + +static int print_driver_s32 (struct rd *rd,const char *key_str,int32_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %d " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%x " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_u32 (struct rd *rd,const char *key_str,uint32_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %u " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%x " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_s64 (struct rd *rd,const char *key_str,int64_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %" PRId64" " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%" PRIx64" " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_u64 (struct rd *rd,const char *key_str,uint64_t val, +enum rdma_nldev_print_type print_type) +{ +if (rd->json_output) { +jsonw_int_field (rd->jw, key_str, val); +return 0 ; + } +switch (print_type) { +case RDMA_NLDEV_PRINT_TYPE_UNSPEC : +return pr_out ("%s %" PRIu64" " , key_str, val); +case RDMA_NLDEV_PRINT_TYPE_HEX : +return pr_out ("%s 0x%" PRIx64" " , key_str, val); +default : +return -EINVAL ; + } +} + +static int print_driver_entry (struct rd *rd,struct nlattr *key_attr, +struct nlattr *val_attr, +enum rdma_nldev_print_type print_type) +{ +const char *key_str =mnl_attr_get_str (key_attr); +int attr_type =nla_type (val_attr); + +switch (attr_type) { +case RDMA_NLDEV_ATTR_DRIVER_STRING : +return print_driver_string (rd, key_str, +mnl_attr_get_str (val_attr)); +case RDMA_NLDEV_ATTR_DRIVER_S32 : +return print_driver_s32 (rd, key_str, +mnl_attr_get_u32 (val_attr), print_type); +case RDMA_NLDEV_ATTR_DRIVER_U32 : +return print_driver_u32 (rd, key_str, +mnl_attr_get_u32 (val_attr), print_type); +case RDMA_NLDEV_ATTR_DRIVER_S64 : +return print_driver_s64 (rd, key_str, +mnl_attr_get_u64 (val_attr), print_type); +case RDMA_NLDEV_ATTR_DRIVER_U64 : +return print_driver_u64 (rd, key_str, +mnl_attr_get_u64 (val_attr), print_type); + } +return -EINVAL ; +} + +void print_driver_table (struct rd *rd,struct nlattr *tb) +{ +int print_type =RDMA_NLDEV_PRINT_TYPE_UNSPEC ; +struct nlattr *tb_entry, *key =NULL , *val; +int type, cc =0 ; + +if (!rd->show_driver_details || !tb) +return ; + +if (rd->pretty_output) +newline_indent (rd); + +/* +* Driver attrs are tuples of {key, [print-type], value}. +* The key must be a string. If print-type is present, it +* defines an alternate printf format type vs the native format +* for the attribute. And the value can be any available +* driver type. +*/ +mnl_attr_for_each_nested (tb_entry, tb) { + +if (cc >MAX_LINE_LENGTH ) { +if (rd->pretty_output) +newline_indent (rd); + cc =0 ; + } +if (rd_attr_check (tb_entry, &type) !=MNL_CB_OK ) +return ; +if (!key) { +if (type !=MNL_TYPE_NUL_STRING ) +return ; + key = tb_entry; + }else if (type ==MNL_TYPE_U8 ) { + print_type =mnl_attr_get_u8 (tb_entry);
Quoted 8 lines
rdma/utils.c struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index) · line 848
Quoted 3 lines
rdma/utils.c +3
-0+ }else { + val = tb_entry; + cc +=print_driver_entry (rd, key, val, print_type);I stopped to read here, because of two problems:
1.print_driver_entrycan return negative number, so unclear to me what will be the final result of "cc += ..".
2. The netlink design is to ignore unknown attributes and not return error. It allows to use new kernels with old applications.
Yes, this is a bug. See below the check for 'cc < 0':
Quoted 2 lines
rdma/utils.c struct dev_map *dev_map_lookup(struct rd *rd, bool allow_port_index) · line 850
Quoted 2 lines
rdma/utils.c +2
-0+if (cc <0 ) +return ;
It's incorrect. The return from print_driver_entry() should be checked for error to allow ignoring unknown attrs, and then if no error, cc gets incremented. I'll fix this up.
Thanks for reviewing,
Steve.
Quoted 9 lines
Quoted 9 lines
rdma/utils.c +6
-1+ print_type =RDMA_NLDEV_PRINT_TYPE_UNSPEC ; + key =NULL ; + } + } +return ; +} --1.8.3.1
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 10 lines · Steve Wise
Quoted 8 lines · Leon Romanovsky
Quoted 2 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't
Double space between "." and "This".
Quoted 2 lines
need to know about the details of every type of rdma device.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present,ditto
I'll fix these.
Fix it if you want, but don't do it because Leon told you to. A double space after period is perfectly acceptable.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 15 lines · Doug Ledford
Quoted 14 lines · Steve Wise
Quoted 12 lines · Leon Romanovsky
Quoted 2 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't
Double space between "." and "This".
Quoted 5 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present,
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
ditto
I'll fix these.
Fix it if you want, but don't do it because Leon told you to. A double space after period is perfectly acceptable.
It is very controversial thing [1],
"Most style guides indicate that single sentence spacing is proper for final or published work today, and most publishers require manuscripts to be submitted as they will appear in publication—single sentence spaced."
[1] https://en.wikipedia.org/wiki/Sentence_spacing
Quoted 5 lines
--
Doug Ledford <[email protected]>GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
RE: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 26 lines · Doug Ledford
Quoted 5 lines · Steve Wise
Quoted 4 lines · Leon Romanovsky
Quoted 2 lines · Steve Wise
Quoted 1 line
This enhancement allows printing rdma device-specific state, if
provided
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 1 line
by the kernel. This is done in a generic manner, so rdma tool doesn't
Double space between "." and "This".
Quoted 5 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, ifpresent,
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
ditto
I'll fix these.
Fix it if you want, but don't do it because Leon told you to. A double space after period is perfectly acceptable.
Quoted 8 lines
It is very controversial thing [1],
"Most style guides indicate that single sentence spacing is proper for final or published work today, and most publishers require manuscripts to be submitted as they will appear in publication—single sentence spaced."
We're not writing a manuscript. 😉 Regardless, I made the changes and they are in v2 of the patch series, which I think is probably ready to merge.
Steve.
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
In reply to Leon RomanovskyQuoted 23 lines · Leon Romanovsky
Quoted 15 lines · Doug Ledford
Quoted 14 lines · Steve Wise
Quoted 12 lines · Leon Romanovsky
Quoted 2 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't
Double space between "." and "This".
Quoted 5 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present,Quoted 6 lines
Quoted 3 lines
Quoted 1 line
ditto
I'll fix these.
Fix it if you want, but don't do it because Leon told you to. A double space after period is perfectly acceptable.
Quoted 8 lines
It is very controversial thing [1],
"Most style guides indicate that single sentence spacing is proper for final or published work today, and most publishers require manuscripts to be submitted as they will appear in publication—single sentence spaced."
Yes...and the justification is that proportional font systems resolve the issue of delineating sentences without the need for a second space (they actually don't because they are improperly implemented, but that's another issue). But we don't work on proportional font systems, we work with git, on command lines, with fixed spacing fonts, all the things that indicate double spaces are actually preferred even by those people that are proponents of single spacing. And on top of that, current research suggests maybe the single spacers are wrong after all :-o
https://www.theatlantic.com/science/archive/2018/05/two-spaces-after-a-p
eriod/559304/
Anyway, my original point stands. It's controversial, as you said, so Steve should do what Steve feels is best and not worry about anyone else' opinion on the matter.
Signature · 3 lines
Doug Ledford <[email protected]> GPG KeyID: B826A3330E572FDD Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
In reply to Steve WiseQuoted 15 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present, provides a print format to use vs the standard print format for the type. For example, the default print type for aPROVIDER_S32value is "%d ", but "0x%x " if theprint_typeofPRINT_TYPE_HEXis included inthe tuple.Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80 columns, otherwise it is printed as a single row to be grep/awk friendly.
Quoted 7 lines
Example output:
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma] sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0 size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00 rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0
Hey some of these look like kernel pointers.. That is a no-no.. What is up there?
The wr_id often contains a pointer, right? So we cannot just pass it to user space..
Jason
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 18 lines · Jason Gunthorpe
Quoted 17 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present, provides a print format to use vs the standard print format for the type. For example, the default print type for aPROVIDER_S32value is "%d ", but "0x%x " if theprint_typeofPRINT_TYPE_HEXis included inthe tuple.Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80 columns, otherwise it is printed as a single row to be grep/awk friendly.
Example output:
Quoted 7 lines
Quoted 5 lines
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma] sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0 size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00 rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0Hey some of these look like kernel pointers.. That is a no-no.. What is up there?
Nothing is defined as a kernel pointer. But wr_id is often a pointer to the kernel rdma application's context...
Quoted 2 lines
The
wr_idoften contains a pointer, right? So we cannot just pass it to user space..
Hmm. It is useful for debugging kernel rdma applications. Perhaps these attrs can be only be sent up by the kernel if the capabilities allow. But previous review comments of the kernel series, which is now merged, forced me to remove passing the capabilities information to the driver resource fill functions.
So what's the right way to do this?
Steve.
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 35 lines · Steve Wise
Quoted 18 lines · Jason Gunthorpe
Quoted 17 lines · Steve Wise
This enhancement allows printing rdma device-specific state, if provided by the kernel. This is done in a generic manner, so rdma tool doesn't need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value can be any supported driver attribute. Theprint_typeattribute, if present, provides a print format to use vs the standard print format for the type. For example, the default print type for aPROVIDER_S32value is "%d ", but "0x%x " if theprint_typeofPRINT_TYPE_HEXis included inthe tuple.Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80 columns, otherwise it is printed as a single row to be grep/awk friendly.
Example output:
Quoted 7 lines
Quoted 5 lines
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0 path-mig-state MIGRATED pid 0 comm [nvme_rdma] sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106 flush_cidx 85 in_use 0 size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41 wq_pidx 171 msn 44 rqt_hwaddr 0x2a8a5d00 rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408 idx 40 wr_id 0xffff881057c033f0Hey some of these look like kernel pointers.. That is a no-no.. What is up there?
Nothing is defined as a kernel pointer. But
wr_idis often a pointer to the kernel rdma application's context...Quoted 2 lines
The
wr_idoften contains a pointer, right? So we cannot just pass it to user space..
Quoted 7 lines
Hmm. It is useful for debugging kernel rdma applications. Perhaps these attrs can be only be sent up by the kernel if the capabilities allow. But previous review comments of the kernel series, which is now merged, forced me to remove passing the capabilities information to the driver resource fill functions.
So what's the right way to do this?
The reviewer asked do not pass to drivers whole CAP_.. bits, because they anyway don't need such granularity.
Quoted 4 lines
Steve.
RE: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 6 lines · Steve Wise
Quoted 5 lines · Jason Gunthorpe
Quoted 2 lines · Steve Wise
Quoted 1 line
This enhancement allows printing rdma device-specific state, if
provided
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
by the kernel. This is done in a generic manner, so rdma tool
doesn't
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the value
can
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
be any supported driver attribute. The
print_typeattribute, if
present,
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
provides a print format to use vs the standard print format for the
type.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
For example, the default print type for a
PROVIDER_S32value is "%d
",
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
but "0x%x " if the
print_typeofPRINT_TYPE_HEXis included inthe
tuple.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80
columns,
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0path-mig-state MIGRATED pid 0 comm [
nvme_rdma]Quoted 1 line
Quoted 1 line
Quoted 1 line
sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106
flush_cidx85in_use0Quoted 1 line
Quoted 1 line
Quoted 1 line
size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41
wq_pidx
Quoted 2 lines
171 msn 44
rqt_hwaddr0x2a8a5d00Quoted 1 line
Quoted 1 line
Quoted 1 line
rqt_size 256 in_use 128 size 130 idx 43 wr_id 0xffff881057c03408
idx
Quoted 16 lines
40
wr_id0xffff881057c033f0Quoted 15 lines
Quoted 2 lines
Hey some of these look like kernel pointers.. That is a no-no.. What is up there?
Nothing is defined as a kernel pointer. But
wr_idis often a pointer to the kernel rdma application's context...Quoted 2 lines
The
wr_idoften contains a pointer, right? So we cannot just pass it to user space..Hmm. It is useful for debugging kernel rdma applications. Perhaps these attrs can be only be sent up by the kernel if the capabilities allow. But previous review comments of the kernel series, which is now merged, forced me to remove passing the capabilities information to the driver resource fill functions.
Quoted 5 lines
Quoted 1 line
So what's the right way to do this?
The reviewer asked do not pass to drivers whole
CAP_.. bits, because they anyway don't need such granularity.
Ok thanks.
RE: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
In reply to Leon RomanovskyQuoted 9 lines
Quoted 7 lines · Steve Wise
Quoted 5 lines · Jason Gunthorpe
Quoted 2 lines · Steve Wise
Quoted 1 line
This enhancement allows printing rdma device-specific state, if
provided
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
by the kernel. This is done in a generic manner, so rdma tool
doesn't
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and the
value can
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
be any supported driver attribute. The
print_typeattribute, if
present,
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
provides a print format to use vs the standard print format for the
type.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
For example, the default print type for a
PROVIDER_S32value is "%d
",
Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
but "0x%x " if the
print_typeofPRINT_TYPE_HEXis included inthetuple.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80
columns,
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0path-mig-state MIGRATED pid 0 comm [
nvme_rdma]Quoted 1 line
Quoted 1 line
Quoted 1 line
sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106
flush_cidx85in_use0Quoted 1 line
Quoted 1 line
Quoted 1 line
size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41
wq_pidx
Quoted 2 lines
Quoted 2 lines
171 msn 44
rqt_hwaddr0x2a8a5d00Quoted 1 line
Quoted 1 line
Quoted 1 line
rqt_size 256 in_use 128 size 130 idx 43 wr_id
0xffff881057c03408 idx
Quoted 5 lines
Quoted 5 lines
40
wr_id0xffff881057c033f0Quoted 4 lines
Quoted 2 lines
Hey some of these look like kernel pointers.. That is a no-no.. What is up there?
Nothing is defined as a kernel pointer. But
wr_idis often a pointer
to
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
the kernel rdma application's context...
Quoted 2 lines
The
wr_idoften contains a pointer, right? So we cannot just pass it to user space..Hmm. It is useful for debugging kernel rdma applications. Perhaps these attrs can be only be sent up by the kernel if the capabilities allow. But previous review comments of the kernel series, which is
now
Quoted 1 line
Quoted 1 line
Quoted 1 line
merged, forced me to remove passing the capabilities information to
the
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
driver resource fill functions.
So what's the right way to do this?
The reviewer asked do not pass to drivers whole
CAP_.. bits, because they anyway don't need such granularity.Ok thanks.
How's this?
include/rdma/restrack.h +2 -1
@@ -66,7 +66,8 @@ struct rdma_restrack_root {* Allows rdma drivers to add their own restrack attributes. */ int (*fill_res_entry)(struct sk_buff *msg, -struct rdma_restrack_entry *entry); +struct rdma_restrack_entry *entry, +bool net_admin_capable); };
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 74 lines · Steve Wise
Quoted 9 lines
Quoted 7 lines · Steve Wise
Quoted 5 lines · Jason Gunthorpe
Quoted 2 lines · Steve Wise
Quoted 1 line
This enhancement allows printing rdma device-specific state, if
provided
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
by the kernel. This is done in a generic manner, so rdma tool
doesn't
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and thevalue can
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
be any supported driver attribute. The
print_typeattribute, ifpresent,
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
provides a print format to use vs the standard print format for the
type.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
For example, the default print type for a
PROVIDER_S32value is "%d",
Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
but "0x%x " if the
print_typeofPRINT_TYPE_HEXis included inthetuple.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80
columns,
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0path-mig-state MIGRATED pid 0 comm [
nvme_rdma]Quoted 1 line
Quoted 1 line
Quoted 1 line
sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106
flush_cidx85in_use0Quoted 1 line
Quoted 1 line
Quoted 1 line
size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41
wq_pidxQuoted 2 lines
Quoted 2 lines
171 msn 44
rqt_hwaddr0x2a8a5d00Quoted 1 line
Quoted 1 line
Quoted 1 line
rqt_size 256 in_use 128 size 130 idx 43 wr_id
0xffff881057c03408idxQuoted 5 lines
Quoted 5 lines
40
wr_id0xffff881057c033f0Quoted 4 lines
Quoted 2 lines
Hey some of these look like kernel pointers.. That is a no-no.. What is up there?
Nothing is defined as a kernel pointer. But
wr_idis often a pointerto
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
the kernel rdma application's context...
Quoted 2 lines
The
wr_idoften contains a pointer, right? So we cannot just pass it to user space..Hmm. It is useful for debugging kernel rdma applications. Perhaps these attrs can be only be sent up by the kernel if the capabilities allow. But previous review comments of the kernel series, which is
now
Quoted 1 line
Quoted 1 line
Quoted 1 line
merged, forced me to remove passing the capabilities information to
the
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
driver resource fill functions.
So what's the right way to do this?
The reviewer asked do not pass to drivers whole
CAP_.. bits, because they anyway don't need such granularity.Ok thanks.
How's this?
include/rdma/restrack.h +1
-0+++ b/include/rdma/restrack.h
include/rdma/restrack.h struct rdma_restrack_root { · line 71
Quoted 7 lines
include/rdma/restrack.h +2
-1@@ -66,7 +66,8 @@ struct rdma_restrack_root {* Allows rdma drivers to add their own restrack attributes. */ int (*fill_res_entry)(struct sk_buff *msg, -struct rdma_restrack_entry *entry); +struct rdma_restrack_entry *entry, +bool net_admin_capable); };
cap net admin is not high enough privledge to see unhashed kernel pointers. CAP_RAW_IO? Or follow what printk does?
Honestly, I don't really know, this hashed pointer stuff is new..
Jason
RE: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 74 lines
From: Jason Gunthorpe <[email protected]>
Quoted 9 lines · Steve Wise
Quoted 9 lines
Quoted 7 lines · Steve Wise
Quoted 5 lines · Jason Gunthorpe
Quoted 2 lines · Steve Wise
Quoted 1 line
This enhancement allows printing rdma device-specific state, if
provided
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
by the kernel. This is done in a generic manner, so rdma tool
Quoted 11 lines
doesn't
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
need to know about the details of every type of rdma device.
Driver attributes for a rdma resource are in the form of <key, [
print_type], value> tuples, where the key is a string and thevalue can
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
be any supported driver attribute. The
print_typeattribute, ifpresent,
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
provides a print format to use vs the standard print format for the
type.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
For example, the default print type for a
PROVIDER_S32value is"%d
Quoted 50 lines
",
Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
but "0x%x " if the
print_typeofPRINT_TYPE_HEXis included inthetuple.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Driver resources are only printed when the -dd flag is present. If -p is present, then the output is formatted to not exceed 80
columns,
Quoted 10 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
otherwise it is printed as a single row to be grep/awk friendly.
Example output:
# rdma resource show qp lqpn 1028 -dd -p link cxgb4_0/- lqpn 1028 rqpn 0 type RC state RTS rq-psn 0 sq-psn 0path-mig-state MIGRATED pid 0 comm [
nvme_rdma]Quoted 1 line
Quoted 1 line
Quoted 1 line
sqid 1028 flushed 0 memsize 123968 cidx 85 pidx 85 wq_pidx 106
flush_cidx85in_use0Quoted 1 line
Quoted 1 line
Quoted 1 line
size 386 flags 0x0 rqid 1029 memsize 16768 cidx 43 pidx 41
wq_pidxQuoted 2 lines
Quoted 2 lines
171 msn 44
rqt_hwaddr0x2a8a5d00Quoted 1 line
Quoted 1 line
Quoted 1 line
rqt_size 256 in_use 128 size 130 idx 43 wr_id
0xffff881057c03408idxQuoted 5 lines
Quoted 5 lines
40
wr_id0xffff881057c033f0Quoted 4 lines
Quoted 2 lines
Hey some of these look like kernel pointers.. That is a no-no.. What is up there?
Nothing is defined as a kernel pointer. But
wr_idis often a pointerto
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
the kernel rdma application's context...
Quoted 2 lines
The
wr_idoften contains a pointer, right? So we cannot just pass it to user space..Hmm. It is useful for debugging kernel rdma applications. Perhaps these attrs can be only be sent up by the kernel if the capabilities allow. But previous review comments of the kernel series, which is
now
Quoted 1 line
Quoted 1 line
Quoted 1 line
merged, forced me to remove passing the capabilities information to
the
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
driver resource fill functions.
So what's the right way to do this?
The reviewer asked do not pass to drivers whole
CAP_.. bits, because they anyway don't need such granularity.Ok thanks.
How's this?
Quoted 15 lines
include/rdma/restrack.h struct rdma_restrack_root { · line 71
Quoted 11 lines
include/rdma/restrack.h +3
-1+++ b/include/rdma/restrack.h@@ -66,7 +66,8 @@ struct rdma_restrack_root {* Allows rdma drivers to add their own restrack attributes. */ int (*fill_res_entry)(struct sk_buff *msg, -struct rdma_restrack_entry *entry); +struct rdma_restrack_entry *entry, +bool net_admin_capable); };cap net admin is not high enough privledge to see unhashed kernel pointers.
CAP_RAW_IO? Or follow what printk does?
Do you mean CAP_NET_RAW? Here's the comments for it:
/* Allow use of RAW sockets */
/* Allow use of PACKET sockets */
/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
Func restricted_pointer() from lib/vsprintf.c uses CAP_SYSLOG. The comment for CAP_SYSLOG:
/* Allow configuring the kernel's syslog (printk behaviour) */
Func kallsyms_show_value() also uses CAP_SYSLOG. And there is a non-exported global kptr_restrict that they use apparently to allow overriding all this for profiling.
Here is NET_ADMIN's comments:
/* Allow interface configuration */
/* Allow administration of IP firewall, masquerading and accounting */ /* Allow setting debug option on sockets */
/* Allow modification of routing tables */
/* Allow setting arbitrary process / process group ownership on
sockets */
/* Allow binding to any address for transparent proxying (also via NET_RAW) */ /* Allow setting TOS (type of service) */
/* Allow setting promiscuous mode */
/* Allow clearing driver statistics */
/* Allow multicasting */
/* Allow read/write of device-specific registers */
/* Allow activation of ATM control sockets */
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 5 lines · Steve Wise
Quoted 3 lines
cap net admin is not high enough privledge to see unhashed kernel pointers.
CAP_RAW_IO? Or follow what printk does?Do you mean
CAP_NET_RAW? Here's the comments for it:
Nope..
Quoted 1 line
Func
restricted_pointer()fromlib/vsprintf.cusesCAP_SYSLOG. The comment forCAP_SYSLOG:
Yikes, yes, that is probably the required logic here, including the kptr_restrict = 0 thing
Jason
RE: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 7 lines · Steve Wise
Quoted 5 lines
Quoted 3 lines
cap net admin is not high enough privledge to see unhashed kernel pointers.
CAP_RAW_IO? Or follow what printk does?Do you mean
CAP_NET_RAW? Here's the comments for it:
Quoted 8 lines
Nope..
Quoted 1 line
Func
restricted_pointer()fromlib/vsprintf.cusesCAP_SYSLOG. Thecomment for
CAP_SYSLOG:Yikes, yes, that is probably the required logic here, including the
kptr_restrict= 0 thing
Let's defer the ktpr_restrict issue for now; I want to finish the initial
work this cycle, and adding that will likely take too much time. I'll useCAP_SYSLOG and add a FIXME comment. Ok?
Steve.
Re: [PATCH v1 iproute2-next 2/3] rdma: print driver resource attributes
Quoted 12 lines · Steve Wise
Quoted 12 lines · Steve Wise
Quoted 5 lines
Quoted 3 lines
cap net admin is not high enough privledge to see unhashed kernel pointers.
CAP_RAW_IO? Or follow what printk does?Do you mean
CAP_NET_RAW? Here's the comments for it:Nope..
Quoted 1 line
Func
restricted_pointer()fromlib/vsprintf.cusesCAP_SYSLOG. Thecomment for
CAP_SYSLOG:
Quoted 7 lines
Quoted 3 lines
Yikes, yes, that is probably the required logic here, including the
kptr_restrict= 0 thingLet's defer the
ktpr_restrictissue for now; I want to finish the initial
work this cycle, and adding that will likely take too much time. I'll useCAP_SYSLOGand add a FIXME comment. Ok?
Lets just drop wr_id instead...
Jason
PATCH 3/3 rdma: update man pages
In reply to Steve WiseUpdate the man pages for the resource attributes as well as the driver-specific attributes.
--- man/man8/rdma-resource.8 | 29 ++++++++++++++++++++++++++--- man/man8/rdma.8 | 2 +- 2 files changed, 27 insertions(+), 4 deletions(-)
man/man8/rdma-resource.8 +26 -3
@@ -7,13 +7,16 @@ rdma-resource \- rdma resource configuration .in +8 .ti -8 .B rdma -.RI "[ " OPTIONS " ]" -.B resource -.RI " { " COMMAND " | " +.RI "[ " OPTIONS " ] " RESOURCE " { " COMMAND " | " .BR help " }" .sp .ti -8 +.IR RESOURCE " := { " +.BR cm_id " | " cq " | " mr " | " pd " | " qp " }" +.sp + +.ti -8 .IR OPTIONS " := { " \fB\-j\fR[\fIson\fR] | \fB\-d\fR[\fIetails\fR] }
@@ -70,11 +73,31 @@ rdma res show qp link mlx5_4/- -d Detailed view. .RE .PP +rdma res show qp link mlx5_4/- -dd +.RS 4 +Detailed view including driver-specific details. +.RE +.PP rdma res show qp link mlx5_4/1 lqpn 0-6 .RS 4 Limit to specific Local QPNs. .RE .PP +rdma resource show cm_id dst-port 7174 +.RS 4 +Show CM_IDs with destination ip port of 7174. +.RE +.PP +rdma resource show cm_id src-addr 172.16.0.100 +.RS 4 +Show CM_IDs bound to local ip address 172.16.0.100 +.RE +.PP +rdma resource show cq pid 30489 +.RS 4 +Show CQs belonging to pid 30489 +.RE +.PP .SH SEE ALSO .BR rdma (8),
man/man8/rdma.8 +1 -1
@@ -49,7 +49,7 @@ If there were any errors during execution of the commands, the application retur .TP .BR "\-d" , " --details" -Output detailed information. +Output detailed information. Adding a second \-d includes driver-specific details. .TP .BR "\-p" , " --pretty"
Signature · 1 line
1.8.3.1