Unverified Commit 2d3afd0c authored by Kevin Di Lallo's avatar Kevin Di Lallo Committed by GitHub
Browse files

Merge pull request #33 from pastorsx/sp_dev_dataRateIssue

tc-engine and bwsharing concurrent updates
parents 0d356bd6 a44caa3c
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1145,6 +1145,9 @@ func applyNetCharRules() {
						list := dstElementPtr.FilterInfoList
						_ = deleteFilterRule(&list[index])
						list[index] = filterInfo //swap
					} else if needUpdateNetChar {
						list := dstElementPtr.FilterInfoList
						list[index] = filterInfo //replace only
					}
				}
			}
+1 −1
Original line number Diff line number Diff line
@@ -752,7 +752,7 @@ func cmdSetIfb(shape map[string]string) error {
		normalDistributionStr = "distribution normal"
	}
	str := "tc qdisc change dev ifb" + ifbNumber + " handle 1:0 root netem delay " + delay + "ms " + delayVariation + "ms " + delayCorrelation + "% " + normalDistributionStr + " loss " + lossInteger + "." + lossFraction + "%"
	if dataRate != "0" {
	if dataRate != "" && dataRate != "0" {
		str = str + " rate " + dataRate + "bit"
	}
	_, err := cmdExec(str)
+5 −1
Original line number Diff line number Diff line
@@ -557,6 +557,7 @@ func (this *DefaultBwSharingAlgorithm) resetAllBandwidthSharingFlowMaxPlannedThr
// updateAllBandwidthSharingFlow -
func (this *DefaultBwSharingAlgorithm) updateAllBandwidthSharingFlow() {

	changed := false
	for _, flow := range this.BandwidthSharingFlowMap {

		if flow.MaxPlannedThroughput != flow.AllocatedThroughput && flow.MaxPlannedThroughput != MAX_THROUGHPUT {
@@ -565,8 +566,11 @@ func (this *DefaultBwSharingAlgorithm) updateAllBandwidthSharingFlow() {
			flow.AllocatedThroughputLowerBound = flow.MaxPlannedLowerBound
			flow.AllocatedThroughputUpperBound = flow.MaxPlannedUpperBound
			this.updateFilterCB(flow.DstNetworkElement, flow.SrcNetworkElement, flow.AllocatedThroughput)
			this.applyFilterCB()
			changed = true
		}
	}
	if changed {
		this.applyFilterCB()
	}
}