git: 6ff2d2d5d47e - main - fixup! verbs/mlx5: Add GRE and MPLS flow specification filter

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 16 Sep 2026 14:13:31 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=6ff2d2d5d47e53028bbfb48150c32cb0d128e58f

commit 6ff2d2d5d47e53028bbfb48150c32cb0d128e58f
Author:     Ariel Ehrenberg <aehrenberg@nvidia.com>
AuthorDate: 2026-07-28 12:02:56 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-09-16 14:12:10 +0000

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