NDN-DPDK
High-Speed Named Data Networking Forwarder
Loading...
Searching...
No Matches
store.c File Reference
#include "store.h"
#include "../core/logger.h"

Functions

 N_LOG_INIT (DiskStore)
void DiskStore_PutData (DiskStore *store, uint64_t slotID, Packet *npkt, BdevStoredPacket *sp)
 Store a Data packet.
void DiskStore_GetData (DiskStore *store, uint64_t slotID, Packet *npkt, struct rte_mbuf *dataBuf, BdevStoredPacket *sp)
 Retrieve a Data packet.

Function Documentation

◆ DiskStore_GetData()

void DiskStore_GetData ( DiskStore * store,
uint64_t slotID,
Packet * npkt,
struct rte_mbuf * dataBuf,
BdevStoredPacket * sp )

Retrieve a Data packet.

Parameters
slotIDdisk slot number.
npktan Interest packet. DiskStore takes ownership until callback.
dataBufa uniquely owned, unsegmented, direct mbuf for Data packet. DiskStore takes ownership until callback.
spsame BdevStoredPacket used during PutData, will be copied.

This function asynchronously reads from a specified slot of the underlying disk, and parses the content as a Data packet. Upon success, it assigns interest->diskSlot and interest->diskData . Upon failure, it assigns interest->diskSlot and clears interest->diskData . It then calls store->getDataCb with the npkt .

This function may be invoked on any thread, including non-SPDK thread.

◆ DiskStore_PutData()

void DiskStore_PutData ( DiskStore * store,
uint64_t slotID,
Packet * npkt,
BdevStoredPacket * sp )

Store a Data packet.

Parameters
slotIDdisk slot number; slot 0 cannot be used.
npkta Data packet. DiskStore takes ownership.
spoutput of a successful DiskStore_PrepareData .

This function may be invoked on any thread, including non-SPDK thread.

◆ N_LOG_INIT()

N_LOG_INIT ( DiskStore )

Variable Documentation

◆ begin

void(* begin) (DiskStore *store, DiskStoreRequest *req, Packet *npkt, uint64_t slotID) ( DiskStore * store,
DiskStoreRequest * req,
Packet * npkt,
uint64_t slotID )

◆ finish

void(* finish) (DiskStore *store, Packet *npkt, int res) ( DiskStore * store,
Packet * npkt,
int res )

◆ verb

const char* verb