Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove incorrect assignment in AddQoS() #86

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions internal/context/datapath.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,14 @@ func (p *DataPath) RemovePDR() {
}

func (p *DataPath) AddQoS(smContext *SMContext, qfi uint8, qos *models.QosData) {
if qos == nil {
// QFI = 1 -> default QFI
if qos == nil && qfi != 1 {
return
}
for node := p.FirstDPNode; node != nil; node = node.Next() {
var qer *QER

currentUUID := node.UPF.GetUUID()
qfi := uint8(qos.Var5qi)
id := getQosIdKey(currentUUID, qfi)

if qerId, ok := smContext.QerUpfMap[id]; !ok {
Expand All @@ -735,15 +735,15 @@ func (p *DataPath) AddQoS(smContext *SMContext, qfi uint8, qos *models.QosData)
ULGate: pfcpType.GateOpen,
DLGate: pfcpType.GateOpen,
}
newQER.MBR = &pfcpType.MBR{
ULMBR: util.BitRateTokbps(qos.MaxbrUl),
DLMBR: util.BitRateTokbps(qos.MaxbrDl),
}
if isGBRFlow(qos) {
newQER.GBR = &pfcpType.GBR{
ULGBR: util.BitRateTokbps(qos.GbrUl),
DLGBR: util.BitRateTokbps(qos.GbrDl),
}
newQER.MBR = &pfcpType.MBR{
ULMBR: util.BitRateTokbps(qos.MaxbrUl),
DLMBR: util.BitRateTokbps(qos.MaxbrDl),
}
}
qer = newQER
}
Expand Down
8 changes: 2 additions & 6 deletions internal/sbi/producer/gsm_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,11 @@ func HandlePDUSessionModificationRequest(
authQoSRules := nasType.QoSRules{}
authQoSFlowDesc := reqQoSFlowDescs

for _, pcc := range smPolicyDecision.PccRules {
qosRef := pcc.RefQosData[0]
qosDesc := smPolicyDecision.QosDecs[qosRef]
qfi := uint8(qosDesc.Var5qi)
for id := range smPolicyDecision.PccRules {
// get op code from request
opCode := reqQoSRules[0].Operation
// build nas Qos Rule
pccRule := smf_context.NewPCCRule(pcc)
pccRule.QFI = qfi
pccRule := smCtx.PCCRules[id]
rule, err := pccRule.BuildNasQoSRule(smCtx, opCode)
if err != nil {
return nil, err
Expand Down