Expand NIC offloads support on Windows
cover Expand NIC offloads support on Windows
The series supports a group of NIC offloads on Windows:
DEV_TX_OFFLOAD_TCP_TSODEV_TX_OFFLOAD_VXLAN_TNL_TSODEV_TX_OFFLOAD_GRE_TNL_TSODEV_TX_OFFLOAD_GENEVE_TNL_TSODEV_RX_OFFLOAD_VLAN_STRIPDEV_RX_OFFLOAD_KEEP_CRC
Tal Shnaiderman (12):
net/mlx5: fix software parsing support query common/mlx5: read software parsing capabilities from DevX net/mlx5: query software parsing support on Windows net/mlx5: fix tunneling support query common/mlx5: read tunneling capabilities from DevX net/mlx5: query tunneling support on Windows common/mlx5: read TSO capability from DevX net/mlx5: support TSO offload on Windows common/mlx5: read VLAN capability from DevX net/mlx5: support VLAN stripping offload on Windows common/mlx5: read FCS scattering capability from DevX net/mlx5: support keep-CRC offload on Windows
drivers/common/mlx5/mlx5_devx_cmds.c | 18 +++++++++++++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 8 ++++++++ drivers/net/mlx5/linux/mlx5_os.c | 9 ++++----- drivers/net/mlx5/linux/mlx5_os.h | 27 +++++++++++++++++++++++++ drivers/net/mlx5/mlx5.c | 30 +++++++++++++++++++++++++++ drivers/net/mlx5/mlx5.h | 8 ++++++-- drivers/net/mlx5/mlx5_txq.c | 39 ++++++++++++++++++++++++++---------- drivers/net/mlx5/windows/mlx5_os.c | 16 ++++++++++++--- drivers/net/mlx5/windows/mlx5_os.h | 11 ++++++++++ 9 files changed, 145 insertions(+), 21 deletions(-)
Signature · 1 line
2.16.1.windows.4
RFC PATCH 1/12 net/mlx5: fix software parsing support query
Currently, the PMD decides if the software parsing offload can enable outer IPv4 checksum and tunneled TSO support by checking config->hw_csum and config->tso respectively.
This is incorrect, the right way is to check the following flags returned by the mlx5dv_query_device function:
MLX5DV_SW_PARSING - check general swp support. MLX5DV_SW_PARSING_CSUM - check swp checksum support. MLX5DV_SW_PARSING_LSO - check swp LSO/TSO support.
The fix enables the offloads according to the correct flags returned by the kernel.
--- drivers/net/mlx5/linux/mlx5_os.c | 3 ++- drivers/net/mlx5/linux/mlx5_os.h | 12 ++++++++++++ drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_txq.c | 15 +++++++++------ 4 files changed, 24 insertions(+), 8 deletions(-)
drivers/net/mlx5/linux/mlx5_os.c +2 -1
@@ -1112,7 +1112,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, swp = dv_attr.sw_parsing_caps.sw_parsing_offloads;DRV_LOG (DEBUG ,"SWP support: %u" , swp);#endif - config->swp = !!swp; + config->swp = swp & (MLX5_SW_PARSING_CAP |MLX5_SW_PARSING_CSUM_CAP | +MLX5_SW_PARSING_TSO_CAP );#ifdef HAVE_IBV_DEVICE_STRIDING_RQ_SUPPORT if (dv_attr.comp_mask &MLX5DV_CONTEXT_MASK_STRIDING_RQ ) { struct mlx5dv_striding_rq_caps mprq_caps =
drivers/net/mlx5/linux/mlx5_os.h +12 -0
@@ -21,4 +21,16 @@ enum {int mlx5_auxiliary_get_ifindex (const char *sf_name); + +enum mlx5_sw_parsing_offloads { +#ifdef HAVE_IBV_MLX5_MOD_SWP +MLX5_SW_PARSING_CAP =MLX5DV_SW_PARSING , +MLX5_SW_PARSING_CSUM_CAP =MLX5DV_SW_PARSING_CSUM , +MLX5_SW_PARSING_TSO_CAP =MLX5DV_SW_PARSING_LSO , +#else +MLX5_SW_PARSING_CAP =0 , +MLX5_SW_PARSING_CSUM_CAP =0 , +MLX5_SW_PARSING_TSO_CAP =0 , +#endif +};#endif /* RTE_PMD_MLX5_OS_H_ */
drivers/net/mlx5/mlx5.h +1 -1
@@ -260,7 +260,7 @@ struct mlx5_dev_config { unsigned int dv_xmeta_en:2; /* Enable extensive flow metadata. */ unsigned int lacp_by_user:1;/* Enable user to manage LACP traffic. */ - unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */ + unsigned int swp:3; /* Tx generic tunnel checksum and TSO offload. */ unsigned int devx:1; /* Whether devx interface is available or not. */ unsigned int dest_tir:1; /* Whether advanced DR API is available. */ unsigned int reclaim_mode:2; /* Memory reclaim mode. */
drivers/net/mlx5/mlx5_txq.c +9 -6
@@ -111,9 +111,9 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev)if (config->tx_pp) offloads |=DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP ;if (config->swp) { -if (config->hw_csum) +if (config->swp &MLX5_SW_PARSING_CSUM_CAP ) offloads |=DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM ; -if (config->tso) +if (config->swp &MLX5_SW_PARSING_TSO_CAP ) offloads |= (DEV_TX_OFFLOAD_IP_TNL_TSO |DEV_TX_OFFLOAD_UDP_TNL_TSO ); }
@@ -979,10 +979,13 @@ txq_set_params(struct mlx5_txq_ctrl *txq_ctrl) txq_ctrl->txq.tso_en =1 ; } txq_ctrl->txq.tunnel_en = config->tunnel_en | config->swp; - txq_ctrl->txq.swp_en = ((DEV_TX_OFFLOAD_IP_TNL_TSO | -DEV_TX_OFFLOAD_UDP_TNL_TSO | -DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM ) & - txq_ctrl->txq.offloads) && config->swp; + txq_ctrl->txq.swp_en = (((DEV_TX_OFFLOAD_IP_TNL_TSO | +DEV_TX_OFFLOAD_UDP_TNL_TSO ) & + txq_ctrl->txq.offloads) && (config->swp & +MLX5_SW_PARSING_TSO_CAP )) | + ((DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM & + txq_ctrl->txq.offloads) && (config->swp & +MLX5_SW_PARSING_CSUM_CAP )); }/**
Signature · 1 line
2.16.1.windows.4
RFC PATCH 2/12 common/mlx5: read software parsing capabilities from DevX
In reply to Tal Shnaidermanmlx5 in Windows needs the software parsing hca capabilities to query the NIC for TSO and Checksum offloading support.
Added the capability as part of the capabilities
queried by the PMD using DevX.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 3 +++ 2 files changed, 9 insertions(+)
drivers/common/mlx5/mlx5_devx_cmds.c +6 -0
@@ -991,6 +991,12 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, hcattr, tunnel_lro_gre); attr->tunnel_lro_vxlan =MLX5_GET (per_protocol_networking_offload_caps, hcattr, tunnel_lro_vxlan); + attr->swp =MLX5_GET (per_protocol_networking_offload_caps, + hcattr, swp); + attr->swp_csum =MLX5_GET (per_protocol_networking_offload_caps, + hcattr, swp_csum); + attr->swp_lso =MLX5_GET (per_protocol_networking_offload_caps, + hcattr, swp_lso); attr->lro_max_msg_sz_mode =MLX5_GET (per_protocol_networking_offload_caps, hcattr, lro_max_msg_sz_mode);
drivers/common/mlx5/mlx5_devx_cmds.h +3 -0
@@ -116,6 +116,9 @@ struct mlx5_hca_attr { uint32_t lro_cap:1; uint32_t tunnel_lro_gre:1; uint32_t tunnel_lro_vxlan:1; + uint32_t swp:1; + uint32_t swp_csum:1; + uint32_t swp_lso:1; uint32_t lro_max_msg_sz_mode:2;uint32_t lro_timer_supported_periods[MLX5_LRO_NUM_SUPP_PERIODS ];uint16_t lro_min_mss_size;
Signature · 1 line
2.16.1.windows.4
RFC PATCH 3/12 net/mlx5: query software parsing support on Windows
In reply to Tal ShnaidermanQuery software parsing supported on the NIC.
Save the offloads values in a config parameter.
This is needed for the outer IPv4 checksum and
IP and UPD tunneled packet TSO support.
--- drivers/net/mlx5/mlx5.c | 16 ++++++++++++++++ drivers/net/mlx5/mlx5.h | 2 ++ drivers/net/mlx5/windows/mlx5_os.c | 6 +++++- drivers/net/mlx5/windows/mlx5_os.h | 6 ++++++ 4 files changed, 29 insertions(+), 1 deletion(-)
drivers/net/mlx5/mlx5.c +16 -0
@@ -947,6 +947,22 @@ mlx5_flex_parser_ecpri_release(struct rte_eth_dev *dev) prf->obj =NULL ; } +uint32_t +mlx5_get_supported_sw_parsing_offloads (const struct mlx5_hca_attr *attr) +{ +uint32_t sw_parsing_offloads =0 ; + +if (attr->swp) { + sw_parsing_offloads |=MLX5_SW_PARSING_CAP ; +if (attr->swp_csum) + sw_parsing_offloads |=MLX5_SW_PARSING_CSUM_CAP ; + +if (attr->swp_lso) + sw_parsing_offloads |=MLX5_SW_PARSING_TSO_CAP ; + } +return sw_parsing_offloads; +} +/* * Allocate Rx and Tx UARs in robust fashion. * This routine handles the following UAR allocation issues:
drivers/net/mlx5/mlx5.h +2 -0
@@ -1827,5 +1827,7 @@ int mlx5_aso_ct_query_by_wqe(struct mlx5_dev_ctx_shared *sh, struct rte_flow_action_conntrack *profile);int mlx5_aso_ct_available (struct mlx5_dev_ctx_shared *sh,struct mlx5_aso_ct_action *ct); +uint32_t +mlx5_get_supported_sw_parsing_offloads (const struct mlx5_hca_attr *attr);#endif /* RTE_PMD_MLX5_H_ */
drivers/net/mlx5/windows/mlx5_os.c +5 -1
@@ -169,6 +169,8 @@ mlx5_os_get_dev_attr(void *ctx, struct mlx5_dev_attr *device_attr) device_attr->max_rwq_indirection_table_size =1 << hca_attr.rss_ind_tbl_cap; } + device_attr->sw_parsing_offloads = +mlx5_get_supported_sw_parsing_offloads (&hca_attr); pv_iseg = mlx5_glue->query_hca_iseg (mlx5_ctx, &cb_iseg);if (pv_iseg ==NULL ) {DRV_LOG (ERR ,"Failed to get device hca_iseg" );
@@ -393,7 +395,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, }DRV_LOG (DEBUG ,"MPW isn't supported" );mlx5_os_get_dev_attr (sh->ctx, &device_attr); - config->swp =0 ; + config->swp = device_attr.sw_parsing_offloads & + (MLX5_SW_PARSING_CAP |MLX5_SW_PARSING_CSUM_CAP | +MLX5_SW_PARSING_TSO_CAP ); config->ind_table_max_size = sh->device_attr.max_rwq_indirection_table_size; cqe_comp =0 ;
drivers/net/mlx5/windows/mlx5_os.h +6 -0
@@ -16,4 +16,10 @@ enum {#define MLX5_NAMESIZE MLX5_FS_NAME_MAX +enum mlx5_sw_parsing_offloads { +MLX5_SW_PARSING_CAP =1 <<0 , +MLX5_SW_PARSING_CSUM_CAP =1 <<1 , +MLX5_SW_PARSING_TSO_CAP =1 <<2 , +}; +#endif /* RTE_PMD_MLX5_OS_H_ */
Signature · 1 line
2.16.1.windows.4
RFC PATCH 4/12 net/mlx5: fix tunneling support query
In reply to Tal ShnaidermanCurrently, the PMD decides if the tunneling offload can enable VXLAN/GRE/GENEVE tunneled TSO support by checking config->tunnel_en (single bit) and config->tso.
This is incorrect, the right way is to check the following flags returned by the mlx5dv_query_device function:
MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN - if supported the offload DEV_TX_OFFLOAD_VXLAN_TNL_TSO can be enabled. MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE - if supported the offload DEV_TX_OFFLOAD_GRE_TNL_TSO can be enabled. MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GENEVE - if supported the offload DEV_TX_OFFLOAD_GENEVE_TNL_TSO can be enabled.
The fix enables the offloads according to the correct flags returned by the kernel.
--- drivers/net/mlx5/linux/mlx5_os.c | 6 ++---- drivers/net/mlx5/linux/mlx5_os.h | 15 +++++++++++++++ drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_txq.c | 24 +++++++++++++++++++----- 4 files changed, 37 insertions(+), 10 deletions(-)
drivers/net/mlx5/linux/mlx5_os.c +2 -4
@@ -963,7 +963,6 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,int err =0 ;unsigned int hw_padding =0 ;unsigned int mps; -unsigned int tunnel_en =0 ;unsigned int mpls_en =0 ;unsigned int swp =0 ;unsigned int mprq =0 ;
@@ -1145,7 +1144,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->cqe_comp =1 ;#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT if (dv_attr.comp_mask &MLX5DV_CONTEXT_MASK_TUNNEL_OFFLOADS ) { - tunnel_en = ((dv_attr.tunnel_offloads_caps & + config->tunnel_en = ((dv_attr.tunnel_offloads_caps & MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN) && (dv_attr.tunnel_offloads_caps & MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE) &&
@@ -1153,12 +1152,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GENEVE)); }DRV_LOG (DEBUG ,"tunnel offloading is %ssupported" , - tunnel_en ?"" :"not " ); + config->tunnel_en ?"" :"not " );#else DRV_LOG (WARNING ,"tunnel offloading disabled due to old OFED/rdma-core version" );#endif - config->tunnel_en = tunnel_en;#ifdef HAVE_IBV_DEVICE_MPLS_SUPPORT mpls_en = ((dv_attr.tunnel_offloads_caps & MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_CW_MPLS_OVER_GRE) &&
drivers/net/mlx5/linux/mlx5_os.h +15 -0
@@ -33,4 +33,19 @@ enum mlx5_sw_parsing_offloads { MLX5_SW_PARSING_TSO_CAP = 0, #endif }; + +enum mlx5_tunnel_offloads { +#ifdef HAVE_IBV_DEVICE_TUNNEL_SUPPORT +MLX5_TUNNELED_OFFLOADS_VXLAN_CAP = +MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_VXLAN , +MLX5_TUNNELED_OFFLOADS_GRE_CAP = +MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GRE , +MLX5_TUNNELED_OFFLOADS_GENEVE_CAP = +MLX5DV_RAW_PACKET_CAP_TUNNELED_OFFLOAD_GENEVE , +#else +MLX5_TUNNELED_OFFLOADS_VXLAN_CAP =0 , +MLX5_TUNNELED_OFFLOADS_GRE_CAP =0 , +MLX5_TUNNELED_OFFLOADS_GENEVE_CAP =0 , +#endif +};#endif /* RTE_PMD_MLX5_OS_H_ */
drivers/net/mlx5/mlx5.h +1 -1
@@ -244,7 +244,7 @@ struct mlx5_dev_config { unsigned int hw_padding:1; /* End alignment padding is supported. */ unsigned int vf:1; /* This is a VF. */ unsigned int sf:1; /* This is a SF. */ - unsigned int tunnel_en:1; + unsigned int tunnel_en:3;/* 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. */
drivers/net/mlx5/mlx5_txq.c +19 -5
@@ -120,10 +120,17 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev)if (config->tunnel_en) {if (config->hw_csum) offloads |=DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM ; -if (config->tso) - offloads |= (DEV_TX_OFFLOAD_VXLAN_TNL_TSO | -DEV_TX_OFFLOAD_GRE_TNL_TSO | -DEV_TX_OFFLOAD_GENEVE_TNL_TSO ); +if (config->tso) { +if (config->tunnel_en & +MLX5_TUNNELED_OFFLOADS_VXLAN_CAP ) + offloads |=DEV_TX_OFFLOAD_VXLAN_TNL_TSO ; +if (config->tunnel_en & +MLX5_TUNNELED_OFFLOADS_GRE_CAP ) + offloads |=DEV_TX_OFFLOAD_GRE_TNL_TSO ; +if (config->tunnel_en & +MLX5_TUNNELED_OFFLOADS_GENEVE_CAP ) + offloads |=DEV_TX_OFFLOAD_GENEVE_TNL_TSO ; + } }if (!config->mprq.enabled) offloads |=DEV_TX_OFFLOAD_MBUF_FAST_FREE ;
@@ -978,7 +985,14 @@ txq_set_params(struct mlx5_txq_ctrl *txq_ctrl) MLX5_MAX_TSO_HEADER); txq_ctrl->txq.tso_en =1 ; } - txq_ctrl->txq.tunnel_en = config->tunnel_en | config->swp; +if (((DEV_TX_OFFLOAD_VXLAN_TNL_TSO & txq_ctrl->txq.offloads) && + (config->tunnel_en &MLX5_TUNNELED_OFFLOADS_VXLAN_CAP )) | + ((DEV_TX_OFFLOAD_GRE_TNL_TSO & txq_ctrl->txq.offloads) && + (config->tunnel_en &MLX5_TUNNELED_OFFLOADS_GRE_CAP )) | + ((DEV_TX_OFFLOAD_GENEVE_TNL_TSO & txq_ctrl->txq.offloads) && + (config->tunnel_en &MLX5_TUNNELED_OFFLOADS_GENEVE_CAP )) | + (config->swp &MLX5_SW_PARSING_TSO_CAP )) + txq_ctrl->txq.tunnel_en =1 ; txq_ctrl->txq.swp_en = (((DEV_TX_OFFLOAD_IP_TNL_TSO | DEV_TX_OFFLOAD_UDP_TNL_TSO) & txq_ctrl->txq.offloads) && (config->swp &
Signature · 1 line
2.16.1.windows.4
RFC PATCH 5/12 common/mlx5: read tunneling capabilities from DevX
In reply to Tal Shnaidermanmlx5 in Windows needs the tunneling hca capabilities to query the NIC for Inner TSO offloading support.
Added the capability as part of the capabilities
queried by the PMD using DevX.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ 2 files changed, 8 insertions(+)
drivers/common/mlx5/mlx5_devx_cmds.c +6 -0
@@ -993,6 +993,12 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, hcattr, tunnel_lro_vxlan); attr->swp =MLX5_GET (per_protocol_networking_offload_caps, hcattr, swp); + attr->tunnel_stateless_gre = +MLX5_GET (per_protocol_networking_offload_caps, + hcattr, tunnel_stateless_gre); + attr->tunnel_stateless_vxlan = +MLX5_GET (per_protocol_networking_offload_caps, + hcattr, tunnel_stateless_vxlan); attr->swp_csum =MLX5_GET (per_protocol_networking_offload_caps, hcattr, swp_csum); attr->swp_lso = MLX5_GET(per_protocol_networking_offload_caps,
drivers/common/mlx5/mlx5_devx_cmds.h +2 -0
@@ -116,6 +116,8 @@ struct mlx5_hca_attr { uint32_t lro_cap:1; uint32_t tunnel_lro_gre:1; uint32_t tunnel_lro_vxlan:1; + uint32_t tunnel_stateless_gre:1; + uint32_t tunnel_stateless_vxlan:1; uint32_t swp:1; uint32_t swp_csum:1; uint32_t swp_lso:1;
Signature · 1 line
2.16.1.windows.4
RFC PATCH 6/12 net/mlx5: query tunneling support on Windows
In reply to Tal ShnaidermanQuery tunneling supported on the NIC.
Save the offloads values in a config parameter.
This is needed for the following TSO support:
DEV_TX_OFFLOAD_VXLAN_TNL_TSODEV_TX_OFFLOAD_GRE_TNL_TSODEV_TX_OFFLOAD_GENEVE_TNL_TSO
--- drivers/net/mlx5/mlx5.c | 14 ++++++++++++++ drivers/net/mlx5/mlx5.h | 2 ++ drivers/net/mlx5/windows/mlx5_os.c | 2 ++ drivers/net/mlx5/windows/mlx5_os.h | 5 +++++ 4 files changed, 23 insertions(+)
drivers/net/mlx5/mlx5.c +14 -0
@@ -963,6 +963,20 @@ mlx5_get_supported_sw_parsing_offloads(const struct mlx5_hca_attr *attr)return sw_parsing_offloads; } +uint32_t +mlx5_get_supported_tunneling_offloads (const struct mlx5_hca_attr *attr) +{ +uint32_t tn_offloads =0 ; + +if (attr->tunnel_stateless_vxlan) + tn_offloads |=MLX5_TUNNELED_OFFLOADS_VXLAN_CAP ; +if (attr->tunnel_stateless_gre) + tn_offloads |=MLX5_TUNNELED_OFFLOADS_GRE_CAP ; +if (attr->tunnel_stateless_geneve_rx) + tn_offloads |=MLX5_TUNNELED_OFFLOADS_GENEVE_CAP ; +return tn_offloads; +} +/* * Allocate Rx and Tx UARs in robust fashion. * This routine handles the following UAR allocation issues:
drivers/net/mlx5/mlx5.h +2 -0
@@ -1829,5 +1829,7 @@ int mlx5_aso_ct_available(struct mlx5_dev_ctx_shared *sh, struct mlx5_aso_ct_action *ct);uint32_t mlx5_get_supported_sw_parsing_offloads (const struct mlx5_hca_attr *attr); +uint32_t +mlx5_get_supported_tunneling_offloads (const struct mlx5_hca_attr *attr);#endif /* RTE_PMD_MLX5_H_ */
drivers/net/mlx5/windows/mlx5_os.c +2 -0
@@ -171,6 +171,8 @@ mlx5_os_get_dev_attr(void *ctx, struct mlx5_dev_attr *device_attr) } device_attr->sw_parsing_offloads =mlx5_get_supported_sw_parsing_offloads (&hca_attr); + device_attr->tunnel_offloads_caps = +mlx5_get_supported_tunneling_offloads (&hca_attr); pv_iseg = mlx5_glue->query_hca_iseg (mlx5_ctx, &cb_iseg);if (pv_iseg ==NULL ) {DRV_LOG (ERR ,"Failed to get device hca_iseg" );
drivers/net/mlx5/windows/mlx5_os.h +5 -0
@@ -22,4 +22,9 @@ enum mlx5_sw_parsing_offloads { MLX5_SW_PARSING_TSO_CAP = 1 << 2, }; +enum mlx5_tunnel_offloads { +MLX5_TUNNELED_OFFLOADS_VXLAN_CAP =1 <<0 , +MLX5_TUNNELED_OFFLOADS_GRE_CAP =1 <<1 , +MLX5_TUNNELED_OFFLOADS_GENEVE_CAP =1 <<2 , +};#endif /* RTE_PMD_MLX5_OS_H_ */
Signature · 1 line
2.16.1.windows.4
RFC PATCH 7/12 common/mlx5: read TSO capability from DevX
In reply to Tal Shnaidermanmlx5 in Windows needs the hca capability max_lso_cap to query the NIC for TSO offloading support.
Added the capability as part of the capabilities
queried by the PMD using DevX.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + 2 files changed, 3 insertions(+)
drivers/common/mlx5/mlx5_devx_cmds.c +2 -0
@@ -987,6 +987,8 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, hcattr, csum_cap); attr->lro_cap =MLX5_GET (per_protocol_networking_offload_caps, hcattr, lro_cap); + attr->max_lso_cap =MLX5_GET (per_protocol_networking_offload_caps, + hcattr, max_lso_cap); attr->tunnel_lro_gre =MLX5_GET (per_protocol_networking_offload_caps, hcattr, tunnel_lro_gre); attr->tunnel_lro_vxlan = MLX5_GET(per_protocol_networking_offload_caps,
drivers/common/mlx5/mlx5_devx_cmds.h +1 -0
@@ -113,6 +113,7 @@ struct mlx5_hca_attr { uint32_t tunnel_stateless_geneve_rx:1; uint32_t geneve_max_opt_len:1; /* 0x0: 14DW, 0x1: 63DW */ uint32_t tunnel_stateless_gtp:1; +uint32_t max_lso_cap; uint32_t lro_cap:1; uint32_t tunnel_lro_gre:1; uint32_t tunnel_lro_vxlan:1;
Signature · 1 line
2.16.1.windows.4
RFC PATCH 8/12 net/mlx5: support TSO offload on Windows
In reply to Tal ShnaidermanSupport of the TSO offloading by checking
the relevant FW capability for NIC support.
Supported offloads:
DEV_TX_OFFLOAD_TCP_TSODEV_TX_OFFLOAD_VXLAN_TNL_TSODEV_TX_OFFLOAD_GRE_TNL_TSODEV_TX_OFFLOAD_GENEVE_TNL_TSO
--- drivers/net/mlx5/windows/mlx5_os.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/mlx5/windows/mlx5_os.c +2 -0
@@ -165,6 +165,7 @@ mlx5_os_get_dev_attr(void *ctx, struct mlx5_dev_attr *device_attr) device_attr->max_pd =1 << hca_attr.log_max_pd; device_attr->max_srq =1 << hca_attr.log_max_srq; device_attr->max_srq_wr =1 << hca_attr.log_max_srq_sz; + device_attr->max_tso =1 << hca_attr.max_lso_cap;if (hca_attr.rss_ind_tbl_cap) { device_attr->max_rwq_indirection_table_size =1 << hca_attr.rss_ind_tbl_cap;
@@ -480,6 +481,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,DRV_LOG (DEBUG ,"Rx end alignment padding isn't supported" ); config->hw_padding =0 ; } + config->tso = (sh->device_attr.max_tso >0 );if (config->tso) config->tso_max_payload_sz = sh->device_attr.max_tso; DRV_LOG(DEBUG, "%sMPS is %s.",
Signature · 1 line
2.16.1.windows.4
RFC PATCH 9/12 common/mlx5: read VLAN capability from DevX
In reply to Tal Shnaidermanmlx5 in Windows needs the hca capability vlan_cap
to query the NIC for VLAN stripping support
Added the capability as part of the capabilities
queried by the PMD using DevX.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + 2 files changed, 3 insertions(+)
drivers/common/mlx5/mlx5_devx_cmds.c +2 -0
@@ -985,6 +985,8 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, hcattr, wqe_vlan_insert); attr->csum_cap =MLX5_GET (per_protocol_networking_offload_caps, hcattr, csum_cap); + attr->vlan_cap =MLX5_GET (per_protocol_networking_offload_caps, + hcattr, vlan_cap); attr->lro_cap =MLX5_GET (per_protocol_networking_offload_caps, hcattr, lro_cap); attr->max_lso_cap = MLX5_GET(per_protocol_networking_offload_caps,
drivers/common/mlx5/mlx5_devx_cmds.h +1 -0
@@ -108,6 +108,7 @@ struct mlx5_hca_attr { uint32_t eth_virt:1; uint32_t wqe_vlan_insert:1; uint32_t csum_cap:1; + uint32_t vlan_cap:1; uint32_t wqe_inline_mode:2; uint32_t vport_inline_mode:3; uint32_t tunnel_stateless_geneve_rx:1;
Signature · 1 line
2.16.1.windows.4
RFC PATCH 10/12 net/mlx5: support VLAN stripping offload on Windows
In reply to Tal ShnaidermanSupport of the VLAN stripping offloading by checking the relevant FW capability (vlan_cap) for NIC support.
Supported offload:
DEV_RX_OFFLOAD_VLAN_STRIP
--- drivers/net/mlx5/windows/mlx5_os.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/mlx5/windows/mlx5_os.c +3 -2
@@ -475,8 +475,6 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->ind_table_max_size =ETH_RSS_RETA_SIZE_512 ;DRV_LOG (DEBUG ,"maximum Rx indirection table size is %u" , config->ind_table_max_size); -DRV_LOG (DEBUG ,"VLAN stripping is %ssupported" , - (config->hw_vlan_strip ?"" :"not " ));if (config->hw_padding) {DRV_LOG (DEBUG ,"Rx end alignment padding isn't supported" ); config->hw_padding =0 ;
@@ -510,6 +508,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->hw_csum = config->hca_attr.csum_cap;DRV_LOG (DEBUG ,"checksum offloading is %ssupported" , (config->hw_csum ?"" :"not " )); + config->hw_vlan_strip = config->hca_attr.vlan_cap; +DRV_LOG (DEBUG ,"VLAN stripping is %ssupported" , + (config->hw_vlan_strip ?"" :"not " )); }if (config->devx) {uint32_t reg[MLX5_ST_SZ_DW (register_mtutc)];
Signature · 1 line
2.16.1.windows.4
RFC PATCH 11/12 common/mlx5: read FCS scattering capability from DevX
In reply to Tal Shnaidermanmlx5 in Windows needs the hca capability scatter_fcs to query the NIC support for the CRC keeping offload.
Added the capability as part of the capabilities
queried by the PMD using DevX.
--- drivers/common/mlx5/mlx5_devx_cmds.c | 2 ++ drivers/common/mlx5/mlx5_devx_cmds.h | 1 + 2 files changed, 3 insertions(+)
drivers/common/mlx5/mlx5_devx_cmds.c +2 -0
@@ -991,6 +991,8 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, lro_cap); attr->max_lso_cap =MLX5_GET (per_protocol_networking_offload_caps, hcattr, max_lso_cap); + attr->scatter_fcs =MLX5_GET (per_protocol_networking_offload_caps, + hcattr, scatter_fcs); attr->tunnel_lro_gre =MLX5_GET (per_protocol_networking_offload_caps, hcattr, tunnel_lro_gre); attr->tunnel_lro_vxlan = MLX5_GET(per_protocol_networking_offload_caps,
drivers/common/mlx5/mlx5_devx_cmds.h +1 -0
@@ -115,6 +115,7 @@ struct mlx5_hca_attr { uint32_t geneve_max_opt_len:1; /* 0x0: 14DW, 0x1: 63DW */ uint32_t tunnel_stateless_gtp:1;uint32_t max_lso_cap; + uint32_t scatter_fcs:1; uint32_t lro_cap:1; uint32_t tunnel_lro_gre:1; uint32_t tunnel_lro_vxlan:1;
Signature · 1 line
2.16.1.windows.4
RFC PATCH 12/12 net/mlx5: support keep-CRC offload on Windows
In reply to Tal ShnaidermanSupport of the keep-CRC offloading by checking the relevant FW capability (scatter_fcs) for NIC support.
Supported offload:
DEV_RX_OFFLOAD_KEEP_CRC
--- drivers/net/mlx5/windows/mlx5_os.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/mlx5/windows/mlx5_os.c +1 -0
@@ -511,6 +511,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, config->hw_vlan_strip = config->hca_attr.vlan_cap;DRV_LOG (DEBUG ,"VLAN stripping is %ssupported" , (config->hw_vlan_strip ?"" :"not " )); + config->hw_fcs_strip = config->hca_attr.scatter_fcs; }if (config->devx) {uint32_t reg[MLX5_ST_SZ_DW (register_mtutc)];
Signature · 1 line
2.16.1.windows.4