Skip to content

Commit

Permalink
net/mlx5: fix secondary process query stats segfault
Browse files Browse the repository at this point in the history
The "outer_of_buffer" counter is owned by the primary process devx
object and it is pointer by pointer in mlx5_priv structure. Actually,
there are 4 levels' pointers in this piece of code.

The secondary process can't access this part directly since it belongs
to another process' heap.

Return ENOTSUP as workaround.

Signed-off-by: Rongwei Liu <rongweil@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Fixes: 750e48c ("common/mlx5: add DevX commands for queue counters")
Cc: matan@nvidia.com
Cc: stable@dpdk.org
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
lrw514 authored and ovsrobot committed Jan 22, 2024
1 parent f1631b9 commit b9a8a39
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/mlx5/linux/mlx5_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -2993,9 +2993,15 @@ mlx5_os_read_dev_stat(struct mlx5_priv *priv, const char *ctr_name,

if (priv->sh) {
if (priv->q_counters != NULL &&
strcmp(ctr_name, "out_of_buffer") == 0)
strcmp(ctr_name, "out_of_buffer") == 0) {
if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
DRV_LOG(WARNING, "Devx out_of_buffer counter is not supported in the secondary process");
rte_errno = ENOTSUP;
return 1;
}
return mlx5_devx_cmd_queue_counter_query
(priv->q_counters, 0, (uint32_t *)stat);
}
MKSTR(path, "%s/ports/%d/hw_counters/%s",
priv->sh->ibdev_path,
priv->dev_port,
Expand Down

0 comments on commit b9a8a39

Please sign in to comment.