Skip to content

Commit

Permalink
Merge pull request #311 from TrekkieCoder/main
Browse files Browse the repository at this point in the history
PR - Enhancements to debugging
  • Loading branch information
UltraInstinct14 committed Jun 12, 2023
2 parents 739799c + 0c52a4e commit 2acc108
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion loxilb-ebpf
7 changes: 6 additions & 1 deletion loxinet/dpebpf_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func dpEbpfTicker() {
}

// DpEbpfInit - initialize the ebpf dp subsystem
func DpEbpfInit(clusterEn bool, nodeNum int) *DpEbpfH {
func DpEbpfInit(clusterEn bool, nodeNum int, debug bool) *DpEbpfH {
var cfg C.struct_ebpfcfg

if clusterEn {
Expand All @@ -202,6 +202,11 @@ func DpEbpfInit(clusterEn bool, nodeNum int) *DpEbpfH {
cfg.have_mtrace = 0
}
cfg.nodenum = C.int(nodeNum)
cfg.loglevel = 1

if debug {
cfg.loglevel = 0
}

C.loxilb_main(&cfg)

Expand Down
6 changes: 5 additions & 1 deletion loxinet/loxinet.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ func loxiNetInit() {
}

// Initialize logger and specify the log file
do_debug := false
logfile := fmt.Sprintf("%s%s.log", "/var/log/loxilb", os.Getenv("HOSTNAME"))
logLevel := LogString2Level(opts.Opts.LogLevel)
if logLevel == tk.LogDebug {
do_debug = true
}
mh.logger = tk.LogItInit(logfile, logLevel, true)

// Stack trace logger
Expand Down Expand Up @@ -198,7 +202,7 @@ func loxiNetInit() {
}

// Initialize the ebpf datapath subsystem
mh.dpEbpf = DpEbpfInit(clusterMode, mh.self)
mh.dpEbpf = DpEbpfInit(clusterMode, mh.self, do_debug)
mh.dp = DpBrokerInit(mh.dpEbpf)

// Initialize the security zone subsystem
Expand Down
2 changes: 1 addition & 1 deletion loxinet/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const (
InitHostProbeTimeout = 15 // Initial probe timeout for end-point host
MaxHostProbeTime = 24 * 3600 // Max possible host health check duration
LbDefaultInactiveTimeout = 4 * 60 // Default inactive timeout for established sessions
LbMaxInactiveTimeout = 24 * 60 // Maximum inactive timeout for established sessions
LbMaxInactiveTimeout = 24 * 3600 // Maximum inactive timeout for established sessions
MaxEndPointCheckers = 4 // Maximum helpers to check endpoint health
EndPointCheckerDuration = 2 // Duration at which ep-helpers will run
MaxEndPointSweeps = 20 // Maximum end-point sweeps per round
Expand Down

0 comments on commit 2acc108

Please sign in to comment.