crypto/mlx5: add WQE set initialization
[dpdk.git] / drivers / net / mlx5 / windows / mlx5_os.c
index 79eac80..5da362a 100644 (file)
 #include "mlx5_utils.h"
 #include "mlx5_rxtx.h"
 #include "mlx5_rx.h"
+#include "mlx5_tx.h"
 #include "mlx5_autoconf.h"
 #include "mlx5_mr.h"
 #include "mlx5_flow.h"
 #include "mlx5_devx.h"
 
-#define MLX5_TAGS_HLIST_ARRAY_SIZE 8192
-
 static const char *MZ_MLX5_PMD_SHARED_DATA = "mlx5_pmd_shared_data";
 
 /* Spinlock for mlx5_shared_data allocation. */
@@ -358,11 +357,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
        config->swp = 0;
        config->ind_table_max_size =
                sh->device_attr.max_rwq_indirection_table_size;
-       if (RTE_CACHE_LINE_SIZE == 128 &&
-           !(device_attr.flags & MLX5DV_CONTEXT_FLAGS_CQE_128B_COMP))
-               cqe_comp = 0;
-       else
-               cqe_comp = 1;
+       cqe_comp = 0;
        config->cqe_comp = cqe_comp;
        DRV_LOG(DEBUG, "tunnel offloading is not supported");
        config->tunnel_en = 0;
@@ -423,10 +418,6 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
        err = mlx5_dev_check_sibling_config(priv, config);
        if (err)
                goto error;
-       config->hw_csum = !!(sh->device_attr.device_cap_flags_ex &
-                           IBV_DEVICE_RAW_IP_CSUM);
-       DRV_LOG(DEBUG, "checksum offloading is %ssupported",
-               (config->hw_csum ? "" : "not "));
        DRV_LOG(DEBUG, "counters are not supported");
        config->ind_table_max_size =
                sh->device_attr.max_rwq_indirection_table_size;
@@ -438,19 +429,12 @@ 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);
-       config->hw_vlan_strip = !!(sh->device_attr.raw_packet_caps &
-                                 IBV_RAW_PACKET_CAP_CVLAN_STRIPPING);
        DRV_LOG(DEBUG, "VLAN stripping is %ssupported",
                (config->hw_vlan_strip ? "" : "not "));
-       config->hw_fcs_strip = !!(sh->device_attr.raw_packet_caps &
-                                IBV_RAW_PACKET_CAP_SCATTER_FCS);
        if (config->hw_padding) {
                DRV_LOG(DEBUG, "Rx end alignment padding isn't supported");
                config->hw_padding = 0;
        }
-       config->tso = (sh->device_attr.max_tso > 0 &&
-                     (sh->device_attr.tso_supported_qpts &
-                      (1 << IBV_QPT_RAW_PACKET)));
        if (config->tso)
                config->tso_max_payload_sz = sh->device_attr.max_tso;
        DRV_LOG(DEBUG, "%sMPS is %s.",
@@ -476,6 +460,9 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                        sh->cmng.relaxed_ordering_read =
                                config->hca_attr.relaxed_ordering_read;
                }
+               config->hw_csum = config->hca_attr.csum_cap;
+               DRV_LOG(DEBUG, "checksum offloading is %ssupported",
+                   (config->hw_csum ? "" : "not "));
        }
        if (config->devx) {
                uint32_t reg[MLX5_ST_SZ_DW(register_mtutc)];
@@ -574,10 +561,11 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
        eth_dev->rx_queue_count = mlx5_rx_queue_count;
        /* Register MAC address. */
        claim_zero(mlx5_mac_addr_add(eth_dev, &mac, 0, 0));
-       priv->flows = 0;
        priv->ctrl_flows = 0;
        TAILQ_INIT(&priv->flow_meters);
-       TAILQ_INIT(&priv->flow_meter_profiles);
+       priv->mtr_profile_tbl = mlx5_l3t_create(MLX5_L3T_TYPE_PTR);
+       if (!priv->mtr_profile_tbl)
+               goto error;
        /* Bring Ethernet device up. */
        DRV_LOG(DEBUG, "port %u forcing Ethernet interface up.",
                eth_dev->data->port_id);
@@ -620,10 +608,10 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
                        err = ENOTSUP;
                        goto error;
        }
-       mlx5_cache_list_init(&priv->hrxqs, "hrxq", 0, eth_dev,
-                            mlx5_hrxq_create_cb,
-                            mlx5_hrxq_match_cb,
-                            mlx5_hrxq_remove_cb);
+       priv->hrxqs = mlx5_list_create("hrxq", eth_dev, true,
+               mlx5_hrxq_create_cb, mlx5_hrxq_match_cb,
+               mlx5_hrxq_remove_cb, mlx5_hrxq_clone_cb,
+               mlx5_hrxq_clone_free_cb);
        /* Query availability of metadata reg_c's. */
        err = mlx5_flow_discover_mreg_c(eth_dev);
        if (err < 0) {
@@ -655,6 +643,8 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
        return eth_dev;
 error:
        if (priv) {
+               if (priv->mtr_profile_tbl)
+                       mlx5_l3t_destroy(priv->mtr_profile_tbl);
                if (own_domain_id)
                        claim_zero(rte_eth_switch_domain_free(priv->domain_id));
                mlx5_free(priv);