Skip to content

Commit f3770c6

Browse files
Merge pull request #662 from TrekkieCoder/main
service-proxy: ipvs-compat fixes
2 parents eeaac51 + a56c6aa commit f3770c6

File tree

6 files changed

+25
-23
lines changed

6 files changed

+25
-23
lines changed

.github/workflows/basic-sanity-ubuntu-22.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
with:
3636
go-version: '>=1.18.0'
3737
- run: sudo apt-get update
38-
- run: sudo apt-get -y install clang-13 llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iproute2
38+
- run: sudo apt-get -y install clang llvm libelf-dev gcc-multilib libpcap-dev linux-tools-$(uname -r) elfutils dwarves git libbsd-dev bridge-utils unzip build-essential bison flex iproute2
3939
- run: |
4040
sudo ip netns add test
4141
sudo ip netns del test

api/loxinlp/ipvs.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func (ctx *IPVSH) buildIPVSDB() []*ipVSEntry {
8585
}
8686

8787
newEntry.sel = cmn.LbSelRr
88-
newEntry.pType = ""
88+
newEntry.pType = "none"
8989
newEntry.timeout = svc.Timeout
9090
if svc.Flags&0x1 == 0x1 {
9191
newEntry.sel = cmn.LbSelRrPersist
@@ -107,7 +107,7 @@ func (ctx *IPVSH) buildIPVSDB() []*ipVSEntry {
107107
newEntry.mode = cmn.LBModeDefault
108108
if svc.Port >= K8sNodePortMin && svc.Port <= K8sNodePortMax {
109109
newEntry.mode = cmn.LBModeFullNAT
110-
newEntry.pType = "ping"
110+
//newEntry.pType = "ping"
111111
}
112112

113113
key := ipVSKey{Address: svc.Address.String(), Protocol: proto, Port: svc.Port}

api/loxinlp/nlp.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -1363,7 +1363,7 @@ func RUWorkSingle(m nlp.RouteUpdate) int {
13631363

13641364
func LUWorker(ch chan nlp.LinkUpdate, f chan struct{}) {
13651365

1366-
for n := 0; n < cmn.LuWorkQLen; n++ {
1366+
for n := 0; n < 32; n++ {
13671367
select {
13681368
case m := <-ch:
13691369
LUWorkSingle(m)
@@ -1375,7 +1375,7 @@ func LUWorker(ch chan nlp.LinkUpdate, f chan struct{}) {
13751375

13761376
func AUWorker(ch chan nlp.AddrUpdate, f chan struct{}) {
13771377

1378-
for n := 0; n < cmn.AuWorkqLen; n++ {
1378+
for n := 0; n < 64; n++ {
13791379
select {
13801380
case m := <-ch:
13811381
AUWorkSingle(m)
@@ -1388,7 +1388,7 @@ func AUWorker(ch chan nlp.AddrUpdate, f chan struct{}) {
13881388

13891389
func NUWorker(ch chan nlp.NeighUpdate, f chan struct{}) {
13901390

1391-
for n := 0; n < cmn.NuWorkQLen; n++ {
1391+
for n := 0; n < 128; n++ {
13921392
select {
13931393
case m := <-ch:
13941394
NUWorkSingle(m)
@@ -1400,7 +1400,7 @@ func NUWorker(ch chan nlp.NeighUpdate, f chan struct{}) {
14001400

14011401
func RUWorker(ch chan nlp.RouteUpdate, f chan struct{}) {
14021402

1403-
for n := 0; n < cmn.RuWorkQLen; n++ {
1403+
for n := 0; n < 128; n++ {
14041404
select {
14051405
case m := <-ch:
14061406
RUWorkSingle(m)
@@ -1433,7 +1433,7 @@ func NLWorker(nNl *NlH, bgpPeerMode bool, ch chan bool, wch chan bool) {
14331433
AUWorker(nNl.FromAUCh, nNl.FromAUDone)
14341434
NUWorker(nNl.FromNUCh, nNl.FromNUDone)
14351435
RUWorker(nNl.FromRUCh, nNl.FromRUDone)
1436-
time.Sleep(1000 * time.Millisecond)
1436+
time.Sleep(500 * time.Millisecond)
14371437
}
14381438
}
14391439
}

pkg/loxinet/layer2.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ func (l2 *L2H) L2FdbAdd(key FdbKey, attr FdbAttr) (int, error) {
223223
if p.SInfo.PortType&cmn.PortVxlanBr == cmn.PortVxlanBr {
224224
unRch, ret, err := nfdb.L2FdbResolveNh()
225225
if err != nil {
226-
tk.LogIt(tk.LogDebug, "tun-fdb ent resolve error, %v", key)
227-
return ret, err
226+
tk.LogIt(tk.LogDebug, "tun-fdb ent resolve error, %v:%s(%d)", key, err, ret)
227+
//return ret, err
228228
}
229229
nfdb.unReach = unRch
230230
}

pkg/loxinet/port.go

+14-12
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,8 @@ func (p *Port) DP(work DpWorkT) int {
914914
ipts.Qfi = 0
915915
ipts.TTeID = 0
916916

917-
//mh.dp.ToDpCh <- ipts
918-
DpWorkSingle(mh.dp, ipts)
917+
mh.dp.ToDpCh <- ipts
918+
//DpWorkSingle(mh.dp, ipts)
919919
return 0
920920
}
921921

@@ -945,8 +945,8 @@ func (p *Port) DP(work DpWorkT) int {
945945
rmWq.TunType = DpTunVxlan
946946
rmWq.BD = p.L2.Vid
947947

948-
//mh.dp.ToDpCh <- rmWq
949-
DpWorkSingle(mh.dp, rmWq)
948+
mh.dp.ToDpCh <- rmWq
949+
//DpWorkSingle(mh.dp, rmWq)
950950

951951
return 0
952952
}
@@ -963,8 +963,8 @@ func (p *Port) DP(work DpWorkT) int {
963963
pWq.IngVlan = p.L2.Vid
964964
pWq.SetBD = p.L2.Vid
965965
pWq.SetZoneNum = zoneNum
966-
//mh.dp.ToDpCh <- pWq
967-
DpWorkSingle(mh.dp, pWq)
966+
mh.dp.ToDpCh <- pWq
967+
//DpWorkSingle(mh.dp, pWq)
968968

969969
return 0
970970
}
@@ -984,8 +984,8 @@ func (p *Port) DP(work DpWorkT) int {
984984
pWq.SetPol = p.SInfo.PortPolNum
985985
pWq.SetMirr = p.SInfo.PortMirNum
986986

987-
//mh.dp.ToDpCh <- pWq
988-
DpWorkSingle(mh.dp, pWq)
987+
mh.dp.ToDpCh <- pWq
988+
//DpWorkSingle(mh.dp, pWq)
989989
}
990990
return 0
991991
}
@@ -1040,7 +1040,8 @@ func (p *Port) DP(work DpWorkT) int {
10401040
}
10411041
rmWq.Status = &p.Sync
10421042
rmWq.PortNum = p.PortNo
1043-
DpWorkSingle(mh.dp, rmWq)
1043+
//DpWorkSingle(mh.dp, rmWq)
1044+
mh.dp.ToDpCh <- rmWq
10441045
}
10451046
} else if work == DpRemove {
10461047
if p.SInfo.BpfLoaded == true {
@@ -1069,7 +1070,8 @@ func (p *Port) DP(work DpWorkT) int {
10691070
}
10701071
rmWq.Status = &p.Sync
10711072
rmWq.PortNum = p.PortNo
1072-
DpWorkSingle(mh.dp, rmWq)
1073+
//DpWorkSingle(mh.dp, rmWq)
1074+
mh.dp.ToDpCh <- rmWq
10731075
}
10741076
}
10751077
}
@@ -1079,8 +1081,8 @@ func (p *Port) DP(work DpWorkT) int {
10791081
}
10801082

10811083
// TODO - Need to unload eBPF when port properties change
1082-
//mh.dp.ToDpCh <- pWq
1083-
DpWorkSingle(mh.dp, pWq)
1084+
mh.dp.ToDpCh <- pWq
1085+
//DpWorkSingle(mh.dp, pWq)
10841086

10851087
return 0
10861088
}

pkg/loxinet/rules.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ func (R *RuleH) DeleteNatLbRule(serv cmn.LbServiceArg) (int, error) {
15761576

15771577
eEps := rule.act.action.(*ruleNatActs).endPoints
15781578
activatedProbe := false
1579-
if rule.act.action.(*ruleNatActs).mode == cmn.LBModeOneArm || rule.hChk.actChk {
1579+
if rule.act.action.(*ruleNatActs).mode == cmn.LBModeOneArm || rule.act.action.(*ruleNatActs).mode == cmn.LBModeFullNAT || rule.hChk.actChk {
15801580
activatedProbe = true
15811581
}
15821582
R.modNatEpHost(rule, eEps, false, activatedProbe)

0 commit comments

Comments
 (0)