Skip to contentSkip to conversation

net/mlx5: fix missing next proto in IPv4/6 encap hash calc

PATCH In review Maayan Kashani 2 participants 2 messages Sep 15, 2025 – Sep 22, 2025 Network drivers

lore
Share & tools
lore
#0 lore raw

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")
---
 drivers/net/mlx5/mlx5_flow_hw.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/mlx5/mlx5_flow_hw.c +4 -0
index 2ca40b41465..ee8f8c35e57 100644
@@ -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
#1 lore raw

Hi,

Quoted 10 lines · Maayan Kashani

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")

---

Patch applied to next-net-mlx,

Kindest regards
Raslan Darawsheh