From: Tal Shnaiderman <talshn@nvidia.com>
To: <dev@dpdk.org>
Cc: <thomas@monjalon.net>, <matan@nvidia.com>
Subject: [RFC PATCH 3/3] net/mlx5: support enhanced multi-packet write on Windows
Date: Tue, 12 Apr 2022 18:00:00 +0300 [thread overview]
Message-ID: <20220412150000.3412-4-talshn@nvidia.com> (raw)
In-Reply-To: <20220412150000.3412-1-talshn@nvidia.com>
Add support for enhanced multi-packet write on Windows.
Enhanced multi-packet write allows the Tx burst function to pack up
multiple packets in a single descriptor session to save PCI bandwidth
and improve performance.
The feature can be controlled by the txq_mpw_en PMD argument:
txq_mpw_en=1 - PMD will first attempt to use "enhanced multi packet write"
if the feature is not supported by the HW the legacy "multi packet write"
will be used.
if both are unsupported the multi packet write feature is disabled.
txq_mpw_en=0 - multi packet write is disabled.
txq_mpw_en unset(default) - enhanced multi packet write
will be activated if supported.
if unsupported the multi packet write feature is disabled.
Signed-off-by: Tal Shnaiderman <talshn@nvidia.com>
---
drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++++
drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++
drivers/net/mlx5/windows/mlx5_os.c | 14 ++++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c
index a109341d02..c6fc59dbbe 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.c
+++ b/drivers/common/mlx5/mlx5_devx_cmds.c
@@ -1119,6 +1119,12 @@ mlx5_devx_cmd_query_hca_attr(void *ctx,
attr->rss_ind_tbl_cap = MLX5_GET
(per_protocol_networking_offload_caps,
hcattr, rss_ind_tbl_cap);
+ attr->multi_pkt_send_wqe = MLX5_GET
+ (per_protocol_networking_offload_caps,
+ hcattr, multi_pkt_send_wqe);
+ attr->enhanced_multi_pkt_send_wqe = MLX5_GET
+ (per_protocol_networking_offload_caps,
+ hcattr, enhanced_multi_pkt_send_wqe);
/* Query HCA attribute for ROCE. */
if (attr->roce) {
hcattr = mlx5_devx_get_hca_cap(ctx, in, out, &rc,
diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h
index 6413176f2e..db6f1b2e71 100644
--- a/drivers/common/mlx5/mlx5_devx_cmds.h
+++ b/drivers/common/mlx5/mlx5_devx_cmds.h
@@ -259,6 +259,8 @@ struct mlx5_hca_attr {
uint32_t striding_rq:1;
uint32_t ext_stride_num_range:1;
uint32_t cqe_compression_128:1;
+ uint32_t multi_pkt_send_wqe:1;
+ uint32_t enhanced_multi_pkt_send_wqe:1;
};
/* LAG Context. */
diff --git a/drivers/net/mlx5/windows/mlx5_os.c b/drivers/net/mlx5/windows/mlx5_os.c
index 232f22232b..a99f4ea183 100644
--- a/drivers/net/mlx5/windows/mlx5_os.c
+++ b/drivers/net/mlx5/windows/mlx5_os.c
@@ -173,8 +173,6 @@ mlx5_os_capabilities_prepare(struct mlx5_dev_ctx_shared *sh)
sh->dev_cap.max_qp = 1 << hca_attr->log_max_qp;
sh->dev_cap.max_qp_wr = 1 << hca_attr->log_max_qp_sz;
sh->dev_cap.dv_flow_en = 1;
- sh->dev_cap.mps = MLX5_MPW_DISABLED;
- DRV_LOG(DEBUG, "MPW isn't supported.");
DRV_LOG(DEBUG, "MPLS over GRE/UDP tunnel offloading is no supported.");
sh->dev_cap.hw_csum = hca_attr->csum_cap;
DRV_LOG(DEBUG, "Checksum offloading is %ssupported.",
@@ -224,6 +222,18 @@ mlx5_os_capabilities_prepare(struct mlx5_dev_ctx_shared *sh)
DRV_LOG(DEBUG, "Maximum Rx indirection table size is %u",
sh->dev_cap.ind_table_max_size);
}
+ if (hca_attr->enhanced_multi_pkt_send_wqe) {
+ sh->dev_cap.mps = MLX5_MPW_ENHANCED;
+ DRV_LOG(DEBUG, "Enhanced MPW is supported.");
+ }
+ else if (hca_attr->multi_pkt_send_wqe &&
+ sh->dev_cap.mps != MLX5_ARG_UNSET) {
+ sh->dev_cap.mps = MLX5_MPW;
+ DRV_LOG(DEBUG, "MPW is supported.");
+ } else {
+ sh->dev_cap.mps = MLX5_MPW_DISABLED;
+ DRV_LOG(DEBUG, "MPW isn't supported.");
+ }
sh->dev_cap.swp = mlx5_get_supported_sw_parsing_offloads(hca_attr);
sh->dev_cap.tunnel_en = mlx5_get_supported_tunneling_offloads(hca_attr);
if (sh->dev_cap.tunnel_en) {
--
2.16.1.windows.4
prev parent reply other threads:[~2022-04-12 15:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-12 14:59 [RFC PATCH 0/3] Windows performance enhancements Tal Shnaiderman
2022-04-12 14:59 ` [RFC PATCH 1/3] net/mlx5: support multi-packet RQ on Windows Tal Shnaiderman
2022-04-12 14:59 ` [RFC PATCH 2/3] net/mlx5: support CQE compression " Tal Shnaiderman
2022-04-12 15:00 ` Tal Shnaiderman [this message]
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=20220412150000.3412-4-talshn@nvidia.com \
--to=talshn@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=thomas@monjalon.net \
/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).