There is no CLI to configure `policy` for VPP VyOS but VPP itself seems has bugs.
If we reapply the policy several times, the speed decreases.
```
set vpp settings interface eth1 dpdk-options promisc
set vpp settings interface eth1 driver 'dpdk'
set vpp settings unix poll-sleep-usec '222'
```
A client is connected to the `eth1` interface
1. Set the policy `10mbit` for the first time and start the iperf server `sudo iperf3 -s`
```
sudo vppctl
policer del name policer
policer add name policer type 1r2c cir 10000 cb 1000000 rate kbps conform-action transmit
policer input name policer eth1
policer output name policer eth1
```
Check on the client site (expected 10mbit):
```
vyos@client01:~$ sudo iperf3 -c 192.168.122.1
Connecting to host 192.168.122.1, port 5201
[ 5] local 100.64.0.0 port 53690 connected to 192.168.122.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 4.58 MBytes 38.4 Mbits/sec 659 45.0 KBytes
[ 5] 1.00-2.00 sec 1.11 MBytes 9.33 Mbits/sec 157 107 KBytes
[ 5] 2.00-3.00 sec 1.11 MBytes 9.33 Mbits/sec 81 22.5 KBytes
[ 5] 3.00-4.00 sec 1.11 MBytes 9.33 Mbits/sec 255 39.4 KBytes
[ 5] 4.00-5.00 sec 1.11 MBytes 9.33 Mbits/sec 198 5.62 KBytes
[ 5] 5.00-6.00 sec 1.11 MBytes 9.33 Mbits/sec 187 19.7 KBytes
[ 5] 6.00-7.00 sec 1.11 MBytes 9.33 Mbits/sec 201 5.62 KBytes
[ 5] 7.00-8.00 sec 1.11 MBytes 9.33 Mbits/sec 217 5.62 KBytes
[ 5] 8.00-9.00 sec 1.11 MBytes 9.33 Mbits/sec 95 5.62 KBytes
[ 5] 9.00-10.00 sec 1.11 MBytes 9.33 Mbits/sec 248 25.3 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 14.6 MBytes 12.2 Mbits/sec 2298 sender
[ 5] 0.00-10.00 sec 12.1 MBytes 10.2 Mbits/sec receiver
iperf Done.
vyos@client01:~$
```
2. Delete policy and assign again:
```
# VPP server
policer del name policer
policer add name policer type 1r2c cir 10000 cb 1000000 rate kbps conform-action transmit
policer input name policer eth1
policer output name policer eth1
```
Check on the client site (**expected 10mbit**):
```
vyos@client01:~$ sudo iperf3 -c 192.168.122.1
Connecting to host 192.168.122.1, port 5201
[ 5] local 100.64.0.0 port 57958 connected to 192.168.122.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 3.22 MBytes 27.0 Mbits/sec 359 45.0 KBytes
[ 5] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 156 121 KBytes
[ 5] 2.00-3.00 sec 823 KBytes 6.74 Mbits/sec 161 33.8 KBytes
[ 5] 3.00-4.00 sec 823 KBytes 6.74 Mbits/sec 92 103 KBytes
[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 159 28.1 KBytes
[ 5] 5.00-6.00 sec 823 KBytes 6.74 Mbits/sec 115 107 KBytes
[ 5] 6.00-7.00 sec 823 KBytes 6.74 Mbits/sec 250 33.8 KBytes
[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 117 117 KBytes
[ 5] 8.00-9.00 sec 823 KBytes 6.74 Mbits/sec 318 36.6 KBytes
[ 5] 9.00-10.00 sec 823 KBytes 6.74 Mbits/sec 2 2.81 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 8.04 MBytes 6.75 Mbits/sec 1729 sender
[ 5] 0.00-10.00 sec 5.88 MBytes 4.93 Mbits/sec receiver
iperf Done.
vyos@client01:~$
```
3. Delete policy and assign again:
```
# VPP server
policer del name policer
policer add name policer type 1r2c cir 10000 cb 1000000 rate kbps conform-action transmit
policer input name policer eth1
policer output name policer eth1
```
Check on the client site (**expected 10mbit**):
```
vyos@client01:~$ sudo iperf3 -c 192.168.122.1
Connecting to host 192.168.122.1, port 5201
[ 5] local 100.64.0.0 port 39924 connected to 192.168.122.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 2.82 MBytes 23.7 Mbits/sec 305 42.2 KBytes
[ 5] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 9 28.1 KBytes
[ 5] 2.00-3.00 sec 823 KBytes 6.74 Mbits/sec 229 81.6 KBytes
[ 5] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 58 28.1 KBytes
[ 5] 4.00-5.00 sec 823 KBytes 6.74 Mbits/sec 41 53.4 KBytes
[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 209 30.9 KBytes
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0 25.3 KBytes
[ 5] 7.00-8.00 sec 886 KBytes 7.25 Mbits/sec 201 78.8 KBytes
[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 56 28.1 KBytes
[ 5] 9.00-10.00 sec 823 KBytes 6.74 Mbits/sec 0 124 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 6.10 MBytes 5.12 Mbits/sec 1108 sender
[ 5] 0.00-10.00 sec 3.88 MBytes 3.25 Mbits/sec receiver
iperf Done.
vyos@client01:~$
```
Delete policy completely (**expected no traffic limits**):
```
policer del name police
vpp# policer del name policer
vpp#
vpp# show policer
vpp#
```
Client:
```
vyos@client01:~$ sudo iperf3 -c 192.168.122.1
Connecting to host 192.168.122.1, port 5201
[ 5] local 100.64.0.0 port 47932 connected to 192.168.122.1 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 2.82 MBytes 23.7 Mbits/sec 312 42.2 KBytes
[ 5] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 0 25.3 KBytes
[ 5] 2.00-3.00 sec 823 KBytes 6.74 Mbits/sec 172 30.9 KBytes
[ 5] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 33 28.1 KBytes
[ 5] 4.00-5.00 sec 823 KBytes 6.75 Mbits/sec 68 84.4 KBytes
[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 120 33.8 KBytes
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0 25.3 KBytes
[ 5] 7.00-8.00 sec 823 KBytes 6.74 Mbits/sec 192 30.9 KBytes
[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 15 22.5 KBytes
[ 5] 9.00-10.00 sec 823 KBytes 6.74 Mbits/sec 159 70.3 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 6.04 MBytes 5.06 Mbits/sec 1071 sender
[ 5] 0.00-10.00 sec 3.88 MBytes 3.25 Mbits/sec receiver
iperf Done.
vyos@client01:~$
```