| .. | .. |
|---|
| 36 | 36 | * Global resources are common to all the netdevices crated on the same nic. |
|---|
| 37 | 37 | */ |
|---|
| 38 | 38 | |
|---|
| 39 | | -int mlx5e_create_tir(struct mlx5_core_dev *mdev, |
|---|
| 40 | | - struct mlx5e_tir *tir, u32 *in, int inlen) |
|---|
| 39 | +int mlx5e_create_tir(struct mlx5_core_dev *mdev, struct mlx5e_tir *tir, u32 *in) |
|---|
| 41 | 40 | { |
|---|
| 42 | 41 | int err; |
|---|
| 43 | 42 | |
|---|
| 44 | | - err = mlx5_core_create_tir(mdev, in, inlen, &tir->tirn); |
|---|
| 43 | + err = mlx5_core_create_tir(mdev, in, &tir->tirn); |
|---|
| 45 | 44 | if (err) |
|---|
| 46 | 45 | return err; |
|---|
| 47 | 46 | |
|---|
| .. | .. |
|---|
| 61 | 60 | mutex_unlock(&mdev->mlx5e_res.td.list_lock); |
|---|
| 62 | 61 | } |
|---|
| 63 | 62 | |
|---|
| 63 | +void mlx5e_mkey_set_relaxed_ordering(struct mlx5_core_dev *mdev, void *mkc) |
|---|
| 64 | +{ |
|---|
| 65 | + bool ro_pci_enable = pcie_relaxed_ordering_enabled(mdev->pdev); |
|---|
| 66 | + bool ro_write = MLX5_CAP_GEN(mdev, relaxed_ordering_write); |
|---|
| 67 | + bool ro_read = MLX5_CAP_GEN(mdev, relaxed_ordering_read); |
|---|
| 68 | + |
|---|
| 69 | + MLX5_SET(mkc, mkc, relaxed_ordering_read, ro_pci_enable && ro_read); |
|---|
| 70 | + MLX5_SET(mkc, mkc, relaxed_ordering_write, ro_pci_enable && ro_write); |
|---|
| 71 | +} |
|---|
| 72 | + |
|---|
| 64 | 73 | static int mlx5e_create_mkey(struct mlx5_core_dev *mdev, u32 pdn, |
|---|
| 65 | 74 | struct mlx5_core_mkey *mkey) |
|---|
| 66 | 75 | { |
|---|
| .. | .. |
|---|
| 77 | 86 | MLX5_SET(mkc, mkc, access_mode_1_0, MLX5_MKC_ACCESS_MODE_PA); |
|---|
| 78 | 87 | MLX5_SET(mkc, mkc, lw, 1); |
|---|
| 79 | 88 | MLX5_SET(mkc, mkc, lr, 1); |
|---|
| 80 | | - |
|---|
| 89 | + mlx5e_mkey_set_relaxed_ordering(mdev, mkc); |
|---|
| 81 | 90 | MLX5_SET(mkc, mkc, pd, pdn); |
|---|
| 82 | 91 | MLX5_SET(mkc, mkc, length64, 1); |
|---|
| 83 | 92 | MLX5_SET(mkc, mkc, qpn, 0xffffff); |
|---|
| .. | .. |
|---|
| 142 | 151 | memset(res, 0, sizeof(*res)); |
|---|
| 143 | 152 | } |
|---|
| 144 | 153 | |
|---|
| 145 | | -int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb) |
|---|
| 154 | +int mlx5e_refresh_tirs(struct mlx5e_priv *priv, bool enable_uc_lb, |
|---|
| 155 | + bool enable_mc_lb) |
|---|
| 146 | 156 | { |
|---|
| 147 | 157 | struct mlx5_core_dev *mdev = priv->mdev; |
|---|
| 148 | 158 | struct mlx5e_tir *tir; |
|---|
| 159 | + u8 lb_flags = 0; |
|---|
| 149 | 160 | int err = 0; |
|---|
| 150 | 161 | u32 tirn = 0; |
|---|
| 151 | 162 | int inlen; |
|---|
| .. | .. |
|---|
| 159 | 170 | } |
|---|
| 160 | 171 | |
|---|
| 161 | 172 | if (enable_uc_lb) |
|---|
| 162 | | - MLX5_SET(modify_tir_in, in, ctx.self_lb_block, |
|---|
| 163 | | - MLX5_TIRC_SELF_LB_BLOCK_BLOCK_UNICAST_); |
|---|
| 173 | + lb_flags = MLX5_TIRC_SELF_LB_BLOCK_BLOCK_UNICAST; |
|---|
| 174 | + |
|---|
| 175 | + if (enable_mc_lb) |
|---|
| 176 | + lb_flags |= MLX5_TIRC_SELF_LB_BLOCK_BLOCK_MULTICAST; |
|---|
| 177 | + |
|---|
| 178 | + if (lb_flags) |
|---|
| 179 | + MLX5_SET(modify_tir_in, in, ctx.self_lb_block, lb_flags); |
|---|
| 164 | 180 | |
|---|
| 165 | 181 | MLX5_SET(modify_tir_in, in, bitmask.self_lb_en, 1); |
|---|
| 166 | 182 | |
|---|
| 167 | 183 | mutex_lock(&mdev->mlx5e_res.td.list_lock); |
|---|
| 168 | 184 | list_for_each_entry(tir, &mdev->mlx5e_res.td.tirs_list, list) { |
|---|
| 169 | 185 | tirn = tir->tirn; |
|---|
| 170 | | - err = mlx5_core_modify_tir(mdev, tirn, in, inlen); |
|---|
| 186 | + err = mlx5_core_modify_tir(mdev, tirn, in); |
|---|
| 171 | 187 | if (err) |
|---|
| 172 | 188 | goto out; |
|---|
| 173 | 189 | } |
|---|
| .. | .. |
|---|
| 179 | 195 | mutex_unlock(&mdev->mlx5e_res.td.list_lock); |
|---|
| 180 | 196 | |
|---|
| 181 | 197 | return err; |
|---|
| 182 | | -} |
|---|
| 183 | | - |
|---|
| 184 | | -u8 mlx5e_params_calculate_tx_min_inline(struct mlx5_core_dev *mdev) |
|---|
| 185 | | -{ |
|---|
| 186 | | - u8 min_inline_mode; |
|---|
| 187 | | - |
|---|
| 188 | | - mlx5_query_min_inline(mdev, &min_inline_mode); |
|---|
| 189 | | - if (min_inline_mode == MLX5_INLINE_MODE_NONE && |
|---|
| 190 | | - !MLX5_CAP_ETH(mdev, wqe_vlan_insert)) |
|---|
| 191 | | - min_inline_mode = MLX5_INLINE_MODE_L2; |
|---|
| 192 | | - |
|---|
| 193 | | - return min_inline_mode; |
|---|
| 194 | 198 | } |
|---|