Support reading inline jumbo frame and dump them 51/56551/1
authorXavier Simonart <xavier.simonart@intel.com>
Sun, 15 Apr 2018 13:14:01 +0000 (15:14 +0200)
committerXavier Simonart <xavier.simonart@intel.com>
Wed, 25 Apr 2018 23:22:09 +0000 (01:22 +0200)
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 <xavier.simonart@intel.com>
VNFs/DPPD-PROX/cfgfile.h
VNFs/DPPD-PROX/defaults.h
VNFs/DPPD-PROX/parse_utils.h
VNFs/DPPD-PROX/prox_args.c
VNFs/DPPD-PROX/task_base.h
VNFs/DPPD-PROX/task_init.h

index 41b474e..c0de4f1 100644 (file)
@@ -18,6 +18,7 @@
 #define _CFG_FILE_H_
 
 #include <stdio.h>
+#include "defaults.h"
 
 #define DEFAULT_CONFIG_FILE    "./prox.cfg"
 
@@ -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 {
index 573cc9c..4cf3cf7 100644 (file)
@@ -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
index 27ebb0b..6e4bc77 100644 (file)
@@ -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;
index 53223ca..aa7ff51 100644 (file)
@@ -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;
index 00087ab..95c50ba 100644 (file)
@@ -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 {
@@ -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];
@@ -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
index c5a1779..a8ac14c 100644 (file)
@@ -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;