Chapter XX. Classification and Filtering
Switch Filter with Mirroring
The following example explains the method to switch and mirror traffic simultaneously:
i.
Obtain the PF and VF values of the incoming port from /sys/kernel/debug/cxgb4/<bus-
id>/mps_tcam
ii. Create the desired switch filter rule:
[root@host~]# cxgbtool ethX filter 100 fip 102.8.8.2 lip 102.8.8.1 fport
20000 lport 12865 pf 4 vf 64 action switch iport 0 eport 1 cap maskless
The above hash filter rule is created to switch traffic from 102.8.8.2,20000 to 102.8.8.1,12865
received on port 0 to be switched out from port 1. The traffic will be switched and simultaneously
received on mirror queues and network stack of host as mirroring is enabled.
Filtered Traffic Mirroring
Once mirroring is enabled, all the traffic received on a physical port will be duplicated. The
following example explains the method to filter out the redundant traffic and receive only specific
traffic on mirror queues:
i.
Obtain the mirror PF and VF values from dmesg. You should see a similar output:
ii. Create a DROP-ALL rule as below:
[root@host~]# cxgbtool ethX filter 255 pf 4 vf 66 action drop
Where, 255 is the last index of available TCAM filters. This will create a catch-all DROP filter for
Mirror PF/VF of port 0. Similarly, create DROP filters for rest of Mirror PF/VF.
iii. Create specific filter rules to allow specific traffic to be received on mirror queues as below:
[root@host~]# cxgbtool ethX filter 101 lip 102.8.8.1 fip 102.8.8.2 lport
12865 fport 20000 pf 4 vf 66 action pass
Now, the above specific traffic (from 102.8.8.2,20000 to 102.8.8.1,12865) will be received in
mirror receive queues and network stack of host.
Chelsio Unified Wire for Linux
293
Need help?
Do you have a question about the Terminator Series and is the answer not in the manual?
Questions and answers