* [DPDK/testpmd Bug 1479] mlx5: Not able to create rte_flows to match head fragments and sub fragments
@ 2024-07-02 14:21 bugzilla
  2024-07-03  6:19 ` Asaf Penso
  2025-10-27  9:17 ` bugzilla
  0 siblings, 2 replies; 3+ messages in thread
From: bugzilla @ 2024-07-02 14:21 UTC (permalink / raw)
  To: dev
[-- Attachment #1: Type: text/plain, Size: 4173 bytes --]
https://bugs.dpdk.org/show_bug.cgi?id=1479
            Bug ID: 1479
           Summary: mlx5: Not able to create rte_flows to match head
                    fragments and sub fragments
           Product: DPDK
           Version: 21.11
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: major
          Priority: Normal
         Component: testpmd
          Assignee: dev@dpdk.org
          Reporter: pingtosiva@gmail.com
  Target Milestone: ---
I am trying to create an RTE flow rule to match head and non-head fragments to
compute NIC RSS based on 5tuple/3tuple respectively on connectX-6 DX NIC and
mlx5 driver. 
As part of it when trying to install RTE flow rule using testpmd on dpdk
21.11/23.07 version, the following errors are thrown.
Flow rule to match head fragment
=================================
testpmd>  flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000
fragment_offset mask 0x3fff / end actions drop / count / end
port_flow_complain(): Caught PMD error type 13 (specific pattern item): cause:
0x7ffd1954c548, match on first fragment not supported: Operation not supported
Flow rule to match non-head fragments
======================================
testpmd> flow validate 0 ingress pattern eth / ipv4 fragment_offset is 0x2001
fragment_offset last 0x1fff / end actions drop / end
port_flow_complain(): Caught PMD error type 11 (item specification range):
cause: 0x7ffc6f629534, specified range not supported: Operation not supported
When I browsed mlx5_flow_dv.c driver file, there are set of conditions
implemented to block this configurations.
Could you kindly help is there a way to compute different RSS hash for
fragments and non-fragments using RTE flow rules on mellanox?
Thanks! in advance.
       /*
         * Match on fragment_offset 0x2000 means MF is 1 and frag-offset is 0,
         * indicating this is 1st fragment of fragmented packet.
         * This is not yet supported in MLX5, return appropriate error message.
         */
        if (fragment_offset_spec == RTE_BE16(RTE_IPV4_HDR_MF_FLAG))
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM, item,
                                          "match on first fragment not "
                                          "supported");
        if (fragment_offset_spec && !last)
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM, item,
                                          "specified value not supported");
        /*
         * Match on fragment_offset spec 0x2001 and last 0x3fff
         * means MF is 1 and frag-offset is > 0.
         * This packet is fragment 2nd and onward, excluding last.
         * This is not yet supported in MLX5, return appropriate
         * error message.
         */
        if (fragment_offset_spec == RTE_BE16(RTE_IPV4_HDR_MF_FLAG + 1) &&
            fragment_offset_last == RTE_BE16(MLX5_IPV4_FRAG_OFFSET_MASK))
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM_LAST,
                                          last, "match on following "
                                          "fragments not supported");
        /*
         * Match on fragment_offset spec 0x0001 and last 0x1fff
         * means MF is 0 and frag-offset is > 0.
         * This packet is last fragment of fragmented packet.
         * This is not yet supported in MLX5, return appropriate
         * error message.
         */
        if (fragment_offset_spec == RTE_BE16(1) &&
            fragment_offset_last == RTE_BE16(RTE_IPV4_HDR_OFFSET_MASK))
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM_LAST,
                                          last, "match on last "
                                          "fragment not supported");
-- 
You are receiving this mail because:
You are the assignee for the bug.
[-- Attachment #2: Type: text/html, Size: 6162 bytes --]
^ permalink raw reply	[flat|nested] 3+ messages in thread* RE: [DPDK/testpmd Bug 1479] mlx5: Not able to create rte_flows to match head fragments and sub fragments
  2024-07-02 14:21 [DPDK/testpmd Bug 1479] mlx5: Not able to create rte_flows to match head fragments and sub fragments bugzilla
@ 2024-07-03  6:19 ` Asaf Penso
  2025-10-27  9:17 ` bugzilla
  1 sibling, 0 replies; 3+ messages in thread
From: Asaf Penso @ 2024-07-03  6:19 UTC (permalink / raw)
  To: bugzilla, dev
[-- Attachment #1: Type: text/plain, Size: 4920 bytes --]
Hello
Mlx5 pmd supports only these two modes:
  1.  fragment_offset=0x0000 with mask 0xffff means MF is 0 and frag-offset is 0.
This is an unfragmented packet.
  2.  fragment_offset spec 0x0001 and last 0x3fff with mask 0xffff, means MF and/or frag-offset is not 0.
This is a fragmented packet.
To answer your questions, mlx5 doesn’t support match on head fragment and to match on non-head fragment, try mode 2 above.
Regards,
Asaf Penso
From: bugzilla@dpdk.org <bugzilla@dpdk.org>
Sent: Tuesday, 2 July 2024 17:21
To: dev@dpdk.org
Subject: [DPDK/testpmd Bug 1479] mlx5: Not able to create rte_flows to match head fragments and sub fragments
Bug ID
1479<https://bugs.dpdk.org/show_bug.cgi?id=1479>
Summary
mlx5: Not able to create rte_flows to match head fragments and sub fragments
Product
DPDK
Version
21.11
Hardware
All
OS
All
Status
UNCONFIRMED
Severity
major
Priority
Normal
Component
testpmd
Assignee
dev@dpdk.org<mailto:dev@dpdk.org>
Reporter
pingtosiva@gmail.com<mailto:pingtosiva@gmail.com>
Target Milestone
---
I am trying to create an RTE flow rule to match head and non-head fragments to
compute NIC RSS based on 5tuple/3tuple respectively on connectX-6 DX NIC and
mlx5 driver.
As part of it when trying to install RTE flow rule using testpmd on dpdk
21.11/23.07 version, the following errors are thrown.
Flow rule to match head fragment
=================================
testpmd>  flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000
fragment_offset mask 0x3fff / end actions drop / count / end
port_flow_complain(): Caught PMD error type 13 (specific pattern item): cause:
0x7ffd1954c548, match on first fragment not supported: Operation not supported
Flow rule to match non-head fragments
======================================
testpmd> flow validate 0 ingress pattern eth / ipv4 fragment_offset is 0x2001
fragment_offset last 0x1fff / end actions drop / end
port_flow_complain(): Caught PMD error type 11 (item specification range):
cause: 0x7ffc6f629534, specified range not supported: Operation not supported
When I browsed mlx5_flow_dv.c driver file, there are set of conditions
implemented to block this configurations.
Could you kindly help is there a way to compute different RSS hash for
fragments and non-fragments using RTE flow rules on mellanox?
Thanks! in advance.
       /*
         * Match on fragment_offset 0x2000 means MF is 1 and frag-offset is 0,
         * indicating this is 1st fragment of fragmented packet.
         * This is not yet supported in MLX5, return appropriate error message.
         */
        if (fragment_offset_spec == RTE_BE16(RTE_IPV4_HDR_MF_FLAG))
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM, item,
                                          "match on first fragment not "
                                          "supported");
        if (fragment_offset_spec && !last)
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM, item,
                                          "specified value not supported");
        /*
         * Match on fragment_offset spec 0x2001 and last 0x3fff
         * means MF is 1 and frag-offset is > 0.
         * This packet is fragment 2nd and onward, excluding last.
         * This is not yet supported in MLX5, return appropriate
         * error message.
         */
        if (fragment_offset_spec == RTE_BE16(RTE_IPV4_HDR_MF_FLAG + 1) &&
            fragment_offset_last == RTE_BE16(MLX5_IPV4_FRAG_OFFSET_MASK))
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM_LAST,
                                          last, "match on following "
                                          "fragments not supported");
        /*
         * Match on fragment_offset spec 0x0001 and last 0x1fff
         * means MF is 0 and frag-offset is > 0.
         * This packet is last fragment of fragmented packet.
         * This is not yet supported in MLX5, return appropriate
         * error message.
         */
        if (fragment_offset_spec == RTE_BE16(1) &&
            fragment_offset_last == RTE_BE16(RTE_IPV4_HDR_OFFSET_MASK))
                return rte_flow_error_set(error, ENOTSUP,
                                          RTE_FLOW_ERROR_TYPE_ITEM_LAST,
                                          last, "match on last "
                                          "fragment not supported");
________________________________
You are receiving this mail because:
  *   You are the assignee for the bug.
[-- Attachment #2: Type: text/html, Size: 24083 bytes --]
^ permalink raw reply	[flat|nested] 3+ messages in thread* [DPDK/testpmd Bug 1479] mlx5: Not able to create rte_flows to match head fragments and sub fragments
  2024-07-02 14:21 [DPDK/testpmd Bug 1479] mlx5: Not able to create rte_flows to match head fragments and sub fragments bugzilla
  2024-07-03  6:19 ` Asaf Penso
@ 2025-10-27  9:17 ` bugzilla
  1 sibling, 0 replies; 3+ messages in thread
From: bugzilla @ 2025-10-27  9:17 UTC (permalink / raw)
  To: dev
http://bugs.dpdk.org/show_bug.cgi?id=1479
mkashani@nvidia.com (mkashani@nvidia.com) changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mkashani@nvidia.com
             Status|CONFIRMED                   |RESOLVED
         Resolution|---                         |FIXED
--- Comment #1 from mkashani@nvidia.com (mkashani@nvidia.com) ---
Hi, Siva,
Sorry for the late response,
You're correct that the mlx5 driver explicitly blocks the fragment matching
patterns you're trying to use.
For your use case (computing different RSS based on 5-tuple vs 3-tuple):
Create two flow rules:
One for ANY fragmented packets → RSS with 3-tuple (ipv4-frag)
One for non-fragmented packets → RSS with 5-tuple (ipv4-tcp, ipv4-udp)
The NIC will automatically:
Use 3-tuple for fragments (only IP src/dst/protocol available)
Use 5-tuple for non-fragments (full 5-tuple available)
You cannot differentiate between first, middle, and last fragments in flow
rules on ConnectX-6 DX.
The hardware RSS engine already handles this correctly by design - fragmented
packets can only use 3-tuple because port information is only in the first
fragment, and may not be available to all fragments.
-- 
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply	[flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-10-27  9:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-02 14:21 [DPDK/testpmd Bug 1479] mlx5: Not able to create rte_flows to match head fragments and sub fragments bugzilla
2024-07-03  6:19 ` Asaf Penso
2025-10-27  9:17 ` bugzilla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).