Skip to content

Commit

Permalink
Support reading inline jumbo frame and dump them
Browse files Browse the repository at this point in the history
Add support for pkt_inline of jumbo frames.
Dump the whole packet, and not a truncated packet. This might
have a small impact on performance as the memory footprint
is increased (by ~640K * number of tasks), resulting in potential
higher DTLB misses.

Change-Id: I4ed02be7ca899db4f8f97355c180a92d69d39d8f
Signed-off-by: Xavier Simonart <[email protected]>
  • Loading branch information
xsimonar authored and sdeepak2 committed Apr 26, 2018
1 parent 3ea3ffe commit 4176bb2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion VNFs/DPPD-PROX/cfgfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define _CFG_FILE_H_

#include <stdio.h>
#include "defaults.h"

#define DEFAULT_CONFIG_FILE "./prox.cfg"

Expand All @@ -38,7 +39,7 @@ struct cfg_section {
int error;
};

#define MAX_CFG_STRING_LEN 8192
#define MAX_CFG_STRING_LEN (3 * MAX_PKT_SIZE)
#define STRING_TERMINATOR_LEN 4

struct cfg_file {
Expand Down
3 changes: 2 additions & 1 deletion VNFs/DPPD-PROX/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ void set_global_defaults(struct prox_cfg* prox_cfg);
void set_task_defaults(struct prox_cfg* prox_cfg, struct lcore_cfg* lcore_cfg_init);
void set_port_defaults(void);

#define MAX_PKT_SIZE 10000
#define MAX_PKT_BURST 64
#define MAX_RING_BURST 64
#define DUMP_PKT_LEN 128
#define DUMP_PKT_LEN MAX_PKT_SIZE

#if MAX_RING_BURST < MAX_PKT_BURST
#error MAX_RING_BURST < MAX_PKT_BURST
Expand Down
2 changes: 1 addition & 1 deletion VNFs/DPPD-PROX/parse_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <inttypes.h>
#include "ip_subnet.h"

#define MAX_STR_LEN_PROC (3 * 1518 + 20)
#define MAX_STR_LEN_PROC (3 * MAX_PKT_SIZE + 20)

struct ipv6_addr;
struct ether_addr;
Expand Down
3 changes: 2 additions & 1 deletion VNFs/DPPD-PROX/prox_args.c
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,8 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
return -1;
}
if (targ->pkt_size == sizeof(targ->pkt_inline)) {
set_errf("Inline packet definition can't be longer than 1518");
set_errf("Inline packet definition can't be longer than %u", sizeof(targ->pkt_inline));
return -1;
}

targ->pkt_inline[targ->pkt_size++] = byte;
Expand Down
6 changes: 3 additions & 3 deletions VNFs/DPPD-PROX/task_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ typedef uint16_t (*rx_pkt_func) (struct task_base *tbase, struct rte_mbuf ***mbu
struct task_base_aux {
/* Not used when PROX_STATS is not defined */
struct task_rt_stats stats;
struct task_rt_dump task_rt_dump;

/* Used if TASK_TSC_RX is enabled*/
struct {
Expand All @@ -163,8 +162,8 @@ struct task_base_aux {

struct rte_mbuf **all_mbufs;

int rx_prev_count;
int rx_prev_idx;
uint16_t rx_prev_count;
uint16_t rx_prev_idx;
uint16_t (*rx_pkt_prev[MAX_STACKED_RX_FUCTIONS])(struct task_base *tbase, struct rte_mbuf ***mbufs);

uint32_t rx_bucket[RX_BUCKET_SIZE];
Expand All @@ -177,6 +176,7 @@ struct task_base_aux {
void (*start)(struct task_base *tbase);
void (*stop_last)(struct task_base *tbase);
void (*start_first)(struct task_base *tbase);
struct task_rt_dump task_rt_dump;
};

/* The task_base is accessed for _all_ task types. In case
Expand Down
2 changes: 1 addition & 1 deletion VNFs/DPPD-PROX/task_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ struct task_args {
uint32_t bucket_size;
uint32_t lat_enabled;
uint32_t pkt_size;
uint8_t pkt_inline[ETHER_MAX_LEN];
uint8_t pkt_inline[MAX_PKT_SIZE];
uint32_t probability;
char nat_table[256];
uint32_t use_src;
Expand Down

0 comments on commit 4176bb2

Please sign in to comment.