1 #ifndef NDNDPDK_FETCH_WINDOW_H
2 #define NDNDPDK_FETCH_WINDOW_H
6 #include "../core/mintmr.h"
28 __attribute__((nonnull))
static inline void
29 FetchSeg_Init(
FetchSeg* seg, uint64_t segNum) {
46 __attribute__((nonnull))
void
50 __attribute__((nonnull))
void
54 __attribute__((nonnull))
void
64 __attribute__((nonnull))
static __rte_always_inline
void
66 uint64_t* deletedBit) {
68 *seg = &win->
array[pos];
69 *deletedSlab = &win->
deleted[pos >> 6];
70 *deletedBit = RTE_BIT64(pos & 0x3F);
74 __attribute__((nonnull))
void
77 __attribute__((nonnull))
static __rte_always_inline
FetchSeg*
78 FetchWindow_GetOrDelete_(
FetchWindow* win, uint64_t segNum,
bool isDelete) {
79 if (unlikely(segNum < win->loSegNum || segNum >= win->
hiSegNum)) {
84 uint64_t* deletedSlab = NULL;
85 uint64_t deletedBit = 0;
86 FetchWindow_Pos_(win, segNum, &seg, &deletedSlab, &deletedBit);
87 if (unlikely((*deletedSlab & deletedBit) != 0)) {
92 *deletedSlab |= deletedBit;
105 __attribute__((nonnull))
static inline FetchSeg*
106 FetchWindow_Get(
FetchWindow* win, uint64_t segNum) {
107 return FetchWindow_GetOrDelete_(win, segNum,
false);
114 __attribute__((nonnull))
static inline FetchSeg*
123 uint64_t* deletedSlab = NULL;
124 uint64_t deletedBit = 0;
125 FetchWindow_Pos_(win, segNum, &seg, &deletedSlab, &deletedBit);
126 *deletedSlab &= ~deletedBit;
127 FetchSeg_Init(seg, segNum);
132 __attribute__((nonnull))
static inline void
133 FetchWindow_Delete(
FetchWindow* win, uint64_t segNum) {
134 FetchWindow_GetOrDelete_(win, segNum,
true);
Per-segment state.
Definition: window.h:15
bool hasRetx
whether Interest has been retransmitted at least once
Definition: window.h:19
MinTmr rtoExpiry
RTO expiration timer, valid if inRetxQ==false.
Definition: window.h:23
bool inRetxQ
Definition: window.h:20
uint64_t segNum
segment number
Definition: window.h:16
uint64_t txTime
TscTime last Interest tx time.
Definition: window.h:18
struct cds_list_head retxNode
retxQ node, valid if inRetxQ==true
Definition: window.h:24
struct FetchSeg::@40 __rte_packed
Window of segment states.
Definition: window.h:34
uint64_t hiSegNum
exclusive upper bound of segment numbers
Definition: window.h:39
uint32_t capacityMask
array capacity minus one
Definition: window.h:37
FetchSeg * array
segment records
Definition: window.h:35
uint64_t loSegNum
inclusive lower bound of segment numbers
Definition: window.h:38
uint64_t * deleted
deleted flag bit vector
Definition: window.h:36
Timer on minute scheduler.
Definition: mintmr.h:9
@ FetchSegTxTimeMask
Definition: window.h:10
@ FetchSegTxTimeBits
Definition: window.h:9
void FetchWindow_Advance_(FetchWindow *win)
Move loPos and loSegNum after some segment states have been deleted.
Definition: window.c:36
void FetchWindow_Reset(FetchWindow *win, uint64_t firstSegNum)
Delete all records and set first segment number.
Definition: window.c:30
void FetchWindow_Init(FetchWindow *win, uint32_t capacity, int numaSocket)
Initialize FetchWindow.
Definition: window.c:4
struct FetchWindow FetchWindow
Window of segment states.
void FetchWindow_Free(FetchWindow *win)
Deallocated memory.
Definition: window.c:23
struct FetchSeg FetchSeg
Per-segment state.