net/mlx5e: IPoIB, TX TIS creation
[platform/kernel/linux-starfive.git] / drivers / net / ethernet / mellanox / mlx5 / core / en_main.c
index 08b67aa..1fde4e2 100644 (file)
@@ -2759,24 +2759,25 @@ static void mlx5e_close_drop_rq(struct mlx5e_rq *drop_rq)
        mlx5e_free_cq(&drop_rq->cq);
 }
 
-static int mlx5e_create_tis(struct mlx5e_priv *priv, int tc)
+int mlx5e_create_tis(struct mlx5_core_dev *mdev, int tc,
+                    u32 underlay_qpn, u32 *tisn)
 {
-       struct mlx5_core_dev *mdev = priv->mdev;
        u32 in[MLX5_ST_SZ_DW(create_tis_in)] = {0};
        void *tisc = MLX5_ADDR_OF(create_tis_in, in, ctx);
 
        MLX5_SET(tisc, tisc, prio, tc << 1);
+       MLX5_SET(tisc, tisc, underlay_qpn, underlay_qpn);
        MLX5_SET(tisc, tisc, transport_domain, mdev->mlx5e_res.td.tdn);
 
        if (mlx5_lag_is_lacp_owner(mdev))
                MLX5_SET(tisc, tisc, strict_lag_tx_port_affinity, 1);
 
-       return mlx5_core_create_tis(mdev, in, sizeof(in), &priv->tisn[tc]);
+       return mlx5_core_create_tis(mdev, in, sizeof(in), tisn);
 }
 
-static void mlx5e_destroy_tis(struct mlx5e_priv *priv, int tc)
+void mlx5e_destroy_tis(struct mlx5_core_dev *mdev, u32 tisn)
 {
-       mlx5_core_destroy_tis(priv->mdev, priv->tisn[tc]);
+       mlx5_core_destroy_tis(mdev, tisn);
 }
 
 int mlx5e_create_tises(struct mlx5e_priv *priv)
@@ -2785,7 +2786,7 @@ int mlx5e_create_tises(struct mlx5e_priv *priv)
        int tc;
 
        for (tc = 0; tc < priv->profile->max_tc; tc++) {
-               err = mlx5e_create_tis(priv, tc);
+               err = mlx5e_create_tis(priv->mdev, tc, 0, &priv->tisn[tc]);
                if (err)
                        goto err_close_tises;
        }
@@ -2794,7 +2795,7 @@ int mlx5e_create_tises(struct mlx5e_priv *priv)
 
 err_close_tises:
        for (tc--; tc >= 0; tc--)
-               mlx5e_destroy_tis(priv, tc);
+               mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
 
        return err;
 }
@@ -2804,7 +2805,7 @@ void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv)
        int tc;
 
        for (tc = 0; tc < priv->profile->max_tc; tc++)
-               mlx5e_destroy_tis(priv, tc);
+               mlx5e_destroy_tis(priv->mdev, priv->tisn[tc]);
 }
 
 static void mlx5e_build_indir_tir_ctx(struct mlx5e_priv *priv,
@@ -3841,6 +3842,7 @@ void mlx5e_build_nic_params(struct mlx5_core_dev *mdev,
        mlx5e_set_rq_params(mdev, params);
 
        /* HW LRO */
+       /* TODO: && MLX5_CAP_ETH(mdev, lro_cap) */
        if (params->rq_wq_type == MLX5_WQ_TYPE_LINKED_LIST_STRIDING_RQ)
                params->lro_en = true;
        params->lro_timeout = mlx5e_choose_lro_timeout(mdev, MLX5E_DEFAULT_LRO_TIMEOUT);