common/mlx5: introduce common library
[dpdk.git] / drivers / net / mlx5 / mlx5_ethdev.c
index 2b7c867..eddf888 100644 (file)
 #include <rte_rwlock.h>
 #include <rte_cycles.h>
 
+#include <mlx5_glue.h>
+#include <mlx5_devx_cmds.h>
+
 #include "mlx5.h"
-#include "mlx5_glue.h"
 #include "mlx5_rxtx.h"
 #include "mlx5_utils.h"
 
@@ -404,6 +406,10 @@ mlx5_dev_configure(struct rte_eth_dev *dev)
                rte_errno = ENOMEM;
                return -rte_errno;
        }
+
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
        memcpy(priv->rss_conf.rss_key,
               use_app_rss_key ?
               dev->data->dev_conf.rx_adv_conf.rss_conf.rss_key :
@@ -472,7 +478,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev)
 
                rxq_data = (*priv->rxqs)[i];
                rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
-               if (rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
+               if (rxq_ctrl && rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
                        rss_queue_arr[j++] = i;
        }
        rss_queue_n = j;
@@ -529,8 +535,8 @@ mlx5_set_default_params(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
        /* Minimum CPU utilization. */
        info->default_rxportconf.ring_size = 256;
        info->default_txportconf.ring_size = 256;
-       info->default_rxportconf.burst_size = 64;
-       info->default_txportconf.burst_size = 64;
+       info->default_rxportconf.burst_size = MLX5_RX_DEFAULT_BURST;
+       info->default_txportconf.burst_size = MLX5_TX_DEFAULT_BURST;
        if (priv->link_speed_capa & ETH_LINK_SPEED_100G) {
                info->default_rxportconf.nb_queues = 16;
                info->default_txportconf.nb_queues = 16;
@@ -606,6 +612,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info)
        /* FIXME: we should ask the device for these values. */
        info->min_rx_bufsize = 32;
        info->max_rx_pktlen = 65536;
+       info->max_lro_pkt_size = MLX5_MAX_LRO_SIZE;
        /*
         * Since we need one CQ per QP, the limit is the minimum number
         * between the two values.