net/mlx5e: Change VF representors' RQ type
[sfrench/cifs-2.6.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_rep.c
index c9cc9747d21d187810c9f93efaf0937bb9c1ebe2..fc4433e938469225a57e1342106cf48e1d9e10b0 100644 (file)
@@ -46,8 +46,6 @@
 
 #define MLX5E_REP_PARAMS_LOG_SQ_SIZE \
        max(0x6, MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE)
-#define MLX5E_REP_PARAMS_LOG_RQ_SIZE \
-       max(0x6, MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE)
 
 static const char mlx5e_rep_driver_name[] = "mlx5e_rep";
 
@@ -934,14 +932,15 @@ static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev,
        params->hard_mtu    = MLX5E_ETH_HARD_MTU;
        params->sw_mtu      = mtu;
        params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE;
-       params->rq_wq_type  = MLX5_WQ_TYPE_CYCLIC;
-       params->log_rq_mtu_frames = MLX5E_REP_PARAMS_LOG_RQ_SIZE;
 
+       /* RQ */
+       mlx5e_build_rq_params(mdev, params);
+
+       /* CQ moderation params */
        params->rx_dim_enabled = MLX5_CAP_GEN(mdev, cq_moderation);
        mlx5e_set_rx_cq_mode_params(params, cq_period_mode);
 
        params->num_tc                = 1;
-       params->lro_wqe_sz            = MLX5E_PARAMS_DEFAULT_LRO_WQE_SZ;
 
        mlx5_query_min_inline(mdev, &params->tx_min_inline_mode);
 }
@@ -999,14 +998,21 @@ static int mlx5e_init_rep_rx(struct mlx5e_priv *priv)
        struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
        struct mlx5e_rep_priv *rpriv = priv->ppriv;
        struct mlx5_eswitch_rep *rep = rpriv->rep;
+       struct mlx5_core_dev *mdev = priv->mdev;
        struct mlx5_flow_handle *flow_rule;
        int err;
 
        mlx5e_init_l2_addr(priv);
 
+       err = mlx5e_open_drop_rq(priv, &priv->drop_rq);
+       if (err) {
+               mlx5_core_err(mdev, "open drop rq failed, %d\n", err);
+               return err;
+       }
+
        err = mlx5e_create_direct_rqts(priv);
        if (err)
-               return err;
+               goto err_close_drop_rq;
 
        err = mlx5e_create_direct_tirs(priv);
        if (err)
@@ -1027,6 +1033,8 @@ err_destroy_direct_tirs:
        mlx5e_destroy_direct_tirs(priv);
 err_destroy_direct_rqts:
        mlx5e_destroy_direct_rqts(priv);
+err_close_drop_rq:
+       mlx5e_close_drop_rq(&priv->drop_rq);
        return err;
 }
 
@@ -1037,6 +1045,7 @@ static void mlx5e_cleanup_rep_rx(struct mlx5e_priv *priv)
        mlx5_del_flow_rules(rpriv->vport_rx_rule);
        mlx5e_destroy_direct_tirs(priv);
        mlx5e_destroy_direct_rqts(priv);
+       mlx5e_close_drop_rq(&priv->drop_rq);
 }
 
 static int mlx5e_init_rep_tx(struct mlx5e_priv *priv)
@@ -1067,7 +1076,7 @@ static const struct mlx5e_profile mlx5e_rep_profile = {
        .max_nch                = mlx5e_get_rep_max_num_channels,
        .update_carrier         = NULL,
        .rx_handlers.handle_rx_cqe       = mlx5e_handle_rx_cqe_rep,
-       .rx_handlers.handle_rx_cqe_mpwqe = NULL /* Not supported */,
+       .rx_handlers.handle_rx_cqe_mpwqe = mlx5e_handle_rx_cqe_mpwrq,
        .max_tc                 = 1,
 };