NDN-DPDK
High-Speed Named Data Networking Forwarder
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
strategy.c File Reference
#include "strategy.h"
#include "../core/logger.h"

Functions

 N_LOG_INIT (FwFwd)
 
uint32_t SgRandInt (SgCtx *ctx0, uint32_t max)
 Generate a random integer. More...
 
void SgTriggerTimer (Pit *pit, PitEntry *pitEntry, uintptr_t fwd0)
 
bool SgSetTimer (SgCtx *ctx0, TscDuration after)
 Set a timer to invoke strategy after a duration. More...
 
const struct rte_bpf_xsym * SgGetXsyms (uint32_t *nXsyms)
 Obtain external symbols available to strategy dataplane eBPF programs. More...
 

Function Documentation

◆ N_LOG_INIT()

N_LOG_INIT ( FwFwd  )

◆ SgGetXsyms()

const struct rte_bpf_xsym* SgGetXsyms ( uint32_t *  nXsyms)

Obtain external symbols available to strategy dataplane eBPF programs.

◆ SgRandInt()

uint32_t SgRandInt ( SgCtx ctx,
uint32_t  max 
)

Generate a random integer.

Parameters
maxexclusive maximum.
Returns
uniformly distributed random number r, where 0 <= r < max .

◆ SgSetTimer()

bool SgSetTimer ( SgCtx ctx,
TscDuration  after 
)

Set a timer to invoke strategy after a duration.

Parameters
afterduration in TSC unit, cannot exceed PIT entry expiration time.
Precondition
Not available in SGEVT_DATA .

Strategy program will be invoked again with SGEVT_TIMER after after . However, the timer would be cancelled if strategy program is invoked for any other event, a different timer is set, or the strategy choice has been changed.

◆ SgTriggerTimer()

void SgTriggerTimer ( Pit pit,
PitEntry pitEntry,
uintptr_t  fwd0 
)