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

gnrc_sixlowpan_frag_sfr_congure: add congure_abe support #16171

Merged
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
8 changes: 8 additions & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_stats
## @{
##
PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure
## @defgroup net_gnrc_sixlowpan_frag_sfr_congure_abe gnrc_sixlowpan_frag_sfr_congure_abe: TCP Reno with ABE
## @brief Congestion control for SFR using the [TCP Reno congestion control algorithm with ABE](@ref sys_congure_abe)
##
## Provides an Alternative Backoff with Explicit Content Notification (ABE) to TCP-Reno-based congestion
## control
## @{
PSEUDOMODULES += gnrc_sixlowpan_frag_sfr_congure_abe
## @}
## @defgroup net_gnrc_sixlowpan_frag_sfr_congure_reno gnrc_sixlowpan_frag_sfr_congure_reno: TCP Reno
## @brief Congestion control for SFR using the [TCP Reno congestion control algorithm](@ref sys_congure_reno)
## @{
Expand Down
1 change: 1 addition & 0 deletions sys/include/net/gnrc/sixlowpan/frag/sfr/congure.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* - @ref net_gnrc_sixlowpan_frag_sfr_congure_sfr (the default)
* - @ref net_gnrc_sixlowpan_frag_sfr_congure_quic
* - @ref net_gnrc_sixlowpan_frag_sfr_congure_reno
* - @ref net_gnrc_sixlowpan_frag_sfr_congure_abe
* @{
*
* @file
Expand Down
5 changes: 5 additions & 0 deletions sys/net/gnrc/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_%,$(USEMODULE)))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure
endif

ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_abe,$(USEMODULE)))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure_reno
USEMODULE += congure_abe
endif

ifneq (,$(filter gnrc_sixlowpan_frag_sfr_congure_quic,$(USEMODULE)))
USEMODULE += congure_quic
endif
Expand Down
18 changes: 18 additions & 0 deletions sys/net/gnrc/network_layer/sixlowpan/frag/sfr/congure_reno.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@
*/

#include "kernel_defines.h"
#include "congure/abe.h"
#include "congure/reno.h"
#include "net/gnrc/sixlowpan/config.h"

#include "net/gnrc/sixlowpan/frag/sfr/congure.h"

#if IS_USED(MODULE_CONGURE_ABE)
typedef congure_abe_snd_t _sfr_congure_snd_t;
#else
typedef congure_reno_snd_t _sfr_congure_snd_t;
#endif

#define SFR_CONGURE_RENO_CONSTS { \
.fr = _fr, \
Expand All @@ -36,14 +41,27 @@ static void _fr(congure_reno_snd_t *c);
static bool _same_wnd_adv(congure_reno_snd_t *c, congure_snd_ack_t *ack);

static _sfr_congure_snd_t _sfr_congures[CONFIG_GNRC_SIXLOWPAN_FRAG_FB_SIZE];
#if IS_USED(MODULE_CONGURE_ABE)
static const congure_abe_snd_consts_t _sfr_congure_abe_consts = {
.reno = SFR_CONGURE_RENO_CONSTS,
.abe_multiplier_numerator = CONFIG_CONGURE_ABE_MULTIPLIER_NUMERATOR_DEFAULT,
.abe_multiplier_denominator = CONFIG_CONGURE_ABE_MULTIPLIER_DENOMINATOR_DEFAULT,
};
#else
static const congure_reno_snd_consts_t _sfr_congure_reno_consts = SFR_CONGURE_RENO_CONSTS;
#endif

congure_snd_t *gnrc_sixlowpan_frag_sfr_congure_snd_get(void)
{
for (unsigned i = 0; i < ARRAY_SIZE(_sfr_congures); i++) {
if (_sfr_congures[i].super.driver == NULL) {
#if IS_USED(MODULE_CONGURE_ABE)
congure_abe_snd_setup(&_sfr_congures[i],
&_sfr_congure_abe_consts);
#else
congure_reno_snd_setup(&_sfr_congures[i],
&_sfr_congure_reno_consts);
#endif
return &_sfr_congures[i].super;
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/gnrc_sixlowpan_frag_sfr_congure_impl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ endif

CONGURE_IMPL ?= congure_sfr

ifeq (congure_abe,$(CONGURE_IMPL))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure_abe
else
ifeq (congure_quic,$(CONGURE_IMPL))
USEMODULE += gnrc_sixlowpan_frag_sfr_congure_quic
USEMODULE += ztimer_msec
Expand All @@ -44,6 +47,7 @@ else
endif
endif
endif
endif

.PHONY: zep_dispatch

Expand Down