Skip to content

Commit

Permalink
Merge pull request #662 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
service-proxy: ipvs-compat fixes
  • Loading branch information
UltraInstinct14 authored May 2, 2024
2 parents eeaac51 + a56c6aa commit f3770c6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/basic-sanity-ubuntu-22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
go-version: '>=1.18.0'
- run: sudo apt-get update
- 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
- 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
- run: |
sudo ip netns add test
sudo ip netns del test
Expand Down
4 changes: 2 additions & 2 deletions api/loxinlp/ipvs.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (ctx *IPVSH) buildIPVSDB() []*ipVSEntry {
}

newEntry.sel = cmn.LbSelRr
newEntry.pType = ""
newEntry.pType = "none"
newEntry.timeout = svc.Timeout
if svc.Flags&0x1 == 0x1 {
newEntry.sel = cmn.LbSelRrPersist
Expand All @@ -107,7 +107,7 @@ func (ctx *IPVSH) buildIPVSDB() []*ipVSEntry {
newEntry.mode = cmn.LBModeDefault
if svc.Port >= K8sNodePortMin && svc.Port <= K8sNodePortMax {
newEntry.mode = cmn.LBModeFullNAT
newEntry.pType = "ping"
//newEntry.pType = "ping"
}

key := ipVSKey{Address: svc.Address.String(), Protocol: proto, Port: svc.Port}
Expand Down
10 changes: 5 additions & 5 deletions api/loxinlp/nlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ func RUWorkSingle(m nlp.RouteUpdate) int {

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

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

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

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

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

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

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

for n := 0; n < cmn.RuWorkQLen; n++ {
for n := 0; n < 128; n++ {
select {
case m := <-ch:
RUWorkSingle(m)
Expand Down Expand Up @@ -1433,7 +1433,7 @@ func NLWorker(nNl *NlH, bgpPeerMode bool, ch chan bool, wch chan bool) {
AUWorker(nNl.FromAUCh, nNl.FromAUDone)
NUWorker(nNl.FromNUCh, nNl.FromNUDone)
RUWorker(nNl.FromRUCh, nNl.FromRUDone)
time.Sleep(1000 * time.Millisecond)
time.Sleep(500 * time.Millisecond)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/loxinet/layer2.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ func (l2 *L2H) L2FdbAdd(key FdbKey, attr FdbAttr) (int, error) {
if p.SInfo.PortType&cmn.PortVxlanBr == cmn.PortVxlanBr {
unRch, ret, err := nfdb.L2FdbResolveNh()
if err != nil {
tk.LogIt(tk.LogDebug, "tun-fdb ent resolve error, %v", key)
return ret, err
tk.LogIt(tk.LogDebug, "tun-fdb ent resolve error, %v:%s(%d)", key, err, ret)
//return ret, err
}
nfdb.unReach = unRch
}
Expand Down
26 changes: 14 additions & 12 deletions pkg/loxinet/port.go
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,8 @@ func (p *Port) DP(work DpWorkT) int {
ipts.Qfi = 0
ipts.TTeID = 0

//mh.dp.ToDpCh <- ipts
DpWorkSingle(mh.dp, ipts)
mh.dp.ToDpCh <- ipts
//DpWorkSingle(mh.dp, ipts)
return 0
}

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

//mh.dp.ToDpCh <- rmWq
DpWorkSingle(mh.dp, rmWq)
mh.dp.ToDpCh <- rmWq
//DpWorkSingle(mh.dp, rmWq)

return 0
}
Expand All @@ -963,8 +963,8 @@ func (p *Port) DP(work DpWorkT) int {
pWq.IngVlan = p.L2.Vid
pWq.SetBD = p.L2.Vid
pWq.SetZoneNum = zoneNum
//mh.dp.ToDpCh <- pWq
DpWorkSingle(mh.dp, pWq)
mh.dp.ToDpCh <- pWq
//DpWorkSingle(mh.dp, pWq)

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

//mh.dp.ToDpCh <- pWq
DpWorkSingle(mh.dp, pWq)
mh.dp.ToDpCh <- pWq
//DpWorkSingle(mh.dp, pWq)
}
return 0
}
Expand Down Expand Up @@ -1040,7 +1040,8 @@ func (p *Port) DP(work DpWorkT) int {
}
rmWq.Status = &p.Sync
rmWq.PortNum = p.PortNo
DpWorkSingle(mh.dp, rmWq)
//DpWorkSingle(mh.dp, rmWq)
mh.dp.ToDpCh <- rmWq
}
} else if work == DpRemove {
if p.SInfo.BpfLoaded == true {
Expand Down Expand Up @@ -1069,7 +1070,8 @@ func (p *Port) DP(work DpWorkT) int {
}
rmWq.Status = &p.Sync
rmWq.PortNum = p.PortNo
DpWorkSingle(mh.dp, rmWq)
//DpWorkSingle(mh.dp, rmWq)
mh.dp.ToDpCh <- rmWq
}
}
}
Expand All @@ -1079,8 +1081,8 @@ func (p *Port) DP(work DpWorkT) int {
}

// TODO - Need to unload eBPF when port properties change
//mh.dp.ToDpCh <- pWq
DpWorkSingle(mh.dp, pWq)
mh.dp.ToDpCh <- pWq
//DpWorkSingle(mh.dp, pWq)

return 0
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/loxinet/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ func (R *RuleH) DeleteNatLbRule(serv cmn.LbServiceArg) (int, error) {

eEps := rule.act.action.(*ruleNatActs).endPoints
activatedProbe := false
if rule.act.action.(*ruleNatActs).mode == cmn.LBModeOneArm || rule.hChk.actChk {
if rule.act.action.(*ruleNatActs).mode == cmn.LBModeOneArm || rule.act.action.(*ruleNatActs).mode == cmn.LBModeFullNAT || rule.hChk.actChk {
activatedProbe = true
}
R.modNatEpHost(rule, eEps, false, activatedProbe)
Expand Down

0 comments on commit f3770c6

Please sign in to comment.