-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrlc_dl_am_tx_pdu_retx_max_reached.cpp
More file actions
executable file
·49 lines (33 loc) · 1.41 KB
/
rlc_dl_am_tx_pdu_retx_max_reached.cpp
File metadata and controls
executable file
·49 lines (33 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include <linux/bpf.h>
#include "jbpf_srsran_contexts.h"
#include "../utils/misc_utils.h"
#include "../utils/hashmap_utils.h"
#define SEC(NAME) __attribute__((section(NAME), used))
#include "jbpf_defs.h"
#include "jbpf_helper.h"
#define DEBUG_PRINT
extern "C" SEC("jbpf_srsran_generic")
uint64_t jbpf_main(void* state)
{
int zero_index=0;
struct jbpf_ran_generic_ctx *ctx = (jbpf_ran_generic_ctx *)state;
const jbpf_rlc_ctx_info& rlc_ctx = *reinterpret_cast<const jbpf_rlc_ctx_info*>(ctx->data);
// Ensure the object is within valid bounds
if (reinterpret_cast<const uint8_t*>(&rlc_ctx) + sizeof(jbpf_rlc_ctx_info) > reinterpret_cast<const uint8_t*>(ctx->data_end)) {
return JBPF_CODELET_FAILURE; // Out-of-bounds access
}
// create explicit rbid
int rb_id = RBID_2_EXPLICIT(rlc_ctx.is_srb, rlc_ctx.rb_id);
// Store SDU arrival time so we can calculate delay and queue size at the rlc level
uint32_t sn = (uint32_t) (ctx->srs_meta_data1 >> 32);
uint32_t retx_count = (uint32_t) (ctx->srs_meta_data1 & 0xFFFFFFFF);
#ifdef DEBUG_PRINT
jbpf_printf_debug("RLC DL AM MAX RETX REACHED: du_ue_index=%d, rb_id=%d, window_size=%d\n",
rlc_ctx.du_ue_index, rb_id, retx_count);
jbpf_printf_debug(" retx_count=%d sn=%d\n",
retx_count, sn);
#endif
return JBPF_CODELET_SUCCESS;
}