net/mlx5: fix missing next proto in IPv4/6 encap hash calc
PATCH 1/1 net/mlx5: fix missing next proto in IPv4/6 encap hash calc
Add missing memcpy for next_protocol field when processing IPv4/6 items in flow_hw_calc_encap_hash function. This ensures the IPv4/6 header's proto field is properly copied to the hash calculation data structure.
Fixes bb328f44afe9 ("net/mlx5: support encapsulation hash calculation")
Signed-off-by Maayan Kashani <[email protected]>
Acked-by Bing Zhao <[email protected]>
--- drivers/net/mlx5/mlx5_flow_hw.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/mlx5/mlx5_flow_hw.c +4 -0
@@ -15096,6 +15096,8 @@ flow_hw_calc_encap_hash(struct rte_eth_dev *dev, ((const struct rte_flow_item_ipv4 *)(pattern->spec))->hdr.dst_addr; data.src.ipv4_addr = ((const struct rte_flow_item_ipv4 *)(pattern->spec))->hdr.src_addr; + data.next_protocol = ((const struct rte_flow_item_ipv4 *) + (pattern->spec))->hdr.next_proto_id;break ;case RTE_FLOW_ITEM_TYPE_IPV6 : memcpy(data.dst.ipv6_addr,
@@ -15104,6 +15106,8 @@ flow_hw_calc_encap_hash(struct rte_eth_dev *dev,memcpy (data.src.ipv6_addr, &((const struct rte_flow_item_ipv6 *)(pattern->spec))->hdr.src_addr,sizeof (data.src.ipv6_addr)); + data.next_protocol = ((const struct rte_flow_item_ipv6 *) + (pattern->spec))->hdr.proto;break ;case RTE_FLOW_ITEM_TYPE_UDP : data.next_protocol =IPPROTO_UDP ;
Signature · 1 line
2.21.0
Hi,
Quoted 10 lines · Maayan Kashani
Add missing memcpy for
next_protocolfield when processing IPv4/6 items inflow_hw_calc_encap_hashfunction. This ensures the IPv4/6 header's proto field is properly copied to the hash calculation data structure.Fixes bb328f44afe9 ("net/mlx5: support encapsulation hash calculation")Signed-off-by Maayan Kashani <[email protected]>Acked-by Bing Zhao <[email protected]>---
Patch applied to next-net-mlx,
Kindest regards
Raslan Darawsheh