From: "Minggang Li(Gavin)" <gavinl@nvidia.com>
To: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
<thomas@monjalon.net>, Dariusz Sosnowski <dsosnowski@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Suanming Mou <suanmingm@nvidia.com>
Cc: <dev@dpdk.org>, <rasland@nvidia.com>
Subject: [PATCH 5/7] common/mlx5: add RDMA monitor event awareness
Date: Mon, 23 Dec 2024 12:10:59 +0200 [thread overview]
Message-ID: <20241223101101.677449-6-gavinl@nvidia.com> (raw)
In-Reply-To: <20241223101101.677449-1-gavinl@nvidia.com>
RDMA monitor is a new feature introduced by kernel driver. This commit
adds backward compatibility for the kernels do not support it.
Signed-off-by: Minggang Li(Gavin) <gavinl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
drivers/common/mlx5/linux/meson.build | 10 ++++++++++
drivers/common/mlx5/linux/mlx5_nl.c | 17 +++++++++++++++++
2 files changed, 27 insertions(+)
diff --git a/drivers/common/mlx5/linux/meson.build b/drivers/common/mlx5/linux/meson.build
index 82e8046e0c..58d0328c6d 100644
--- a/drivers/common/mlx5/linux/meson.build
+++ b/drivers/common/mlx5/linux/meson.build
@@ -170,6 +170,16 @@ has_sym_args = [
'RDMA_NLDEV_ATTR_PORT_STATE' ],
[ 'HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX', 'rdma/rdma_netlink.h',
'RDMA_NLDEV_ATTR_NDEV_INDEX' ],
+ [ 'HAVE_RDMA_NL_GROUP_NOTIFY', 'rdma/rdma_netlink.h',
+ 'RDMA_NL_GROUP_NOTIFY' ],
+ [ 'HAVE_RDMA_NLDEV_CMD_SYS_GET', 'rdma/rdma_netlink.h',
+ 'RDMA_NLDEV_CMD_SYS_GET' ],
+ [ 'HAVE_RDMA_NLDEV_SYS_ATTR_MONITOR_MODE', 'rdma/rdma_netlink.h',
+ 'RDMA_NLDEV_SYS_ATTR_MONITOR_MODE' ],
+ [ 'HAVE_RDMA_NLDEV_ATTR_EVENT_TYPE', 'rdma/rdma_netlink.h',
+ 'RDMA_NLDEV_ATTR_EVENT_TYPE' ],
+ [ 'HAVE_RDMA_NLDEV_CMD_MONITOR', 'rdma/rdma_netlink.h',
+ 'RDMA_NLDEV_CMD_MONITOR' ],
[ 'HAVE_MLX5_DR_FLOW_DUMP', 'infiniband/mlx5dv.h',
'mlx5dv_dump_dr_domain'],
[ 'HAVE_MLX5_DR_CREATE_ACTION_FLOW_SAMPLE', 'infiniband/mlx5dv.h',
diff --git a/drivers/common/mlx5/linux/mlx5_nl.c b/drivers/common/mlx5/linux/mlx5_nl.c
index 745e443f8f..e03db4f918 100644
--- a/drivers/common/mlx5/linux/mlx5_nl.c
+++ b/drivers/common/mlx5/linux/mlx5_nl.c
@@ -84,6 +84,23 @@
#ifndef HAVE_RDMA_NLDEV_ATTR_NDEV_INDEX
#define RDMA_NLDEV_ATTR_NDEV_INDEX 50
#endif
+#ifndef HAVE_RDMA_NLDEV_ATTR_EVENT_TYPE
+#define RDMA_NLDEV_ATTR_EVENT_TYPE 102
+#define RDMA_NETDEV_ATTACH_EVENT 2
+#define RDMA_NETDEV_DETACH_EVENT 3
+#endif
+#ifndef HAVE_RDMA_NLDEV_SYS_ATTR_MONITOR_MODE
+#define RDMA_NLDEV_SYS_ATTR_MONITOR_MODE 103
+#endif
+#ifndef HAVE_RDMA_NLDEV_CMD_MONITOR
+#define RDMA_NLDEV_CMD_MONITOR 28
+#endif
+#ifndef HAVE_RDMA_NLDEV_CMD_SYS_GET
+#define RDMA_NLDEV_CMD_SYS_GET 6
+#endif
+#ifndef HAVE_RDMA_NL_GROUP_NOTIFY
+#define RDMA_NL_GROUP_NOTIFY 4
+#endif
/* These are normally found in linux/if_link.h. */
#ifndef HAVE_IFLA_NUM_VF
--
2.34.1
next prev parent reply other threads:[~2024-12-23 10:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-23 10:10 [PATCH V1 0/7] port probe time optimization Minggang Li(Gavin)
2024-12-23 10:10 ` [PATCH 1/7] mailmap: update user name Minggang Li(Gavin)
2024-12-23 10:10 ` [PATCH 2/7] net/mlx5: optimize device probing Minggang Li(Gavin)
2024-12-23 10:10 ` [PATCH 3/7] net/mlx5: add new devargs to control probe optimization Minggang Li(Gavin)
2024-12-23 10:10 ` [PATCH 4/7] common/mlx5: fix Netlink socket leak Minggang Li(Gavin)
2024-12-23 10:10 ` Minggang Li(Gavin) [this message]
2024-12-23 10:11 ` [PATCH 6/7] mlx5: use RDMA Netlink to update port information Minggang Li(Gavin)
2024-12-23 10:11 ` [PATCH 7/7] mlx5: add backward compatibility for RDMA monitor Minggang Li(Gavin)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241223101101.677449-6-gavinl@nvidia.com \
--to=gavinl@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=suanmingm@nvidia.com \
--cc=thomas@monjalon.net \
--cc=viacheslavo@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).