15–Traffic Control Offload
Ingress Packet Redirection
272
BC0154501-00 P
Ingress Packet Redirection
Ingress packet redirection for traffic control includes redirection for SR-IOV VFs
and redirection with both MAC-vLAN offloaded devices and SR-IOV VFs.
Ingress Packet Redirection for SR-IOV VFs
Ingress packet redirection for SR-IOV VFs includes the following:
tc qdisc add dev p5p1 ingress
tc filter add dev p5p1 protocol ip parent ffff: pref 0x2 flower skip_sw dst_ip
192.168.50.100 action mirred egress redirect dev eth_vf
Ingress Packet Redirection with MAC-vLAN Offloaded
Devices and SR-IOV VFs
Use the packet redirection ingress flow to offload MAC-vLAN devices based on
the destination IP.
Enable MAC-vLAN and TC offload as follows:
ethtool -K p5p1 l2-fwd-offload on
ethtool -K p5p1 hw-tc-offload on
To create and delete offloaded MAC-vLAN devices, use the IP utility as follows:
ip link add link p5p1 name mvlan_1 type macvlan ; ifconfig mvlan_1
up
ip link delete mvlan_1
To add and delete filters for MAC-vLAN devices, issue commands in the tc utility
as follows:
tc qdisc add dev p5p1 ingress
A one-time job to add ingress Qdisc until you delete it. When this job is
complete, you can add many filters attached to this Qdisc.
tc filter add dev p5p1 protocol ip parent ffff: pref 0x2
flower skip_sw dst_ip 192.168.50.100 action mirred
egress redirect dev mvlan_1
A filter to steer packets with specific destination IP on the specified
MAC-vLAN device, which causes all packets with the destination IP
192.168.50.100 to be forwarded to
mvlan_1
.
tc filter del dev p5p1 protocol ip parent ffff: pref 0x2
You must delete this filter.
tc qdisc del dev p5p1 ingress
Delete the Qdisc and all associated filters, if any.