X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5_flow.c;h=32634c9af7f44123e9060b7a5c562099f08d2b1c;hb=09546d7b01927b5e31fdb51eea1f4ccc3abac5d2;hp=281153722689ed31560509b7e345aff4761d3eac;hpb=9f39076b71a8f6526e8da0612f365ef2c682efe0;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 2811537226..32634c9af7 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -99,6 +99,8 @@ struct mlx5_flow_expand_node { * RSS types bit-field associated with this node * (see ETH_RSS_* definitions). */ + uint8_t optional; + /**< optional expand field. Default 0 to expand, 1 not go deeper. */ }; /** Object returned by mlx5_flow_expand_rss(). */ @@ -212,7 +214,7 @@ mlx5_flow_expand_rss_item_complete(const struct rte_flow_item *item) return ret; } -#define MLX5_RSS_EXP_ELT_N 8 +#define MLX5_RSS_EXP_ELT_N 16 /** * Expand RSS flows into several possible flows according to the RSS hash @@ -366,7 +368,7 @@ mlx5_flow_expand_rss(struct mlx5_flow_expand_rss *buf, size_t size, } } /* Go deeper. */ - if (node->next) { + if (!node->optional && node->next) { next_node = node->next; if (stack_pos++ == MLX5_RSS_EXP_ELT_N) { rte_errno = E2BIG; @@ -405,6 +407,7 @@ enum mlx5_expansion { MLX5_EXPANSION_VXLAN, MLX5_EXPANSION_VXLAN_GPE, MLX5_EXPANSION_GRE, + MLX5_EXPANSION_GRE_KEY, MLX5_EXPANSION_MPLS, MLX5_EXPANSION_ETH, MLX5_EXPANSION_ETH_VLAN, @@ -513,9 +516,16 @@ static const struct mlx5_flow_expand_node mlx5_support_expansion[] = { }, [MLX5_EXPANSION_GRE] = { .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, - MLX5_EXPANSION_IPV6), + MLX5_EXPANSION_IPV6, + MLX5_EXPANSION_GRE_KEY), .type = RTE_FLOW_ITEM_TYPE_GRE, }, + [MLX5_EXPANSION_GRE_KEY] = { + .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, + MLX5_EXPANSION_IPV6), + .type = RTE_FLOW_ITEM_TYPE_GRE_KEY, + .optional = 1, + }, [MLX5_EXPANSION_MPLS] = { .next = MLX5_FLOW_EXPAND_RSS_NEXT(MLX5_EXPANSION_IPV4, MLX5_EXPANSION_IPV6),