NDN-DPDK
High-Speed Named Data Networking Forwarder
|
#include "bdev.h"
Functions | |
void | Bdev_ReadPacket (Bdev *bd, struct spdk_io_channel *ch, uint64_t blockOffset, BdevRequest *req) |
Read block device into mbuf. More... | |
bool | Bdev_WritePrepare (Bdev *bd, struct rte_mbuf *pkt, BdevStoredPacket *sp) |
Prepare writing according to bdev alignment requirements. More... | |
void | Bdev_WritePacket (Bdev *bd, struct spdk_io_channel *ch, uint64_t blockOffset, BdevRequest *req) |
Write block device from mbuf via scatter gather list. More... | |
Variables | |
uint8_t * | BdevFiller_ = NULL |
void Bdev_ReadPacket | ( | Bdev * | bd, |
struct spdk_io_channel * | ch, | ||
uint64_t | blockOffset, | ||
BdevRequest * | req | ||
) |
Read block device into mbuf.
ch | an SPDK I/O channel associated with the bdev and the current SPDK thread. |
req | request context. All fields must be kept alive until req->cb is called. |
req->pkt
must be a uniquely owned, unsegmented, direct mbuf with sufficient dataroom. req->pkt->data_off
may be adjusted (either increased or decreased) to achieve proper alignment as required by SPDK bdev driver.
void Bdev_WritePacket | ( | Bdev * | bd, |
struct spdk_io_channel * | ch, | ||
uint64_t | blockOffset, | ||
BdevRequest * | req | ||
) |
Write block device from mbuf via scatter gather list.
ch | an SPDK I/O channel associated with the bdev and the current SPDK thread. |
req | request context. req->sp may be freed after this function returns. All other fields must be kept alive until req->cb is called. |
req->pkt->pkt_len
determines write length. Some headroom and tailroom in each mbuf segment may be written to disk to achieve proper alignment as required by SPDK bdev driver, but they will not appear in readback if the same BdevStorePacket
is passed.
bool Bdev_WritePrepare | ( | Bdev * | bd, |
struct rte_mbuf * | pkt, | ||
BdevStoredPacket * | sp | ||
) |
Prepare writing according to bdev alignment requirements.
[in] | pkt | input packet; cannot be modified between this call and Bdev_WritePacket . |
[out] | sp | stored packet alignment information, needed to later recover the packet. |
uint8_t* BdevFiller_ = NULL |
bool(* prepare) (Bdev *bd, struct rte_mbuf *pkt, BdevStoredPacket *sp) | ( | Bdev * | bd, |
struct rte_mbuf * | pkt, | ||
BdevStoredPacket * | sp | ||
) |
int(* writeIov) (Bdev *bd, BdevRequest *req, uint32_t totalLen) | ( | Bdev * | bd, |
BdevRequest * | req, | ||
uint32_t | totalLen | ||
) |