What can I help you with?
NVIDIA DPDK Documentation MLNX_DPDK_22.11_2310.5.1 LTS

IPv4 Header Length Offload

The IHL field contains the size of the IPv4 header. It has 4 bits that specify the number of 32-bit words in the header. The minimum value for this field is 5, which indicates a length of 20 bytes. As a 4-bit field, the maximum value is 15. IPv4 header length offload extends the flow rule IPv4 header item with the ability to match on IHL field.

Applications can arrange the flow rules to match on IPv4 IHL in one of the following patterns:

  • Hit & default miss. Application MUST create both rules (1) and (2) to receive IPv4 packets with options.

    1. Create a flow rule to offload IPv4 packets without options:

      Copy
      Copied!
                  

      flow create {port} {attributes}      pattern eth / ipv4 ihl mask 5 ihl spec 5 {ipv4 matchers} / {rule items} / end      actions {rule actions} / end

    2. Create a flow rule that forwards packets missed in (1) to RX queue.

  • Hit & explicit miss:

    Valid IHL range is 0x05 – 0x0f. In this scenario application creates explicit rule for each valid IHL:

    Copy
    Copied!
                

    / ipv4 ihl mask 5 ihl spec 5 {ipv4 matchers} / - hit actions / ipv4 ihl mask X ihl spec X {ipv4 matchers} / - miss actions. 0x05 < X <= 0x0f

Copy
Copied!
            

struct rte_flow_item_ipv4 ipv4_mask, ipv4_spec; ipv4_mask.hdr.ihl = ihl_mask_val; ipv4_spec.hdr.ihl = ihl_spec_val;

Current testpmd flow rules parser works with integral types and cannot parse and assign 4 bits long ihl value. Therefore, the testpmd application must use legacy version_ihl member of the rte_ipv4_hdr structure:

Copy
Copied!
            

/ ipv4 version_ihl 0x4X version_ihl spec 0x4X {ipv4 matchers} /

© Copyright 2024, NVIDIA. Last updated on Jan 9, 2025.