From 7d8d95fbce7b101c51bae6f468b7942dcdaf1032 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 8 Nov 2016 13:10:15 +0200 Subject: mlx5 support build WIP Signed-off-by: Hanoh Haim --- linux_dpdk/ws_main.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 0a6ff7c1..fb743003 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -315,6 +315,21 @@ dpdk_src = SrcGroup(dir='src/dpdk/', 'drivers/net/ixgbe/ixgbe_pf.c', 'drivers/net/ixgbe/ixgbe_rxtx.c', 'drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c', + + 'drivers/net/mlx5/mlx5_mr.c', + 'drivers/net/mlx5/mlx5_ethdev.c', + 'drivers/net/mlx5/mlx5_mac.c', + 'drivers/net/mlx5/mlx5_rxmode.c', + 'drivers/net/mlx5/mlx5_rxtx.c', + 'drivers/net/mlx5/mlx5_stats.c', + 'drivers/net/mlx5/mlx5_txq.c', + 'drivers/net/mlx5/mlx5.c', + 'drivers/net/mlx5/mlx5_fdir.c', + 'drivers/net/mlx5/mlx5_rss.c', + 'drivers/net/mlx5/mlx5_rxq.c', + 'drivers/net/mlx5/mlx5_trigger.c', + 'drivers/net/mlx5/mlx5_vlan.c', + 'drivers/net/i40e/base/i40e_adminq.c', 'drivers/net/i40e/base/i40e_common.c', 'drivers/net/i40e/base/i40e_dcb.c', @@ -518,6 +533,8 @@ includes_path =''' ../src/pal/linux_dpdk/ dpdk_includes_path =''' ../src/ ../src/pal/linux_dpdk/ ../src/pal/linux_dpdk/dpdk + ../external_libs/ibverbs/include/ + ../src/dpdk/drivers/ ../src/dpdk/drivers/net/ ../src/dpdk/drivers/net/af_packet/ @@ -722,6 +739,9 @@ def build_prog (bld, build_obj): zmq_lib_path='external_libs/zmq/' bld.read_shlib( name='zmq' , paths=[top+zmq_lib_path] ) + ibverbs_lib_path='external_libs/ibverbs/' + bld.read_shlib( name='ibverbs' , paths=[top+ibverbs_lib_path] ) + #rte_libs =[ # 'dpdk']; @@ -751,7 +771,7 @@ def build_prog (bld, build_obj): cxxflags =(build_obj.get_cxx_flags()+['-std=gnu++11',]), linkflags = build_obj.get_link_flags() , lib=['pthread','dl', 'z'], - use =[build_obj.get_dpdk_target(),'zmq'], + use =[build_obj.get_dpdk_target(),'zmq','ibverbs'], source = bp.file_list(top) + debug_file_list, target = build_obj.get_target()) @@ -880,6 +900,7 @@ def copy_single_system1 (bld, exec_p, build_obj): files_list=[ 'libzmq.so.3', + 'libibverbs.so.1', 'trex-cfg', 'bp-sim-64', 'bp-sim-64-debug', -- cgit 1.2.3-korg From 8e9aa6d85f8990dd521b1a65ca0315c0d66f09b9 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 8 Nov 2016 17:04:08 +0200 Subject: mlx5 WIP Stateful work -- all traffic goes to RX_QUEUE=0 Signed-off-by: Hanoh Haim --- linux_dpdk/ws_main.py | 4 +- scripts/trex-cfg | 4 +- src/main_dpdk.cpp | 303 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 306 insertions(+), 5 deletions(-) (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index fb743003..63377495 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -752,9 +752,9 @@ def build_prog (bld, build_obj): # add electric fence only for debug image debug_file_list=''; - if not build_obj.isRelease (): + #if not build_obj.isRelease (): #debug - debug_file_list +=ef_src.file_list(top) + # debug_file_list +=ef_src.file_list(top) bld.objects( diff --git a/scripts/trex-cfg b/scripts/trex-cfg index 19b12129..714aea6c 100755 --- a/scripts/trex-cfg +++ b/scripts/trex-cfg @@ -39,9 +39,7 @@ done PATH=$PATH:/sbin:/usr/sbin -#! lsmod | grep -q igb_uio ; -# TBD need to fix this for Mellanox , need to check if all NICS are mellanox and not to do this -if false ; then +if ! lsmod | grep -q igb_uio ; then echo "Loading kernel drivers for the first time" modprobe uio if [ $? -ne 0 ]; then diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 348c4eee..be4ec2ea 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -402,6 +402,77 @@ public: }; +class CTRexExtendedDriverBaseMlnx5G : public CTRexExtendedDriverBase10G { +public: + + CTRexExtendedDriverBaseMlnx5G(){ + // Since we support only 128 counters per if, it is OK to configure here 4 statically. + // If we want to support more counters in case of card having less interfaces, we + // Will have to identify the number of interfaces dynamically. + m_if_per_card = 2; + } + + TRexPortAttr * create_port_attr(uint8_t port_id) { + // disabling flow control on 40G using DPDK API causes the interface to malfunction + return new DpdkTRexPortAttr(port_id, false, false); + } + + + static CTRexExtendedDriverBase * create(){ + return ( new CTRexExtendedDriverBaseMlnx5G() ); + } + + virtual void update_global_config_fdir(port_cfg_t * cfg){ + } + + virtual void update_configuration(port_cfg_t * cfg); + + virtual int configure_rx_filter_rules(CPhyEthIF * _if); + virtual int add_del_rx_flow_stat_rule(uint8_t port_id, enum rte_filter_op op, uint16_t l3_proto + , uint8_t l4_proto, uint8_t ipv6_next_h, uint16_t id); + + virtual bool is_hardware_filter_is_supported(){ + return (true); + } + + virtual bool is_hardware_support_drop_queue(){ + return(true); + } + virtual void get_extended_stats(CPhyEthIF * _if,CPhyEthIFStats *stats); + virtual void clear_extended_stats(CPhyEthIF * _if); + virtual void reset_rx_stats(CPhyEthIF * _if, uint32_t *stats, int min, int len); + virtual int get_rx_stats(CPhyEthIF * _if, uint32_t *pkts, uint32_t *prev_pkts, uint32_t *bytes, uint32_t *prev_bytes, int min, int max); + virtual int dump_fdir_global_stats(CPhyEthIF * _if, FILE *fd); + virtual int get_stat_counters_num() {return MAX_FLOW_STATS;} + virtual int get_rx_stat_capabilities() { + return TrexPlatformApi::IF_STAT_IPV4_ID | TrexPlatformApi::IF_STAT_PAYLOAD; + } + virtual int wait_for_stable_link(); + // disabling flow control on 40G using DPDK API causes the interface to malfunction + virtual bool flow_control_disable_supported(){return false;} + virtual bool hw_rx_stat_supported(){return true;} + virtual CFlowStatParser *get_flow_stat_parser(); + virtual int set_rcv_all(CPhyEthIF * _if, bool set_on){ + /* TBD need to support that */ + return (-1); + } + + +private: + virtual void add_del_rules(enum rte_filter_op op, uint8_t port_id, + uint16_t type, uint8_t ttl, + uint16_t ip_id, + uint16_t l4_proto, + int queue, + uint16_t stat_idx); + virtual int configure_rx_filter_rules_statfull(CPhyEthIF * _if); + +private: + uint8_t m_if_per_card; +}; + + + typedef CTRexExtendedDriverBase * (*create_object_t) (void); @@ -453,6 +524,8 @@ private: register_driver(std::string("rte_igb_pmd"),CTRexExtendedDriverBase1G::create); register_driver(std::string("rte_i40e_pmd"),CTRexExtendedDriverBase40G::create); register_driver(std::string("rte_enic_pmd"),CTRexExtendedDriverBaseVIC::create); + register_driver(std::string("librte_pmd_mlx5"),CTRexExtendedDriverBaseMlnx5G::create); + /* virtual devices */ register_driver(std::string("rte_em_pmd"),CTRexExtendedDriverBase1GVm::create); @@ -6305,6 +6378,236 @@ int CTRexExtendedDriverBase40G::set_rcv_all(CPhyEthIF * _if, bool set_on) { } ///////////////////////////////////////////////////////////////////// +/* MLX5 */ + +void CTRexExtendedDriverBaseMlnx5G::clear_extended_stats(CPhyEthIF * _if){ + rte_eth_stats_reset(_if->get_port_id()); +} + +void CTRexExtendedDriverBaseMlnx5G::update_configuration(port_cfg_t * cfg){ + cfg->m_tx_conf.tx_thresh.pthresh = TX_PTHRESH; + cfg->m_tx_conf.tx_thresh.hthresh = TX_HTHRESH; + cfg->m_tx_conf.tx_thresh.wthresh = TX_WTHRESH; + cfg->update_global_config_fdir_40g(); +} + +void CTRexExtendedDriverBaseMlnx5G::add_del_rules(enum rte_filter_op op, uint8_t port_id, uint16_t type, uint8_t ttl, uint16_t ip_id, + uint16_t l4_proto, int queue, uint16_t stat_idx) { + /* Mellanox card does not have TTL support, + so we will replace it in low level with TOS */ + + int ret=rte_eth_dev_filter_supported(port_id, RTE_ETH_FILTER_FDIR); + static int filter_soft_id = 0; + + if ( ret != 0 ){ + rte_exit(EXIT_FAILURE, "rte_eth_dev_filter_supported " + "err=%d, port=%u \n", + ret, port_id); + } + + struct rte_eth_fdir_filter filter; + + memset(&filter,0,sizeof(struct rte_eth_fdir_filter)); + +#if 0 + printf("40g::%s rules: port:%d type:%d ttl:%d ip_id:%x l4:%d q:%d hw index:%d\n" + , (op == RTE_ETH_FILTER_ADD) ? "add" : "del" + , port_id, type, ttl, ip_id, l4_proto, queue, stat_idx); +#endif + + filter.action.rx_queue = queue; + filter.action.behavior =RTE_ETH_FDIR_ACCEPT; + filter.action.report_status =RTE_ETH_FDIR_NO_REPORT_STATUS; + filter.action.stat_count_index = stat_idx; + filter.soft_id = filter_soft_id++; + filter.input.flow_type = type; + + if (op == RTE_ETH_FILTER_ADD) { + fdir_hw_id_rule_params[stat_idx].rule_type = type; + fdir_hw_id_rule_params[stat_idx].l4_proto = l4_proto; + } + + switch (type) { + case RTE_ETH_FLOW_NONFRAG_IPV4_UDP: + case RTE_ETH_FLOW_NONFRAG_IPV4_TCP: + case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP: + case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: + filter.input.flow.ip4_flow.ttl=ttl; + filter.input.flow.ip4_flow.ip_id = ip_id; + if (l4_proto != 0) + filter.input.flow.ip4_flow.proto = l4_proto; + break; + case RTE_ETH_FLOW_NONFRAG_IPV6_UDP: + case RTE_ETH_FLOW_NONFRAG_IPV6_TCP: + case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER: + filter.input.flow.ipv6_flow.hop_limits=ttl; + filter.input.flow.ipv6_flow.flow_label = ip_id; + filter.input.flow.ipv6_flow.proto = l4_proto; + break; + } + + ret = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, op, (void*)&filter); + if ( ret != 0 ) { + rte_exit(EXIT_FAILURE, "rte_eth_dev_filter_ctrl: err=%d, port=%u\n", + ret, port_id); + } +} + +int CTRexExtendedDriverBaseMlnx5G::add_del_rx_flow_stat_rule(uint8_t port_id, enum rte_filter_op op, uint16_t l3_proto + , uint8_t l4_proto, uint8_t ipv6_next_h, uint16_t id) { + + uint32_t rule_id = (port_id % m_if_per_card) * MAX_FLOW_STATS + id; + uint16_t rte_type = RTE_ETH_FLOW_NONFRAG_IPV4_OTHER; + uint8_t next_proto; + + if (l3_proto == EthernetHeader::Protocol::IP) { + next_proto = l4_proto; + switch(l4_proto) { + case IPPROTO_TCP: + rte_type = RTE_ETH_FLOW_NONFRAG_IPV4_TCP; + break; + case IPPROTO_UDP: + rte_type = RTE_ETH_FLOW_NONFRAG_IPV4_UDP; + break; + default: + rte_type = RTE_ETH_FLOW_NONFRAG_IPV4_OTHER; + break; + } + } else { + // IPv6 + next_proto = ipv6_next_h; + switch(l4_proto) { + case IPPROTO_TCP: + rte_type = RTE_ETH_FLOW_NONFRAG_IPV6_TCP; + break; + case IPPROTO_UDP: + rte_type = RTE_ETH_FLOW_NONFRAG_IPV6_UDP; + break; + default: + rte_type = RTE_ETH_FLOW_NONFRAG_IPV6_OTHER; + break; + } + } + + add_del_rules(op, port_id, rte_type, 0, IP_ID_RESERVE_BASE + id, next_proto, MAIN_DPDK_DATA_Q, rule_id); + return 0; +} + + +int CTRexExtendedDriverBaseMlnx5G::configure_rx_filter_rules_statfull(CPhyEthIF * _if) { + uint32_t port_id = _if->get_port_id(); + /* TTL==TOS */ + + /* Configure rules for latency measurement packets */ + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_UDP, TTL_RESERVE_DUPLICATE, 0, 0, MAIN_DPDK_RX_Q, 0); + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_TCP, TTL_RESERVE_DUPLICATE, 0, 0, MAIN_DPDK_RX_Q, 0); + /* MLX5-IPV6 support */ + +// add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV6_UDP, ttl, tos, 0, MAIN_DPDK_RX_Q, 0); +// add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV6_TCP, ttl, tos, 0, MAIN_DPDK_RX_Q, 0); + + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_OTHER, TTL_RESERVE_DUPLICATE , 0,0, MAIN_DPDK_RX_Q, 0); + //add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_SCTP, TTL_RESERVE_DUPLICATE , 0,0, MAIN_DPDK_RX_Q, 0); + + return 0; +} + +int CTRexExtendedDriverBaseMlnx5G::configure_rx_filter_rules(CPhyEthIF * _if) { + if (get_is_stateless()) { + uint32_t port_id = _if->get_port_id(); + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_TCP, 0, 0, FLOW_STAT_PAYLOAD_IP_ID, MAIN_DPDK_RX_Q, FDIR_PAYLOAD_RULES_HW_ID); + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_UDP, 0, 0, FLOW_STAT_PAYLOAD_IP_ID, MAIN_DPDK_RX_Q, FDIR_PAYLOAD_RULES_HW_ID); + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_OTHER, 0, 0, FLOW_STAT_PAYLOAD_IP_ID, MAIN_DPDK_RX_Q, FDIR_PAYLOAD_RULES_HW_ID); + rte_eth_fdir_stats_reset(_if->get_port_id(), NULL, FDIR_TEMP_HW_ID, 1); + return 0; // Other rules are configured dynamically in stateless + } else { + return configure_rx_filter_rules_statfull(_if); + } +} + +void CTRexExtendedDriverBaseMlnx5G::reset_rx_stats(CPhyEthIF * _if, uint32_t *stats, int min, int len) { + uint32_t port_id = _if->get_port_id(); + uint32_t rule_id = (port_id % m_if_per_card) * MAX_FLOW_STATS + min; + + // Since flow dir counters are not wrapped around as promised in the data sheet, but rather get stuck at 0xffffffff + // we reset the HW value + rte_eth_fdir_stats_reset(port_id, NULL, rule_id, len); + + for (int i =0; i < len; i++) { + stats[i] = 0; + } +} + +int CTRexExtendedDriverBaseMlnx5G::get_rx_stats(CPhyEthIF * _if, uint32_t *pkts, uint32_t *prev_pkts + ,uint32_t *bytes, uint32_t *prev_bytes, int min, int max) { + /* not supported yet */ + return 0; +} + +int CTRexExtendedDriverBaseMlnx5G::dump_fdir_global_stats(CPhyEthIF * _if, FILE *fd) +{ + uint32_t port_id = _if->get_port_id(); + struct rte_eth_fdir_stats stat; + int ret; + + ret = rte_eth_dev_filter_ctrl(port_id, RTE_ETH_FILTER_FDIR, RTE_ETH_FILTER_STATS, (void*)&stat); + if (ret == 0) { + if (fd) + fprintf(fd, "Num filters on guarant poll:%d, best effort poll:%d\n", stat.guarant_cnt, stat.best_cnt); + return (stat.guarant_cnt + stat.best_cnt); + } else { + if (fd) + fprintf(fd, "Failed reading fdir statistics\n"); + return -1; + } +} + +void CTRexExtendedDriverBaseMlnx5G::get_extended_stats(CPhyEthIF * _if,CPhyEthIFStats *stats){ + + struct rte_eth_stats stats1; + struct rte_eth_stats *prev_stats = &stats->m_prev_stats; + rte_eth_stats_get(_if->get_port_id(), &stats1); + + stats->ipackets += stats1.ipackets - prev_stats->ipackets; + stats->ibytes += stats1.ibytes - prev_stats->ibytes; + stats->opackets += stats1.opackets - prev_stats->opackets; + stats->obytes += stats1.obytes - prev_stats->obytes + + (stats1.opackets << 2) - (prev_stats->opackets << 2); + stats->f_ipackets += 0; + stats->f_ibytes += 0; + stats->ierrors += stats1.imissed + stats1.ierrors + stats1.rx_nombuf + - prev_stats->imissed - prev_stats->ierrors - prev_stats->rx_nombuf; + stats->oerrors += stats1.oerrors - prev_stats->oerrors; + stats->imcasts += 0; + stats->rx_nombuf += stats1.rx_nombuf - prev_stats->rx_nombuf; + + prev_stats->ipackets = stats1.ipackets; + prev_stats->ibytes = stats1.ibytes; + prev_stats->opackets = stats1.opackets; + prev_stats->obytes = stats1.obytes; + prev_stats->imissed = stats1.imissed; + prev_stats->oerrors = stats1.oerrors; + prev_stats->ierrors = stats1.ierrors; + prev_stats->rx_nombuf = stats1.rx_nombuf; +} + +int CTRexExtendedDriverBaseMlnx5G::wait_for_stable_link(){ + delay(20); + return (0); +} + +CFlowStatParser *CTRexExtendedDriverBaseMlnx5G::get_flow_stat_parser() { + CFlowStatParser *parser = new CFlowStatParser(); + assert (parser); + return parser; +} + + + + +///////////////////////////////////////////////////////////////////// + + void CTRexExtendedDriverBase1GVm::update_configuration(port_cfg_t * cfg){ -- cgit 1.2.3-korg From 54305984a9be01d55bc6a4c99d948dec01eda51a Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 10 Nov 2016 14:24:56 +0200 Subject: No debug for DPDK in case of release Signed-off-by: Hanoh Haim --- linux_dpdk/ws_main.py | 2 ++ src/dpdk/drivers/net/mlx5/mlx5_fdir.c | 37 +++++++++++++++++++++++++++++------ src/dpdk/drivers/net/mlx5/mlx5_rxq.c | 4 ++-- src/dpdk/drivers/net/mlx5/mlx5_rxtx.h | 4 ++-- src/main_dpdk.cpp | 15 ++++++++++++-- src/stateful_rx_core.cpp | 4 ++-- 6 files changed, 52 insertions(+), 14 deletions(-) (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 63377495..8d9a236c 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -710,6 +710,8 @@ class build_option: def get_c_flags (self): flags = self.get_common_flags() + if self.isRelease () : + flags += ['-DNDEBUG']; # for C no special flags yet return (flags) diff --git a/src/dpdk/drivers/net/mlx5/mlx5_fdir.c b/src/dpdk/drivers/net/mlx5/mlx5_fdir.c index 73eb00ec..e4f0bf06 100644 --- a/src/dpdk/drivers/net/mlx5/mlx5_fdir.c +++ b/src/dpdk/drivers/net/mlx5/mlx5_fdir.c @@ -42,7 +42,7 @@ #ifdef PEDANTIC #pragma GCC diagnostic ignored "-pedantic" #endif -#include +#include #ifdef PEDANTIC #pragma GCC diagnostic error "-pedantic" #endif @@ -67,6 +67,10 @@ struct fdir_flow_desc { uint16_t src_port; uint32_t src_ip[4]; uint32_t dst_ip[4]; + uint8_t tos; + uint8_t ip_id; + uint16_t proto; + uint8_t mac[6]; uint16_t vlan_tag; enum hash_rxq_type type; @@ -141,9 +145,13 @@ fdir_filter_to_flow_desc(const struct rte_eth_fdir_filter *fdir_filter, case RTE_ETH_FLOW_NONFRAG_IPV4_TCP: desc->src_port = fdir_filter->input.flow.udp4_flow.src_port; desc->dst_port = fdir_filter->input.flow.udp4_flow.dst_port; + case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER: desc->src_ip[0] = fdir_filter->input.flow.ip4_flow.src_ip; desc->dst_ip[0] = fdir_filter->input.flow.ip4_flow.dst_ip; + desc->tos = fdir_filter->input.flow.ip4_flow.ttl; /* TTL is map to TOS*/ + desc->ip_id = fdir_filter->input.flow.ip4_flow.ip_id; + desc->proto = fdir_filter->input.flow.ip4_flow.proto; break; case RTE_ETH_FLOW_NONFRAG_IPV6_UDP: case RTE_ETH_FLOW_NONFRAG_IPV6_TCP: @@ -157,6 +165,10 @@ fdir_filter_to_flow_desc(const struct rte_eth_fdir_filter *fdir_filter, rte_memcpy(desc->dst_ip, fdir_filter->input.flow.ipv6_flow.dst_ip, sizeof(desc->dst_ip)); + desc->tos = fdir_filter->input.flow.ipv6_flow.tc; + desc->ip_id = (uint8_t)fdir_filter->input.flow.ipv6_flow.flow_label; + desc->proto = fdir_filter->input.flow.ipv6_flow.proto; + break; default: break; @@ -251,8 +263,8 @@ priv_fdir_flow_add(struct priv *priv, struct ibv_exp_flow_attr *attr = &data->attr; uintptr_t spec_offset = (uintptr_t)&data->spec; struct ibv_exp_flow_spec_eth *spec_eth; - struct ibv_exp_flow_spec_ipv4 *spec_ipv4; - struct ibv_exp_flow_spec_ipv6 *spec_ipv6; + struct ibv_exp_flow_spec_ipv4_ext *spec_ipv4; + struct ibv_exp_flow_spec_ipv6_ext *spec_ipv6; struct ibv_exp_flow_spec_tcp_udp *spec_tcp_udp; struct mlx5_fdir_filter *iter_fdir_filter; unsigned int i; @@ -305,10 +317,10 @@ priv_fdir_flow_add(struct priv *priv, spec_offset += spec_eth->size; /* Set IP spec */ - spec_ipv4 = (struct ibv_exp_flow_spec_ipv4 *)spec_offset; + spec_ipv4 = (struct ibv_exp_flow_spec_ipv4_ext *)spec_offset; /* The second specification must be IP. */ - assert(spec_ipv4->type == IBV_EXP_FLOW_SPEC_IPV4); + assert(spec_ipv4->type == IBV_EXP_FLOW_SPEC_IPV4_EXT); assert(spec_ipv4->size == sizeof(*spec_ipv4)); spec_ipv4->val.src_ip = @@ -318,6 +330,19 @@ priv_fdir_flow_add(struct priv *priv, spec_ipv4->mask.src_ip = mask->ipv4_mask.src_ip; spec_ipv4->mask.dst_ip = mask->ipv4_mask.dst_ip; + /* PROTO */ + spec_ipv4->val.proto = desc->proto & mask->ipv4_mask.proto; + spec_ipv4->mask.proto = mask->ipv4_mask.proto; + + /* TOS */ + if (desc->ip_id ==1 ){ + spec_ipv4->mask.tos = 0x1; + }else{ + spec_ipv4->mask.tos = 0x0; + } + spec_ipv4->val.tos = + desc->tos & spec_ipv4->mask.tos;// & mask->ipv4_mask.tos; + /* Update priority */ attr->priority = 1; @@ -332,7 +357,7 @@ priv_fdir_flow_add(struct priv *priv, spec_offset += spec_eth->size; /* Set IP spec */ - spec_ipv6 = (struct ibv_exp_flow_spec_ipv6 *)spec_offset; + spec_ipv6 = (struct ibv_exp_flow_spec_ipv6_ext *)spec_offset; /* The second specification must be IP. */ assert(spec_ipv6->type == IBV_EXP_FLOW_SPEC_IPV6); diff --git a/src/dpdk/drivers/net/mlx5/mlx5_rxq.c b/src/dpdk/drivers/net/mlx5/mlx5_rxq.c index 29c137cd..6be01d39 100644 --- a/src/dpdk/drivers/net/mlx5/mlx5_rxq.c +++ b/src/dpdk/drivers/net/mlx5/mlx5_rxq.c @@ -102,7 +102,7 @@ const struct hash_rxq_init hash_rxq_init[] = { ETH_RSS_FRAG_IPV4), .flow_priority = 1, .flow_spec.ipv4 = { - .type = IBV_EXP_FLOW_SPEC_IPV4, + .type = IBV_EXP_FLOW_SPEC_IPV4_EXT, .size = sizeof(hash_rxq_init[0].flow_spec.ipv4), }, .underlayer = &hash_rxq_init[HASH_RXQ_ETH], @@ -140,7 +140,7 @@ const struct hash_rxq_init hash_rxq_init[] = { ETH_RSS_FRAG_IPV6), .flow_priority = 1, .flow_spec.ipv6 = { - .type = IBV_EXP_FLOW_SPEC_IPV6, + .type = IBV_EXP_FLOW_SPEC_IPV6_EXT, .size = sizeof(hash_rxq_init[0].flow_spec.ipv6), }, .underlayer = &hash_rxq_init[HASH_RXQ_ETH], diff --git a/src/dpdk/drivers/net/mlx5/mlx5_rxtx.h b/src/dpdk/drivers/net/mlx5/mlx5_rxtx.h index f6e2cbac..d87dd19b 100644 --- a/src/dpdk/drivers/net/mlx5/mlx5_rxtx.h +++ b/src/dpdk/drivers/net/mlx5/mlx5_rxtx.h @@ -173,8 +173,8 @@ struct hash_rxq_init { uint16_t size; } hdr; struct ibv_exp_flow_spec_tcp_udp tcp_udp; - struct ibv_exp_flow_spec_ipv4 ipv4; - struct ibv_exp_flow_spec_ipv6 ipv6; + struct ibv_exp_flow_spec_ipv4_ext ipv4; + struct ibv_exp_flow_spec_ipv6_ext ipv6; struct ibv_exp_flow_spec_eth eth; } flow_spec; /* Flow specification template. */ const struct hash_rxq_init *underlayer; /* Pointer to underlayer. */ diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 511f7fc3..de7221b5 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -6389,9 +6389,14 @@ void CTRexExtendedDriverBaseMlnx5G::update_configuration(port_cfg_t * cfg){ cfg->m_tx_conf.tx_thresh.hthresh = TX_HTHRESH; cfg->m_tx_conf.tx_thresh.wthresh = TX_WTHRESH; cfg->update_global_config_fdir_40g(); + /* update mask */ + cfg->m_port_conf.fdir_conf.mask.ipv4_mask.proto=0xff; + cfg->m_port_conf.fdir_conf.mask.ipv4_mask.tos=0x01; } -void CTRexExtendedDriverBaseMlnx5G::add_del_rules(enum rte_filter_op op, uint8_t port_id, uint16_t type, uint8_t ttl, uint16_t ip_id, +void CTRexExtendedDriverBaseMlnx5G::add_del_rules(enum rte_filter_op op, uint8_t port_id, uint16_t type, + uint8_t ttl, + uint16_t ip_id, uint16_t l4_proto, int queue, uint16_t stat_idx) { /* Mellanox card does not have TTL support, so we will replace it in low level with TOS */ @@ -6495,9 +6500,15 @@ int CTRexExtendedDriverBaseMlnx5G::add_del_rx_flow_stat_rule(uint8_t port_id, en int CTRexExtendedDriverBaseMlnx5G::configure_rx_filter_rules_statfull(CPhyEthIF * _if) { - //uint32_t port_id = _if->get_port_id(); + uint32_t port_id = _if->get_port_id(); /* TTL==TOS */ + /*PID=1 ==> MASK TOS=0x1/0x1*/ + //add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_UDP, 0x1, 1, 17, MAIN_DPDK_RX_Q, 0); + //add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_TCP, 0x1, 1, 6, MAIN_DPDK_RX_Q, 0); + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_OTHER, 0x1, 1, 132, MAIN_DPDK_RX_Q, 0); /*SCTP*/ + add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_OTHER, 0x1, 1, 1, MAIN_DPDK_RX_Q, 0); /*ICMP*/ + return (0); /* Configure rules for latency measurement packets */ //add_del_rules(RTE_ETH_FILTER_ADD, port_id, RTE_ETH_FLOW_NONFRAG_IPV4_UDP, TTL_RESERVE_DUPLICATE, 0, 0, MAIN_DPDK_RX_Q, 0); diff --git a/src/stateful_rx_core.cpp b/src/stateful_rx_core.cpp index ebc51fcb..cbf62a17 100644 --- a/src/stateful_rx_core.cpp +++ b/src/stateful_rx_core.cpp @@ -33,7 +33,7 @@ const uint8_t sctp_pkt[]={ 0x00,0x0e,0x2e,0x24,0x37,0x5f, 0x08,0x00, - 0x45,0x02,0x00,0x30, + 0x45,0x03,0x00,0x30, 0x00,0x00,0x40,0x00, 0xff,0x84,0xbd,0x04, 0x9b,0xe6,0x18,0x9b, //sIP @@ -57,7 +57,7 @@ const uint8_t icmp_pkt[]={ 0x00,0x0e,0x2e,0x24,0x37,0x5f, 0x08,0x00, - 0x45,0x02,0x00,0x30, + 0x45,0x03,0x00,0x30, 0x00,0x00,0x40,0x00, 0xff,0x01,0xbd,0x04, 0x9b,0xe6,0x18,0x9b, //SIP -- cgit 1.2.3-korg From 2e660da63bf8dfd0aaf29185854f529fa30944cb Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Fri, 11 Nov 2016 00:51:14 +0200 Subject: add verbs lib to pkg Signed-off-by: Hanoh Haim --- linux_dpdk/ws_main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 8d9a236c..0ad407e4 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -902,7 +902,6 @@ def copy_single_system1 (bld, exec_p, build_obj): files_list=[ 'libzmq.so.3', - 'libibverbs.so.1', 'trex-cfg', 'bp-sim-64', 'bp-sim-64-debug', @@ -921,7 +920,7 @@ files_list=[ 'daemon_server' ]; -files_dir=['cap2','avl','cfg','ko','automation', 'external_libs', 'python-lib','stl','api','exp'] +files_dir=['cap2','avl','cfg','ko','automation', 'external_libs', 'python-lib','stl','api','exp','dumy_libs'] class Env(object): -- cgit 1.2.3-korg From 0b1274653592fe4232d14e3a2de8b909bd6c5d13 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Sun, 13 Nov 2016 13:46:19 +0200 Subject: verify os.system return status in linux_dpdk/ws_main.py Signed-off-by: Yaroslav Brustinov --- linux_dpdk/ws_main.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 0ad407e4..b5635e8c 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -31,6 +31,16 @@ USERS_ALLOWED_TO_RELEASE = ['hhaim'] # utility for group source code ################################### +orig_system = os.system + +def verify_system(cmd): + ret = orig_system(cmd) + if ret: + raise Exception('Return code %s on command: system("%s")' % (ret, cmd)) + +os.system = verify_system + + class SrcGroup: ' group of source by directory ' @@ -905,12 +915,11 @@ files_list=[ 'trex-cfg', 'bp-sim-64', 'bp-sim-64-debug', - 't-rex-debug-gdb', + 't-rex-64-debug-gdb', 'stl-sim', 'find_python.sh', 'run_regression', 'run_functional_tests', - 'release_notes.pdf', 'dpdk_nic_bind.py', 'dpdk_setup_ports.py', 'doc_process.py', @@ -920,7 +929,7 @@ files_list=[ 'daemon_server' ]; -files_dir=['cap2','avl','cfg','ko','automation', 'external_libs', 'python-lib','stl','api','exp','dumy_libs'] +files_dir=['cap2','avl','cfg','ko','automation', 'external_libs', 'python-lib','stl','exp','dumy_libs'] class Env(object): -- cgit 1.2.3-korg From 47f6ce0eed8d7f6a32f0a0d723a02e440d9d0fc5 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Sun, 13 Nov 2016 16:23:29 +0200 Subject: debug image will use EF Signed-off-by: Hanoh Haim --- linux_dpdk/ws_main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index b5635e8c..ce877d6d 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -764,9 +764,8 @@ def build_prog (bld, build_obj): # add electric fence only for debug image debug_file_list=''; - #if not build_obj.isRelease (): - #debug - # debug_file_list +=ef_src.file_list(top) + if not build_obj.isRelease (): + debug_file_list +=ef_src.file_list(top) bld.objects( -- cgit 1.2.3-korg From 7b3c33b9769bac4ec62f330f8f54338cd7d28d2d Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 15 Nov 2016 15:26:23 +0200 Subject: backup old trex-07 setup config Signed-off-by: Hanoh Haim --- linux_dpdk/ws_main.py | 4 +- .../regression/setups/trex07/backup/benchmark.yaml | 244 +++++++++++++++++++++ .../regression/setups/trex07/backup/config.yaml | 66 ++++++ .../regression/setups/trex07/benchmark.yaml | 167 +++++++------- .../regression/setups/trex07/config.yaml | 29 +-- .../regression/stateless_tests/stl_rx_test.py | 16 +- scripts/dpdk_setup_ports.py | 27 +++ src/flow_stat_parser.cpp | 1 + 8 files changed, 432 insertions(+), 122 deletions(-) create mode 100644 scripts/automation/regression/setups/trex07/backup/benchmark.yaml create mode 100644 scripts/automation/regression/setups/trex07/backup/config.yaml (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index ce877d6d..9c4c877f 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -764,8 +764,8 @@ def build_prog (bld, build_obj): # add electric fence only for debug image debug_file_list=''; - if not build_obj.isRelease (): - debug_file_list +=ef_src.file_list(top) + #if not build_obj.isRelease (): + # debug_file_list +=ef_src.file_list(top) bld.objects( diff --git a/scripts/automation/regression/setups/trex07/backup/benchmark.yaml b/scripts/automation/regression/setups/trex07/backup/benchmark.yaml new file mode 100644 index 00000000..0dc340b0 --- /dev/null +++ b/scripts/automation/regression/setups/trex07/backup/benchmark.yaml @@ -0,0 +1,244 @@ +############################################################### +#### TRex benchmark configuration file #### +############################################################### + +#### common templates ### + +stat_route_dict: &stat_route_dict + clients_start : 16.0.0.1 + servers_start : 48.0.0.1 + dual_port_mask : 1.0.0.0 + client_destination_mask : 255.0.0.0 + server_destination_mask : 255.0.0.0 + +nat_dict: &nat_dict + clients_net_start : 16.0.0.0 + client_acl_wildcard_mask : 0.0.0.255 + dual_port_mask : 1.0.0.0 + pool_start : 200.0.0.0 + pool_netmask : 255.255.255.0 + + +### stateful ### + +test_jumbo: + multiplier : 17 + cores : 1 + bw_per_core : 543.232 + + +test_routing_imix: + multiplier : 10 + cores : 1 + bw_per_core : 34.128 + + +test_routing_imix_64: + multiplier : 430 + cores : 1 + bw_per_core : 5.893 + + +test_static_routing_imix: &test_static_routing_imix + stat_route_dict : *stat_route_dict + multiplier : 8 + cores : 1 + bw_per_core : 34.339 + +test_static_routing_imix_asymmetric: *test_static_routing_imix + + +test_ipv6_simple: + multiplier : 9 + cores : 2 + bw_per_core : 19.064 + + +test_nat_simple_mode1: &test_nat_simple + stat_route_dict : *stat_route_dict + nat_dict : *nat_dict + multiplier : 6000 + cores : 1 + nat_opened : 500000 + allow_timeout_dev : True + bw_per_core : 44.445 + +test_nat_simple_mode2: *test_nat_simple + +test_nat_simple_mode3: *test_nat_simple + +test_nat_learning: *test_nat_simple + + +test_nbar_simple: + multiplier : 7.5 + cores : 2 + bw_per_core : 17.174 + nbar_classification: + rtp : 32.57 + http : 30.25 + oracle_sqlnet : 11.23 + exchange : 10.80 + citrix : 5.62 + rtsp : 2.84 + dns : 1.95 + smtp : 0.57 + pop3 : 0.36 + ssl : 0.17 + sctp : 0.13 + sip : 0.09 + unknown : 3.41 + + +test_rx_check_http: &rx_http + multiplier : 15000 + cores : 1 + rx_sample_rate : 16 + bw_per_core : 39.560 + +test_rx_check_http_ipv6: + << : *rx_http + bw_per_core : 49.237 + +test_rx_check_http_negative_disabled: + << : *rx_http + stat_route_dict : *stat_route_dict + nat_dict : *nat_dict + + +test_rx_check_sfr: &rx_sfr + multiplier : 10 + cores : 3 + rx_sample_rate : 16 + bw_per_core : 16.082 + +test_rx_check_sfr_ipv6: + << : *rx_sfr + bw_per_core : 19.198 + + + +### stateless ### + +test_CPU_benchmark: + profiles: + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 64} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 64, stream_count: 10} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 64, stream_count: 100} + cpu_util : 1 + bw_per_core : 1 + +# causes queue full +# - name : stl/udp_for_benchmarks.py +# kwargs : {packet_len: 64, stream_count: 1000} +# cpu_util : 1 +# bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 128} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 256} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 512} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 1500} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 4000} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 9000} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 9000, stream_count: 10} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_for_benchmarks.py + kwargs : {packet_len: 9000, stream_count: 100} + cpu_util : 1 + bw_per_core : 1 + +# not enough memory + queue full if memory increase +# - name : stl/udp_for_benchmarks.py +# kwargs : {packet_len: 9000, stream_count: 1000} +# cpu_util : 1 +# bw_per_core : 1 + + - name : stl/imix.py + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_1pkt_tuple_gen.py + kwargs : {packet_len: 64} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_1pkt_tuple_gen.py + kwargs : {packet_len: 128} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_1pkt_tuple_gen.py + kwargs : {packet_len: 256} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_1pkt_tuple_gen.py + kwargs : {packet_len: 512} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_1pkt_tuple_gen.py + kwargs : {packet_len: 1500} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_1pkt_tuple_gen.py + kwargs : {packet_len: 4000} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_1pkt_tuple_gen.py + kwargs : {packet_len: 9000} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/pcap.py + kwargs : {ipg_usec: 2, loop_count: 0} + cpu_util : 1 + bw_per_core : 1 + + - name : stl/udp_rand_len_9k.py + cpu_util : 1 + bw_per_core : 1 + + - name : stl/hlt/hlt_udp_rand_len_9k.py + cpu_util : 1 + bw_per_core : 1 + + diff --git a/scripts/automation/regression/setups/trex07/backup/config.yaml b/scripts/automation/regression/setups/trex07/backup/config.yaml new file mode 100644 index 00000000..db6e9bf8 --- /dev/null +++ b/scripts/automation/regression/setups/trex07/backup/config.yaml @@ -0,0 +1,66 @@ +################################################################ +#### TRex nightly test configuration file #### +################################################################ + + +### TRex configuration: +# hostname - can be DNS name or IP for the TRex machine for ssh to the box +# password - root password for TRex machine +# is_dual - should the TRex inject with -p ? +# version_path - path to the TRex version and executable +# cores - how many cores should be used +# latency - rate of latency packets injected by the TRex +# modes - list of modes (tagging) of this setup (loopback etc.) +# * loopback - Trex works via loopback. Router and TFTP configurations may be skipped. +# * VM - Virtual OS (accept low CPU utilization in tests, latency can get spikes) +# * virt_nics - NICs are virtual (VMXNET3 etc.) + +### Router configuration: +# hostname - the router hostname as apears in ______# cli prefix +# ip_address - the router's ip that can be used to communicate with +# image - the desired imaged wished to be loaded as the router's running config +# line_password - router password when access via Telent +# en_password - router password when changing to "enable" mode +# interfaces - an array of client-server pairs, representing the interfaces configurations of the router +# configurations - an array of configurations that could possibly loaded into the router during the test. +# The "clean" configuration is a mandatory configuration the router will load with to run the basic test bench + +### TFTP configuration: +# hostname - the tftp hostname +# ip_address - the tftp's ip address +# images_path - the tftp's relative path in which the router's images are located + +### Test_misc configuration: +# expected_bw - the "golden" bandwidth (in Gbps) results planned on receiving from the test + +trex: + hostname : csi-trex-07 + cores : 4 + +router: + model : ASR1001x + hostname : csi-asr-01 + ip_address : 10.56.216.120 + image : asr1001x-universalk9.03.13.02.S.154-3.S2-ext.SPA.bin + line_password : cisco + en_password : cisco + mgmt_interface : GigabitEthernet0 + clean_config : clean_config.cfg + intf_masking : 255.255.255.0 + ipv6_mask : 64 + interfaces : + - client : + name : Te0/0/0 + src_mac_addr : 0000.0001.0002 + dest_mac_addr : 0000.0001.0001 + server : + name : Te0/0/1 + src_mac_addr : 0000.0002.0002 + dest_mac_addr : 0000.0002.0001 + vrf_name : null + +tftp: + hostname : ats-asr-srv-1 + ip_address : 10.56.217.7 + root_dir : /scratch/tftp/ + images_path : /asr1001x/ diff --git a/scripts/automation/regression/setups/trex07/benchmark.yaml b/scripts/automation/regression/setups/trex07/benchmark.yaml index 0dc340b0..04cda4aa 100644 --- a/scripts/automation/regression/setups/trex07/benchmark.yaml +++ b/scripts/automation/regression/setups/trex07/benchmark.yaml @@ -4,120 +4,57 @@ #### common templates ### -stat_route_dict: &stat_route_dict - clients_start : 16.0.0.1 - servers_start : 48.0.0.1 - dual_port_mask : 1.0.0.0 - client_destination_mask : 255.0.0.0 - server_destination_mask : 255.0.0.0 - -nat_dict: &nat_dict - clients_net_start : 16.0.0.0 - client_acl_wildcard_mask : 0.0.0.255 - dual_port_mask : 1.0.0.0 - pool_start : 200.0.0.0 - pool_netmask : 255.255.255.0 - - -### stateful ### - test_jumbo: - multiplier : 17 - cores : 1 - bw_per_core : 543.232 + multiplier : 150 + cores : 2 + bw_per_core : 962.464 test_routing_imix: - multiplier : 10 - cores : 1 - bw_per_core : 34.128 + multiplier : 80 + cores : 4 + bw_per_core : 55.130 test_routing_imix_64: - multiplier : 430 - cores : 1 - bw_per_core : 5.893 + multiplier : 8000 + cores : 7 + bw_per_core : 11.699 -test_static_routing_imix: &test_static_routing_imix - stat_route_dict : *stat_route_dict - multiplier : 8 - cores : 1 - bw_per_core : 34.339 - -test_static_routing_imix_asymmetric: *test_static_routing_imix +test_static_routing_imix_asymmetric: + multiplier : 70 + cores : 3 + bw_per_core : 50.561 test_ipv6_simple: - multiplier : 9 - cores : 2 - bw_per_core : 19.064 - - -test_nat_simple_mode1: &test_nat_simple - stat_route_dict : *stat_route_dict - nat_dict : *nat_dict - multiplier : 6000 - cores : 1 - nat_opened : 500000 - allow_timeout_dev : True - bw_per_core : 44.445 - -test_nat_simple_mode2: *test_nat_simple - -test_nat_simple_mode3: *test_nat_simple - -test_nat_learning: *test_nat_simple - - -test_nbar_simple: - multiplier : 7.5 - cores : 2 - bw_per_core : 17.174 - nbar_classification: - rtp : 32.57 - http : 30.25 - oracle_sqlnet : 11.23 - exchange : 10.80 - citrix : 5.62 - rtsp : 2.84 - dns : 1.95 - smtp : 0.57 - pop3 : 0.36 - ssl : 0.17 - sctp : 0.13 - sip : 0.09 - unknown : 3.41 + multiplier : 80 + cores : 7 + bw_per_core : 25.948 test_rx_check_http: &rx_http - multiplier : 15000 - cores : 1 - rx_sample_rate : 16 - bw_per_core : 39.560 + multiplier : 99000 + cores : 3 + rx_sample_rate : 128 + bw_per_core : 49.464 test_rx_check_http_ipv6: << : *rx_http bw_per_core : 49.237 -test_rx_check_http_negative_disabled: - << : *rx_http - stat_route_dict : *stat_route_dict - nat_dict : *nat_dict - - test_rx_check_sfr: &rx_sfr - multiplier : 10 - cores : 3 - rx_sample_rate : 16 - bw_per_core : 16.082 + multiplier : 80 + cores : 7 + rx_sample_rate : 128 + bw_per_core : 20.871 test_rx_check_sfr_ipv6: << : *rx_sfr bw_per_core : 19.198 - ### stateless ### test_CPU_benchmark: @@ -178,10 +115,10 @@ test_CPU_benchmark: cpu_util : 1 bw_per_core : 1 - - name : stl/udp_for_benchmarks.py - kwargs : {packet_len: 9000, stream_count: 100} - cpu_util : 1 - bw_per_core : 1 + #- name : stl/udp_for_benchmarks.py + # kwargs : {packet_len: 9000, stream_count: 100} + # cpu_util : 1 + # bw_per_core : 1 # not enough memory + queue full if memory increase # - name : stl/udp_for_benchmarks.py @@ -241,4 +178,52 @@ test_CPU_benchmark: cpu_util : 1 bw_per_core : 1 +test_performance_vm_single_cpu: + cfg: + mult : "90%" + mpps_per_core_golden : + min: 16.2 + max: 17.3 + + +test_performance_vm_single_cpu_cached: + cfg: + mult : "90%" + mpps_per_core_golden : + min: 29.5 + max: 31.2 + + + +test_performance_syn_attack_single_cpu: + cfg: + mult : "90%" + mpps_per_core_golden : + min: 12.9 + max: 14.5 + +test_performance_vm_multi_cpus: + cfg: + core_count : 2 + mult : "90%" + mpps_per_core_golden : + min: 15.2 + max: 16.3 + + +test_performance_vm_multi_cpus_cached: + cfg: + core_count : 2 + mult : "90%" + mpps_per_core_golden : + min: 28.8 + max: 29.5 + +test_performance_syn_attack_multi_cpus: + cfg: + core_count : 2 + mult : "90%" + mpps_per_core_golden : + min: 13.0 + max: 13.8 diff --git a/scripts/automation/regression/setups/trex07/config.yaml b/scripts/automation/regression/setups/trex07/config.yaml index db6e9bf8..10472c4f 100644 --- a/scripts/automation/regression/setups/trex07/config.yaml +++ b/scripts/automation/regression/setups/trex07/config.yaml @@ -35,32 +35,7 @@ trex: hostname : csi-trex-07 - cores : 4 + cores : 8 + modes : ['loopback'] -router: - model : ASR1001x - hostname : csi-asr-01 - ip_address : 10.56.216.120 - image : asr1001x-universalk9.03.13.02.S.154-3.S2-ext.SPA.bin - line_password : cisco - en_password : cisco - mgmt_interface : GigabitEthernet0 - clean_config : clean_config.cfg - intf_masking : 255.255.255.0 - ipv6_mask : 64 - interfaces : - - client : - name : Te0/0/0 - src_mac_addr : 0000.0001.0002 - dest_mac_addr : 0000.0001.0001 - server : - name : Te0/0/1 - src_mac_addr : 0000.0002.0002 - dest_mac_addr : 0000.0002.0001 - vrf_name : null -tftp: - hostname : ats-asr-srv-1 - ip_address : 10.56.217.7 - root_dir : /scratch/tftp/ - images_path : /asr1001x/ diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py index 524ad4bf..14fcbd0f 100644 --- a/scripts/automation/regression/stateless_tests/stl_rx_test.py +++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py @@ -51,6 +51,17 @@ class STLRX_Test(CStlGeneral_Test): 'latency_9k_enable': False, 'allow_packets_drop_num': 1, # allow 1 pkt drop }, + + 'librte_pmd_mlx5': { + 'rate_percent': 80, + 'total_pkts': 1000, + 'rate_latency': 1, + 'latency_9k_enable': True, + 'latency_9k_max_average': 100, + 'latency_9k_max_latency': 250, + }, + + } CStlGeneral_Test.setUp(self) @@ -63,7 +74,6 @@ class STLRX_Test(CStlGeneral_Test): port_info = self.c.get_port_info(ports = self.rx_port)[0] self.speed = port_info['speed'] - cap = port_info['rx']['caps'] if "flow_stats" not in cap or "latency" not in cap: self.skip('port {0} does not support RX'.format(self.rx_port)) @@ -400,12 +410,14 @@ class STLRX_Test(CStlGeneral_Test): s_port=random.sample(all_ports, random.randint(1, len(all_ports)) ) s_port=sorted(s_port) - if self.speed == 40 : + print s_port + if self.speed == 40 || self.speed == 100: # the NIC does not support all full rate in case both port works let's filter odd ports s_port=list(filter(lambda x: x % 2==0, s_port)) if len(s_port)==0: s_port=[0]; + error=1; for j in range(0,5): print(" {4} - duration {0} pgid {1} pkt_size {2} s_port {3} ".format(duration,pgid,pkt_size,s_port,j)); diff --git a/scripts/dpdk_setup_ports.py b/scripts/dpdk_setup_ports.py index d3b65c5b..2f06b78f 100755 --- a/scripts/dpdk_setup_ports.py +++ b/scripts/dpdk_setup_ports.py @@ -291,6 +291,32 @@ Other network devices self.write_pci (pci_id,68,val) assert(self.read_pci (pci_id,68)==val); + def get_mtu_mlx5 (self,dev_id): + if len(dev_id)>0: + out=subprocess.check_output(['ifconfig', dev_id]) + out=out.decode(errors='replace'); + obj=re.search(r'MTU:(\d+)',out,flags=re.MULTILINE|re.DOTALL); + if obj: + return int(obj.group(1)); + else: + return -1 + + def set_mtu_mlx5 (self,dev_id,new_mtu): + if len(dev_id)>0: + out=subprocess.check_output(['ifconfig', dev_id,'mtu',str(new_mtu)]) + out=out.decode(errors='replace'); + + + def set_max_mtu_mlx5_device(self,dev_id): + mtu=9*1024+22 + dev_mtu=self.get_mtu_mlx5 (dev_id); + if (dev_mtu>0) and (dev_mtu!=mtu): + self.set_mtu_mlx5(dev_id,mtu); + if self.get_mtu_mlx5(dev_id) != mtu: + print("Could not set MTU to %d" % mtu) + exit(-1); + + def disable_flow_control_mlx5_device (self,dev_id): if len(dev_id)>0: @@ -440,6 +466,7 @@ Other network devices if 'Interface' in self.m_devices[key]: dev_id=self.m_devices[key]['Interface'] self.disable_flow_control_mlx5_device (dev_id) + self.set_max_mtu_mlx5_device(dev_id) if only_check_all_mlx: diff --git a/src/flow_stat_parser.cpp b/src/flow_stat_parser.cpp index c0813c3e..4a6722e6 100644 --- a/src/flow_stat_parser.cpp +++ b/src/flow_stat_parser.cpp @@ -129,6 +129,7 @@ int CFlowStatParser::set_ip_id(uint32_t new_id) { } if (m_ipv6) { + m_ipv6->setTrafficClass(m_ipv6->getTrafficClass()|TOS_TTL_RESERVE_DUPLICATE); m_ipv6->setFlowLabel(new_id); return 0; } -- cgit 1.2.3-korg From 453dc59d5257096a9b2273162ad2f80315097951 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 15 Nov 2016 15:28:37 +0200 Subject: debug with ef is back Signed-off-by: Hanoh Haim --- linux_dpdk/ws_main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux_dpdk') diff --git a/linux_dpdk/ws_main.py b/linux_dpdk/ws_main.py index 9c4c877f..ce877d6d 100755 --- a/linux_dpdk/ws_main.py +++ b/linux_dpdk/ws_main.py @@ -764,8 +764,8 @@ def build_prog (bld, build_obj): # add electric fence only for debug image debug_file_list=''; - #if not build_obj.isRelease (): - # debug_file_list +=ef_src.file_list(top) + if not build_obj.isRelease (): + debug_file_list +=ef_src.file_list(top) bld.objects( -- cgit 1.2.3-korg