-
Notifications
You must be signed in to change notification settings - Fork 2.1k
gnrc/sixlowpan: migrate to ztimer_msec #19067
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: master
Are you sure you want to change the base?
Conversation
The timebase has been switched from us to ms. Jitter will get much larger.
f593bbd
to
697bb5b
Compare
The garbage collector is triggered by a massage that is created by ztimer_set(CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT). On fast machines with low latencies, the gc runs in the same millisecond in which the ztimer expired.
697bb5b
to
bc813ea
Compare
((now_usec - rbuf[i].super.arrival) > | ||
CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US)) { | ||
((now_msec - rbuf[i].super.arrival) >= | ||
CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US / US_PER_MS)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to de 8000 scribe this comment to others. Learn more.
This macro is only used within the reassembly buffer, so why not redefine it to TIMEOUT_MS
. If you want to avoid API changes, we could define a deprecated TIMEOUT_US = TIMEOUT_MS * US_PER_MS
as well.
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.
I actually had to deprecate 3 config vars.
To get things clear I prefixed the time unit to some affected variables.
If you're happy with the changes, I'd squash if you don't mind.
* [gnrc_sixlowpan_frag_rb](@ref net_gnrc_sixlowpan_frag_rb) module | ||
* | ||
* @deprecated Use @ref CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS instead. | ||
* Will be removed after 2023.01 release. |
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.
The usual deprecation cycle is two releases, since the 2023.01 release is just up ahead, I think, 2023.07 is the better release to deprecate. This way users still have some time to adjust ;-).
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.
Ping?
@@ -112,13 +129,30 @@ extern "C" { | |||
* @note Only applicable with | |||
* [gnrc_sixlowpan_frag_rb](@ref net_gnrc_sixlowpan_frag_rb) module | |||
* | |||
* @deprecated Use @ref CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_DEL_TIMER_MS instead. | |||
* Will be removed after 2023.01 release. |
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.
Same here.
* [gnrc_sixlowpan_frag_vrb](@ref net_gnrc_sixlowpan_frag_vrb) module. | ||
* | ||
* @deprecated Use @ref CONFIG_GNRC_SIXLOWPAN_FRAG_VRB_TIMEOUT_MS instead. | ||
* Will be removed after 2023.01 release. |
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.
And here.
We should get this in before the hard feature freeze if it is mostly about deprecations. |
uint32_t now; | ||
uint32_t if_gap = gnrc_sixlowpan_frag_sfr_congure_snd_inter_frame_gap(fbuf); | ||
uint32_t now_msec; | ||
uint32_t if_gap_msec = gnrc_sixlowpan_frag_sfr_congure_snd_inter_frame_gap(fbuf) / US_PER_MS; |
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.
IIRC the inter frame gap is currently configured to be in the sub-millisecond range. How is this handled here?
#ifndef CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US | ||
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS (3U) | ||
#else | ||
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS (CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US / US_PER_SEC) |
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.
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS (CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US / US_PER_SEC) | |
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS (CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US / US_PER_MS) |
#ifndef CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US | ||
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS (3U) |
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.
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS (3U) | |
#define CONFIG_GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_MS (3000U) |
old default was "(3U * US_PER_SEC) " -> 3000 ms or 3 seconds
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.
there seem to be a number of usec to msec conversions that result in the value being 1 such gaps or sleep might be 1 usec to 2000 usec ( this seems not to be enough resolution for at least some of the cases).
from ztimer.h:
* 2. due to its implementation details, expect +-1 clock tick systemic
* inaccuracy for all clocks.
I think these parts may need higher resolution using ztimer_usec and if there are no ztimer_t that keep the timer running they need aquire and release are need for that as well (an event-timer or something like that might also be able to do the job).
if the single digit values are there only in the tests it might be ok but the 1s should be increased (to 2) (since 1count might be very close to 0ms 2 counts are at least 1ms).
Contribution description
This PR migrates all time stamping done by
gnrc_sixlowpan_%
toZTIMER_MSEC
.Testing procedure
TBD
Issues/PRs references
#17607