From d6955f5255c6953fe88c130ab6476a71a5826b06 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 31 Aug 2023 14:28:54 +0800 Subject: [PATCH 1/3] fix: remove incorrect assignment in AddQoS() --- internal/context/datapath.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/context/datapath.go b/internal/context/datapath.go index 456165a8..cfb148ad 100644 --- a/internal/context/datapath.go +++ b/internal/context/datapath.go @@ -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 { From 1378b38cb20cdf805b77ada246ee1edcd13edd06 Mon Sep 17 00:00:00 2001 From: ianchen0119 Date: Thu, 31 Aug 2023 07:16:59 +0000 Subject: [PATCH 2/3] fix: assign wrong qfi in HandlePDUSessionModificationRequest() --- internal/sbi/producer/gsm_handler.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/internal/sbi/producer/gsm_handler.go b/internal/sbi/producer/gsm_handler.go index 1c80ea1a..ccc3904a 100644 --- a/internal/sbi/producer/gsm_handler.go +++ b/internal/sbi/producer/gsm_handler.go @@ -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 From 52a8e203d869245a5dba1061d8745570bb113ebb Mon Sep 17 00:00:00 2001 From: ianchen0119 Date: Fri, 1 Sep 2023 03:51:22 +0000 Subject: [PATCH 3/3] fix: do not assign MBR to non-GBR flow --- internal/context/datapath.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/context/datapath.go b/internal/context/datapath.go index cfb148ad..de75c44c 100644 --- a/internal/context/datapath.go +++ b/internal/context/datapath.go @@ -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 }