FRP (Flexible Receive Parser) Validation

This section explains how to enable an in-built programmable parser to parse the received Ethernet packet and provide an interface for users to configure rules in the parser.

The sample(QM) application shows how to configure parser rules for user-defined actions matched Rx packets.

FRP (Flexible Receive Parser)

The MAC hardware controller has an in-built programmable parser to parse the Ethernet packet based on a software-controlled/programmable rule-set. This supports filtering and packet steering decisions (DMA channel selection) of the received packet based on any header field, 64/124 bytes from SOF (start of frame), of existing protocols or custom and future protocols. The parser uses a software programmed lookup table that contains instructions and filtering and routing decisions taken by the controller on the received packets.
Note: When FRP-based routing is enabled, MAC, RSS and IP based routing will not apply. Create FRP rules for any such added routing rules.

Scope

There is a designated interface for FRP configuration, such as default 0, and this dedicated instance can configure any physical MAC controller instance of that hardware.

Abbreviations

  • FRP -Flexible Receive Parser
  • MAC - Medium access control
  • MAC - Medium access control
  • RSS - Receive side scaling
  • IP - Internet protocol
  • DUT - Device under test
  • OK index(OKI)
  • NIC - Next Instruction Control.
     if (NIC==0) continue parse from OK Index
     else /*(NIC ==1)*/ continue sequentially (parse the next entry in the instruction table)
    
  • L2 Filter - Layer 2 MAC address filter

Linux OS

Note: The sample application is for development purposes and not for production.

Linux nvether_sample_app utility

QM sample application binary for Nvidia DUT (nvether_sample_app)

  • Part of SDK release for reference
To check the version:
./nvether_sample_app

Look for string such as Version(4), which means 4.

FRP_ADD Command Syntax

AV+L:

nvether_sample_app <primary interface> frp_add <ID> <Match> <Type> <Filter Mode> <Offset> <OKI> <DMASel>

Parameters

  • Id - FRP table ID to add (0 to 255)
  • Match - Match data is used for comparing
    • MAX 12 bytes data
  • Type - Match data type
    • 0 - Normal data
    • 1 - L2 DA MAC
    • 2 - L2 SA MAC
    • 3 - L3 Source IP
    • 4 - L3 Destination IP
    • 5 - L4 UDP Source Port
    • 6 - L4 UDP Destination Port
    • 7 - L4 TCP Source Port
    • 8 - L4 TCP Destination Port
    • 9 - VLAN Tag
  • Mode - Filter mode for the entry
    • 0 - Accept and route
    • 1 - Reject and Drop
    • 2 - Accept and Bypass FRP Route
    • 3 - Link to OK Index
    • 4 - Inverse the Match, Accept and route
    • 5 - Inverse the Match, Reject and Drop
    • 6 - Inverse the Match, Accept and Bypass FRP Route
    • 7 - Inverse the Match, Link to OK Index
  • Offset - Frame offset of Match data
  • OKI - When NIC set give the value for Next Instruction
  • DMASel - Bit selection of DMA channels to route the frame
    • Bit[0] - DMA channel 0
    • ...
    • Bit [N] - DMA channel N]
      • Max N for EQOS HW is 7
      • Max N for MGBE is 9
Note: Packet duplication to multiple DMA channels works only for MC/BC packets and Highest RxQ needs to be enabled on the DT. Highest queue (Rx queue 9 for MGBE and Rx queue 7 for Orin platform)

Example

  1. Add FRP rule to accept and route packets from 192.168.1.100
    nvether_sample_app <primary interface> frp_add 0 C0A80164 4 0 0 0 1
  2. Add FRP rule to reject and drop packets from 192.168.1.100
    nvether_sample_app <primary interface> frp_add 0 C0A80164 4 1 0 0 1

FRP_UPDATE Command Syntax

AV+L:

nvether_sample_app <primary interface> frp_update <ID> <Match> <Type> <Filter Mode> <Offset> <OKI> <DMASel>

  • Id - FRP table ID to add (0 to 255)
  • Match - Match data is used for comparing
    • MAX 12 bytes data
  • Type - Match data type
    • 0 - Normal data
    • 1 - L2 DA MAC
    • 2 - L2 SA MAC
    • 3 - L3 Source IP
    • 4 - L3 Destination IP
    • 5 - L4 UDP Source Port
    • 6 - L4 UDP Destination Port
    • 7 - L4 TCP Source Port
    • 8 - L4 TCP Destination Port
    • 9 - VLAN Tag
  • Mode - Filter mode for the entry
    • 0 - Accept and route
    • 1 - Reject and Drop
    • 2 - Accept and Bypass FRP Route
    • 3 - Link to OK Index
    • 4 - Inverse the Match, Accept and route
    • 5 - Inverse the Match, Reject and Drop
    • 6 - Inverse the Match, Accept and Bypass FRP Route
    • 7 - Inverse the Match, Link to OK Index
  • Offset - Frame offset of Match data
  • OKI - When NIC set give the value for Next Instruction
  • DMASel - Bit selection of DMA channels to route the frame
    • Bit[0] - DMA channel 0
    • ...
    • Bit [N] - DMA channel N]
      • Max N for EQOS HW is 7
      • Max N for MGBE is 9
Note: The Multiple DMA channel selection only works for MC/BC packets and Highest RxQ needs to be enabled on the DT. Highest queue (9 for MGBE and 7 for Orin platform)

Example

  1. Add FRP rule to accept and route packets from 192.168.1.100
    nvether_sample_app <primary interface> frp_add 0 C0A80164 4 0 0 0 1
  2. Update FRP rule to reject and drop packets from 192.168.1.100
    nvether_sample_app <primary interface> frp_update 0 C0A80164 4 1 0 0 1

FRP_DEL Command Syntax

AV+L

./nvether_sample_app <primary interface> frp_del <ID>

Parameters

  • Id - FRP table ID to add (0 to 255)

Example

  • Delete FRP rule at ID 0.
    nvether_sample_app <primary interface> frp_del 0

Additional Example Syntax

L2 DA accept Filtering and DMA route

  • Delete Old FRP entries with frp_del command
    nvether_sample_app <primary interface> frp_del 0
  • Add FRP rule to ADD DA f2:3b:00:06:87:ff:
    nvether_sample_app <primary interface> frp_add 0 f23b000687ff 1 0 0 0 0x10

L2 DA Reject Filtering and DMA route

  • Add FRP rule to ADD DA f2:3b:00:06:87:ff:
    nvether_sample_app <primary interface> frp_update 0 f23b000687ff 1 1 0 0 0x10

L2 MC DA Accept Filtering and Multiple DMA Channels Route

  • DUT side Add/Update FRP rule to MC MAC 01:00:5E:01:01:01
    1. nvether_sample_app <primary interface> frp_update 0 01005E010101 1 0 0 0 0x3FF
L2 MC DA Reject Filtering
  • DUT side Add/Update FRP rule to MC MAC 01:00:5E:01:01:01
    nvether_sample_app <primary interface> frp_update 0 01005E010101 1 1 0 0 0x3FF

L2 BC DA Accept Filtering and Multiple DMA Channels

  • DUT side Add/Update FRP rule for BC MAC FF:FF:FF:FF:FF:FF
    nvether_sample_app <primary interface> frp_update 0 FFFFFFFFFFFF 1 0 0 0 0x3FF

L2 BC DA Reject Filtering

  • DUT side Add/Update FRP rule for BC MAC FF:FF:FF:FF:FF:FF
    nvether_sample_app <primary interface> frp_update 0 FFFFFFFFFFFF 1 1 0 0 0x3FF

L2 SA Reject filtering

  • DUT side Add/Update FRP table 0 and 1 entry to ADD SA <<00:17:b6:00:00:00>>
    nvether_sample_app <primary interface> frp_update 0 <<0017b6000000>> 2 1 0 0 0x8
L3 SA IP Reject filtering
  • DUT Side Add/Update FRP table entry 0 and 1 for Source IP 192.168.1.3
    nvether_sample_app <primary interface> frp_update 0 C0A80103 3 1 0 0 0x2

Enable VLAN accept filtering using FRP command

nvether_sample_app <primary interface> frp_update 0 0005 9 0 0 0 0x2

Enable VLAN reject filtering FRP commands

nvether_sample_app <primary interface> frp_update 0 0005 9 1 0 0 0x2
L2 DA + L2 SA accept Filtering and DMA route
  • Add FRP rule for L2 DA <<f2:3b:00:06:87:ff>> L2 SA and link both rules:
    • nvether_sample_app <primary interface> frp_add 0 <f23b000687ff> 1 0 0 0 0x10
    • nvether_sample_app <primary interface> frp_add 1 <f23b000687ff> 2 0 0 0 0x10
    • nvether_sample_app <primary interface> frp_update 0 <f23b000687ff> 1 4 0 0 0x10
L2 DA + L2 SA Reject Filtering
  • Add FRP rule for L2 DA <<f2:3b:00:06:87:ff>> L2 SA and link both rules:
    • nvether_sample_app <primary interface> frp_add 0 <f23b000687ff> 1 0 0 0 0x10
    • nvether_sample_app <primary interface> frp_add 1 <f23b000687ff> 2 1 0 0 0x10
    • nvether_sample_app <primary interface> frp_update 0 <f23b000687ff> 1 4 0 0 0x10

L2 Address Filter Command Syntax

AV+L
nvether_sample_app <interface name> l2_filter <filter_no> <enable/disable> <mac addr>
            Filter_no
 	Index  0 to 31.
            enable/disable
            	0 - to disable filter, 1 - to enable filter\n"
            mac addr - MAC address(Ex - 94:18:82:71:ae:1d)]\n"
Note:
  • Rx Packets are routed to the DMA channel, which is bound to the interface used for configuration.
  • This feature can be used only with Ethernet virtualization enabled.
  • As there are multiple default L2 addresses configured, use index numbers in reverse order reverse, such as 31, 30, 29, to avoid overwriting.

Example

  • To add/enable AA:10:18:2b:8f:8a at index 9
    • eqos_0 l2_filter 9 1 AA:10:18:2b:8f:8a
  • To delete/disable AA:10:18:2b:8f:8a at index 9
    • eqos_0 l2_filter 9 0 AA:10:18:2b:8f:8a