Skip to content

Commit

Permalink
Merge #16171
Browse files Browse the repository at this point in the history
16171: gnrc_sixlowpan_frag_sfr_congure: add congure_abe support r=miri64 a=miri64



Co-authored-by: Martine Lenders <m.lenders@fu-berlin.de>
  • Loading branch information
bors[bot] and miri64 authored Mar 1, 2023
2 parents e9da0c1 + 1cff487 commit 2ae3383
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
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

0 comments on commit 2ae3383

Please sign in to comment.