mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
gnrc_sixlowpan_frag_sfr_congure: add congure_abe support
This commit is contained in:
parent
2539521907
commit
13f613429d
@ -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)
|
||||
## @{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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, \
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user