* [dpdk-stable] [PATCH 01/18] net/mlx5/windows: fix miss callback register for mem event
[not found] <20210930172822.1949969-1-michaelba@nvidia.com>
@ 2021-09-30 17:28 ` michaelba
[not found] ` <20211006220350.2357487-1-michaelba@nvidia.com>
1 sibling, 0 replies; 3+ messages in thread
From: michaelba @ 2021-09-30 17:28 UTC (permalink / raw)
To: dev; +Cc: Matan Azrad, Thomas Monjalon, Michael Baum, stable
From: Michael Baum <michaelba@oss.nvidia.com>
In device initialization, the driver registers to free hugepages events.
When husepage is released, this callback frees all its related MRs.
In Windows initialization, this callback is not registered what may
cause to use invalid memory.
This patch adds memory event callback registration in Windows
initialization.
Fixes: 980826dc6f0f ("net/mlx5: probe on Windows")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@oss.nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/windows/mlx5_os.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 149253d174..459414d5c2 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -122,8 +122,21 @@ mlx5_init_shared_data(void)
static int
mlx5_init_once(void)
{
+ struct mlx5_shared_data *sd;
+
if (mlx5_init_shared_data())
return -rte_errno;
+ sd = mlx5_shared_data;
+ rte_spinlock_lock(&sd->lock);
+ MLX5_ASSERT(sd);
+ if (!sd->init_done) {
+ LIST_INIT(&sd->mem_event_cb_list);
+ rte_rwlock_init(&sd->mem_event_rwlock);
+ rte_mem_event_callback_register("MLX5_MEM_EVENT_CB",
+ mlx5_mr_mem_event_cb, NULL);
+ sd->init_done = true;
+ }
+ rte_spinlock_unlock(&sd->lock);
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-stable] [PATCH v2 01/18] net/mlx5/windows: fix miss callback register for mem event
[not found] ` <20211006220350.2357487-1-michaelba@nvidia.com>
@ 2021-10-06 22:03 ` michaelba
[not found] ` <20211019205602.3188203-1-michaelba@nvidia.com>
1 sibling, 0 replies; 3+ messages in thread
From: michaelba @ 2021-10-06 22:03 UTC (permalink / raw)
To: dev; +Cc: Matan Azrad, Thomas Monjalon, Michael Baum, stable
From: Michael Baum <michaelba@oss.nvidia.com>
In device initialization, the driver registers to free hugepages events.
When husepage is released, this callback frees all its related MRs.
In Windows initialization, this callback is not registered what may
cause to use invalid memory.
This patch adds memory event callback registration in Windows
initialization.
Fixes: 980826dc6f0f ("net/mlx5: probe on Windows")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@oss.nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/windows/mlx5_os.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 149253d174..459414d5c2 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -122,8 +122,21 @@ mlx5_init_shared_data(void)
static int
mlx5_init_once(void)
{
+ struct mlx5_shared_data *sd;
+
if (mlx5_init_shared_data())
return -rte_errno;
+ sd = mlx5_shared_data;
+ rte_spinlock_lock(&sd->lock);
+ MLX5_ASSERT(sd);
+ if (!sd->init_done) {
+ LIST_INIT(&sd->mem_event_cb_list);
+ rte_rwlock_init(&sd->mem_event_rwlock);
+ rte_mem_event_callback_register("MLX5_MEM_EVENT_CB",
+ mlx5_mr_mem_event_cb, NULL);
+ sd->init_done = true;
+ }
+ rte_spinlock_unlock(&sd->lock);
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [dpdk-stable] [PATCH v3 01/18] net/mlx5/windows: fix miss callback register for mem event
[not found] ` <20211019205602.3188203-1-michaelba@nvidia.com>
@ 2021-10-19 20:55 ` michaelba
0 siblings, 0 replies; 3+ messages in thread
From: michaelba @ 2021-10-19 20:55 UTC (permalink / raw)
To: dev; +Cc: Matan Azrad, Thomas Monjalon, Michael Baum, stable
From: Michael Baum <michaelba@oss.nvidia.com>
In device initialization, the driver registers to free hugepages events.
When husepage is released, this callback frees all its related MRs.
In Windows initialization, this callback is not registered what may
cause to use invalid memory.
This patch adds memory event callback registration in Windows
initialization.
Fixes: 980826dc6f0f ("net/mlx5: probe on Windows")
Cc: stable@dpdk.org
Signed-off-by: Michael Baum <michaelba@oss.nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
drivers/net/mlx5/windows/mlx5_os.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 149253d174..459414d5c2 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -122,8 +122,21 @@ mlx5_init_shared_data(void)
static int
mlx5_init_once(void)
{
+ struct mlx5_shared_data *sd;
+
if (mlx5_init_shared_data())
return -rte_errno;
+ sd = mlx5_shared_data;
+ rte_spinlock_lock(&sd->lock);
+ MLX5_ASSERT(sd);
+ if (!sd->init_done) {
+ LIST_INIT(&sd->mem_event_cb_list);
+ rte_rwlock_init(&sd->mem_event_rwlock);
+ rte_mem_event_callback_register("MLX5_MEM_EVENT_CB",
+ mlx5_mr_mem_event_cb, NULL);
+ sd->init_done = true;
+ }
+ rte_spinlock_unlock(&sd->lock);
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-19 20:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20210930172822.1949969-1-michaelba@nvidia.com>
2021-09-30 17:28 ` [dpdk-stable] [PATCH 01/18] net/mlx5/windows: fix miss callback register for mem event michaelba
[not found] ` <20211006220350.2357487-1-michaelba@nvidia.com>
2021-10-06 22:03 ` [dpdk-stable] [PATCH v2 " michaelba
[not found] ` <20211019205602.3188203-1-michaelba@nvidia.com>
2021-10-19 20:55 ` [dpdk-stable] [PATCH v3 " michaelba
patches for DPDK stable branches
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
stable@dpdk.org
public-inbox-index stable
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://inbox.dpdk.org/inbox.dpdk.stable
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git