Partial fix for discrepancy between docs and implementation

This commit is contained in:
Joseph Henry 2022-09-15 15:56:23 -07:00
parent e18d206248
commit 50e131a4ff
No known key found for this signature in database
GPG key ID: C45B33FF5EBC9344
3 changed files with 2 additions and 6 deletions

View file

@ -1808,7 +1808,6 @@ void Bond::setBondParameters(int policy, SharedPtr<Bond> templateBond, bool useT
_qw[ZT_QOS_PDV_IDX] = 0.3f; _qw[ZT_QOS_PDV_IDX] = 0.3f;
_qw[ZT_QOS_PLR_IDX] = 0.1f; _qw[ZT_QOS_PLR_IDX] = 0.1f;
_qw[ZT_QOS_PER_IDX] = 0.1f; _qw[ZT_QOS_PER_IDX] = 0.1f;
_qw[ZT_QOS_SCP_IDX] = 0.1f;
_failoverInterval = ZT_BOND_FAILOVER_DEFAULT_INTERVAL; _failoverInterval = ZT_BOND_FAILOVER_DEFAULT_INTERVAL;

View file

@ -28,7 +28,7 @@
/** /**
* Indices for the path quality weight vector * Indices for the path quality weight vector
*/ */
enum ZT_BondQualityWeightIndex { ZT_QOS_LAT_IDX, ZT_QOS_LTM_IDX, ZT_QOS_PDV_IDX, ZT_QOS_PLR_IDX, ZT_QOS_PER_IDX, ZT_QOS_THR_IDX, ZT_QOS_THM_IDX, ZT_QOS_THV_IDX, ZT_QOS_AGE_IDX, ZT_QOS_SCP_IDX, ZT_QOS_WEIGHT_SIZE }; enum ZT_BondQualityWeightIndex { ZT_QOS_LAT_IDX, ZT_QOS_LTM_IDX, ZT_QOS_PDV_IDX, ZT_QOS_PLR_IDX, ZT_QOS_PER_IDX, ZT_QOS_WEIGHT_SIZE };
/** /**
* Multipath bonding policy * Multipath bonding policy

View file

@ -2078,16 +2078,13 @@ public:
newTemplateBond->setMinAcceptableAllocation((float)OSUtils::jsonDouble(customPolicy["minAcceptableAllocation"],0)); newTemplateBond->setMinAcceptableAllocation((float)OSUtils::jsonDouble(customPolicy["minAcceptableAllocation"],0));
// Quality weights // Quality weights
json &qualityWeights = customPolicy["qualityWeights"]; json &qualityWeights = customPolicy["qualityWeights"];
if (qualityWeights.size() == ZT_QOS_WEIGHT_SIZE) { // TODO: Generalize this if (qualityWeights.size() == ZT_QOS_WEIGHT_SIZE) {
float weights[ZT_QOS_WEIGHT_SIZE]; float weights[ZT_QOS_WEIGHT_SIZE];
weights[ZT_QOS_LAT_IDX] = (float)OSUtils::jsonDouble(qualityWeights["lat"],0.0); weights[ZT_QOS_LAT_IDX] = (float)OSUtils::jsonDouble(qualityWeights["lat"],0.0);
weights[ZT_QOS_LTM_IDX] = (float)OSUtils::jsonDouble(qualityWeights["ltm"],0.0); weights[ZT_QOS_LTM_IDX] = (float)OSUtils::jsonDouble(qualityWeights["ltm"],0.0);
weights[ZT_QOS_PDV_IDX] = (float)OSUtils::jsonDouble(qualityWeights["pdv"],0.0); weights[ZT_QOS_PDV_IDX] = (float)OSUtils::jsonDouble(qualityWeights["pdv"],0.0);
weights[ZT_QOS_PLR_IDX] = (float)OSUtils::jsonDouble(qualityWeights["plr"],0.0); weights[ZT_QOS_PLR_IDX] = (float)OSUtils::jsonDouble(qualityWeights["plr"],0.0);
weights[ZT_QOS_PER_IDX] = (float)OSUtils::jsonDouble(qualityWeights["per"],0.0); weights[ZT_QOS_PER_IDX] = (float)OSUtils::jsonDouble(qualityWeights["per"],0.0);
weights[ZT_QOS_THR_IDX] = (float)OSUtils::jsonDouble(qualityWeights["thr"],0.0);
weights[ZT_QOS_THM_IDX] = (float)OSUtils::jsonDouble(qualityWeights["thm"],0.0);
weights[ZT_QOS_THV_IDX] = (float)OSUtils::jsonDouble(qualityWeights["thv"],0.0);
newTemplateBond->setUserQualityWeights(weights,ZT_QOS_WEIGHT_SIZE); newTemplateBond->setUserQualityWeights(weights,ZT_QOS_WEIGHT_SIZE);
} }
// Bond-specific properties // Bond-specific properties