35. ICE IAVF IP FRAGMENT RTE FLOW TEST

35.1. Description

This document provides the plan for testing ip fragment.

DPDK-21.05 enable ipv4/6 fragment in rte_flow by IPID on Intel E810 series ethernet cards, major feature are:

  • IP fragment packet can be filtered by IPID with RTE_FLOW in FDIR:

    queue index
    drop
    rss queues
    passthru
    mark
    mark/rss
    
  • IP fragment packet is based on 5-tuple(src-ip/dst-ip/src-port/dst-port/l3 protocol) + IPID as inputset to get hash value in RSS

  • It’s enable on both PF and VF, this plan test on VF.

Note

Currently, ipv4/6 fragment packet was treated as “IPv4/6 pay”, so only validate ipv4/6 fragment pattern.

35.2. Prerequisites

  1. Hardware: Intel® Ethernet 800 Series: E810-XXVDA4/E810-CQ

  2. Software: dpdk: http://dpdk.org/git/dpdk

    scapy: http://www.secdev.org/projects/scapy/

  3. Get the pci device id of DUT, for example:

    ./usertools/dpdk-devbind.py -s
    
    0000:18:00.0 'Device 1593' if=enp24s0f0 drv=ice unused=vfio-pci
    0000:18:00.1 'Device 1593' if=enp24s0f1 drv=ice unused=vfio-pci
    
  4. create vf and bind to dpdk:

    echo 1 > /sys/bus/pci/devices/0000:18:00.0/sriov_numvfs
    ip link set ens801f0 vf 0 mac 00:11:22:33:55:66
    
    ./usertools/dpdk-devbind.py -s
    0000:18:01.0 'Ethernet Adaptive Virtual Function 1889' if=enp24s1 drv=iavf unused=vfio-pci
    
    Bind VFs to dpdk driver:
    modprobe vfio-pci
    ./usertools/dpdk-devbind.py -b vfio-pci 0000:18:01.0 0000:18:01.1
    
  5. Launch testpmd:

    fdir testpmd command:
    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -- -i --rxq=16 --txq=16
    
    rss testpmd command:
    ./x86_64-native-linuxapp-gcc/app/dpdk-testpmd -c 0xf -n 4 -- -i --rxq=16 --txq=16 --disable-rss --rxd=384 --txd=384
    
    testpmd> set fwd rxonly
    testpmd> set verbose 1
    testpmd> start
    

35.3. Basic Test Steps

The steps same as FDIR/RSS suites test steps

35.3.1. take ‘MAC_IPV4_FRAG fdir queue index’ for fdir example

Note

The default rss not support ipfragment, need take a rss rule to enable ipfragment rss.

  1. validate and create rule:

    take a ipfragment rss rule:
    flow create 0 ingress pattern eth / ipv4 / end actions rss types eth ipv4-frag end key_len 0 queues end / end
    
    take fdir rule:
    
    flow validate 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions queue index 1 / mark / end
    Flow rule validated
    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions queue index 1 / mark / end
    Flow rule #0 created
    

Note

For ipfragment rule, it’s a fixed combination for parser to know that a fragment pkt. dpdk care about the bit 12-13 of fragment offset, so the valid range is 0x2000-0x1fff, the spec is 0x2000 and mask is 0x2000.

  1. send matched pkts and check two pkts distributed to queue 1, RSS hash=0x261a7deb - RSS queue=0x1 in output:

    scapy:
    p = Ether()/IP(id=47750)/Raw('X'*666)
    pkts=fragment(p, fragsize=500)
    sendp(pkts, iface="enp1s0")
    
    Sent 2 packets.
          dut.10.240.183.133: port 0/queue 1: received 1 packets
    src=00:00:00:00:00:00 - dst=FF:FF:FF:FF:FF:FF - type=0x0800 - length=530 - nb_segs=1 - RSS hash=0x261a7deb - RSS queue=0x1 - FDIR matched ID=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x1
    ol_flags: PKT_RX_RSS_HASH PKT_RX_FDIR PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_FDIR_ID PKT_RX_OUTER_L4_CKSUM_GOOD
    port 0/queue 1: received 1 packets
    src=00:00:00:00:00:00 - dst=FF:FF:FF:FF:FF:FF - type=0x0800 - length=204 - nb_segs=1 - RSS hash=0x261a7deb - RSS queue=0x1 - FDIR matched ID=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x1
    ol_flags: PKT_RX_RSS_HASH PKT_RX_FDIR PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_FDIR_ID PKT_RX_OUTER_L4_CKSUM_GOOD
    
  2. send mismatched pkts and check fdir id is none:

    scapy:
    Ether(dst='00:11:22:33:55:66')/IP()/Raw('X'*666)
    Ether(dst='00:11:22:33:55:66')/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)
    sendp(p, iface="enp1s0")
    
    port 0/queue 4: received 1 packets
      src=00:00:00:00:00:00 - dst=00:11:22:33:55:66 - type=0x0800 - length=700 - nb_segs=1 - RSS hash=0xafca6174 - RSS queue=0x4 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_NONFRAG  - sw ptype: L2_ETHER L3_IPV4  - l2_len=14 - l3_len=20 - Receive queue=0x4
      ol_flags: RTE_MBUF_F_RX_RSS_HASH RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
    port 0/queue 0: received 1 packets
      src=00:00:00:00:00:00 - dst=00:11:22:33:55:66 - type=0x86dd - length=728 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV6_EXT L4_FRAG  - l2_len=14 - l3_len=48 - l4_len=0 - Receive queue=0x0
      ol_flags: RTE_MBUF_F_RX_L4_CKSUM_GOOD RTE_MBUF_F_RX_IP_CKSUM_GOOD RTE_MBUF_F_RX_OUTER_L4_CKSUM_UNKNOWN
    
  3. destroy rule re-send step 2 pkts and check fdir id is none:

    flow destroy 0 rule 0
    Flow rule #0 destroyed
    
    p = Ether()/IP(id=47750)/Raw('X'*666)
    pkts=fragment(p, fragsize=500)
    sendp(pkts, iface="enp1s0")
    
    Sent 2 packets.
          dut.10.240.183.133: port 0/queue 7: received 1 packets
    src=00:00:00:00:00:00 - dst=FF:FF:FF:FF:FF:FF - type=0x0800 - length=530 - nb_segs=1 - RSS hash=0x4cf81c87 - RSS queue=0x7 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x7
    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_GOOD
    port 0/queue 7: received 1 packets
    src=00:00:00:00:00:00 - dst=FF:FF:FF:FF:FF:FF - type=0x0800 - length=204 - nb_segs=1 - RSS hash=0x4cf81c87 - RSS queue=0x7 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x7
    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_GOOD
    

35.3.2. take ‘MAC_IPV4_FRAG_RSS for rss example

  1. validate and create rule:

    flow validate 0 ingress pattern eth / ipv4 / end actions rss types eth ipv4-frag end key_len 0 queues end / end
    Flow rule validated
    flow create 0 ingress pattern eth / ipv4 / end actions rss types eth ipv4-frag end key_len 0 queues end / end
    Flow rule #0 created
    
  2. send basic pkts and record hash values, RSS hash=0xa1dd9f10 - RSS queue=0x0 in output:

    scapy:
    p = Ether(src='00:11:22:33:44:55', dst='00:11:22:33:55:66')/IP(src='192.168.6.11', dst='10.11.12.13', id=47750)/Raw('X'*666)
    pkts=fragment(p, fragsize=500)
    sendp(pkts, iface="enp1s0")
    
    Sent 2 packets.
          dut.10.240.183.133: port 0/queue 0: received 1 packets
    src=00:11:22:33:44:55 - dst=00:11:22:33:55:66 - type=0x0800 - length=530 - nb_segs=1 - RSS hash=0xa1dd9f10 - RSS queue=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x0
    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    port 0/queue 0: received 1 packets
    src=00:11:22:33:44:55 - dst=00:11:22:33:55:66 - type=0x0800 - length=204 - nb_segs=1 - RSS hash=0xa1dd9f10 - RSS queue=0x0 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x0
    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    
  3. send change input set pkts and check received pkts have different hash value with basic pkts:

    p = Ether(src='00:11:22:33:44:66', dst='00:11:22:33:55:66')/IP(src='192.168.6.11', dst='10.11.12.13', id=47750)/Raw('X'*666)
    pkts=fragment(p, fragsize=500)
    sendp(pkts, iface="enp1s0")
    
    Sent 2 packets.
          dut.10.240.183.133: port 0/queue 12: received 1 packets
    src=00:11:22:33:44:66 - dst=00:11:22:33:55:66 - type=0x0800 - length=530 - nb_segs=1 - RSS hash=0xf4a26fbc - RSS queue=0xc - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0xc
    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    port 0/queue 12: received 1 packets
    src=00:11:22:33:44:66 - dst=00:11:22:33:55:66 - type=0x0800 - length=204 - nb_segs=1 - RSS hash=0xf4a26fbc - RSS queue=0xc - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0xc
    ol_flags: PKT_RX_RSS_HASH PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    
  4. send unhit rule pkts and check received pkts have no hash valuse:

    p = Ether()/IPv6()/IPv6ExtHdrFragment(id=47751)/Raw('X'*666)
    pkts=fragment6(p, 500)
    sendp(pkts, iface="enp1s0")
    
    Sent 2 packets.
          dut.10.240.183.133: port 0/queue 0: received 1 packets
    src=00:00:00:00:00:00 - dst=FF:FF:FF:FF:FF:FF - type=0x86dd - length=494 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV6_EXT L4_FRAG  - l2_len=14 - l3_len=48 - l4_len=0 - Receive queue=0x0
    ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    port 0/queue 0: received 1 packets
    src=00:00:00:00:00:00 - dst=FF:FF:FF:FF:FF:FF - type=0x86dd - length=296 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV6_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV6_EXT L4_FRAG  - l2_len=14 - l3_len=48 - l4_len=0 - Receive queue=0x0
    ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    
  5. destroy rule re-send basic pkts and check received pkts have no hash valuse:

    flow destroy 0 rule 0
    Flow rule #0 destroyed
    
    scapy:
    p = Ether(src='00:11:22:33:44:55', dst='00:11:22:33:55:66')/IP(src='192.168.6.11', dst='10.11.12.13', id=47750)/Raw('X'*666)
    pkts=fragment(p, fragsize=500)
    sendp(pkts, iface="enp1s0")
    
    Sent 2 packets.
          dut.10.240.183.133: port 0/queue 0: received 1 packets
    src=00:11:22:33:44:55 - dst=00:11:22:33:55:66 - type=0x0800 - length=530 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x0
    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    port 0/queue 0: received 1 packets
    src=00:11:22:33:44:55 - dst=00:11:22:33:55:66 - type=0x0800 - length=204 - nb_segs=1 - hw ptype: L2_ETHER L3_IPV4_EXT_UNKNOWN L4_FRAG  - sw ptype: L2_ETHER L3_IPV4 L4_FRAG  - l2_len=14 - l3_len=20 - l4_len=0 - Receive queue=0x0
    ol_flags: PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD PKT_RX_OUTER_L4_CKSUM_UNKNOWN
    

35.4. Test case: MAC_IPV4_FRAG pattern fdir fragment

35.4.1. Subcase 1: MAC_IPV4_FRAG fdir queue index

  1. rules:

    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions queue index 1 / mark / end
    
  2. matched packets:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment(p, 500)
    
  3. unmatched packets:

    Ether()/IP()/Raw('X'*666)
    Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)
    

35.4.2. Subcase 2: MAC_IPV4_FRAG fdir rss queues

  1. rules:

    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions rss queues 2 3 end / mark / end
    
  2. matched packets:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment(p, 500)
    
  3. unmatched packets:

    Ether()/IP()/Raw('X'*666)
    Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)
    

35.4.3. Subcase 3: MAC_IPV4_FRAG fdir passthru

  1. rules:

    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions passthru / mark / end
    
  2. matched packets:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment(p, 500)
    
  3. unmatched packets:

    Ether()/IP()/Raw('X'*666)
    Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)
    

35.4.4. Subcase 4: MAC_IPV4_FRAG fdir drop

  1. rules:

    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions drop / mark / end
    
  2. matched packets:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment(p, 500)
    
  3. unmatched packets:

    Ether()/IP()/Raw('X'*666)
    Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)
    

35.4.5. Subcase 5: MAC_IPV4_FRAG fdir mark+rss

  1. rules:

    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions mark / rss / end
    
  2. matched packets:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment(p, 500)
    
  3. unmatched packets:

    Ether()/IP()/Raw('X'*666)
    Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)
    

35.4.6. Subcase 6: MAC_IPV4_FRAG fdir mark

  1. rules:

    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions mark id 1 / end
    
  2. matched packets:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment(p, 500)
    
  3. unmatched packets:

    Ether()/IP()/Raw('X'*666)
    Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)
    

35.5. Test case: MAC_IPV6_FRAG pattern fdir fragment

35.5.1. Subcase 1: MAC_IPV6_FRAG fdir queue index

  1. rules:

    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext frag_data spec 0x0001 frag_data mask 0x0001 / end actions queue index 1 / mark / end
    
  2. matched packets:

    p=Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    
  3. unmatched packets:

    Ether()/IPv6()/Raw('X'*666)
    Ether()/IP(id=47750)/Raw('X'*666)
    

35.5.2. Subcase 2: MAC_IPV6_FRAG fdir rss queues

  1. rules:

    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext frag_data spec 0x0001 frag_data mask 0x0001 / end actions rss queues 2 3 end / mark / end
    
  2. matched packets:

    p=Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    
  3. unmatched packets:

    Ether()/IPv6()/Raw('X'*666)
    Ether()/IP(id=47750)/Raw('X'*666)
    

35.5.3. Subcase 3: MAC_IPV6_FRAG fdir passthru

  1. rules:

    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext frag_data spec 0x0001 frag_data mask 0x0001 / end actions passthru / mark / end
    
  2. matched packets:

    p=Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    
  3. unmatched packets:

    Ether()/IPv6()/Raw('X'*666)
    Ether()/IP(id=47750)/Raw('X'*666)
    

35.5.4. Subcase 4: MAC_IPV6_FRAG fdir drop

  1. rules:

    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext frag_data spec 0x0001 frag_data mask 0x0001 / end actions drop / mark / end
    
  2. matched packets:

    p=Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    
  3. unmatched packets:

    Ether()/IPv6()/Raw('X'*666)
    Ether()/IP(id=47750)/Raw('X'*666)
    

35.5.5. Subcase 5: MAC_IPV6_FRAG fdir mark+rss

  1. rules:

    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext frag_data spec 0x0001 frag_data mask 0x0001 / end actions mark / rss / end
    
  2. matched packets:

    p=Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    
  3. unmatched packets:

    Ether()/IPv6()/Raw('X'*666)
    Ether()/IP(id=47750)/Raw('X'*666)
    

35.5.6. Subcase 6: MAC_IPV6_FRAG fdir mark

  1. rules:

    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext frag_data spec 0x0001 frag_data mask 0x0001 / end actions mark id 1 / end
    
  2. matched packets:

    p=Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    
  3. unmatched packets:

    Ether()/IPv6()/Raw('X'*666)
    Ether()/IP(id=47750)/Raw('X'*666)
    

35.6. Test case: MAC_IPV4_FRAG_fdir_with_l2

Note

VF not support take l2 as inputset

35.7. Test case: MAC_IPV6_FRAG_fdir_with_l2

Note

VF not support take l2 as inputset

35.8. Test case: MAC_IPV4_FRAG_fdir_with_l3

  1. The test step is the same as MAC_IPV4_FRAG pattern fdir fragment
  2. rule and pkt need contain IP(src=’XX’) addr

take ‘mac_ipv4_frag_l3src_fdir_queue_index’ example:

1.rules:

flow create 0 ingress pattern eth / ipv4 src is 192.168.1.1 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions queue index 1 / mark / end

2.matched packets:

p=Ether()/IP(id=47750, src='192.168.1.1')/Raw('X'*666); pkts=fragment(p, fragsize=500)

3.unmatched packets:

Ether()/IP(src='192.168.1.1')/Raw('X'*666)
Ether()/IPv6()/IPv6ExtHdrFragment(id=47750)/Raw('X'*666)

35.8.1. subcase 1: MAC_IPV4_FRAG_fdir_with_l3dst

35.8.2. subcase 2: MAC_IPV4_FRAG_fdir_with_l3src

35.9. Test case: MAC_IPV6_FRAG_fdir_with_l3

  1. The test step is the same as MAC_IPV6_FRAG pattern fdir fragment
  2. rule and pkt need contain IPv6(src=’XX’) addr

take ‘mac_ipv6_frag_l3src_fdir_queue_index’ example:

1.rules:

flow create 0 ingress pattern eth / ipv6 src is 2001::1 / ipv6_frag_ext frag_data spec 0x0001 frag_data mask 0x0001 / end actions queue index 1 / mark / end

2.matched packets:

p=Ether()/IPv6(src='2001::1')/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkts=fragment6(p, 500)

3.unmatched packets:

Ether()/IPv6(src='2001::1')/Raw('X'*666)
Ether()/IP(id=47750)/Raw('X'*666)

35.9.1. subcase 1: MAC_IPV6_FRAG_fdir_with_l3dst

35.9.2. subcase 2: MAC_IPV6_FRAG_fdir_with_l3src

35.10. Test case: MAC_IPV4_FRAG RSS

  1. rule:

    flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-frag end key_len 0 queues end / end
    
  2. basic packet:

    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IP(src='192.168.6.11', dst='10.11.12.13', id=47750)/Raw('X'*666); pkts=fragment(p, 500)
    
  3. hit pattern packet with changed input set in the rule:

    p=Ether(src='00:11:22:33:44:66', dst='66:77:88:99:AA:BB')/IP(src='192.168.6.11', dst='10.11.12.13', id=47750)/Raw('X'*666); pkts=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:CC')/IP(src='192.168.6.11', dst='10.11.12.13', id=47750)/Raw('X'*666); pkts=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IP(src='192.168.6.12', dst='10.11.12.13', id=47750)/Raw('X'*666); pkts=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IP(src='192.168.6.11', dst='10.11.12.14', id=47750)/Raw('X'*666); pkts=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IP(src='192.168.6.11', dst='10.11.12.13', id=47751)/Raw('X'*666); pkts=fragment6(p, 500)
    
  4. not hit pattern packets with input set in the rule:

    p=Ether()/IPv6()/IPv6ExtHdrFragment(id=47751)/Raw('X'*666); pkt=fragment6(p, 500)
    

35.11. Test case: MAC_IPV6_FRAG RSS

  1. rules:

    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext / end actions rss types ipv6-frag end key_len 0 queues end / end
    
  2. basic packet:

    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IPv6(src='CDCD:910A:2222:5498:8475:1111:3900:1537', dst='CDCD:910A:2222:5498:8475:1111:3900:2020')/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    
  3. hit pattern packet with changed input set in the rule:

    p=Ether(src='00:11:22:33:44:66', dst='66:77:88:99:AA:BB')/IPv6(src='CDCD:910A:2222:5498:8475:1111:3900:1537', dst='CDCD:910A:2222:5498:8475:1111:3900:2020')/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:CC')/IPv6(src='CDCD:910A:2222:5498:8475:1111:3900:1537', dst='CDCD:910A:2222:5498:8475:1111:3900:2020')/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IPv6(src='CDCD:910A:2222:5498:8475:1111:3900:1538', dst='CDCD:910A:2222:5498:8475:1111:3900:2020')/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IPv6(src='CDCD:910A:2222:5498:8475:1111:3900:1537', dst='CDCD:910A:2222:5498:8475:1111:3900:2021')/IPv6ExtHdrFragment(id=47750)/Raw('X'*666); pkt=fragment6(p, 500)
    p=Ether(src='00:11:22:33:44:55', dst='66:77:88:99:AA:BB')/IPv6(src='CDCD:910A:2222:5498:8475:1111:3900:1537', dst='CDCD:910A:2222:5498:8475:1111:3900:2020')/IPv6ExtHdrFragment(id=47751)/Raw('X'*666); pkt=fragment6(p, 500)
    
  4. not hit pattern packets with input set in the rule:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment6(p, 500)
    

35.12. Test case: VF exclusive validation

35.12.1. Subcase 1: exclusive validation fdir rule

  1. create fdir filter rules:

    flow create 0 ingress pattern eth / ipv4 src is 192.168.0.20 / end actions queue index 1 / mark / end
    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions queue index 2 / mark / end
    
  2. hit pattern/defined input set id, the pkt received for queue 2:

    p=Ether()/IP(src="192.168.0.20", id=47750)/Raw('X'*666)
    

35.12.2. Subcase 2: exclusive validation fdir rule

  1. create fdir filter rules:

    flow create 0 ingress pattern eth / ipv4 fragment_offset spec 0x2000 fragment_offset mask 0x2000 / end actions queue index 1 / end actions queue index 2 / mark / end
    flow create 0 ingress pattern eth / ipv4 src is 192.168.0.20 / end actions queue index 1 / mark / end
    
  2. hit pattern/defined input set id, the pkt received for queue 2:

    p=Ether()/IP(src="192.168.0.20", id=47750)/Raw('X'*666)
    

35.12.3. Subcase 3: exclusive validation rss rule

  1. create rss rules:

    flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4 end key_len 0 queues end / end
    flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-frag end key_len 0 queues end / end
    
  2. hit pattern/defined input set id, the pkt received for rss different queue:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment6(p, 500)
    p=Ether()/IP(id=47751)/Raw('X'*666); pkts=fragment6(p, 500)
    

35.12.4. Subcase 4: exclusive validation rss rule

  1. create rss rules:

    flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4-frag end key_len 0 queues end / end
    flow create 0 ingress pattern eth / ipv4 / end actions rss types ipv4 end key_len 0 queues end / end
    
  2. hit pattern/defined input set id, the pkt received for rss different queue:

    p=Ether()/IP(id=47750)/Raw('X'*666); pkts=fragment6(p, 500)
    p=Ether()/IP(id=47751)/Raw('X'*666); pkts=fragment6(p, 500)
    

35.13. Test case: negative validation

Note: there may be error message change.

  1. Invalid action:

    flow create 0 ingress pattern eth / ipv6 packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff fragment_offset spec 0x2000 fragment_offset last 0x1fff fragment_offset mask 0xffff / end actions queue index 2 / end
    flow create 0 ingress pattern eth / ipv6 packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff fragment_offset spec 0x2000 fragment_offset last 0x1fff fragment_offset mask 0xffff / end actions queue index 300 / end
    flow create 0 ingress pattern eth / ipv6 packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff fragment_offset spec 0x2 fragment_offset last 0x1fff fragment_offset mask 0xffff / end actions queue index 2 / end
    flow create 0 ingress pattern eth / ipv6 packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff fragment_offset spec 0x2000 fragment_offset last 0x1 fragment_offset mask 0xffff / end actions queue index 2 / end
    flow create 0 ingress pattern eth / ipv6 packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff fragment_offset spec 0x2000 fragment_offset last 0x1fff fragment_offset mask 0xf / end actions queue index 2 / end
    flow create 0 ingress pattern eth / ipv4 packet_id is 47750 fragment_offset last 0x1fff fragment_offset mask 0xffff / end actions queue index 2 / end
    flow create 0 ingress pattern eth / ipv4 packet_id is 47750 fragment_offset spec 0x2000 fragment_offset / end actions queue index 2 / end
    flow create 0 ingress pattern eth / ipv4 packet_id is 47750 fragment_offset spec 0x2000 fragment_offset last 0x1fff / end actions queue index 2 / end
    flow create 0 ingress pattern eth / ipv4 packet_id is 47750 / end actions queue index 300 / end
    flow create 0 ingress pattern eth / ipv4 packet_id last 0xffff packet_id mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv4 packet_id spec 0 packet_id mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv4 packet_id spec 0 packet_id last 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv4 / ipv6_frag_ext packet_id is 47750 frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id is 47750 frag_data spec 0xfff8 frag_data last 0x0001 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id is 47750 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id is 47750 frag_data spec 0x0001 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id is 47750 frag_data spec 0x0001 frag_data last 0xfff8 / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id is 47750 frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 300 / end
    flow create 0 ingress pattern eth / ipv4 / ipv6_frag_ext packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id spec 0xffff packet_id last 0x0 packet_id mask 0xffff frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff frag_data spec 0xfff8 frag_data last 0x0001 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / packet_id last 0xffff packet_id mask 0xffff frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id spec 0 packet_id mask 0xffff frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id spec 0 packet_id last 0xffff frag_data spec 0x0001 frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff frag_data last 0xfff8 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff frag_data spec 0x0001 frag_data last 0xfff8 / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id spec 0 packet_id last 0xffff packet_id mask 0xffff frag_data spec 0x0001 frag_data mask 0xffff / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv4 / ipv6_frag_ext packet_id is 47750 / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext packet_id is 0x10000 / end actions queue index 1 / end
    flow create 0 ingress pattern eth / ipv6 / end actions rss types ipv4-frag end key_len 0 queues end / end
    flow create 0 ingress pattern eth / ipv4 / ipv6_frag_ext / end actions rss types ipv6-frag end key_len 0 queues end / end
    flow create 0 ingress pattern eth / ipv6 / ipv6_frag_ext / end actions rss types ipv4-frag end key_len 0 queues end / end