summaryrefslogtreecommitdiff
path: root/cesar/mac
diff options
context:
space:
mode:
authorCyril Jourdan2011-05-17 15:44:36 +0200
committerCyril Jourdan2011-06-14 16:09:19 +0200
commit9eeb86ba5293d065b08dfa3150c6a4214ed9b5d5 (patch)
tree7c8b44142eef118940178d4ce2831f3ff620f6bb /cesar/mac
parentf397c55b2b9fcb99313262382ddcd3bcc0ffe86b (diff)
cesar/mac/pbproc: modification of the management of expired PBs, closes #2525
The function pbproc_mfs_expire is no longer active on the MFS currently used for transmission. The PBs of that MFS are now treated during the transmission, after the chaining process for the PBs remaining in the MFS, and at the reception of the SACK for the sent PBs.
Diffstat (limited to 'cesar/mac')
-rw-r--r--cesar/mac/pbproc/inc/mfs.h43
-rw-r--r--cesar/mac/pbproc/inc/prep_mpdu.h6
-rw-r--r--cesar/mac/pbproc/pbproc.h10
-rw-r--r--cesar/mac/pbproc/src/mfs.c117
-rw-r--r--cesar/mac/pbproc/src/prep_mpdu.c51
-rw-r--r--cesar/mac/pbproc/test/int/src/add_seg.c7
-rw-r--r--cesar/mac/pbproc/test/mfs/src/test_mfs.c161
-rw-r--r--cesar/mac/pbproc/test/pbproc/inc/test_pbproc.h7
-rw-r--r--cesar/mac/pbproc/test/pbproc/inc/utils.h3
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c147
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/test_pbproc.c3
-rw-r--r--cesar/mac/pbproc/test/pbproc/src/utils.c3
-rw-r--r--cesar/mac/sar/src/sar_expiration.c9
-rw-r--r--cesar/mac/sar/test/unit_test/ecos/src/sar_pbproc_override_mfs.c2
14 files changed, 337 insertions, 232 deletions
diff --git a/cesar/mac/pbproc/inc/mfs.h b/cesar/mac/pbproc/inc/mfs.h
new file mode 100644
index 0000000000..13f6808767
--- /dev/null
+++ b/cesar/mac/pbproc/inc/mfs.h
@@ -0,0 +1,43 @@
+#ifndef mac_pbproc_inc_mfs_h
+#define mac_pbproc_inc_mfs_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file mac/pbproc/inc/mfs.h
+ * \brief PBProc MFS interface.
+ * \ingroup mac_pbproc
+ */
+
+BEGIN_DECLS
+
+/**
+ * Remove up to max_release_nb expired PBs in the MFS.
+ * \param ctx pbproc context
+ * \param mfs MFS to expire
+ * \param expiration_ntb expiration date used for comparison
+ * \param hysteresis_offset_tck first PB must have expired for at least this
+ * time to start expiration process
+ * \param max_release_nb maximum number of PBs to release
+ * \param release_head filled by this function: head of the expired PBs chain
+ * \param release_tail filled by this function: tail of the expired PBs chain
+ * \return number of expired PBs
+ *
+ * This function always start from the head of the MFS and remove expired PBs,
+ * up to max_release_nb.
+ */
+int
+pbproc_mfs_remove_expired (pbproc_t *ctx, mfs_tx_t *mfs, u32 expiration_ntb,
+ u32 hysteresis_offset_tck, int max_release_nb,
+ pb_t **release_head, pb_t **release_tail);
+
+void ARCH_ILRAM
+pbproc_mfs_insert_ (mfs_tx_t *mfs, pb_t *first, pb_t *last, uint nb);
+
+END_DECLS
+
+#endif /* mac_pbproc_inc_mfs_h */
diff --git a/cesar/mac/pbproc/inc/prep_mpdu.h b/cesar/mac/pbproc/inc/prep_mpdu.h
index bd7e360630..2797022247 100644
--- a/cesar/mac/pbproc/inc/prep_mpdu.h
+++ b/cesar/mac/pbproc/inc/prep_mpdu.h
@@ -110,8 +110,12 @@ struct pbproc_prep_mpdu_t
pb_t *main_commit_return_head;
/** Last segment to be returned to main MFS. */
pb_t *main_commit_return_tail;
- /** Number of segments to be returned to main MFS. */
+ /** Number of segments extracted from the MFS to be returned to main MFS. */
uint main_commit_return_seg_nb;
+ /** Number of reserved segments to be returned to main MFS. */
+ uint main_commit_return_seg_nb_reserved;
+ /** Number of segments expired in the MFS after transmission. */
+ uint expired_segments_nb;
};
typedef struct pbproc_prep_mpdu_t pbproc_prep_mpdu_t;
diff --git a/cesar/mac/pbproc/pbproc.h b/cesar/mac/pbproc/pbproc.h
index d484f84fdd..ef15e7b1b4 100644
--- a/cesar/mac/pbproc/pbproc.h
+++ b/cesar/mac/pbproc/pbproc.h
@@ -21,6 +21,12 @@
/* Forward declarations. */
typedef struct pbproc_t pbproc_t;
+/** Maximum number of PBs to expire after each transmission. */
+#define PBPROC_CURRENT_TX_MFS_EXPIRE_BUDGET 230
+
+/** Hysteresis offset for expiration process. */
+#define PBPROC_EXPIRATION_HYSTERESIS_OFFSET MAC_MS_TO_TCK(70)
+
/** Parameters of the received MPDU. */
struct pbproc_rx_params_t
{
@@ -344,8 +350,6 @@ pbproc_mfs_beacon_prepare (pbproc_t *ctx, mfs_tx_t *mfs, pb_beacon_t *pb,
* \param ctx pbproc context
* \param mfs MFS to expire
* \param expiration_ntb expiration date used for comparison
- * \param first_pb_expiration_ntb filled by this function: expiration date
- * of the first PB if present
* \param expired_nb filled by this function: number of expired PB
* \return true if the MFS is empty
*
@@ -356,7 +360,7 @@ pbproc_mfs_beacon_prepare (pbproc_t *ctx, mfs_tx_t *mfs, pb_beacon_t *pb,
*/
bool
pbproc_mfs_expire (pbproc_t *ctx, mfs_tx_t *mfs, u32 expiration_ntb,
- u32 *first_pb_expiration_ntb, uint *expired_nb);
+ uint *expired_nb);
/**
* Remove all PB from the given MFS.
diff --git a/cesar/mac/pbproc/src/mfs.c b/cesar/mac/pbproc/src/mfs.c
index 2f43d4cd38..3522c182ee 100644
--- a/cesar/mac/pbproc/src/mfs.c
+++ b/cesar/mac/pbproc/src/mfs.c
@@ -17,12 +17,13 @@
#include "lib/slist.h"
#include "mac/pbproc/inc/context.h"
+#include "mac/pbproc/inc/mfs.h"
#include <string.h>
/** Expiration is done ISR locked. Unlock ISR every now and then so that ISR
* could be executed. */
-#define PBPROC_MFS_EXPIRE_BUDGET 40
+#define PBPROC_MFS_EXPIRE_BUDGET 10
pb_t * ARCH_ILRAM
pbproc_mfs_extract_tail (mfs_tx_t *mfs)
@@ -173,87 +174,34 @@ pbproc_mfs_beacon_prepare (pbproc_t *ctx, mfs_tx_t *mfs, pb_beacon_t *pb,
bool
pbproc_mfs_expire (pbproc_t *ctx, mfs_tx_t *mfs, u32 expiration_ntb,
- u32 *first_pb_expiration_ntb, uint *expired_nb)
+ uint *expired_nb)
{
dbg_assert (ctx);
dbg_assert (mfs);
- dbg_assert (first_pb_expiration_ntb);
dbg_assert (expired_nb);
- bool empty;
+ bool empty = false;
int total_release_nb = 0;
int release_nb;
/* Loop until there is no more PB to expire. Do not expire all PB in one
* so that interrupts are unlocked every now and then. */
do
{
- uint skip = 0;
- pb_t *first = NULL, *p, *last_skip = NULL;
/* Release list, to release PB with ISR unlocked. */
pb_t *release_head = NULL, *release_tail;
dbg_invalid_ptr (release_tail);
release_nb = 0;
/* Start of critical section. */
uint flags = arch_isr_lock ();
- /* Is this MFS being transmitted? */
- uint first_mpdu_index = ctx->prep_mpdu.burst_mpdu_nb - 1;
- pbproc_prep_mpdu_single_t *first_mpdu =
- &ctx->prep_mpdu.mpdu[first_mpdu_index];
- if (ctx->prep_mpdu.main_mfs == mfs && first_mpdu->main_seg_nb)
+ /* We do not treat the MFS if it is being used for transmission. */
+ if (ctx->prep_mpdu.main_mfs != mfs)
{
- skip = ctx->prep_mpdu.main_seg_nb_reserved;
- first = first_mpdu->main_head; /* May be NULL. */
+ release_nb = pbproc_mfs_remove_expired (ctx, mfs, expiration_ntb, 0,
+ PBPROC_MFS_EXPIRE_BUDGET, &release_head, &release_tail);
+ /* Is empty? */
+ empty = !mfs->head;
}
- /* Travel into segments. */
- p = mfs->head;
- if (p)
- {
- /* Skip reserved PB. */
- for (p = mfs->head; skip && p != mfs->tail; skip--)
- {
- last_skip = p;
- p = p->next;
- }
- if (skip == 0)
- {
- /* No more to skip, may begin to expire segments. */
- if (lesseq_mod2p32 (p->expiration_ntb, expiration_ntb))
- {
- release_head = p;
- release_nb++;
- /* Find last segment to expire. */
- while (release_nb < PBPROC_MFS_EXPIRE_BUDGET
- && p != mfs->tail
- && lesseq_mod2p32 (p->next->expiration_ntb,
- expiration_ntb))
- {
- p = p->next;
- release_nb++;
- }
- release_tail = p;
- /* Slice MFS list at last expired segment. */
- slist_sever (mfs->, last_skip, p, bare);
- /* Update segment count. */
- if (mfs->seg_nb >= release_nb)
- mfs->seg_nb -= release_nb;
- else
- {
- dbg_assert (mfs->pending_seg_nb
- >= release_nb - mfs->seg_nb);
- mfs->pending_seg_nb -= release_nb - mfs->seg_nb;
- mfs->seg_nb = 0;
- }
- }
- }
- }
- /* Find first PB. */
- if (first)
- *first_pb_expiration_ntb = first->expiration_ntb;
- else if (mfs->head)
- *first_pb_expiration_ntb = mfs->head->expiration_ntb;
- else if (DEBUG)
- *first_pb_expiration_ntb = 0xDEADEEEE;
- /* Is empty? */
- empty = !first && !mfs->head;
+ /* Increment stats. */
+ mfs->stats.num_segs_dropped += release_nb;
/* End of critical section. */
arch_isr_unlock (flags);
/* Release expired segments. */
@@ -267,6 +215,47 @@ pbproc_mfs_expire (pbproc_t *ctx, mfs_tx_t *mfs, u32 expiration_ntb,
return empty;
}
+int
+pbproc_mfs_remove_expired (pbproc_t *ctx, mfs_tx_t *mfs, u32 expiration_ntb,
+ u32 hysteresis_offset_tck, int max_release_nb,
+ pb_t **release_head, pb_t **release_tail)
+{
+ dbg_assert (ctx);
+ dbg_assert (mfs);
+ dbg_assert (release_head);
+ dbg_assert (release_tail);
+ int release_nb = 0;
+ pb_t *p = mfs->head;
+ /* Travel into segments. */
+ if (p)
+ {
+ if (max_release_nb > mfs->seg_nb)
+ max_release_nb = mfs->seg_nb;
+ if (max_release_nb
+ && lesseq_mod2p32 (p->expiration_ntb + hysteresis_offset_tck,
+ expiration_ntb))
+ {
+ *release_head = p;
+ release_nb++;
+ /* Find last segment to expire. */
+ while (release_nb < max_release_nb
+ && lesseq_mod2p32 (p->next->expiration_ntb,
+ expiration_ntb))
+ {
+ p = p->next;
+ release_nb++;
+ }
+ *release_tail = p;
+ /* Slice MFS list at last expired segment. */
+ slist_slice (mfs->, p, bare);
+ /* Update segment count. */
+ dbg_assert (mfs->seg_nb >= release_nb);
+ mfs->seg_nb -= release_nb;
+ }
+ }
+ return release_nb;
+}
+
void
pbproc_mfs_remove_all (mfs_tx_t *mfs)
{
diff --git a/cesar/mac/pbproc/src/prep_mpdu.c b/cesar/mac/pbproc/src/prep_mpdu.c
index b7540a4ea7..60abc6bce8 100644
--- a/cesar/mac/pbproc/src/prep_mpdu.c
+++ b/cesar/mac/pbproc/src/prep_mpdu.c
@@ -15,9 +15,11 @@
#include "inc/context.h"
#include "mac/common/timings.h"
+
#include "lib/bitstream.h"
#include "inc/sacki_dec.h"
+#include "inc/mfs.h"
#include <string.h>
@@ -659,6 +661,29 @@ pbproc_prep_mpdu (pbproc_t *ctx, mfs_tx_t *mfs)
}
}
+static void __attribute__ ((noinline))
+pbproc_handle_expiration (pbproc_t *ctx)
+{
+ dbg_assert (ctx);
+ pbproc_prep_mpdu_t *prep = &ctx->prep_mpdu;
+ /* We parse the first PBs in the MFS to see whether they have expired
+ * or not. */
+ pb_t *release_head = NULL, *release_tail;
+ dbg_invalid_ptr (release_tail);
+ u32 current_date_ntb = phy_date () + ctx->config->ntb_offset_tck;
+ prep->expired_segments_nb = pbproc_mfs_remove_expired (ctx, prep->main_mfs,
+ current_date_ntb, PBPROC_EXPIRATION_HYSTERESIS_OFFSET,
+ PBPROC_CURRENT_TX_MFS_EXPIRE_BUDGET, &release_head, &release_tail);
+ prep->main_mfs->stats.num_segs_dropped += prep->expired_segments_nb;
+ /* Release expired segments. */
+ if (release_head)
+ {
+ slist_push_back_range (ctx->commit.release_,
+ release_head, release_tail);
+ pbproc_fsm_schedule_deferred (ctx);
+ }
+}
+
void ARCH_ILRAM
pbproc_prep_mpdu_chain (pbproc_t *ctx)
{
@@ -706,6 +731,9 @@ pbproc_prep_mpdu_chain (pbproc_t *ctx)
/* If MFS is empty, forbid more segmentation on the last segment. */
if (slist_empty (prep->main_mfs->, bare))
prep->main_mfs->last_seg_offset = 0;
+ else if (!prep->mpdu_count
+ && prep->main_mfs->ca_state != CA_MFS_STATE_REMOVED)
+ pbproc_handle_expiration (ctx);
}
void ARCH_ILRAM
@@ -739,7 +767,7 @@ pbproc_prep_mpdu_cancel (pbproc_t *ctx, uint mpdu_count)
/* Commit. */
pbproc_prep_mpdu_commit (ctx, mpdu_count, NULL, NULL,
mpdu->main_head, mpdu->main_tail,
- mpdu->main_seg_nb + prep->main_seg_nb_reserved);
+ mpdu->main_seg_nb);
}
void ARCH_ILRAM
@@ -1082,9 +1110,10 @@ pbproc_prep_mpdu_commit (pbproc_t *ctx, uint mpdu_count,
return_tail);
prep->main_commit_return_seg_nb += return_nb;
}
+ /* Update return informations. */
+ prep->main_commit_return_seg_nb_reserved = prep->main_seg_nb_reserved;
/* Update link stats. */
- mfs->stats.num_segs_suc += mpdu->main_seg_nb + prep->main_seg_nb_reserved
- - return_nb;
+ mfs->stats.num_segs_suc += mpdu->main_seg_nb - return_nb;
/* Unset prepared MPDU. */
mpdu->pb_nb_total = 0;
dbg_invalid_ptr (mpdu->main_head);
@@ -1154,15 +1183,22 @@ pbproc_prep_mpdu_commit_burst (pbproc_t *ctx)
/* Change MFS. */
if (prep->main_commit_return_head)
{
- /* If the MFS has been removed, do not give PB back. Do not put more
- * than one PB in a beacon MFS. */
+ /* If the MFS has been removed or if the last sent PB has expired,
+ * do not give PB back. Do not put more than one PB in a beacon MFS. */
+ bool expire_return =
+ lesseq_mod2p32 (prep->main_commit_return_tail->expiration_ntb,
+ phy_date () + ctx->config->ntb_offset_tck);
if (mfs->ca_state == CA_MFS_STATE_REMOVED
- || (mfs->beacon && mfs->seg_nb))
+ || (mfs->beacon && mfs->seg_nb)
+ || expire_return)
{
slist_push_back_range (ctx->commit.release_,
prep->main_commit_return_head,
prep->main_commit_return_tail);
pbproc_fsm_schedule_deferred (ctx);
+ if (expire_return)
+ prep->main_mfs->stats.num_segs_dropped +=
+ prep->main_commit_return_seg_nb;
}
else
{
@@ -1170,9 +1206,12 @@ pbproc_prep_mpdu_commit_burst (pbproc_t *ctx)
prep->main_commit_return_tail, bare);
mfs->seg_nb += prep->main_commit_return_seg_nb;
}
+ /* Credit reserved segment number. */
+ mfs->seg_nb += prep->main_commit_return_seg_nb_reserved;
/* Empty commit list. */
slist_init (prep->main_commit_return_);
prep->main_commit_return_seg_nb = 0;
+ prep->main_commit_return_seg_nb_reserved = 0;
}
/* Commit FSM change. */
pbproc_prep_mpdu_commit_fsm (ctx);
diff --git a/cesar/mac/pbproc/test/int/src/add_seg.c b/cesar/mac/pbproc/test/int/src/add_seg.c
index 7a2d9b4a32..9537ed820a 100644
--- a/cesar/mac/pbproc/test/int/src/add_seg.c
+++ b/cesar/mac/pbproc/test/int/src/add_seg.c
@@ -13,6 +13,7 @@
#include "common/std.h"
#include "host/fcall/fcall.h"
+#include "hal/phy/phy.h"
#include "mac/common/mfs.h"
#include "mac/common/store.h"
@@ -20,6 +21,10 @@
#include "inc/add_seg.h"
#include "inc/context.h"
+/** Offset added to phy_date in the expiration_ntb field
+ * to avoid PB expiration in the test. */
+#define PBPROC_ANTI_EXPIRATION_OFFSET 1000000000
+
static int
test_pbproc_add_seg_fcall (fcall_ctx_t *fcall, fcall_param_t **param,
sci_msg_t **msg, void *data);
@@ -68,6 +73,8 @@ test_pbproc_add_seg (test_pbproc_t *ctx, bool mme, uint lid, uint tei,
seg->data[1] = 0x5a;
seg->data[2] = gen;
seg->data[3] = i;
+ /* Set expiration date */
+ seg->expiration_ntb = phy_date () + PBPROC_ANTI_EXPIRATION_OFFSET;
}
/* Insert them. */
pbproc_mfs_insert (mfs, seg_first, seg_last, seg_nb);
diff --git a/cesar/mac/pbproc/test/mfs/src/test_mfs.c b/cesar/mac/pbproc/test/mfs/src/test_mfs.c
index 53fa227a96..634ec2c6f3 100644
--- a/cesar/mac/pbproc/test/mfs/src/test_mfs.c
+++ b/cesar/mac/pbproc/test/mfs/src/test_mfs.c
@@ -334,81 +334,60 @@ mfs_expire_test_case (test_t t)
mfs->next_ssn = 10;
mfs_add_segments (mfs, 10, 10);
/* Run expiration on it with several values. */
- u32 first_seg_expiration_ntb = 0x012345678;
uint expired_nb = 123456;
bool empty;
- empty = pbproc_mfs_expire (&pbproc, mfs, (u32) -5,
- &first_seg_expiration_ntb, &expired_nb);
+ empty = pbproc_mfs_expire (&pbproc, mfs, (u32) -5, &expired_nb);
test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
test_fail_unless (expired_nb == 0);
test_fail_unless (mfs->head->header.ssn == 10);
test_fail_unless (mfs->seg_nb == 10);
test_fail_unless (mfs->pending_seg_nb == 10);
test_fail_unless (mfs_count_segments (mfs) == 20);
- empty = pbproc_mfs_expire (&pbproc, mfs, 4,
- &first_seg_expiration_ntb, &expired_nb);
+ empty = pbproc_mfs_expire (&pbproc, mfs, 4, &expired_nb);
test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
test_fail_unless (expired_nb == 0);
test_fail_unless (mfs->head->header.ssn == 10);
test_fail_unless (mfs->seg_nb == 10);
test_fail_unless (mfs->pending_seg_nb == 10);
test_fail_unless (mfs_count_segments (mfs) == 20);
- empty = pbproc_mfs_expire (&pbproc, mfs, 5,
- &first_seg_expiration_ntb, &expired_nb);
+ empty = pbproc_mfs_expire (&pbproc, mfs, 5, &expired_nb);
test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 6);
test_fail_unless (expired_nb == 2);
test_fail_unless (mfs->head->header.ssn == 12);
test_fail_unless (mfs->seg_nb == 8);
test_fail_unless (mfs->pending_seg_nb == 10);
test_fail_unless (mfs_count_segments (mfs) == 18);
- empty = pbproc_mfs_expire (&pbproc, mfs, 10,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 11);
- test_fail_unless (expired_nb == 10);
- test_fail_unless (mfs->head->header.ssn == 22);
- test_fail_unless (mfs->seg_nb == 0);
- test_fail_unless (mfs->pending_seg_nb == 8);
- test_fail_unless (mfs_count_segments (mfs) == 8);
- empty = pbproc_mfs_expire (&pbproc, mfs, 15,
- &first_seg_expiration_ntb, &expired_nb);
+ pbproc_mfs_provide (mfs, 10);
+ empty = pbproc_mfs_expire (&pbproc, mfs, 20, &expired_nb);
test_fail_unless (empty);
- test_fail_unless (!mfs->head);
- test_fail_unless (expired_nb == 8);
+ test_fail_unless (expired_nb == 18);
test_fail_unless (mfs->seg_nb == 0);
test_fail_unless (mfs->pending_seg_nb == 0);
test_fail_unless (mfs_count_segments (mfs) == 0);
- empty = pbproc_mfs_expire (&pbproc, mfs, 15,
- &first_seg_expiration_ntb, &expired_nb);
+ empty = pbproc_mfs_expire (&pbproc, mfs, 20, &expired_nb);
test_fail_unless (empty);
- test_fail_unless (!mfs->head);
test_fail_unless (expired_nb == 0);
test_fail_unless (mfs->seg_nb == 0);
test_fail_unless (mfs->pending_seg_nb == 0);
test_fail_unless (mfs_count_segments (mfs) == 0);
/* Now with many PB. */
- mfs_add_segments (mfs, 100, 100);
- empty = pbproc_mfs_expire (&pbproc, mfs, 15,
- &first_seg_expiration_ntb, &expired_nb);
+ mfs_add_segments (mfs, 100, 0);
+ empty = pbproc_mfs_expire (&pbproc, mfs, 15, &expired_nb);
test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 16);
test_fail_unless (expired_nb == 2);
test_fail_unless (mfs->head->header.ssn == 32);
test_fail_unless (mfs->seg_nb == 98);
- test_fail_unless (mfs->pending_seg_nb == 100);
- test_fail_unless (mfs_count_segments (mfs) == 198);
- empty = pbproc_mfs_expire (&pbproc, mfs, 115,
- &first_seg_expiration_ntb, &expired_nb);
+ test_fail_unless (mfs->pending_seg_nb == 0);
+ test_fail_unless (mfs_count_segments (mfs) == 98);
+ empty = pbproc_mfs_expire (&pbproc, mfs, 100, &expired_nb);
test_fail_unless (empty);
- test_fail_unless (!mfs->head);
- test_fail_unless (expired_nb == 198);
+ test_fail_unless (expired_nb == 98);
test_fail_unless (mfs->seg_nb == 0);
test_fail_unless (mfs->pending_seg_nb == 0);
test_fail_unless (mfs_count_segments (mfs) == 0);
/* Cleanup. */
+ mfs->ca_state = CA_MFS_STATE_REMOVED;
+ pbproc_mfs_remove_all (mfs);
blk_release (mfs);
} test_end;
test_begin (t, "same mfs")
@@ -417,109 +396,35 @@ mfs_expire_test_case (test_t t)
mfs_tx_t *mfs = blk_alloc ();
mfs_tx_init (mfs, false, false, 0, 1);
mfs->next_ssn = 10;
- mfs_add_segments (mfs, 10, 10);
/* This MFS is selected for TX. */
prep->main_mfs = mfs;
+ /* Run expiration on it. */
+ uint expired_nb = 123456;
+ bool empty;
+ /* Check that the MFS is not treated and not considered as empty. */
+ empty = pbproc_mfs_expire (&pbproc, mfs, 300, &expired_nb);
+ test_fail_unless (!empty);
+ test_fail_unless (expired_nb == 0);
+ test_fail_unless (mfs->seg_nb == 0);
+ test_fail_unless (mfs->pending_seg_nb == 0);
+ test_fail_unless (mfs_count_segments (mfs) == 0);
+ /* Then we add some segments and check that that the MFS is still
+ * not treated */
+ mfs_add_segments (mfs, 10, 0);
mpdu->main_head = mfs->head;
mpdu->main_tail = mfs->head->next;
mfs->head = mfs->head->next->next;
mpdu->main_seg_nb = 2;
prep->main_seg_nb_reserved = 2;
mfs->seg_nb -= 4;
- /* Run expiration on it with several values. */
- u32 first_seg_expiration_ntb = 0x012345678;
- uint expired_nb = 123456;
- bool empty;
- empty = pbproc_mfs_expire (&pbproc, mfs, (u32) -5,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 0);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->head->next->next->header.ssn == 14);
- test_fail_unless (mfs->seg_nb == 6);
- test_fail_unless (mfs->pending_seg_nb == 10);
- test_fail_unless (mfs_count_segments (mfs) == 18);
- empty = pbproc_mfs_expire (&pbproc, mfs, 4,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 0);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->head->next->next->header.ssn == 14);
- test_fail_unless (mfs->seg_nb == 6);
- test_fail_unless (mfs->pending_seg_nb == 10);
- test_fail_unless (mfs_count_segments (mfs) == 18);
- empty = pbproc_mfs_expire (&pbproc, mfs, 5,
- &first_seg_expiration_ntb, &expired_nb);
+ empty = pbproc_mfs_expire (&pbproc, mfs, 300, &expired_nb);
test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
test_fail_unless (expired_nb == 0);
test_fail_unless (mfs->head->header.ssn == 12);
test_fail_unless (mfs->head->next->next->header.ssn == 14);
test_fail_unless (mfs->seg_nb == 6);
- test_fail_unless (mfs->pending_seg_nb == 10);
- test_fail_unless (mfs_count_segments (mfs) == 18);
- empty = pbproc_mfs_expire (&pbproc, mfs, 7,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 2);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->head->next->next->header.ssn == 16);
- test_fail_unless (mfs->seg_nb == 4);
- test_fail_unless (mfs->pending_seg_nb == 10);
- test_fail_unless (mfs_count_segments (mfs) == 16);
- empty = pbproc_mfs_expire (&pbproc, mfs, 10,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 6);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->head->next->next->header.ssn == 22);
- test_fail_unless (mfs->seg_nb == 0);
- test_fail_unless (mfs->pending_seg_nb == 8);
- test_fail_unless (mfs_count_segments (mfs) == 10);
- empty = pbproc_mfs_expire (&pbproc, mfs, 15,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 8);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->head->next == mfs->tail);
- test_fail_unless (mfs->seg_nb == 0);
test_fail_unless (mfs->pending_seg_nb == 0);
- test_fail_unless (mfs_count_segments (mfs) == 2);
- empty = pbproc_mfs_expire (&pbproc, mfs, 15,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 0);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->head->next == mfs->tail);
- test_fail_unless (mfs->seg_nb == 0);
- test_fail_unless (mfs->pending_seg_nb == 0);
- test_fail_unless (mfs_count_segments (mfs) == 2);
- /* Now with many PB. */
- mfs_add_segments (mfs, 100, 100);
- empty = pbproc_mfs_expire (&pbproc, mfs, 15,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 2);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->seg_nb == 98);
- test_fail_unless (mfs->pending_seg_nb == 100);
- test_fail_unless (mfs_count_segments (mfs) == 200);
- empty = pbproc_mfs_expire (&pbproc, mfs, 115,
- &first_seg_expiration_ntb, &expired_nb);
- test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
- test_fail_unless (expired_nb == 198);
- test_fail_unless (mfs->head->header.ssn == 12);
- test_fail_unless (mfs->seg_nb == 0);
- test_fail_unless (mfs->pending_seg_nb == 0);
- test_fail_unless (mfs_count_segments (mfs) == 2);
+ test_fail_unless (mfs_count_segments (mfs) == 8);
/* Cleanup. */
prep->main_mfs = NULL;
blk_release_desc_range (&mpdu->main_head->blk,
@@ -545,13 +450,11 @@ mfs_expire_test_case (test_t t)
mpdu->main_seg_nb = 0;
prep->main_seg_nb_reserved = 0;
/* Run expiration on it. */
- u32 first_seg_expiration_ntb = 0x012345678;
uint expired_nb = 123456;
bool empty;
- empty = pbproc_mfs_expire (&pbproc, mfs, (u32) -5,
- &first_seg_expiration_ntb, &expired_nb);
+ empty = pbproc_mfs_expire (&pbproc, mfs, (u32) 20, &expired_nb);
+ /* Check that the MFS has not been treated. */
test_fail_unless (!empty);
- test_fail_unless (first_seg_expiration_ntb == 5);
test_fail_unless (expired_nb == 0);
test_fail_unless (mfs->head->header.ssn == 10);
test_fail_unless (mfs->seg_nb == 10);
diff --git a/cesar/mac/pbproc/test/pbproc/inc/test_pbproc.h b/cesar/mac/pbproc/test/pbproc/inc/test_pbproc.h
index 8c5a638bae..ee8ebafc1a 100644
--- a/cesar/mac/pbproc/test/pbproc/inc/test_pbproc.h
+++ b/cesar/mac/pbproc/test/pbproc/inc/test_pbproc.h
@@ -15,11 +15,18 @@
#include "lib/test.h"
#include "lib/rnd.h"
#include "mac/common/config.h"
+#include "mac/common/ntb.h"
#include "mac/common/store.h"
#include "mac/ca/ca.h"
#include "mac/pbproc/pbproc.h"
#include "mac/pbproc/inc/context.h"
+/** Default NTB offset value. */
+#define TEST_PBPROC_NTB_OFFSET_TCK 0x12345
+
+/** Date offset for expiration tests. */
+#define TEST_PBPROC_EXPIRATION_DATE_OFFSET 1000000000
+
/** Test pbproc context. */
struct test_pbproc_t
{
diff --git a/cesar/mac/pbproc/test/pbproc/inc/utils.h b/cesar/mac/pbproc/test/pbproc/inc/utils.h
index 54469865bf..6c7dd29e4d 100644
--- a/cesar/mac/pbproc/test/pbproc/inc/utils.h
+++ b/cesar/mac/pbproc/test/pbproc/inc/utils.h
@@ -16,6 +16,9 @@
#include "mac/common/tonemap.h"
#include "inc/test_pbproc.h"
+/** */
+#define UTILS_MFS_EXPIRATION_NTB_STEP 25000
+
/** Define interval properties. */
struct utils_interval_t
{
diff --git a/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c b/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
index e251f28178..3a74532b64 100644
--- a/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
+++ b/cesar/mac/pbproc/test/pbproc/src/prep_mpdu.c
@@ -17,6 +17,8 @@
#include "mac/common/timings.h"
+#include "hal/phy/inc/context.h"
+
/* Maximum number of bits usable in a CRC bitmap. */
#define PREP_MPDU_TEST_CRC_BITMAP_SIZE 72u
@@ -82,6 +84,8 @@ struct prep_mpdu_test_t
* - 2: before chaining remaining segments.
* - 3: before acknowledge or cancel. */
uint remove;
+ /** True to simulate that ACCESS_CONF event has never been received. */
+ bool no_access_conf;
/** Sound completed flag. */
bool scf;
/** Beacon detected. */
@@ -90,6 +94,8 @@ struct prep_mpdu_test_t
bool hp10_detected;
/** HP 1.1 detected. */
bool hp11_detected;
+ /** Current date for expiration tests. */
+ uint expiration_date;
};
#define prep_mpdu_test(t, tp, date, params...) \
@@ -185,6 +191,12 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
tp->pbproc->detect.beacon_detected = params->beacon_detected;
tp->pbproc->detect.hp10_detected = params->hp10_detected;
tp->pbproc->detect.hp11_detected = params->hp11_detected;
+ /* Set the current date for expiration tests. */
+ if (params->expiration_date)
+ tp->pbproc->phy->current_date = params->expiration_date
+ + TEST_PBPROC_EXPIRATION_DATE_OFFSET;
+ else
+ tp->pbproc->phy->current_date = 0;
/* Prepare MPDU. */
pbproc_prep_mpdu (tp->pbproc, params->remove != 1 ? mfs : NULL);
/* Check result. */
@@ -376,20 +388,21 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
test_fail_unless (fc.bm_sacki == 0xf);
test_fail_unless (prep->fc10 == 0x200000);
/* Chain remaining segments. */
- if (params->remove == 2)
- {
- mfs->ca_state = CA_MFS_STATE_REMOVED;
- seg_nb_pending = params->main_seg_nb_total - main_seg_nb;
- }
+ if (params->remove == 2 || params->no_access_conf)
+ seg_nb_pending += params->main_seg_nb_total - main_seg_nb;
else
main_seg_nb = params->main_seg_nb_total;
- pbproc_prep_mpdu_chain (tp->pbproc);
+ if (params->remove == 2)
+ mfs->ca_state = CA_MFS_STATE_REMOVED;
+ if (!params->no_access_conf)
+ pbproc_prep_mpdu_chain (tp->pbproc);
/* Check result. */
test_fail_unless (prep->valid);
test_fail_unless (prep->main_mfs == mfs);
test_fail_unless (prep->current->main_head == seg_first);
test_fail_unless (prep->current->main_seg_nb == main_seg_nb);
- test_fail_unless (prep->main_seg_nb_reserved == 0);
+ test_fail_unless (prep->main_seg_nb_reserved ==
+ (params->no_access_conf ? main_seg_nb_reserved : 0));
test_fail_unless (prep->current->pb_nb_total == main_seg_nb
+ seg_nb_pending);
for (seg = seg_first, i = 1; i < main_seg_nb; seg = seg->next, i++)
@@ -406,6 +419,35 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
if (!params->remove)
acked -= nack_count;
uint mfs_seg_nb_after = params->mfs_seg_nb - acked;
+ /* Expired PBs */
+ if (!params->no_access_conf)
+ {
+ if (params->expiration_date
+ >= params->main_seg_nb_total * UTILS_MFS_EXPIRATION_NTB_STEP)
+ mfs_seg_nb_after -= (params->main_seg_nb_total - acked);
+ if ((uint) params->mfs_seg_nb > params->main_seg_nb_total
+ && !params->no_access_conf)
+ {
+ uint expected_expired_nb = params->expiration_date
+ > params->main_seg_nb_total * UTILS_MFS_EXPIRATION_NTB_STEP
+ + PBPROC_EXPIRATION_HYSTERESIS_OFFSET
+ ? params->expiration_date / UTILS_MFS_EXPIRATION_NTB_STEP
+ - params->main_seg_nb_total : 0;
+ uint mfs_remaining_seg_nb = params->mfs_seg_nb
+ - params->main_seg_nb_total;
+ if (expected_expired_nb > mfs_remaining_seg_nb)
+ expected_expired_nb = mfs_remaining_seg_nb;
+ if (expected_expired_nb > PBPROC_CURRENT_TX_MFS_EXPIRE_BUDGET)
+ expected_expired_nb = PBPROC_CURRENT_TX_MFS_EXPIRE_BUDGET;
+ mfs_seg_nb_after -= expected_expired_nb;
+ }
+ }
+ else
+ {
+ if (params->expiration_date
+ >= main_seg_nb * UTILS_MFS_EXPIRATION_NTB_STEP)
+ mfs_seg_nb_after -= main_seg_nb;
+ }
if (!params->crc)
{
if (params->sacki)
@@ -470,21 +512,24 @@ prep_mpdu_test_f (test_t t, test_pbproc_t *tp, u32 date,
pbproc_fsm_handle_deferred (tp->pbproc);
/* Check result. */
test_fail_unless (mfs->seg_nb == (int) mfs_seg_nb_after);
- seg = mfs->head;
- for (i = 0; i < (uint) params->mfs_seg_nb; i++)
+ if (!params->expiration_date)
{
- bool bad_crc = !params->crc ? !params->all_ok
- : (params->crc_error[i / 32] & (1u << (i % 32))) != 0;
- if (i >= main_seg_nb || (!params->remove && bad_crc))
+ seg = mfs->head;
+ for (i = 0; i < (uint) params->mfs_seg_nb; i++)
{
- test_fail_unless (seg->header.ssn == i
- && seg->header.mfbo == 0
- && seg->header.vpbf == true
- && seg->header.mmqf == params->mme
- && seg->header.mfbf == false
- && seg->header.opsf == (i == 0)
- && seg->header.rsvd == 0);
- seg = seg->next;
+ bool bad_crc = !params->crc ? !params->all_ok
+ : (params->crc_error[i / 32] & (1u << (i % 32))) != 0;
+ if (i >= main_seg_nb || (!params->remove && bad_crc))
+ {
+ test_fail_unless (seg->header.ssn == i
+ && seg->header.mfbo == 0
+ && seg->header.vpbf == true
+ && seg->header.mmqf == params->mme
+ && seg->header.mfbf == false
+ && seg->header.opsf == (i == 0)
+ && seg->header.rsvd == 0);
+ seg = seg->next;
+ }
}
}
}
@@ -1012,6 +1057,67 @@ prep_mpdu_intervals_test_case (test_t t)
}
void
+prep_mpdu_expiration_test_case (test_t t)
+{
+ test_pbproc_t tp;
+ test_case_begin (t, "expiration");
+ test_pbproc_init (&tp);
+ test_begin (t, "expiration on sack return")
+ {
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 40, .duration_symb_nb = 50,
+ .symb_nb = 25, .main_seg_nb_total = 40, .seg_nb_pending = 1,
+ .expiration_date = 20 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .tmi = 5, .tm_mod = 10);
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 40, .duration_symb_nb = 50,
+ .symb_nb = 25, .main_seg_nb_total = 40, .seg_nb_pending = 1,
+ .expiration_date = 50 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .tmi = 5, .tm_mod = 10);
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 40, .duration_symb_nb = 50,
+ .symb_nb = 25, .main_seg_nb_total = 40, .seg_nb_pending = 1,
+ .crc = true, .crc_error = { 0x0fa5c03a, 0x15 },
+ .expiration_date = 50 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .tmi = 5, .tm_mod = 10);
+ } test_end;
+ test_begin (t, "expiration on chaining")
+ {
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 200, .duration_symb_nb = 50,
+ .symb_nb = 50, .main_seg_nb_total = 83, .seg_nb_pending = 0,
+ .expiration_date = 150 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .tmi = 5, .tm_mod = 10);
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 200, .duration_symb_nb = 50,
+ .symb_nb = 50, .main_seg_nb_total = 83, .seg_nb_pending = 0,
+ .expiration_date = 170 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .tmi = 5, .tm_mod = 10);
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 200, .duration_symb_nb = 50,
+ .symb_nb = 50, .main_seg_nb_total = 83, .seg_nb_pending = 0,
+ .expiration_date = 250 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .tmi = 5, .tm_mod = 10);
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 200, .duration_symb_nb = 50,
+ .symb_nb = 50, .main_seg_nb_total = 83, .seg_nb_pending = 0,
+ .crc = true, .crc_error = { 0x0fa5c03a, 0x15, 0x7ff00 },
+ .expiration_date = 170 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .tmi = 5, .tm_mod = 10);
+ } test_end;
+ test_begin (t, "expiration with cancel")
+ {
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 40, .duration_symb_nb = 50,
+ .symb_nb = 25, .main_seg_nb_total = 40, .seg_nb_pending = 1,
+ .expiration_date = 3 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .no_access_conf = true, .tmi = 5, .tm_mod = 10);
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 40, .duration_symb_nb = 50,
+ .symb_nb = 25, .main_seg_nb_total = 40, .seg_nb_pending = 1,
+ .expiration_date = 50 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .no_access_conf = true, .tmi = 5, .tm_mod = 10);
+ prep_mpdu_test (t, &tp, 0, .mfs_seg_nb = 40, .duration_symb_nb = 50,
+ .symb_nb = 25, .main_seg_nb_total = 40, .seg_nb_pending = 1,
+ .expiration_date = 200 * UTILS_MFS_EXPIRATION_NTB_STEP,
+ .no_access_conf = true, .tmi = 5, .tm_mod = 10);
+ } test_end;
+ test_pbproc_uninit (&tp);
+}
+
+
+void
prep_beacon_test (test_t t, test_pbproc_t *tp, u32 date, bool prepared,
uint duration_symb_nb, uint symb_nb)
{
@@ -1314,6 +1420,7 @@ prep_mpdu_test_suite (test_t t)
prep_mpdu_basic_test_case (t);
prep_mpdu_ack_test_case (t);
prep_mpdu_intervals_test_case (t);
+ prep_mpdu_expiration_test_case (t);
prep_mpdu_beacon_test_case (t);
prep_mpdu_fsm_test_case (t);
test_case_begin (t, "memory");
diff --git a/cesar/mac/pbproc/test/pbproc/src/test_pbproc.c b/cesar/mac/pbproc/test/pbproc/src/test_pbproc.c
index ac56ddd477..eea87f8391 100644
--- a/cesar/mac/pbproc/test/pbproc/src/test_pbproc.c
+++ b/cesar/mac/pbproc/test/pbproc/src/test_pbproc.c
@@ -101,7 +101,8 @@ test_pbproc_init (test_pbproc_t *ctx)
dbg_assert (ctx);
lib_rnd_init (ctx->rnd, 1234);
mac_config_init (&ctx->config);
- ctx->config.ntb_offset_tck = 0x12345;
+ mac_ntb_init (&ctx->config);
+ ctx->config.ntb_offset_tck = TEST_PBPROC_NTB_OFFSET_TCK;
ctx->config.tei = 1;
ctx->snid = 1;
ctx->config.seed = 42;
diff --git a/cesar/mac/pbproc/test/pbproc/src/utils.c b/cesar/mac/pbproc/test/pbproc/src/utils.c
index fe69f838d5..30c328a7d3 100644
--- a/cesar/mac/pbproc/test/pbproc/src/utils.c
+++ b/cesar/mac/pbproc/test/pbproc/src/utils.c
@@ -46,6 +46,9 @@ utils_mfs_tx_prepare (bool bcast, bool mme, uint lid, uint tei, int seg_nb)
seg->header.mfbf = false;
seg->header.opsf = false;
seg->header.rsvd = 0;
+ seg->expiration_ntb = mfs->next_ssn * UTILS_MFS_EXPIRATION_NTB_STEP
+ + TEST_PBPROC_NTB_OFFSET_TCK
+ + TEST_PBPROC_EXPIRATION_DATE_OFFSET;
}
pbproc_mfs_insert (mfs, seg_first, seg_last, seg_nb);
pbproc_mfs_provide (mfs, seg_nb);
diff --git a/cesar/mac/sar/src/sar_expiration.c b/cesar/mac/sar/src/sar_expiration.c
index 03fd0e35d7..d6cc611f66 100644
--- a/cesar/mac/sar/src/sar_expiration.c
+++ b/cesar/mac/sar/src/sar_expiration.c
@@ -49,7 +49,6 @@ sar_expiration_mfs_update_ntb (sar_t *ctx, mfs_t *mfs, u32 arrival_ntb)
void
sar_expiration_mfs_purge_tx (sar_t *ctx, mfs_tx_t *mfs, u32 phy_curr_ntb)
{
- u32 expiration_pb_ntb;
bool mfs_empty;
u32 old_first_ssn = SAR_SSN_INVALID;
uint expired_nb;
@@ -58,12 +57,8 @@ sar_expiration_mfs_purge_tx (sar_t *ctx, mfs_tx_t *mfs, u32 phy_curr_ntb)
if (CONFIG_TRACE && mfs->head)
old_first_ssn = mfs->head->header.ssn;
/* Call the PBprocessing to expire the PBs (only on MFS tx). */
- mfs_empty = pbproc_mfs_expire (ctx->pbproc_ctx,
- (mfs_tx_t *) mfs,
- phy_curr_ntb,
- &expiration_pb_ntb, &expired_nb);
- /* Increment stats. */
- mfs->stats.num_segs_dropped += expired_nb;
+ mfs_empty = pbproc_mfs_expire (ctx->pbproc_ctx, (mfs_tx_t *) mfs,
+ phy_curr_ntb, &expired_nb);
if (expired_nb)
{
SAR_TRACE (PB_TX_RELEASE, old_first_ssn,
diff --git a/cesar/mac/sar/test/unit_test/ecos/src/sar_pbproc_override_mfs.c b/cesar/mac/sar/test/unit_test/ecos/src/sar_pbproc_override_mfs.c
index ee998726c5..9526d12bda 100644
--- a/cesar/mac/sar/test/unit_test/ecos/src/sar_pbproc_override_mfs.c
+++ b/cesar/mac/sar/test/unit_test/ecos/src/sar_pbproc_override_mfs.c
@@ -43,7 +43,7 @@ pbproc_mfs_beacon_prepare (pbproc_t *ctx, mfs_tx_t *mfs, pb_beacon_t *pb,
bool
pbproc_mfs_expire (pbproc_t *ctx, mfs_tx_t *mfs, u32 expiration_ntb,
- u32 *first_pb_expiration_ntb, uint *expired_nb)
+ uint *expired_nb)
{
return false;
}