From 6ff2d2d5d47e53028bbfb48150c32cb0d128e58f Mon Sep 17 00:00:00 2001 From: Ariel Ehrenberg Date: Tue, 28 Jul 2026 15:02:56 +0300 Subject: [PATCH] fixup! verbs/mlx5: Add GRE and MPLS flow specification filter Import rdma-core upstream commit ff01da2c5ac2 ("verbs: Fix typo in copying IBV_FLOW_SPEC_UDP/TCP 'val'"). The TCP/UDP filter value was copied using the size of the IPv4 filter, overrunning the destination subobject. Also accept inner MPLS flow specs, matching 6d6f29721eea ("verbs: Allow creation of inner MPLS flow spec"). Upstream deliberately has no inner case for GRE - it is a tunnel header, matched only in the outer stack - so that part of the review comment is not applied. Sponsored by: NVidia networking MFC after: 1 month --- contrib/ofed/libibverbs/cmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/ofed/libibverbs/cmd.c b/contrib/ofed/libibverbs/cmd.c index 9c79757f0e60..e165923184c8 100644 --- a/contrib/ofed/libibverbs/cmd.c +++ b/contrib/ofed/libibverbs/cmd.c @@ -1910,7 +1910,7 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec, case IBV_FLOW_SPEC_UDP | IBV_FLOW_SPEC_INNER: kern_spec->tcp_udp.size = sizeof(struct ibv_kern_spec_tcp_udp); memcpy(&kern_spec->tcp_udp.val, &ib_spec->tcp_udp.val, - sizeof(struct ibv_flow_ipv4_filter)); + sizeof(struct ibv_flow_tcp_udp_filter)); memcpy(&kern_spec->tcp_udp.mask, &ib_spec->tcp_udp.mask, sizeof(struct ibv_flow_tcp_udp_filter)); break; @@ -1922,6 +1922,7 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec, sizeof(struct ibv_flow_gre_filter)); break; case IBV_FLOW_SPEC_MPLS: + case IBV_FLOW_SPEC_MPLS | IBV_FLOW_SPEC_INNER: kern_spec->mpls.size = sizeof(struct ib_uverbs_flow_spec_mpls); memcpy(&kern_spec->mpls.val, &ib_spec->mpls.val, sizeof(struct ibv_flow_mpls_filter));