* [PATCH iproute2-next 0/2] rdma: Support dumping SRQ resource in raw format
@ 2023-10-07 3:58 Junxian Huang
2023-10-07 3:58 ` [PATCH iproute2-next 1/2] rdma: Update uapi headers Junxian Huang
2023-10-07 3:58 ` [PATCH iproute2-next 2/2] rdma: Add support to dump SRQ resource in raw format Junxian Huang
0 siblings, 2 replies; 7+ messages in thread
From: Junxian Huang @ 2023-10-07 3:58 UTC (permalink / raw)
To: jgg, leon, dsahern, stephen
Cc: netdev, linux-rdma, linuxarm, linux-kernel, huangjunxian6
This patchset adds support to dump SRQ resource in raw format with
rdmatool. The corresponding kernel commit is aebf8145e11a
("RDMA/core: Add support to dump SRQ resource in RAW format")
Junxian Huang (1):
rdma: Update uapi headers
wenglianfa (1):
rdma: Add support to dump SRQ resource in raw format
rdma/include/uapi/rdma/rdma_netlink.h | 2 ++
rdma/res-srq.c | 17 ++++++++++++++++-
rdma/res.h | 2 ++
3 files changed, 20 insertions(+), 1 deletion(-)
--
2.30.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH iproute2-next 1/2] rdma: Update uapi headers
2023-10-07 3:58 [PATCH iproute2-next 0/2] rdma: Support dumping SRQ resource in raw format Junxian Huang
@ 2023-10-07 3:58 ` Junxian Huang
2023-10-09 8:44 ` Leon Romanovsky
2023-10-07 3:58 ` [PATCH iproute2-next 2/2] rdma: Add support to dump SRQ resource in raw format Junxian Huang
1 sibling, 1 reply; 7+ messages in thread
From: Junxian Huang @ 2023-10-07 3:58 UTC (permalink / raw)
To: jgg, leon, dsahern, stephen
Cc: netdev, linux-rdma, linuxarm, linux-kernel, huangjunxian6
Update rdma_netlink.h file upto kernel commit aebf8145e11a
("RDMA/core: Add support to dump SRQ resource in RAW format")
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
---
rdma/include/uapi/rdma/rdma_netlink.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index 92c528a0..84f775be 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -299,6 +299,8 @@ enum rdma_nldev_command {
RDMA_NLDEV_CMD_STAT_GET_STATUS,
+ RDMA_NLDEV_CMD_RES_SRQ_GET_RAW,
+
RDMA_NLDEV_NUM_OPS
};
--
2.30.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH iproute2-next 1/2] rdma: Update uapi headers
2023-10-07 3:58 ` [PATCH iproute2-next 1/2] rdma: Update uapi headers Junxian Huang
@ 2023-10-09 8:44 ` Leon Romanovsky
0 siblings, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2023-10-09 8:44 UTC (permalink / raw)
To: Junxian Huang
Cc: jgg, dsahern, stephen, netdev, linux-rdma, linuxarm, linux-kernel
On Sat, Oct 07, 2023 at 11:58:54AM +0800, Junxian Huang wrote:
> Update rdma_netlink.h file upto kernel commit aebf8145e11a
> ("RDMA/core: Add support to dump SRQ resource in RAW format")
>
> Signed-off-by: wenglianfa <wenglianfa@huawei.com>
> Signed-off-by: Junxian Huang <huangjunxian6@hisilicon.com>
> ---
> rdma/include/uapi/rdma/rdma_netlink.h | 2 ++
> 1 file changed, 2 insertions(+)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH iproute2-next 2/2] rdma: Add support to dump SRQ resource in raw format
2023-10-07 3:58 [PATCH iproute2-next 0/2] rdma: Support dumping SRQ resource in raw format Junxian Huang
2023-10-07 3:58 ` [PATCH iproute2-next 1/2] rdma: Update uapi headers Junxian Huang
@ 2023-10-07 3:58 ` Junxian Huang
2023-10-09 8:44 ` Leon Romanovsky
1 sibling, 1 reply; 7+ messages in thread
From: Junxian Huang @ 2023-10-07 3:58 UTC (permalink / raw)
To: jgg, leon, dsahern, stephen
Cc: netdev, linux-rdma, linuxarm, linux-kernel, huangjunxian6
From: wenglianfa <wenglianfa@huawei.com>
Add support to dump SRQ resource in raw format.
This patch relies on the corresponding kernel commit aebf8145e11a
("RDMA/core: Add support to dump SRQ resource in RAW format")
Example:
$ rdma res show srq -r
dev hns3 149000...
$ rdma res show srq -j -r
[{"ifindex":0,"ifname":"hns3","data":[149,0,0,...]}]
Signed-off-by: wenglianfa <wenglianfa@huawei.com>
---
rdma/res-srq.c | 17 ++++++++++++++++-
rdma/res.h | 2 ++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/rdma/res-srq.c b/rdma/res-srq.c
index 186ae281..d2581a3f 100644
--- a/rdma/res-srq.c
+++ b/rdma/res-srq.c
@@ -162,6 +162,20 @@ out:
return -EINVAL;
}
+static int res_srq_line_raw(struct rd *rd, const char *name, int idx,
+ struct nlattr **nla_line)
+{
+ if (!nla_line[RDMA_NLDEV_ATTR_RES_RAW])
+ return MNL_CB_ERROR;
+
+ open_json_object(NULL);
+ print_dev(rd, idx, name);
+ print_raw_data(rd, nla_line);
+ newline(rd);
+
+ return MNL_CB_OK;
+}
+
static int res_srq_line(struct rd *rd, const char *name, int idx,
struct nlattr **nla_line)
{
@@ -276,7 +290,8 @@ int res_srq_parse_cb(const struct nlmsghdr *nlh, void *data)
if (ret != MNL_CB_OK)
break;
- ret = res_srq_line(rd, name, idx, nla_line);
+ ret = (rd->show_raw) ? res_srq_line_raw(rd, name, idx, nla_line) :
+ res_srq_line(rd, name, idx, nla_line);
if (ret != MNL_CB_OK)
break;
}
diff --git a/rdma/res.h b/rdma/res.h
index 70e51acd..e880c28b 100644
--- a/rdma/res.h
+++ b/rdma/res.h
@@ -39,6 +39,8 @@ static inline uint32_t res_get_command(uint32_t command, struct rd *rd)
return RDMA_NLDEV_CMD_RES_CQ_GET_RAW;
case RDMA_NLDEV_CMD_RES_MR_GET:
return RDMA_NLDEV_CMD_RES_MR_GET_RAW;
+ case RDMA_NLDEV_CMD_RES_SRQ_GET:
+ return RDMA_NLDEV_CMD_RES_SRQ_GET_RAW;
default:
return command;
}
--
2.30.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH iproute2-next 2/2] rdma: Add support to dump SRQ resource in raw format
2023-10-07 3:58 ` [PATCH iproute2-next 2/2] rdma: Add support to dump SRQ resource in raw format Junxian Huang
@ 2023-10-09 8:44 ` Leon Romanovsky
0 siblings, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2023-10-09 8:44 UTC (permalink / raw)
To: Junxian Huang
Cc: jgg, dsahern, stephen, netdev, linux-rdma, linuxarm, linux-kernel
On Sat, Oct 07, 2023 at 11:58:55AM +0800, Junxian Huang wrote:
> From: wenglianfa <wenglianfa@huawei.com>
>
> Add support to dump SRQ resource in raw format.
>
> This patch relies on the corresponding kernel commit aebf8145e11a
> ("RDMA/core: Add support to dump SRQ resource in RAW format")
>
> Example:
> $ rdma res show srq -r
> dev hns3 149000...
>
> $ rdma res show srq -j -r
> [{"ifindex":0,"ifname":"hns3","data":[149,0,0,...]}]
>
> Signed-off-by: wenglianfa <wenglianfa@huawei.com>
> ---
> rdma/res-srq.c | 17 ++++++++++++++++-
> rdma/res.h | 2 ++
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/rdma/res-srq.c b/rdma/res-srq.c
> index 186ae281..d2581a3f 100644
> --- a/rdma/res-srq.c
> +++ b/rdma/res-srq.c
> @@ -162,6 +162,20 @@ out:
> return -EINVAL;
> }
<...>
> static int res_srq_line(struct rd *rd, const char *name, int idx,
> struct nlattr **nla_line)
> {
> @@ -276,7 +290,8 @@ int res_srq_parse_cb(const struct nlmsghdr *nlh, void *data)
> if (ret != MNL_CB_OK)
> break;
>
> - ret = res_srq_line(rd, name, idx, nla_line);
> + ret = (rd->show_raw) ? res_srq_line_raw(rd, name, idx, nla_line) :
> + res_srq_line(rd, name, idx, nla_line);
You are missing same change in res_srq_idx_parse_cb(), see commit e2bbf737e61b ("rdma: Add support to get MR in raw format")
as an example.
Thanks
> if (ret != MNL_CB_OK)
> break;
> }
> diff --git a/rdma/res.h b/rdma/res.h
> index 70e51acd..e880c28b 100644
> --- a/rdma/res.h
> +++ b/rdma/res.h
> @@ -39,6 +39,8 @@ static inline uint32_t res_get_command(uint32_t command, struct rd *rd)
> return RDMA_NLDEV_CMD_RES_CQ_GET_RAW;
> case RDMA_NLDEV_CMD_RES_MR_GET:
> return RDMA_NLDEV_CMD_RES_MR_GET_RAW;
> + case RDMA_NLDEV_CMD_RES_SRQ_GET:
> + return RDMA_NLDEV_CMD_RES_SRQ_GET_RAW;
> default:
> return command;
> }
> --
> 2.30.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH iproute2-next 0/2] Add optional-counters binding support
@ 2025-03-19 8:25 Patrisious Haddad
2025-03-19 8:25 ` [PATCH iproute2-next 1/2] rdma: update uapi headers Patrisious Haddad
0 siblings, 1 reply; 7+ messages in thread
From: Patrisious Haddad @ 2025-03-19 8:25 UTC (permalink / raw)
To: leon, dsahern, stephen; +Cc: Patrisious Haddad, netdev, jgg, linux-rdma
Add optional-counters binding support together with new packets/bytes
counters. Previously optional-counters were on a per link basis, this
series allows users to bind optional-counters to a specific counter,
which allows tracking optional-counter over a specific QP group.
The support is added for both binding modes, automatic and manual,
in both cases the bound optional counters are those that are currently
configured over the link when trying to bind the QP.
In addition introduce four new optional-counters :
rdma_tx_bytes, rdma_tx_packets, rdma_rx_bytes, rdma_rx_packets
That just as their name implies allow tracking RDMA egress and ingress
traffic.
This is exposed to users through the iproute2 package which needs to be
updated as well to provide the support for this feature.
Example commands:
- rdma stat set link rocep8s0f0/1 optional-counters
rdma_tx_bytes,rdma_rx_packets
Enables rdma_tx_bytes and rdma_rx_packets optional-counters over
the link.
- rdma stat qp set link rocep8s0f0/1 auto type on optional-counters on
Enabled link automatic counter binding for QPs of same type,
with optional-counter binding support.
- rdma stat qp bind link rocep8s0f0/1 lqpn 134
Manually bind QP number 134 to all available counters.
- rdma stat qp bind link rocep8s0f0/1 lqpn 134 cntn 4
Manually bind QP number 134 to counter number 4 depending on its
configured counters.
Thanks
Patrisious Haddad (2):
rdma: update uapi headers
rdma: Add optional-counter option to rdma stat bind commands
man/man8/rdma-statistic.8 | 6 ++++
rdma/include/uapi/rdma/rdma_netlink.h | 2 ++
rdma/stat.c | 50 +++++++++++++++++++++++++--
rdma/utils.c | 1 +
4 files changed, 57 insertions(+), 2 deletions(-)
--
2.47.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH iproute2-next 1/2] rdma: update uapi headers
2025-03-19 8:25 [PATCH iproute2-next 0/2] Add optional-counters binding support Patrisious Haddad
@ 2025-03-19 8:25 ` Patrisious Haddad
0 siblings, 0 replies; 7+ messages in thread
From: Patrisious Haddad @ 2025-03-19 8:25 UTC (permalink / raw)
To: leon, dsahern, stephen
Cc: Patrisious Haddad, netdev, jgg, linux-rdma, Mark Bloch
Update rdma_netlink.h file upto kernel commit da3711074f52
("RDMA/core: Add support to optional-counters binding configuration")
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
---
rdma/include/uapi/rdma/rdma_netlink.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index 28404085..ec8c19ca 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -580,6 +580,8 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_EVENT_TYPE, /* u8 */
RDMA_NLDEV_SYS_ATTR_MONITOR_MODE, /* u8 */
+
+ RDMA_NLDEV_ATTR_STAT_OPCOUNTER_ENABLED, /* u8 */
/*
* Always the end
*/
--
2.47.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH iproute2-next 0/2] Add copy-on-fork to get sys command
@ 2021-04-28 11:42 Gal Pressman
2021-04-28 11:42 ` [PATCH iproute2-next 1/2] rdma: update uapi headers Gal Pressman
0 siblings, 1 reply; 7+ messages in thread
From: Gal Pressman @ 2021-04-28 11:42 UTC (permalink / raw)
To: David Ahern
Cc: linux-rdma, netdev, Yossi Leybovich, Alexander Matushevsky,
Leon Romanovsky, Jason Gunthorpe, Gal Pressman
This is the userspace part for the new copy-on-fork attribute added to
the get sys netlink command.
The new attribute indicates that the kernel copies DMA pages on fork,
hence fork support through madvise and MADV_DONTFORK is not needed.
Kernel series was merged:
https://lore.kernel.org/linux-rdma/20210418121025.66849-1-galpress@amazon.com/
Thanks
Gal Pressman (2):
rdma: update uapi headers
rdma: Add copy-on-fork to get sys command
rdma/include/uapi/rdma/rdma_netlink.h | 16 ++++++++++++++++
rdma/sys.c | 9 +++++++++
2 files changed, 25 insertions(+)
--
2.31.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH iproute2-next 1/2] rdma: update uapi headers
2021-04-28 11:42 [PATCH iproute2-next 0/2] Add copy-on-fork to get sys command Gal Pressman
@ 2021-04-28 11:42 ` Gal Pressman
0 siblings, 0 replies; 7+ messages in thread
From: Gal Pressman @ 2021-04-28 11:42 UTC (permalink / raw)
To: David Ahern
Cc: linux-rdma, netdev, Yossi Leybovich, Alexander Matushevsky,
Leon Romanovsky, Jason Gunthorpe, Gal Pressman
Update rdma_netlink.h file upto kernel commit
6cc9e215eb27 ("RDMA/nldev: Add copy-on-fork attribute to get sys command")
Signed-off-by: Gal Pressman <galpress@amazon.com>
---
rdma/include/uapi/rdma/rdma_netlink.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/rdma/include/uapi/rdma/rdma_netlink.h b/rdma/include/uapi/rdma/rdma_netlink.h
index 4aef76ae317b..37f583ee58fc 100644
--- a/rdma/include/uapi/rdma/rdma_netlink.h
+++ b/rdma/include/uapi/rdma/rdma_netlink.h
@@ -293,6 +293,10 @@ enum rdma_nldev_command {
RDMA_NLDEV_CMD_RES_MR_GET_RAW,
+ RDMA_NLDEV_CMD_RES_CTX_GET, /* can dump */
+
+ RDMA_NLDEV_CMD_RES_SRQ_GET, /* can dump */
+
RDMA_NLDEV_NUM_OPS
};
@@ -533,6 +537,18 @@ enum rdma_nldev_attr {
RDMA_NLDEV_ATTR_RES_RAW, /* binary */
+ RDMA_NLDEV_ATTR_RES_CTX, /* nested table */
+ RDMA_NLDEV_ATTR_RES_CTX_ENTRY, /* nested table */
+
+ RDMA_NLDEV_ATTR_RES_SRQ, /* nested table */
+ RDMA_NLDEV_ATTR_RES_SRQ_ENTRY, /* nested table */
+ RDMA_NLDEV_ATTR_RES_SRQN, /* u32 */
+
+ RDMA_NLDEV_ATTR_MIN_RANGE, /* u32 */
+ RDMA_NLDEV_ATTR_MAX_RANGE, /* u32 */
+
+ RDMA_NLDEV_SYS_ATTR_COPY_ON_FORK, /* u8 */
+
/*
* Always the end
*/
--
2.31.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-03-19 8:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-07 3:58 [PATCH iproute2-next 0/2] rdma: Support dumping SRQ resource in raw format Junxian Huang
2023-10-07 3:58 ` [PATCH iproute2-next 1/2] rdma: Update uapi headers Junxian Huang
2023-10-09 8:44 ` Leon Romanovsky
2023-10-07 3:58 ` [PATCH iproute2-next 2/2] rdma: Add support to dump SRQ resource in raw format Junxian Huang
2023-10-09 8:44 ` Leon Romanovsky
-- strict thread matches above, loose matches on Subject: below --
2025-03-19 8:25 [PATCH iproute2-next 0/2] Add optional-counters binding support Patrisious Haddad
2025-03-19 8:25 ` [PATCH iproute2-next 1/2] rdma: update uapi headers Patrisious Haddad
2021-04-28 11:42 [PATCH iproute2-next 0/2] Add copy-on-fork to get sys command Gal Pressman
2021-04-28 11:42 ` [PATCH iproute2-next 1/2] rdma: update uapi headers Gal Pressman
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).