-
Notifications
You must be signed in to change notification settings - Fork 70
Update URR report #139
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
Update URR report #139
Conversation
…port request arrives.
src/genl/genl_report.c
Outdated
// set the use_bytes2 flag to the opposite value | ||
urr->use_bytes2 = !urr->use_bytes2; | ||
// sleep for 1 millisecond to make sure the counter is updated | ||
// before the report is converted |
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.
// before converting to the report
include/urr.h
Outdated
@@ -79,6 +79,7 @@ struct urr { | |||
struct Volume volumequota; | |||
|
|||
// For usage report volume measurement | |||
bool use_bytes2; |
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.
rename to
bool use_vol2;
struct VolumeMeasurement vol;
struct VolumeMeasurement vol2;
src/gtpu/encap.c
Outdated
@@ -670,15 +670,16 @@ int update_urr_counter_and_send_report(struct pdr *pdr, struct far *far, u64 vol | |||
} else { | |||
volume = vol; | |||
} | |||
|
|||
// Caculate Volume measurement for each trigger |
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.
fix typo Calculate
include/urr.h
Outdated
struct VolumeMeasurement bytes; | ||
struct VolumeMeasurement bytes2; | ||
bool use_vol2; | ||
struct VolumeMeasurement vol; |
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.
rename to vol1
src/genl/genl_report.c
Outdated
@@ -158,13 +158,15 @@ int gtp5g_genl_get_usage_report(struct sk_buff *skb, struct genl_info *info) | |||
goto fail; | |||
} | |||
|
|||
// set the use_vol2 flag to the opposite value |
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.
// use the other one vol counter
src/genl/genl_report.c
Outdated
@@ -250,13 +252,15 @@ int gtp5g_genl_get_multi_usage_reports(struct sk_buff *skb, struct genl_info *in | |||
goto fail; | |||
} | |||
|
|||
// set the use_vol2 flag to the opposite value |
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.
// use the other one vol counter
4507bfe
to
a2ca3e7
Compare
…ta consistency Changes: - Reader 1. Update the table that the writer will write to (opposite to the one being read). 2. Read data. - Writer 1. Acquire the target table for writing. 2. Write data. Locking mechanism adjustments: - Reader lock scope: - Lock is held while updating the writer's target table and released immediately after, allowing the reader to read the current table freely. - Writer lock scope: - Lock is held while acquiring the target table and writing data. - Ensures consistency between packet count and packet volume, preventing a scenario where packet count is updated but packet volume remains stale before the reader fetches the data.
a2ca3e7
to
e1d3a98
Compare
cb12d3c
to
2c5a3ed
Compare
convert_urr_to_report(urrs[i], &report[i]); | ||
} | ||
urr_counter = get_urr_counter_by_trigger(urrs[i], triggers[i]); | ||
convert_urr_to_report(urr, urr_counter, &report[i]); |
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.
@chen042531 @tim-ywliu
This change introduces a new bug in the online charging feature. I believe the first parameter should be urrs[i] instead of urr.
I propose a fix for this issue in #143 , please help to review the PR.
Thanks!
Refactor period counter statistics and reading mechanism to ensure data consistency
Changes:
Reader
Writer
Locking mechanism adjustments:
Reader lock scope:
Writer lock scope: