Skip to content

Commit 6afc066

Browse files
committed
vpp: cnat performance
Signed-off-by: Nathan Skrzypczak <[email protected]>
1 parent b13eba1 commit 6afc066

File tree

6 files changed

+99
-82
lines changed

6 files changed

+99
-82
lines changed

vpplink/binapi/vpp_clone_current.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,25 @@ function git_clone_cd_and_reset ()
8484

8585
# --------------- Things to cherry pick ---------------
8686

87-
git_clone_cd_and_reset "$1" 88019c40725704e6998625937c764d1d0c827975
87+
git_clone_cd_and_reset "$1" 5b9cb0d275959aeb7f4e9dfb7353b638ec9a2e5a
8888

8989
git_cherry_pick refs/changes/12/33312/4 # 33312: sr: fix srv6 definition of behavior associated to a LocalSID | https://gerrit.fd.io/r/c/vpp/+/33312
9090
git_cherry_pick refs/changes/13/34713/3 # 34713: vppinfra: improve & test abstract socket | https://gerrit.fd.io/r/c/vpp/+/34713
9191
git_cherry_pick refs/changes/71/32271/15 # 32271: memif: add support for ns abstract sockets | https://gerrit.fd.io/r/c/vpp/+/32271
9292
git_cherry_pick refs/changes/34/34734/2 # 34734: memif: autogenerate socket_ids | https://gerrit.fd.io/r/c/vpp/+/34734
9393
git_cherry_pick refs/changes/26/34726/1 # 34726: interface: add buffer stats api | https://gerrit.fd.io/r/c/vpp/+/34726
9494
git_cherry_pick refs/changes/57/34757/1 # 34757: tap: add num_tx_queues API | https://gerrit.fd.io/r/c/vpp/+/34757
95+
git_cherry_pick refs/changes/74/34674/1 # 34674: vppinfra: add new bihash exports | https://gerrit.fd.io/r/c/vpp/+/34674
96+
97+
git_cherry_pick refs/changes/49/31449/8 # 31449: cnat: dont compute offloaded cksums | https://gerrit.fd.io/r/c/vpp/+/31449
98+
git_cherry_pick refs/changes/08/34108/3 # 34108: cnat: flag to disable rsession | https://gerrit.fd.io/r/c/vpp/+/34108
99+
git_cherry_pick refs/changes/21/32821/4 # 32821: cnat: add ip/client bihash | https://gerrit.fd.io/r/c/vpp/+/32821
100+
git_cherry_pick refs/changes/48/29748/3 # 29748: cnat: remove rwlock on ts | https://gerrit.fd.io/r/c/vpp/+/29748
101+
git_cherry_pick refs/changes/52/34552/4 # 34552: cnat: add single lookup | https://gerrit.fd.io/r/c/vpp/+/34552
102+
git_cherry_pick refs/changes/88/31588/3 # 31588: cnat: [WIP] no k8s maglev from pods | https://gerrit.fd.io/r/c/vpp/+/31588
95103

96104
# --------------- Dedicated plugins ---------------
97105
git_cherry_pick refs/changes/64/33264/7 # 33264: pbl: Port based balancer | https://gerrit.fd.io/r/c/vpp/+/33264
98-
git_cherry_pick refs/changes/88/31588/1 # 31588: cnat: [WIP] no k8s maglev from pods | https://gerrit.fd.io/r/c/vpp/+/31588
99106
git_cherry_pick refs/changes/83/28083/20 # 28083: acl: acl-plugin custom policies | https://gerrit.fd.io/r/c/vpp/+/28083
100107
git_cherry_pick refs/changes/13/28513/24 # 25813: capo: Calico Policies plugin | https://gerrit.fd.io/r/c/vpp/+/28513
101108
# --------------- Dedicated plugins ---------------
102-

vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go

Lines changed: 1 addition & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vpplink/binapi/vppapi/cnat/cnat.ba.go

Lines changed: 52 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vpplink/binapi/vppapi/generate.log

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
VPP Version : 22.02-rc0~408-g2c81b117d
1+
VPP Version : 22.02-rc0~462-g10486066f
22
Binapi-generator version : govpp v0.4.0-dev
3-
VPP Base commit : 88019c407 vppinfra: toeplitz hash four in parallel
3+
VPP Base commit : 5b9cb0d27 dpdk: remove unused flag
44
------------------ Cherry picked commits --------------------
55
gerrit:28513/24 capo: Calico Policies plugin
66
gerrit:28083/20 acl: acl-plugin custom policies
7-
gerrit:31588/1 cnat: [WIP] no k8s maglev from pods
87
gerrit:33264/7 pbl: Port based balancer
8+
gerrit:31588/3 cnat: [WIP] no k8s maglev from pods
9+
gerrit:34552/4 cnat: add single lookup
10+
gerrit:29748/3 cnat: remove rwlock on ts
11+
gerrit:32821/4 cnat: add ip/client bihash
12+
gerrit:34108/3 cnat: flag to disable rsession
13+
gerrit:31449/8 cnat: dont compute offloaded cksums
14+
gerrit:34674/1 vppinfra: add new bihash exports
915
gerrit:34757/1 tap: add num_tx_queues API
1016
gerrit:34726/1 interface: add buffer stats api
1117
gerrit:34734/2 memif: autogenerate socket_ids

vpplink/cnat.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ import (
2626
)
2727

2828
const (
29-
FeatureArcCnatInput = "ip?-unicast cnat-input-ip?"
30-
FeatureArcCnatOutput = "ip?-output cnat-output-ip?"
31-
FeatureArcSnat = "ip?-unicast cnat-snat-ip?"
29+
FeatureArcCnatLookup = "ip?-unicast cnat-lookup-ip?"
30+
FeatureArcCnatInput = "ip?-unicast cnat-input-ip?"
31+
FeatureArcCnatOutput = "ip?-output cnat-output-ip?"
32+
FeatureArcCnatWriteBack = "ip?-output cnat-writeback-ip?"
33+
FeatureArcSnat = "ip?-unicast cnat-snat-ip?"
3234
)
3335

3436
const InvalidID = ^uint32(0)
@@ -134,6 +136,14 @@ func (v *VppLink) CnatDelSnatPrefix(prefix *net.IPNet) error {
134136
}
135137

136138
func (v *VppLink) CnatEnableFeatures(swIfIndex uint32) (err error) {
139+
err = v.EnableFeatureArc46(swIfIndex, FeatureArcCnatLookup)
140+
if err != nil {
141+
return errors.Wrap(err, "Error enabling arc dnat in")
142+
}
143+
err = v.EnableFeatureArc46(swIfIndex, FeatureArcCnatWriteBack)
144+
if err != nil {
145+
return errors.Wrap(err, "Error enabling arc dnat out")
146+
}
137147
err = v.EnableFeatureArc46(swIfIndex, FeatureArcCnatInput)
138148
if err != nil {
139149
return errors.Wrap(err, "Error enabling arc dnat in")

vpplink/interfaces.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ func DefaultIntTo(value, defaultValue int) int {
123123
}
124124

125125
func (v *VppLink) CreateTapV2(tap *types.TapV2) (swIfIndex uint32, err error) {
126+
<<<<<<< HEAD
126127
response := &tapv2.TapCreateV3Reply{}
127128
request := &tapv2.TapCreateV3{
128129
ID: ^uint32(0),
@@ -134,6 +135,20 @@ func (v *VppLink) CreateTapV2(tap *types.TapV2) (swIfIndex uint32, err error) {
134135
RxRingSz: uint16(DefaultIntTo(tap.RxQueueSize, DEFAULT_QUEUE_SIZE)),
135136
HostMtuSize: uint32(tap.HostMtu),
136137
HostMtuSet: bool(tap.HostMtu != 0),
138+
=======
139+
response := &tapv2.TapCreateV2Reply{}
140+
request := &tapv2.TapCreateV2{
141+
ID: ^uint32(0),
142+
Tag: tap.Tag,
143+
TapFlags: tapv2.TapFlags(tap.Flags),
144+
NumRxQueues: uint8(defaultIntTo(tap.NumRxQueues, 1)),
145+
// FIXME
146+
// NumTxQueuesPerWorker: uint8(defaultIntTo(tap.NumTxQueues, 1)),
147+
TxRingSz: uint16(defaultIntTo(tap.TxQueueSize, 1024)),
148+
RxRingSz: uint16(defaultIntTo(tap.RxQueueSize, 1024)),
149+
HostMtuSize: uint32(tap.HostMtu),
150+
HostMtuSet: bool(tap.HostMtu != 0),
151+
>>>>>>> 61685a5 (vpp: cnat performance)
137152
}
138153
if tap.HardwareAddr != nil {
139154
request.MacAddress = types.ToVppMacAddress(tap.HardwareAddr)

0 commit comments

Comments
 (0)