Commit 438f2309 authored by Leonardo Lai's avatar Leonardo Lai

polling core loop

parent 2ea087d4
......@@ -14,13 +14,24 @@
#define EXCH_RING_SIZE 128
#define EXCH_RX_RING_NAME "UDPDK_exchange_ring_%u_RX"
#define EXCH_TX_RING_NAME "UDPDK_exchange_ring_%u_TX"
#define EXCH_BUF_SIZE 32
/* DPDK ports */
#define PORT_RX 0
#define PORT_TX 0
#define QUEUE_RX 0
#define NUM_RX_DESC_DEFAULT 1024
#define NUM_TX_DESC_DEFAULT 1024
#define PKTMBUF_POOL_NAME "UDPDK_mbuf_pool"
#define MBUF_CACHE_SIZE 512
/* Packet poller */
#define PKT_READ_SIZE 32
#define PREFETCH_OFFSET 4
#define NUM_FLOWS_DEF 0x1000
#define NUM_FLOWS_MIN 1
#define NUM_FLOWS_MAX UINT16_MAX
#define MAX_FLOW_TTL MS_PER_S
#define IP_FRAG_TBL_BUCKET_ENTRIES 16
#endif //UDPDK_CONSTANTS_H
......@@ -22,26 +22,11 @@
#include "udpdk_api.h"
#include "udpdk_constants.h"
#include "udpdk_poller.h"
#include "udpdk_types.h"
#define RTE_LOGTYPE_INIT RTE_LOGTYPE_USER1
struct exch_slot_info {
int active;
int sockfd;
} __rte_cache_aligned;
struct exch_zone_info {
uint64_t n_zones_active;
struct exch_slot_info slots[NUM_SOCKETS_MAX];
};
struct exch_zone_info *exch_zone_desc = NULL;
struct exch_slot {
struct rte_ring *rx_q;
struct rte_ring *tx_q;
unsigned id;
};
static struct exch_zone_info *exch_zone_desc = NULL;
struct exch_slot *exch_slots = NULL;
......@@ -49,9 +34,6 @@ static struct rte_mempool *pktmbuf_pool;
static pid_t poller_pid;
// TODO move to a utility file
enum exch_ring_func {EXCH_RING_RX, EXCH_RING_TX};
/* Get the name of the rings of exchange slots */
static inline const char * get_exch_ring_name(unsigned id, enum exch_ring_func func)
{
......
This diff is collapsed.
......@@ -6,6 +6,39 @@
#ifndef UDPDK_TYPES_H
#define UDPDK_TYPES_H
#include <rte_common.h>
#include <rte_eal.h>
#include <rte_ethdev.h>
#include <rte_launch.h>
#include <rte_lcore.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_memory.h>
#include <rte_memzone.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include "udpdk_constants.h"
enum exch_ring_func {EXCH_RING_RX, EXCH_RING_TX};
struct exch_slot_info {
int active;
int sockfd;
} __rte_cache_aligned;
struct exch_zone_info {
uint64_t n_zones_active;
struct exch_slot_info slots[NUM_SOCKETS_MAX];
};
struct exch_slot {
struct rte_ring *rx_q; // RX queue
struct rte_ring *tx_q; // TX queue
struct rte_mbuf *rx_buffer[EXCH_BUF_SIZE]; // buffers storing rx packets before flushing to rt_ring
uint16_t rx_count; // current number of packets in the rx buffer
};
#endif //UDPDK_TYPES_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment