abstract class Dpdk

Overview

Crystal bindings to Intel's DPDK

Defined in:

dpdk/core.cr
dpdk/asm.cr
dpdk/llvm.cr
dpdk/macros_defines.cr
dpdk/macros_overrides.cr
dpdk/macros_overloads.cr
dpdk/inlines.cr
dpdk/extras.cr
dpdk/units.cr
dpdk/debug.cr

Instance Method Summary

Macro Summary

Instance Method Detail

def _mm_pause #

emmintrin.h pause implementation


[View source]
def print_macaddr(port) #

rte_eth_macaddr_get and print


[View source]
def rte_errno #

per core rte_errno, use with rte_strerror(rte_errno)


[View source]
def rte_eth_tx_buffer(port_id : UInt16, queue_id : UInt16, buffer : ::Pointer(RteEthDevTxBuffer), tx_pkt : ::Pointer(RteMbuf)) : UInt16 #

Buffer a single packet for future transmission on a port and queue

TODO measure performance vs C


[View source]
def rte_eth_tx_buffer_flush(port_id : UInt16, queue_id : UInt16, buffer : ::Pointer(RteEthDevTxBuffer)) : UInt16 #

Send any packets queued up for transmission on a port and HW queue

TODO measure performance vs C


[View source]
def rte_get_master_lcore #

return master_lcore number


[View source]
def rte_get_next_lcore(i : UInt32, skip_master = 1, wrap = 0) : UInt32 #

return next available lcore


[View source]
def rte_lcore_count #

return lcore_count


[View source]
def rte_lcore_foreach_slave(&block) #

RTE_LCORE_FOREACH_SLAVE equivalent


[View source]
def rte_lcore_foreach_worker(limit = 32, &block) #

rte_lcore_foreach_slave with worker_id


[View source]
def rte_lcore_id #

per core lcore_id


[View source]
def rte_lcore_is_enabled(lcore_id) : Bool #

check lcore is enabled or not, return boolean


[View source]
def rte_prefetch0(p : Pointer) : Void #

[View source]
def rte_prefetch1(p : Pointer) : Void #

[View source]
def rte_prefetch2(p : Pointer) : Void #

[View source]
def rte_prefetch_non_temporal(p : Pointer) : Void #

[View source]
def rte_ring_count(r : ::Pointer(RteRing)) #

[View source]
def rte_socket_id #

per core socket_id, unavailable on old gcc


[View source]

Macro Detail

macro apply_from_si_measure(var, s) #

SI Measure Units (T, G, M, k) to number converter


[View source]
macro apply_from_si_time(var, s) #

SI Time Units (s, ms, us) to number converter


[View source]
macro b16(x) #

[View source]
macro b32(x) #

[View source]
macro configure_tx_offload(port_conf, dev_info) #

set txmode.offloads and return txconf pointer


[View source]
macro copy32(dst, src, size) #

copy by u32


[View source]
macro copy64(dst, src, size) #

copy by u64


[View source]
macro distributor_create(cores) #

rte_distributor_create with error handling


[View source]
macro ether_addr_copy(ea_from, ea_to) #

ether_addr_copy


[View source]
macro fail(*args) #

rte_exit with EXIT_FAILURE


[View source]
macro fflush(arg) #

fflush


[View source]
macro hexdump(name, pkt, pkt_len) #

[View source]
macro inet_pton(address, addr) #

inet_pton with buf


[View source]
macro inet_pton(address) #

inet_pton equivalent


[View source]
macro ipv4(a, b, c, d) #

[View source]
macro ipv4x(a, b, c, d) #

[View source]
macro ipv6(address) #

inet_pton for IPv6


[View source]
macro log_dp(l, t, *args) #

rte_log with log level condition.

TODO fix log level check at compile time


[View source]
macro panic(*args) #

rte_panic equivalent without function name

NOTE lots of assembly


[View source]
macro pool_create(name, n, cache_size) #

pool creation shortcut with only name, numbers of pool, and cache_size


[View source]
macro pool_create(n, cache_size) #

pool creation shortcut with only numbers of pool, and cache_size


[View source]
macro printf(*args) #

printf from LibC


[View source]
macro puts(args) #

puts from LibC


[View source]
macro rte_eal_init(*args) #

rte_eal_init with error handling


[View source]
macro rte_eal_mp_remote_launch(call) #

similar to rte_eal_mp_remote_launch without writing proc directly


[View source]
macro rte_eal_remote_launch(call, *args) #

rte_eal_remote_launch with automatic proc creation


[View source]
macro rte_eth_dev_adjust_nb_rx_tx_desc(*args) #

rte_eth_dev_adjust_nb_rx_tx_desc with error handling


[View source]
macro rte_eth_dev_configure(*args) #

rte_eth_dev_configure with error handling


[View source]
macro rte_eth_dev_start(portid) #

rte_eth_dev_start with error handling


[View source]
macro rte_eth_rx_queue_setup(*args) #

rte_eth_rx_queue_setup with error handling


[View source]
macro rte_eth_tx_buffer_size(sz) #

RTE_ETH_TX_BUFFER_SIZE


[View source]
macro rte_eth_tx_queue_setup(*args) #

rte_eth_tx_queue_setup with error handling


[View source]
macro rte_get_timer_hz #

Get the number of cycles in one second for the default timer. using rte_get_tsc_hz, not rte_get_hpet_hz


[View source]
macro rte_log(l, t, *args) #

rte_log equivalent


[View source]
macro rte_lpm_create(*args) #

rte_lpm_create with error handling


[View source]
macro rte_max(a, b) #

RTE_MAX


[View source]
macro rte_min(a, b) #

RTE_MIN


[View source]
macro rte_pause #

rte_pause implementation


[View source]
macro rte_pktmbuf_adj(mbuf, len) #

rte_pktmbuf_adj with error handling


[View source]
macro rte_pktmbuf_alloc(arg) #

rte_pktmbuf_alloc with error handling


[View source]
macro rte_pktmbuf_clone(arg) #

rte_pktmbuf_clone with error handling


[View source]
macro rte_pktmbuf_copy(mbuf_old, pool) #

rte_pktmbuf_alloc + memcpy packet data


[View source]
macro rte_pktmbuf_free(pkts, nb) #

batch rte_pktmbuf_free


[View source]
macro rte_pktmbuf_mtod(m) #

similar to rte_pktmbuf_mtod, but without type parameters, use .as(...) after this


[View source]
macro rte_pktmbuf_mtod_offset(m, o) #

similar to rte_pktmbuf_mtod_offset, but without type parameters, use .as(...) after this


[View source]
macro rte_pktmbuf_pool_create(*args) #

rte_pktmbuf_pool_create with error handling


[View source]
macro rte_pktmbuf_prepend(mbuf, len) #

rte_pktmbuf_prepend with error handling


[View source]
macro rte_rdtsc #

rte_rdtsc


[View source]
macro rte_ring_create(*args) #

rte_ring_create with error handling


[View source]
macro rte_ring_dequeue_burst(r, obj_table, n, available) #

rte_ring_dequeue_burst with casting to Void**


[View source]
macro rte_ring_enqueue_burst(r, obj_table, n, free_space) #

rte_ring_enqueue_burst with casting to Void**


[View source]
macro rte_ring_free_count(r) #

[View source]
macro rte_ring_lookup(name) #

wait rte_ring_lookup, until success


[View source]
macro rte_ring_sc_dequeue_burst(ring, obj_table, nb) #

rte_ring_sc_dequeue_burst with block


[View source]
macro rte_zmalloc_socket(type, size, align, socket) #

rte_zmalloc_socket with error handling


[View source]
macro signal(signum, call) #

LibC.signal shortcut with automatic proc creation


[View source]
macro snprintf(*args) #

snprintf from LibC


[View source]
macro to_si_measure(n) #

number to SI Measure Units (T, G, M, k) string converter


[View source]
macro to_si_time(n) #

number to SI Time Units (s, ms, us) string converter


[View source]