From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
Suanming Mou <suanmingm@nvidia.com>,
Matan Azrad <matan@nvidia.com>
Cc: <dev@dpdk.org>
Subject: [PATCH 26.07 1/5] common/mlx5: query vport VHCA ID
Date: Wed, 25 Mar 2026 10:07:53 +0100 [thread overview]
Message-ID: <20260325090758.42403-2-dsosnowski@nvidia.com> (raw)
In-Reply-To: <20260325090758.42403-1-dsosnowski@nvidia.com>
Extend port info returned by mlx5_glue_devx_port_query()
with VHCA ID of the device related to the IB port.
This ID will be later used to implement source vport matching
without E-Switch vport metadata enabled.
Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
drivers/common/mlx5/linux/mlx5_glue.c | 4 ++++
drivers/common/mlx5/linux/mlx5_glue.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/drivers/common/mlx5/linux/mlx5_glue.c b/drivers/common/mlx5/linux/mlx5_glue.c
index a91eaa429d..56eaedf0a2 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.c
+++ b/drivers/common/mlx5/linux/mlx5_glue.c
@@ -1263,6 +1263,10 @@ mlx5_glue_devx_port_query(struct ibv_context *ctx,
info->vport_id = devx_port.vport;
info->query_flags |= MLX5_PORT_QUERY_VPORT;
}
+ if (devx_port.flags & MLX5DV_QUERY_PORT_VPORT_VHCA_ID) {
+ info->vport_vhca_id = devx_port.vport_vhca_id;
+ info->query_flags |= MLX5_PORT_QUERY_VPORT_VHCA_ID;
+ }
if (devx_port.flags & MLX5DV_QUERY_PORT_ESW_OWNER_VHCA_ID) {
info->esw_owner_vhca_id = devx_port.esw_owner_vhca_id;
info->query_flags |= MLX5_PORT_QUERY_ESW_OWNER_VHCA_ID;
diff --git a/drivers/common/mlx5/linux/mlx5_glue.h b/drivers/common/mlx5/linux/mlx5_glue.h
index 81d6b0aaf9..0610e7778e 100644
--- a/drivers/common/mlx5/linux/mlx5_glue.h
+++ b/drivers/common/mlx5/linux/mlx5_glue.h
@@ -92,11 +92,13 @@ struct mlx5dv_port;
#define MLX5_PORT_QUERY_VPORT (1u << 0)
#define MLX5_PORT_QUERY_REG_C0 (1u << 1)
#define MLX5_PORT_QUERY_ESW_OWNER_VHCA_ID (1u << 2)
+#define MLX5_PORT_QUERY_VPORT_VHCA_ID (1u << 3)
struct mlx5_port_info {
uint16_t query_flags;
uint16_t vport_id; /* Associated VF vport index (if any). */
uint16_t esw_owner_vhca_id; /* Associated the esw_owner that this VF belongs to. */
+ uint16_t vport_vhca_id; /* VHCA ID of the function associated with the vport. */
uint32_t vport_meta_tag; /* Used for vport index match ove VF LAG. */
uint32_t vport_meta_mask; /* Used for vport index field match mask. */
};
--
2.47.3
next prev parent reply other threads:[~2026-03-25 9:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 9:07 [PATCH 26.07 0/5] net/mlx5: legacy vport match support with HWS Dariusz Sosnowski
2026-03-25 9:07 ` Dariusz Sosnowski [this message]
2026-03-25 9:07 ` [PATCH 26.07 2/5] net/mlx5: store port VHCA ID Dariusz Sosnowski
2026-03-25 9:07 ` [PATCH 26.07 3/5] net/mlx5: return port info regardless of register mask Dariusz Sosnowski
2026-03-25 9:07 ` [PATCH 26.07 4/5] net/mlx5/hws: add source vport match in HWS Dariusz Sosnowski
2026-03-25 9:07 ` [PATCH 26.07 5/5] net/mlx5: allow legacy source vport match Dariusz Sosnowski
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=20260325090758.42403-2-dsosnowski@nvidia.com \
--to=dsosnowski@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=suanmingm@nvidia.com \
--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