Add final results + flow
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-02-14 16:23:49 +01:00
parent bf7de1181c
commit db5dc37d84

View File

@@ -381,6 +381,38 @@ pim@summer:~/src/vpp$ make test-debug TEST=test_policer_subif V=2 | grep 'L2.*po
'exceed_packets': 0, 'exceed_bytes': 0, 'violate_packets': 61, 'violate_bytes': 8906} 'exceed_packets': 0, 'exceed_bytes': 0, 'violate_packets': 61, 'violate_bytes': 8906}
``` ```
## Results
The policer works in all sorts of cool scenario's now. Let me give a concrete example, where I
create an L2XC with VTR and then apply a policer. I've written about VTR, which stands for _VLAN Tag
Rewriting_ before, in an old article lovingly called [[VPP VLAN Gymnastics]({{< ref
"2022-02-14-vpp-vlan-gym" >}})]. It all looks like this:
```
vpp# create sub Gi10/0/0 100
vpp# create sub Gi10/0/1 200
vpp# set interface l2 xconnect Gi10/0/0.100 Gi10/0/1.200
vpp# set interface l2 xconnect Gi10/0/1.200 Gi10/0/0.100
vpp# set interface l2 tag-rewrite Gi10/0/0.100 pop 1
vpp# set interface l2 tag-rewrite Gi10/0/1.200 pop 1
vpp# policer add name pol-test rate kbps cir 150000 cb 15000000 conform-action transmit
vpp# policer input name pol-test Gi10/0/0.100
```
After applying this configuration, the input bitmap on Gi10/0/0.100 becomes `POLICER(14) | VTR(10) |
XCONNECT(1) | DROP(0)`. Packets now take the following path through the dataplane:
```
ethernet-input
→ l2-input (computes bitmap, dispatches to bit 14)
→ l2-policer-input (clears bit 14, polices, dispatches to bit 10)
→ l2-input-vtr (clears bit 10, pops 1 tag, dispatches to bit 1)
→ l2-output (XCONNECT: sw_if_index[TX]=Gi10/0/1.200)
→ inline output VTR (pushes 1 tag for .200)
→ interface-output
→ Gi10/0/1-tx
```
## What's Next ## What's Next
I've sent the change, which was only about ~300 LOC, off for review. You can follow along on the I've sent the change, which was only about ~300 LOC, off for review. You can follow along on the