summaryrefslogtreecommitdiffstats
path: root/VNFs
diff options
context:
space:
mode:
Diffstat (limited to 'VNFs')
-rw-r--r--VNFs/DPPD-PROX/commands.c17
-rw-r--r--VNFs/DPPD-PROX/defaults.c4
-rw-r--r--VNFs/DPPD-PROX/handle_gen.c4
-rw-r--r--VNFs/DPPD-PROX/handle_swap.c2
-rw-r--r--VNFs/DPPD-PROX/prox_args.c4
-rw-r--r--VNFs/DPPD-PROX/prox_compat.h40
-rw-r--r--VNFs/DPPD-PROX/prox_port_cfg.c2
7 files changed, 61 insertions, 12 deletions
diff --git a/VNFs/DPPD-PROX/commands.c b/VNFs/DPPD-PROX/commands.c
index 11b43e53..df5e69cd 100644
--- a/VNFs/DPPD-PROX/commands.c
+++ b/VNFs/DPPD-PROX/commands.c
@@ -258,7 +258,7 @@ static int add_multicast_addr(uint8_t port_id, prox_rte_ether_addr *addr)
return -1;
}
for (i = 0; i < port_cfg->nb_mc_addr; i++) {
- if (is_same_ether_addr(addr, &port_cfg->mc_addr[i])) {
+ if (prox_rte_is_same_ether_addr(addr, &port_cfg->mc_addr[i])) {
plog_info("multicast address already added to port\n");
return -1;
}
@@ -283,7 +283,7 @@ static int del_multicast_addr(uint8_t port_id, prox_rte_ether_addr *addr)
struct prox_port_cfg* port_cfg = &prox_port_cfg[port_id];
for (i = 0; i < port_cfg->nb_mc_addr; i++) {
- if (is_same_ether_addr(addr, &port_cfg->mc_addr[i])) {
+ if (prox_rte_is_same_ether_addr(addr, &port_cfg->mc_addr[i])) {
// Copy last address to the slot to be deleted
prox_rte_ether_addr_copy(&port_cfg->mc_addr[port_cfg->nb_mc_addr-1], &port_cfg->mc_addr[i]);
@@ -347,15 +347,17 @@ static void get_hp_sz_string(char *sz_str, uint64_t hp_sz)
// Unused for now, keep for reference
static int print_all_segments(const struct rte_memseg_list *memseg_list, const struct rte_memseg *memseg, void *arg)
{
- struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
- int memseg_list_idx, memseg_idx;
+ int memseg_list_idx = 0, memseg_idx;
int n = (*(int *)arg)++;
+#if RTE_VERSION < RTE_VERSION_NUM(19,8,0,0)
+ struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
memseg_list_idx = memseg_list - mcfg->memsegs;
if ((memseg_list_idx < 0) || (memseg_list_idx >= RTE_MAX_MEMSEG_LISTS)) {
plog_err("Invalid memseg_list_idx = %d; memseg_list = %p, mcfg->memsegs = %p\n", memseg_list_idx, memseg_list, mcfg->memsegs);
return -1;
}
+#endif
memseg_idx = rte_fbarray_find_idx(&memseg_list->memseg_arr, memseg);
if (memseg_idx < 0) {
plog_err("Invalid memseg_idx = %d; memseg_list = %p, memseg = %p\n", memseg_idx, memseg_list, memseg);
@@ -381,15 +383,17 @@ static int print_all_segments(const struct rte_memseg_list *memseg_list, const s
// Contiguous segments are shown as 1 big segment
static int print_segments(const struct rte_memseg_list *memseg_list, const struct rte_memseg *memseg, size_t len, void *arg)
{
- struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
- int memseg_list_idx, memseg_idx;
+ int memseg_list_idx = 0, memseg_idx;
static int n = 0;
+#if RTE_VERSION < RTE_VERSION_NUM(19,8,0,0)
+ struct rte_mem_config *mcfg = rte_eal_get_configuration()->mem_config;
memseg_list_idx = memseg_list - mcfg->memsegs;
if ((memseg_list_idx < 0) || (memseg_list_idx >= RTE_MAX_MEMSEG_LISTS)) {
plog_err("Invalid memseg_list_idx = %d; memseg_list = %p, mcfg->memsegs = %p\n", memseg_list_idx, memseg_list, mcfg->memsegs);
return -1;
}
+#endif
memseg_idx = rte_fbarray_find_idx(&memseg_list->memseg_arr, memseg);
if (memseg_idx < 0) {
plog_err("Invalid memseg_idx = %d; memseg_list = %p, memseg = %p\n", memseg_idx, memseg_list, memseg);
@@ -412,6 +416,7 @@ static int print_segments(const struct rte_memseg_list *memseg_list, const struc
}
#endif
+
void cmd_mem_layout(void)
{
#if RTE_VERSION < RTE_VERSION_NUM(18,5,0,0)
diff --git a/VNFs/DPPD-PROX/defaults.c b/VNFs/DPPD-PROX/defaults.c
index 915ee31c..27240484 100644
--- a/VNFs/DPPD-PROX/defaults.c
+++ b/VNFs/DPPD-PROX/defaults.c
@@ -94,7 +94,11 @@ static struct rte_sched_pipe_params pipe_params_default = {
.tc_rate = {TEN_GIGABIT / NB_PIPES, TEN_GIGABIT / NB_PIPES, TEN_GIGABIT / NB_PIPES, TEN_GIGABIT / NB_PIPES},
.tc_period = 40,
+#if RTE_VERSION >= RTE_VERSION_NUM(19,8,0,0)
+ .wrr_weights = {1, 1, 1, 1},
+#else
.wrr_weights = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
+#endif
};
static struct rte_sched_subport_params subport_params_default = {
diff --git a/VNFs/DPPD-PROX/handle_gen.c b/VNFs/DPPD-PROX/handle_gen.c
index 7c67b3ce..3bcb231f 100644
--- a/VNFs/DPPD-PROX/handle_gen.c
+++ b/VNFs/DPPD-PROX/handle_gen.c
@@ -1081,7 +1081,7 @@ void task_gen_reset_values(struct task_base *tbase)
task_gen_reset_pkt_templates_content(task);
if (task->flags & TASK_OVERWRITE_SRC_MAC_WITH_PORT_MAC) {
for (uint32_t i = 0; i < task->n_pkts; ++i) {
- rte_memcpy(&task->pkt_template[i].buf[sizeof(struct ether_addr)], &task->src_mac, sizeof(prox_rte_ether_addr));
+ rte_memcpy(&task->pkt_template[i].buf[sizeof(prox_rte_ether_addr)], &task->src_mac, sizeof(prox_rte_ether_addr));
}
}
}
@@ -1317,7 +1317,7 @@ static void init_task_gen(struct task_base *tbase, struct task_args *targ)
task->flags |= TASK_OVERWRITE_SRC_MAC_WITH_PORT_MAC;
memcpy(&task->src_mac, &prox_port_cfg[task->base.tx_params_hw.tx_port_queue->port].eth_addr, sizeof(prox_rte_ether_addr));
for (uint32_t i = 0; i < task->n_pkts; ++i) {
- rte_memcpy(&task->pkt_template[i].buf[sizeof(struct ether_addr)], &task->src_mac, sizeof(prox_rte_ether_addr));
+ rte_memcpy(&task->pkt_template[i].buf[sizeof(prox_rte_ether_addr)], &task->src_mac, sizeof(prox_rte_ether_addr));
}
}
for (uint32_t i = 0; i < targ->n_rand_str; ++i) {
diff --git a/VNFs/DPPD-PROX/handle_swap.c b/VNFs/DPPD-PROX/handle_swap.c
index 5286a4f9..457c2fac 100644
--- a/VNFs/DPPD-PROX/handle_swap.c
+++ b/VNFs/DPPD-PROX/handle_swap.c
@@ -226,7 +226,7 @@ static int handle_swap_bulk(struct task_base *tbase, struct rte_mbuf **mbufs, ui
break;
case IPPROTO_UDP:
case IPPROTO_TCP:
- if (task->igmp_address && IS_IPV4_MCAST(rte_be_to_cpu_32(ip))) {
+ if (task->igmp_address && PROX_RTE_IS_IPV4_MCAST(rte_be_to_cpu_32(ip))) {
out[j] = OUT_DISCARD;
continue;
}
diff --git a/VNFs/DPPD-PROX/prox_args.c b/VNFs/DPPD-PROX/prox_args.c
index f7706755..d31fac29 100644
--- a/VNFs/DPPD-PROX/prox_args.c
+++ b/VNFs/DPPD-PROX/prox_args.c
@@ -1554,6 +1554,10 @@ static int get_core_cfg(unsigned sindex, char *str, void *data)
if (err) {
return -1;
}
+ if (queue_id >= RTE_SCHED_BE_QUEUES_PER_PIPE) {
+ set_errf("queue_id must be < %d", RTE_SCHED_BE_QUEUES_PER_PIPE);
+ return -1;
+ }
targ->qos_conf.pipe_params[0].wrr_weights[queue_id] = val;
return 0;
}
diff --git a/VNFs/DPPD-PROX/prox_compat.h b/VNFs/DPPD-PROX/prox_compat.h
index 7c1c2e11..9c18e36f 100644
--- a/VNFs/DPPD-PROX/prox_compat.h
+++ b/VNFs/DPPD-PROX/prox_compat.h
@@ -173,7 +173,38 @@ typedef struct vlan_hdr prox_rte_vlan_hdr;
typedef struct udp_hdr prox_rte_udp_hdr;
typedef struct tcp_hdr prox_rte_tcp_hdr;
+#ifndef RTE_SCHED_BE_QUEUES_PER_PIPE
+#define RTE_SCHED_BE_QUEUES_PER_PIPE RTE_SCHED_QUEUES_PER_PIPE
+#endif
+
+#define PROX_RTE_IS_IPV4_MCAST IS_IPV4_MCAST
+#define prox_rte_is_same_ether_addr is_same_ether_addr
#else
+
+#define PROX_RTE_ETHER_CRC_LEN RTE_ETHER_CRC_LEN
+#define PROX_RTE_ETHER_MIN_LEN RTE_ETHER_MIN_LEN
+#define PROX_RTE_ETHER_MAX_LEN RTE_ETHER_MAX_LEN
+#define PROX_RTE_ETHER_HDR_LEN RTE_ETHER_HDR_LEN
+#define PROX_RTE_TCP_SYN_FLAG RTE_TCP_SYN_FLAG
+#define PROX_RTE_TCP_FIN_FLAG RTE_TCP_FIN_FLAG
+#define PROX_RTE_TCP_RST_FLAG RTE_TCP_RST_FLAG
+#define PROX_RTE_TCP_ACK_FLAG RTE_TCP_ACK_FLAG
+
+#define prox_rte_ether_addr_copy rte_ether_addr_copy
+#define prox_rte_eth_random_addr rte_eth_random_addr
+
+typedef struct rte_ipv6_hdr prox_rte_ipv6_hdr;
+typedef struct rte_ipv4_hdr prox_rte_ipv4_hdr;
+typedef struct rte_ether_addr prox_rte_ether_addr;
+typedef struct rte_ether_hdr prox_rte_ether_hdr;
+typedef struct rte_vlan_hdr prox_rte_vlan_hdr;
+typedef struct rte_vxlan_gpe_hdr prox_rte_vxlan_gpe_hdr;
+typedef struct rte_udp_hdr prox_rte_udp_hdr;
+typedef struct rte_tcp_hdr prox_rte_tcp_hdr;
+
+#define PROX_RTE_IS_IPV4_MCAST RTE_IS_IPV4_MCAST
+#define prox_rte_is_same_ether_addr rte_is_same_ether_addr
+
#endif
static inline char *prox_strncpy(char * dest, const char * src, size_t count)
@@ -206,14 +237,19 @@ static int prox_rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pa
}
#else
-#define prox_esp_hdr esp_hdr
#define prox_rte_cryptodev_qp_conf rte_cryptodev_qp_conf
-
static int prox_rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id, struct prox_rte_cryptodev_qp_conf *qp_conf, int socket_id)
{
return rte_cryptodev_queue_pair_setup(dev_id, queue_pair_id, (struct rte_cryptodev_qp_conf *)qp_conf, socket_id);
}
+#if RTE_VERSION < RTE_VERSION_NUM(19,8,0,0)
+#define prox_esp_hdr esp_hdr
+
+#else // From DPDK 19.08
+#define prox_esp_hdr rte_esp_hdr
+
+#endif
#endif
#endif // CONFIG_RTE_LIBRTE_PMD_AESNI_MB
diff --git a/VNFs/DPPD-PROX/prox_port_cfg.c b/VNFs/DPPD-PROX/prox_port_cfg.c
index 73afe571..9af141f2 100644
--- a/VNFs/DPPD-PROX/prox_port_cfg.c
+++ b/VNFs/DPPD-PROX/prox_port_cfg.c
@@ -181,7 +181,7 @@ void init_rte_dev(int use_dummy_devices)
char port_name[32] = "0dummy_dev";
for (uint32_t i = 0; i < nb_ports; ++i) {
#if (RTE_VERSION > RTE_VERSION_NUM(17,5,0,1))
- rte_vdev_init(port_name, "size=PROX_RTE_ETHER_MIN_LEN,copy=0");
+ rte_vdev_init(port_name, "size=64,copy=0");
#else
eth_dev_null_create(port_name, 0, PROX_RTE_ETHER_MIN_LEN, 0);
#endif