X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=VNFs%2FDPPD-PROX%2Fdefaults.c;h=8dd29da9765d4f8a227080e582e0f52ada36bebf;hb=ba394f91bd74cd2f0dac04dfbcece5b3cb461f3e;hp=a6be0d7eb6faaf8a136efc3735a3169fb1dc1010;hpb=05a1a5d34353c5f09c25a01b8dc543b06553915d;p=samplevnf.git diff --git a/VNFs/DPPD-PROX/defaults.c b/VNFs/DPPD-PROX/defaults.c index a6be0d7e..8dd29da9 100644 --- a/VNFs/DPPD-PROX/defaults.c +++ b/VNFs/DPPD-PROX/defaults.c @@ -1,5 +1,5 @@ /* -// Copyright (c) 2010-2017 Intel Corporation +// Copyright (c) 2010-2020 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ #include #include #include +#include #include #include "lconf.h" @@ -27,14 +28,16 @@ #include "etypes.h" #include "toeplitz.h" #include "handle_master.h" +#include "prox_compat.h" +#include "prox_ipv6.h" #define TEN_GIGABIT 1250000000 #define QUEUE_SIZES 128 #define NB_PIPES 32768 #define NB_MBUF 4096 #define RING_RX_SIZE 256 -#define NB_RX_RING_DESC 256 -#define NB_TX_RING_DESC 256 +#define NB_RX_RING_DESC 2048 +#define NB_TX_RING_DESC 2048 /* 1500000 milliseconds */ #define DEFAULT_CPE_TIMEOUT_MS 1500000 @@ -46,16 +49,8 @@ static const struct rte_eth_conf default_port_conf = { .rxmode = { - .split_hdr_size = 0, - .header_split = 0, /* Header Split disabled */ - .hw_ip_checksum = 0, /* IP checksum offload disabled */ - .hw_vlan_filter = 0, /* VLAN filtering disabled */ - .hw_vlan_strip = 0, /* VLAN filtering disabled */ - .jumbo_frame = 0, /* Jumbo frame support disabled */ - .hw_strip_crc = 1, /* CRC stripped by hardware --- always set to 1 in VF */ - .hw_vlan_extend = 0, .mq_mode = 0, - .max_rx_pkt_len = PROX_MTU + ETHER_HDR_LEN + ETHER_CRC_LEN + .max_rx_pkt_len = PROX_MTU + PROX_RTE_ETHER_HDR_LEN + PROX_RTE_ETHER_CRC_LEN }, .rx_adv_conf = { .rss_conf = { @@ -89,9 +84,11 @@ static struct rte_sched_port_params port_params_default = { .frame_overhead = RTE_SCHED_FRAME_OVERHEAD_DEFAULT, .n_subports_per_port = 1, .n_pipes_per_subport = NB_PIPES, +#if RTE_VERSION < RTE_VERSION_NUM(19,11,0,0) .qsize = {QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES}, .pipe_profiles = NULL, .n_pipe_profiles = 1 /* only one profile */ +#endif }; static struct rte_sched_pipe_params pipe_params_default = { @@ -101,7 +98,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 = { @@ -109,10 +110,23 @@ static struct rte_sched_subport_params subport_params_default = { .tb_size = 4000000, .tc_rate = {TEN_GIGABIT, TEN_GIGABIT, TEN_GIGABIT, TEN_GIGABIT}, .tc_period = 40, /* default was 10 */ +#if RTE_VERSION > RTE_VERSION_NUM(19,11,0,0) + .qsize = {QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES, QUEUE_SIZES}, + .pipe_profiles = NULL, + .n_pipe_profiles = 1 /* only one profile */ +#endif }; -void set_global_defaults(__attribute__((unused)) struct prox_cfg *prox_cfg) +void set_global_defaults(struct prox_cfg *prox_cfg) { + if (parse_ip6(&prox_cfg->all_routers_ipv6_mcast_addr, ALL_ROUTERS_IPV6_MCAST_ADDR) != 0) + plog_err("Failed to parse %s\n", ALL_ROUTERS_IPV6_MCAST_ADDR); + if (parse_ip6(&prox_cfg->all_nodes_ipv6_mcast_addr, ALL_NODES_IPV6_MCAST_ADDR) != 0) + plog_err("Failed to parse %s\n", ALL_NODES_IPV6_MCAST_ADDR); + if (parse_ip6(&prox_cfg->random_ip, RANDOM_IPV6) != 0) + plog_err("Failed to parse %s\n", RANDOM_IPV6); + set_mcast_mac_from_ipv6(&prox_cfg->all_routers_mac_addr, &prox_cfg->all_routers_ipv6_mcast_addr); + set_mcast_mac_from_ipv6(&prox_cfg->all_nodes_mac_addr, &prox_cfg->all_nodes_ipv6_mcast_addr); } void set_task_defaults(struct prox_cfg* prox_cfg, struct lcore_cfg* lcore_cfg_init) @@ -140,7 +154,11 @@ void set_task_defaults(struct prox_cfg* prox_cfg, struct lcore_cfg* lcore_cfg_in targ->qos_conf.port_params = port_params_default; targ->qos_conf.pipe_params[0] = pipe_params_default; targ->qos_conf.subport_params[0] = subport_params_default; +#if RTE_VERSION > RTE_VERSION_NUM(19,11,0,0) + targ->qos_conf.subport_params[0].pipe_profiles = targ->qos_conf.pipe_params; +#else targ->qos_conf.port_params.pipe_profiles = targ->qos_conf.pipe_params; +#endif targ->qos_conf.port_params.rate = TEN_GIGABIT; targ->qinq_tag = ETYPE_8021ad; targ->n_concur_conn = 8192*2; @@ -153,19 +171,20 @@ void set_task_defaults(struct prox_cfg* prox_cfg, struct lcore_cfg* lcore_cfg_in targ->mapping[i] = i; // identity } - targ->cbs = ETHER_MAX_LEN; - targ->ebs = ETHER_MAX_LEN; - targ->pbs = ETHER_MAX_LEN; + targ->cbs = PROX_RTE_ETHER_MAX_LEN; + targ->ebs = PROX_RTE_ETHER_MAX_LEN; + targ->pbs = PROX_RTE_ETHER_MAX_LEN; targ->n_max_rules = 1024; targ->ring_size = RING_RX_SIZE; targ->nb_cache_mbuf = MAX_PKT_BURST * 4; - targ->overhead = ETHER_CRC_LEN + 20; + targ->overhead = PROX_RTE_ETHER_CRC_LEN + 20; targ->tunnel_hop_limit = 3; targ->ctrl_freq = 1000; targ->lb_friend_core = 0xFF; - targ->n_pkts = 1024*64; + targ->n_pkts = 0; + targ->runtime_flags |= TASK_TX_CRC; targ->accuracy_limit_nsec = 5000; } @@ -176,6 +195,7 @@ void set_port_defaults(void) { for (uint8_t i = 0; i < PROX_MAX_PORTS; ++i ) { prox_port_cfg[i].promiscuous = 1; + prox_port_cfg[i].nb_mc_addr = 0; prox_port_cfg[i].n_rxd = NB_RX_RING_DESC; prox_port_cfg[i].n_txd = NB_TX_RING_DESC; prox_port_cfg[i].port_conf = default_port_conf; @@ -184,5 +204,13 @@ void set_port_defaults(void) prox_port_cfg[i].rx_ring[0] = '\0'; prox_port_cfg[i].tx_ring[0] = '\0'; prox_port_cfg[i].mtu = PROX_MTU; + prox_port_cfg[i].dpdk_mapping = NO_VDEV_PORT; + + // CRC_STRIP becoming the default behavior in DPDK 18.08, and + // DEV_RX_OFFLOAD_CRC_STRIP define has been deleted +#if defined (DEV_RX_OFFLOAD_CRC_STRIP) + prox_port_cfg[i].requested_rx_offload = DEV_RX_OFFLOAD_CRC_STRIP; +#endif + prox_port_cfg[i].requested_tx_offload = DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM; } }