Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
U
udpdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ywj
udpdk
Commits
438f2309
Commit
438f2309
authored
Sep 28, 2020
by
Leonardo Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
polling core loop
parent
2ea087d4
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
330 additions
and
28 deletions
+330
-28
udpdk/udpdk_constants.h
udpdk/udpdk_constants.h
+11
-0
udpdk/udpdk_init.c
udpdk/udpdk_init.c
+2
-20
udpdk/udpdk_poller.c
udpdk/udpdk_poller.c
+284
-8
udpdk/udpdk_types.h
udpdk/udpdk_types.h
+33
-0
No files found.
udpdk/udpdk_constants.h
View file @
438f2309
...
...
@@ -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
udpdk/udpdk_init.c
View file @
438f2309
...
...
@@ -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
)
{
...
...
udpdk/udpdk_poller.c
View file @
438f2309
This diff is collapsed.
Click to expand it.
udpdk/udpdk_types.h
View file @
438f2309
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment