net/mlx5: support Flow Tag and Packet Header miniCQEs
PATCH v2 1/1 net/mlx5: support Flow Tag and Packet Header miniCQEs
CQE compression allows us to save the PCI bandwidth and improve the performance by compressing several CQEs together to a miniCQE. But the miniCQE size is only 8 bytes and this limits the ability to successfully keep the compression session in case of various traffic patterns.
The current miniCQE format only keeps the compression session alive in case of uniform traffic with the Hash RSS as the only difference. There are requests to keep the compression session in case of tagged traffic by RTE Flow Mark Id and mixed UDP/TCP and IPv4/IPv6 traffic. Add 2 new miniCQE formats in order to achieve the best performance for these traffic patterns: Flow Tag and Packet Header miniCQEs.
The existing rxq_cqe_comp_en devarg is modified to specify the desired miniCQE format. Specifying 2 selects Flow Tag format for better compression rate in case of RTE Flow Mark traffic. Specifying 3 selects Checksum format (existing format for MPRQ). Specifying 4 selects L3/L4 Header format for better compression rate in case of mixed TCP/UDP and IPv4/IPv6 traffic.
---
v1: https://patchwork.dpdk.org/patch/82500/
added ARM and PowerPC support, reworked x86 code
--- doc/guides/nics/mlx5.rst | 8 + doc/guides/rel_notes/release_20_11.rst | 2 + drivers/common/mlx5/mlx5_devx_cmds.c | 7 +- drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 27 ++- drivers/net/mlx5/mlx5.c | 7 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_devx.c | 44 +++-- drivers/net/mlx5/mlx5_rxtx.c | 151 +++++++++------ drivers/net/mlx5/mlx5_rxtx.h | 2 + drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 223 ++++++++++++++++++++++- drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 141 +++++++++++++- drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 167 ++++++++++++++--- 13 files changed, 675 insertions(+), 106 deletions(-)
doc/guides/nics/mlx5.rst +8 -0
@@ -432,6 +432,14 @@ Driver options A nonzero value enables the compression of CQE on RX side. This feature allows to save PCI bandwidth and improve performance. Enabled by default. + Different compression formats are supported in order to achieve the best + performance for different traffic patterns. Hash RSS format is the default. + + Specifying 2 as a ``rxq_cqe_comp_en`` value selects Flow Tag format for + better compression rate in case of RTE Flow Mark traffic. + Specifying 3 as a ``rxq_cqe_comp_en`` value selects Checksum format. + Specifying 4 as a ``rxq_cqe_comp_en`` value selects L3/L4 Header format for + better compression rate in case of mixed TCP/UDP and IPv4/IPv6 traffic. Supported on:
doc/guides/rel_notes/release_20_11.rst +2 -0
@@ -231,6 +231,8 @@ New Features * Added support for the new vlan fields ``has_vlan`` in the eth item and ``has_more_vlan`` in the vlan item. * Added support for PMD level multiple-thread flow insertion. + * Added vectorized Multi-Packet Rx Queue burst. + * Added support for 2 new miniCQE formats: Flow Tag and L3/L4 header. Updated Mellanox mlx5 vDPA driver:
drivers/common/mlx5/mlx5_devx_cmds.c +5 -2
@@ -1565,8 +1565,11 @@ mlx5_devx_cmd_create_cq(void *ctx, struct mlx5_devx_cq_attr *attr) MLX5_ADAPTER_PAGE_SHIFT);MLX5_SET (cqc, cqctx, c_eqn, attr->eqn);MLX5_SET (cqc, cqctx, uar_page, attr->uar_page_id); -MLX5_SET (cqc, cqctx, cqe_comp_en, attr->cqe_comp_en); -MLX5_SET (cqc, cqctx, mini_cqe_res_format, attr->mini_cqe_res_format); +MLX5_SET (cqc, cqctx, cqe_comp_en, !!attr->cqe_comp_en); +MLX5_SET (cqc, cqctx, mini_cqe_res_format, + attr->mini_cqe_res_format); +MLX5_SET (cqc, cqctx, mini_cqe_res_format_ext, + attr->mini_cqe_res_format_ext);MLX5_SET (cqc, cqctx, cqe_sz, attr->cqe_size);if (attr->q_umem_valid) {MLX5_SET (create_cq_in, in, cq_umem_valid, attr->q_umem_valid);
drivers/common/mlx5/mlx5_devx_cmds.h +1 -0
@@ -256,6 +256,7 @@ struct mlx5_devx_cq_attr { uint32_t overrun_ignore:1; uint32_t cqe_comp_en:1; uint32_t mini_cqe_res_format:2; + uint32_t mini_cqe_res_format_ext:2; uint32_t cqe_size:3; uint32_t log_cq_size:5; uint32_t log_page_size:5;
drivers/common/mlx5/mlx5_prm.h +22 -5
@@ -239,6 +239,9 @@/* Default mark mask for metadata legacy mode. */ #define MLX5_FLOW_MARK_MASK 0xffffff +/* Byte length mask when mark is enable in miniCQE */ +#define MLX5_LEN_WITH_MARK_MASK 0xffffff00 +/* Maximum number of DS in WQE. Limited by 6-bit field. */ #define MLX5_DSEG_MAX 63
@@ -2152,11 +2155,14 @@ struct mlx5_ifc_cqc_bits {u8 cqe_comp_en[0x1 ];u8 mini_cqe_res_format[0x2 ];u8 st[0x4 ]; -u8 reserved_at_18[0x8 ]; +u8 reserved_at_18[0x1 ]; +u8 cqe_comp_layout[0x7 ];u8 dbr_umem_id[0x20 ];u8 reserved_at_40[0x14 ];u8 page_offset[0x6 ]; -u8 reserved_at_5a[0x6 ]; +u8 reserved_at_5a[0x2 ]; +u8 mini_cqe_res_format_ext[0x2 ]; +u8 cq_timestamp_format[0x2 ];u8 reserved_at_60[0x3 ];u8 log_cq_size[0x5 ];u8 uar_page[0x18 ];
@@ -2918,7 +2924,14 @@ struct mlx5_mini_cqe8 {union {uint32_t rx_hash_result;struct { -uint16_t checksum; +union { +uint16_t checksum; +uint16_t flow_tag_high; +struct { +uint8_t reserved; +uint8_t hdr_type; + }; + };uint16_t stride_idx; };struct {
@@ -2927,15 +2940,19 @@ struct mlx5_mini_cqe8 {uint8_t reserved; } s_wqe_info; }; -uint32_t byte_cnt; +union { +uint32_t byte_cnt_flow; +uint32_t byte_cnt; + }; };/* Mini CQE responder format. */ enum {MLX5_CQE_RESP_FORMAT_HASH =0x0 ,MLX5_CQE_RESP_FORMAT_CSUM =0x1 , -MLX5_CQE_RESP_FORMAT_CSUM_FLOW_TAG =0x2 , +MLX5_CQE_RESP_FORMAT_FTAG_STRIDX =0x2 ,MLX5_CQE_RESP_FORMAT_CSUM_STRIDX =0x3 , +MLX5_CQE_RESP_FORMAT_L34H_STRIDX =0x4 , };/* srTCM PRM flow meter parameters. */
drivers/net/mlx5/mlx5.c +7 -0
@@ -1361,7 +1361,14 @@ mlx5_args_check(const char *key, const char *val, void *opaque) } mod = tmp >=0 ? tmp : -tmp;if (strcmp (MLX5_RXQ_CQE_COMP_EN , key) ==0 ) { +if (tmp >MLX5_CQE_RESP_FORMAT_L34H_STRIDX ) { +DRV_LOG (ERR ,"invalid CQE compression " +"format parameter" ); + rte_errno =EINVAL ; +return -rte_errno; + } config->cqe_comp = !!tmp; + config->cqe_comp_fmt = tmp; }else if (strcmp (MLX5_RXQ_CQE_PAD_EN , key) ==0 ) { config->cqe_pad = !!tmp; }else if (strcmp (MLX5_RXQ_PKT_PAD_EN , key) ==0 ) {
drivers/net/mlx5/mlx5.h +1 -0
@@ -205,6 +205,7 @@ struct mlx5_dev_config {/* Whether tunnel stateless offloads are supported. */ unsigned int mpls_en:1; /* MPLS over GRE/UDP is enabled. */ unsigned int cqe_comp:1; /* CQE compression is enabled. */ + unsigned int cqe_comp_fmt:3; /* CQE compression format. */ unsigned int cqe_pad:1; /* CQE padding is enabled. */ unsigned int tso:1; /* Whether TSO is supported. */ unsigned int rx_vec_en:1; /* Rx vector is enabled. */
drivers/net/mlx5/mlx5_devx.c +33 -11
50 lines not on this page · raw message
drivers/net/mlx5/mlx5_rxtx.c +99 -52
288 lines not on this page · raw message
drivers/net/mlx5/mlx5_rxtx.h +2 -0
@@ -126,6 +126,7 @@ struct mlx5_rxq_data { unsigned int strd_scatter_en:1; /* Scattered packets from a stride. */ unsigned int lro:1; /* Enable LRO. */ unsigned int dynf_meta:1; /* Dynamic metadata is configured. */ + unsigned int mcqe_format:3; /* Dynamic metadata is configured. */volatile uint32_t *rq_db;volatile uint32_t *cq_db;uint16_t port_id;
@@ -135,6 +136,7 @@ struct mlx5_rxq_data {uint32_t rq_pi;uint32_t cq_ci;uint16_t rq_repl_thresh;/* Threshold for buffer replenishment. */ +uint32_t byte_mask;union {struct rxq_zip zip;/* Compressed context. */ uint16_t decompressed;
drivers/net/mlx5/mlx5_rxtx_vec_altivec.h +214 -9
243 lines not on this page · raw message
drivers/net/mlx5/mlx5_rxtx_vec_neon.h +135 -6
153 lines not on this page · raw message
drivers/net/mlx5/mlx5_rxtx_vec_sse.h +146 -21
197 lines not on this page · raw message
Signature · 1 line
2.24.1
Hi,
Quoted 39 lines
-----Original Message-----
From: Alexander Kozyrev <[email protected]>
Sent: Sunday, November 1, 2020 6:15 PM
To: [email protected]
Cc: Raslan Darawsheh <[email protected]>; Slava Ovsiienko <[email protected]>; Matan Azrad <[email protected]>
Subject: [PATCH v2] net/mlx5: support Flow Tag and Packet Header miniCQEsCQE compression allows us to save the PCI bandwidth and improve the performance by compressing several CQEs together to a miniCQE. But the miniCQE size is only 8 bytes and this limits the ability to successfully keep the compression session in case of various traffic patterns.
The current miniCQE format only keeps the compression session alive in case of uniform traffic with the Hash RSS as the only difference. There are requests to keep the compression session in case of tagged traffic by RTE Flow Mark Id and mixed UDP/TCP and IPv4/IPv6 traffic. Add 2 new miniCQE formats in order to achieve the best performance for these traffic patterns: Flow Tag and Packet Header miniCQEs.
The existing
rxq_cqe_comp_endevarg is modified to specify the desired miniCQE format. Specifying 2 selects Flow Tag format for better compression rate in case of RTE Flow Mark traffic. Specifying 3 selects Checksum format (existing format for MPRQ). Specifying 4 selects L3/L4 Header format for better compression rate in case of mixed TCP/UDP and IPv4/IPv6 traffic.Signed-off-by Alexander Kozyrev <[email protected]>---
v1:
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc
hwork.dpdk.org%2Fpatch%2F82500%2F&data=04%7C01%7Crasland%40 nvidia.com%7C396c0aafa96b4d3bd57808d87e813f93%7C43083d15727340c1b7 db39efd9ccc17a%7C0%7C0%7C637398440875666226%7CUnknown%7CTWFpb GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI 6Mn0%3D%7C1000&sdata=DuD7YpUNTqLAqTrcRVaGSm%2F4F6gtWK1I q8Zh6lcvwtA%3D&reserved=0
added ARM and PowerPC support, reworked x86 code
Quoted 17 lines
--- doc/guides/nics/mlx5.rst | 8 + doc/guides/rel_notes/release_20_11.rst | 2 + drivers/common/mlx5/mlx5_devx_cmds.c | 7 +- drivers/common/mlx5/mlx5_devx_cmds.h | 1 + drivers/common/mlx5/mlx5_prm.h | 27 ++- drivers/net/mlx5/mlx5.c | 7 + drivers/net/mlx5/mlx5.h | 1 + drivers/net/mlx5/mlx5_devx.c | 44 +++-- drivers/net/mlx5/mlx5_rxtx.c | 151 +++++++++------ drivers/net/mlx5/mlx5_rxtx.h | 2 + drivers/net/mlx5/mlx5_rxtx_vec_altivec.h | 223 ++++++++++++++++++++++- drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 141 +++++++++++++- drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 167 ++++++++++++++--- 13 files changed, 675 insertions(+), 106 deletions(-)
Patch applied to next-net-mlx,
Kindest regards,
Raslan Darawsheh