-
Notifications
You must be signed in to change notification settings - Fork 14
Support for Multiple DNNs per Device Group with a Single UPF #389
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,13 +244,15 @@ func extractIpDomains(groupNames []string, deviceGroupMap map[string]configmodel | |
logger.NfConfigLog.Warnf("Device group %s not found", name) | ||
continue | ||
} | ||
ip := nfConfigApi.NewIpDomain( | ||
dg.IpDomainExpanded.Dnn, | ||
dg.IpDomainExpanded.DnsPrimary, | ||
dg.IpDomainExpanded.UeIpPool, | ||
dg.IpDomainExpanded.Mtu, | ||
) | ||
ipDomains = append(ipDomains, *ip) | ||
for _, ipDomainExp := range dg.IpDomainExpanded { | ||
ip := nfConfigApi.NewIpDomain( | ||
ipDomainExp.Dnn, | ||
ipDomainExp.DnsPrimary, | ||
ipDomainExp.UeIpPool, // Now accessing the correct field from the slice element | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what does this comment mean ? |
||
ipDomainExp.Mtu, | ||
) | ||
ipDomains = append(ipDomains, *ip) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please add a UT that involves multiple ip-domains in a device group |
||
} | ||
return ipDomains | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -89,28 +89,27 @@ func updateDeviceGroupInNetworkSlices(groupName string) error { | |||||
func deviceGroupPostHelper(requestDeviceGroup configmodels.DeviceGroups, msgOp int, groupName string) (int, error) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to add validation in this function to make sure that the DNN is different than empty string. |
||||||
logger.ConfigLog.Infof("received device group: %s", groupName) | ||||||
|
||||||
ipdomain := &requestDeviceGroup.IpDomainExpanded | ||||||
ipdomains := &requestDeviceGroup.IpDomainExpanded | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
logger.ConfigLog.Infof("imsis.size: %v, Imsis: %s", len(requestDeviceGroup.Imsis), requestDeviceGroup.Imsis) | ||||||
logger.ConfigLog.Infof("IP Domain Name: %s", requestDeviceGroup.IpDomainName) | ||||||
logger.ConfigLog.Infof("IP Domain details: %+v", ipdomain) | ||||||
logger.ConfigLog.Infof("dnn name: %s", ipdomain.Dnn) | ||||||
logger.ConfigLog.Infof("ue pool: %s", ipdomain.UeIpPool) | ||||||
logger.ConfigLog.Infof("dns Primary: %s", ipdomain.DnsPrimary) | ||||||
logger.ConfigLog.Infof("dns Secondary: %s", ipdomain.DnsSecondary) | ||||||
logger.ConfigLog.Infof("ip mtu: %v", ipdomain.Mtu) | ||||||
logger.ConfigLog.Infof("device Group Name: %s", groupName) | ||||||
|
||||||
if ipdomain.UeDnnQos != nil { | ||||||
ipdomain.UeDnnQos.DnnMbrDownlink = convertToBps(ipdomain.UeDnnQos.DnnMbrDownlink, ipdomain.UeDnnQos.BitrateUnit) | ||||||
if ipdomain.UeDnnQos.DnnMbrDownlink < 0 { | ||||||
ipdomain.UeDnnQos.DnnMbrDownlink = math.MaxInt64 | ||||||
} | ||||||
logger.ConfigLog.Infof("MbrDownLink: %v", ipdomain.UeDnnQos.DnnMbrDownlink) | ||||||
ipdomain.UeDnnQos.DnnMbrUplink = convertToBps(ipdomain.UeDnnQos.DnnMbrUplink, ipdomain.UeDnnQos.BitrateUnit) | ||||||
if ipdomain.UeDnnQos.DnnMbrUplink < 0 { | ||||||
ipdomain.UeDnnQos.DnnMbrUplink = math.MaxInt64 | ||||||
for i, ipdomain := range *ipdomains { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
logger.ConfigLog.Infof("IP Domain details [%d]: %+v", i, ipdomain) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are logging 2 times the ip domain details. one in this line and second time in the following lines. We should keep only one |
||||||
logger.ConfigLog.Infof("DNN Name : %v", ipdomain.Dnn) | ||||||
logger.ConfigLog.Infof("UE Pool : %v", ipdomain.UeIpPool) | ||||||
logger.ConfigLog.Infof("DNS Primary : %v", ipdomain.DnsPrimary) | ||||||
logger.ConfigLog.Infof("DNS Secondary : %v", ipdomain.DnsSecondary) | ||||||
Comment on lines
+96
to
+99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these can stay as %s since they are strings |
||||||
logger.ConfigLog.Infof("IP MTU : %v", ipdomain.Mtu) | ||||||
if ipdomain.UeDnnQos != nil { | ||||||
ipdomain.UeDnnQos.DnnMbrDownlink = convertToBps(ipdomain.UeDnnQos.DnnMbrDownlink, ipdomain.UeDnnQos.BitrateUnit) | ||||||
if ipdomain.UeDnnQos.DnnMbrDownlink < 0 { | ||||||
ipdomain.UeDnnQos.DnnMbrDownlink = math.MaxInt64 | ||||||
} | ||||||
logger.ConfigLog.Infof("MBR DownLink : %v", ipdomain.UeDnnQos.DnnMbrDownlink) | ||||||
ipdomain.UeDnnQos.DnnMbrUplink = convertToBps(ipdomain.UeDnnQos.DnnMbrUplink, ipdomain.UeDnnQos.BitrateUnit) | ||||||
if ipdomain.UeDnnQos.DnnMbrUplink < 0 { | ||||||
ipdomain.UeDnnQos.DnnMbrUplink = math.MaxInt64 | ||||||
} | ||||||
logger.ConfigLog.Infof("MBR UpLink : %v", ipdomain.UeDnnQos.DnnMbrUplink) | ||||||
} | ||||||
logger.ConfigLog.Infof("MbrUpLink: %v", ipdomain.UeDnnQos.DnnMbrUplink) | ||||||
} | ||||||
|
||||||
prevDevGroup := getDeviceGroupByName(groupName) | ||||||
|
@@ -214,18 +213,25 @@ func syncDeviceGroupSubscriber(devGroup *configmodels.DeviceGroups, prevDevGroup | |||||
Sst: int32(sVal), | ||||||
} | ||||||
var errorOccured bool | ||||||
dnnMap := make(map[string][]configmodels.DeviceGroupsIpDomainExpandedUeDnnQos) | ||||||
for _, imsi := range devGroup.Imsis { | ||||||
/* update all current IMSIs */ | ||||||
subscriberAuthData := DatabaseSubscriberAuthenticationData{} | ||||||
if subscriberAuthData.SubscriberAuthenticationDataGet("imsi-"+imsi) != nil { | ||||||
dnn := devGroup.IpDomainExpanded.Dnn | ||||||
for _, ipDomain := range devGroup.IpDomainExpanded { | ||||||
dnn := ipDomain.Dnn | ||||||
|
||||||
// Ensure UeDnnQos is not nil before appending | ||||||
if ipDomain.UeDnnQos != nil { | ||||||
dnnMap[dnn] = append(dnnMap[dnn], *ipDomain.UeDnnQos) // Directly append the UeDnnQos | ||||||
} | ||||||
} | ||||||
Comment on lines
+221
to
+228
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be done outside of the loop over |
||||||
err = updatePolicyAndProvisionedData( | ||||||
imsi, | ||||||
slice.SiteInfo.Plmn.Mcc, | ||||||
slice.SiteInfo.Plmn.Mnc, | ||||||
snssai, | ||||||
dnn, | ||||||
devGroup.IpDomainExpanded.UeDnnQos, | ||||||
dnnMap, | ||||||
) | ||||||
if err != nil { | ||||||
logger.DbLog.Errorf("updatePolicyAndProvisionedData failed for IMSI %s: %+v", imsi, err) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can no longer preallocate the capacity of
ipDomains
in line 239