DPDK  17.02.1
Data Structures | Data Fields
rte_ring Struct Reference

#include <rte_ring.h>

Data Structures

struct  cons
struct  prod

Data Fields

char name [RTE_MEMZONE_NAMESIZE]
int flags
struct rte_memzonememzone
void *ring[] __rte_cache_aligned

Detailed Description

An RTE ring structure.

The producer and the consumer have a head and a tail index. The particularity of these index is that they are not between 0 and size(ring). These indexes are between 0 and 2^32, and we mask their value when we access the ring[] field. Thanks to this assumption, we can do subtractions between 2 index values in a modulo-32bit base: that's why the overflow of the indexes is not a problem.

Examples:
examples/distributor/main.c, examples/ip_pipeline/thread.c, examples/load_balancer/init.c, examples/load_balancer/runtime.c, examples/multi_process/client_server_mp/mp_client/client.c, examples/multi_process/simple_mp/main.c, examples/packet_ordering/main.c, examples/performance-thread/common/lthread_tls.c, examples/performance-thread/l3fwd-thread/main.c, examples/qos_sched/init.c, examples/quota_watermark/qw/init.c, examples/quota_watermark/qw/main.c, examples/quota_watermark/qwctl/commands.c, examples/server_node_efd/node/node.c, and examples/tep_termination/main.c.

Definition at line 152 of file rte_ring.h.

Field Documentation

Name of the ring.

Definition at line 158 of file rte_ring.h.

int flags

Flags supplied at creation.

Definition at line 159 of file rte_ring.h.

struct rte_memzone* memzone

Memzone, if any, containing the rte_ring

Definition at line 160 of file rte_ring.h.

void* ring [] __rte_cache_aligned

Memory space of ring starts here. not volatile so need to be careful about compiler re-ordering

Definition at line 190 of file rte_ring.h.


The documentation for this struct was generated from the following file: