|
|
@@ -2022,8 +2022,23 @@ static void mlx5e_build_tir_ctx_lro(void *tirc, struct mlx5e_priv *priv)
|
|
|
MLX5_SET(tirc, tirc, lro_timeout_period_usecs, priv->params.lro_timeout);
|
|
|
}
|
|
|
|
|
|
-void mlx5e_build_tir_ctx_hash(void *tirc, struct mlx5e_priv *priv)
|
|
|
+void mlx5e_build_indir_tir_ctx_hash(struct mlx5e_priv *priv, void *tirc,
|
|
|
+ enum mlx5e_traffic_types tt)
|
|
|
{
|
|
|
+ void *hfso = MLX5_ADDR_OF(tirc, tirc, rx_hash_field_selector_outer);
|
|
|
+
|
|
|
+#define MLX5_HASH_IP (MLX5_HASH_FIELD_SEL_SRC_IP |\
|
|
|
+ MLX5_HASH_FIELD_SEL_DST_IP)
|
|
|
+
|
|
|
+#define MLX5_HASH_IP_L4PORTS (MLX5_HASH_FIELD_SEL_SRC_IP |\
|
|
|
+ MLX5_HASH_FIELD_SEL_DST_IP |\
|
|
|
+ MLX5_HASH_FIELD_SEL_L4_SPORT |\
|
|
|
+ MLX5_HASH_FIELD_SEL_L4_DPORT)
|
|
|
+
|
|
|
+#define MLX5_HASH_IP_IPSEC_SPI (MLX5_HASH_FIELD_SEL_SRC_IP |\
|
|
|
+ MLX5_HASH_FIELD_SEL_DST_IP |\
|
|
|
+ MLX5_HASH_FIELD_SEL_IPSEC_SPI)
|
|
|
+
|
|
|
MLX5_SET(tirc, tirc, rx_hash_fn,
|
|
|
mlx5e_rx_hash_fn(priv->params.rss_hfunc));
|
|
|
if (priv->params.rss_hfunc == ETH_RSS_HASH_TOP) {
|
|
|
@@ -2035,6 +2050,88 @@ void mlx5e_build_tir_ctx_hash(void *tirc, struct mlx5e_priv *priv)
|
|
|
MLX5_SET(tirc, tirc, rx_hash_symmetric, 1);
|
|
|
memcpy(rss_key, priv->params.toeplitz_hash_key, len);
|
|
|
}
|
|
|
+
|
|
|
+ switch (tt) {
|
|
|
+ case MLX5E_TT_IPV4_TCP:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV4);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
+ MLX5_L4_PROT_TYPE_TCP);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_L4PORTS);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV6_TCP:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV6);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
+ MLX5_L4_PROT_TYPE_TCP);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_L4PORTS);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV4_UDP:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV4);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
+ MLX5_L4_PROT_TYPE_UDP);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_L4PORTS);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV6_UDP:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV6);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
+ MLX5_L4_PROT_TYPE_UDP);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_L4PORTS);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV4_IPSEC_AH:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV4);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_IPSEC_SPI);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV6_IPSEC_AH:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV6);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_IPSEC_SPI);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV4_IPSEC_ESP:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV4);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_IPSEC_SPI);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV6_IPSEC_ESP:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV6);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP_IPSEC_SPI);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV4:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV4);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP);
|
|
|
+ break;
|
|
|
+
|
|
|
+ case MLX5E_TT_IPV6:
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
+ MLX5_L3_PROT_TYPE_IPV6);
|
|
|
+ MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
+ MLX5_HASH_IP);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ WARN_ONCE(true, "%s: bad traffic type!\n", __func__);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
static int mlx5e_modify_tirs_lro(struct mlx5e_priv *priv)
|
|
|
@@ -2404,110 +2501,13 @@ void mlx5e_cleanup_nic_tx(struct mlx5e_priv *priv)
|
|
|
static void mlx5e_build_indir_tir_ctx(struct mlx5e_priv *priv, u32 *tirc,
|
|
|
enum mlx5e_traffic_types tt)
|
|
|
{
|
|
|
- void *hfso = MLX5_ADDR_OF(tirc, tirc, rx_hash_field_selector_outer);
|
|
|
-
|
|
|
MLX5_SET(tirc, tirc, transport_domain, priv->mdev->mlx5e_res.td.tdn);
|
|
|
|
|
|
-#define MLX5_HASH_IP (MLX5_HASH_FIELD_SEL_SRC_IP |\
|
|
|
- MLX5_HASH_FIELD_SEL_DST_IP)
|
|
|
-
|
|
|
-#define MLX5_HASH_IP_L4PORTS (MLX5_HASH_FIELD_SEL_SRC_IP |\
|
|
|
- MLX5_HASH_FIELD_SEL_DST_IP |\
|
|
|
- MLX5_HASH_FIELD_SEL_L4_SPORT |\
|
|
|
- MLX5_HASH_FIELD_SEL_L4_DPORT)
|
|
|
-
|
|
|
-#define MLX5_HASH_IP_IPSEC_SPI (MLX5_HASH_FIELD_SEL_SRC_IP |\
|
|
|
- MLX5_HASH_FIELD_SEL_DST_IP |\
|
|
|
- MLX5_HASH_FIELD_SEL_IPSEC_SPI)
|
|
|
-
|
|
|
mlx5e_build_tir_ctx_lro(tirc, priv);
|
|
|
|
|
|
MLX5_SET(tirc, tirc, disp_type, MLX5_TIRC_DISP_TYPE_INDIRECT);
|
|
|
MLX5_SET(tirc, tirc, indirect_table, priv->indir_rqt.rqtn);
|
|
|
- mlx5e_build_tir_ctx_hash(tirc, priv);
|
|
|
-
|
|
|
- switch (tt) {
|
|
|
- case MLX5E_TT_IPV4_TCP:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV4);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
- MLX5_L4_PROT_TYPE_TCP);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_L4PORTS);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV6_TCP:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV6);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
- MLX5_L4_PROT_TYPE_TCP);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_L4PORTS);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV4_UDP:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV4);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
- MLX5_L4_PROT_TYPE_UDP);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_L4PORTS);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV6_UDP:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV6);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l4_prot_type,
|
|
|
- MLX5_L4_PROT_TYPE_UDP);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_L4PORTS);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV4_IPSEC_AH:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV4);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_IPSEC_SPI);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV6_IPSEC_AH:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV6);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_IPSEC_SPI);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV4_IPSEC_ESP:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV4);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_IPSEC_SPI);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV6_IPSEC_ESP:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV6);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP_IPSEC_SPI);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV4:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV4);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP);
|
|
|
- break;
|
|
|
-
|
|
|
- case MLX5E_TT_IPV6:
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, l3_prot_type,
|
|
|
- MLX5_L3_PROT_TYPE_IPV6);
|
|
|
- MLX5_SET(rx_hash_field_select, hfso, selected_fields,
|
|
|
- MLX5_HASH_IP);
|
|
|
- break;
|
|
|
- default:
|
|
|
- WARN_ONCE(true,
|
|
|
- "mlx5e_build_indir_tir_ctx: bad traffic type!\n");
|
|
|
- }
|
|
|
+ mlx5e_build_indir_tir_ctx_hash(priv, tirc, tt);
|
|
|
}
|
|
|
|
|
|
static void mlx5e_build_direct_tir_ctx(struct mlx5e_priv *priv, u32 *tirc,
|
|
|
@@ -3331,7 +3331,7 @@ static const struct net_device_ops mlx5e_netdev_ops_sriov = {
|
|
|
static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
|
|
|
{
|
|
|
if (MLX5_CAP_GEN(mdev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
|
|
|
- return -ENOTSUPP;
|
|
|
+ return -EOPNOTSUPP;
|
|
|
if (!MLX5_CAP_GEN(mdev, eth_net_offloads) ||
|
|
|
!MLX5_CAP_GEN(mdev, nic_flow_table) ||
|
|
|
!MLX5_CAP_ETH(mdev, csum_cap) ||
|
|
|
@@ -3343,7 +3343,7 @@ static int mlx5e_check_required_hca_cap(struct mlx5_core_dev *mdev)
|
|
|
< 3) {
|
|
|
mlx5_core_warn(mdev,
|
|
|
"Not creating net device, some required device capabilities are missing\n");
|
|
|
- return -ENOTSUPP;
|
|
|
+ return -EOPNOTSUPP;
|
|
|
}
|
|
|
if (!MLX5_CAP_ETH(mdev, self_lb_en_modifiable))
|
|
|
mlx5_core_warn(mdev, "Self loop back prevention is not supported\n");
|