diff options
author | 2016-08-08 11:01:51 +0300 | |
---|---|---|
committer | 2016-08-08 11:01:51 +0300 | |
commit | 2067ee3de8e6664e66f872a0b5c6d1b68b99625a (patch) | |
tree | 8882d82eb06660e6b3e89c5776a0c47a5e6e3bb0 /src | |
parent | 7cecfd8ac5537e2128af95660c19f8bb4955a8a0 (diff) |
Adding --no-close option
Diffstat (limited to 'src')
-rwxr-xr-x | src/bp_sim.h | 8 | ||||
-rw-r--r-- | src/main_dpdk.cpp | 35 |
2 files changed, 20 insertions, 23 deletions
diff --git a/src/bp_sim.h b/src/bp_sim.h index 5516dc94..b32534e5 100755 --- a/src/bp_sim.h +++ b/src/bp_sim.h @@ -711,6 +711,14 @@ public: return (btGetMaskBit32(m_flags1, 8, 8) ? true : false); } + void setNoCloseEnable(bool enable) { + btSetMaskBit32(m_flags1, 9, 9, (enable ? 1 : 0) ); + } + + bool getNoCloseEnable(){ + return (btGetMaskBit32(m_flags1, 9, 9) ? true : false); + } + public: void Dump(FILE *fd); diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index e5884f93..bc703cdc 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -525,7 +525,6 @@ enum { OPT_HELP, OPT_LIMT_NUM_OF_PORTS, OPT_PLAT_CFG_FILE, OPT_MBUF_FACTOR, - OPT_LATENCY, OPT_NO_CLEAN_FLOW_CLOSE, OPT_LATENCY_MASK, @@ -551,10 +550,9 @@ enum { OPT_HELP, OPT_NO_WATCHDOG, OPT_ALLOW_COREDUMP, OPT_CHECKSUM_OFFLOAD, - + OPT_NO_CLOSE, }; - /* these are the argument types: SO_NONE -- no argument needed SO_REQ_SEP -- single required argument @@ -575,24 +573,17 @@ static CSimpleOpt::SOption parser_options[] = { OPT_FLIP_CLIENT_SERVER,"--flip",SO_NONE }, { OPT_FLOW_FLIP_CLIENT_SERVER,"-p",SO_NONE }, { OPT_FLOW_FLIP_CLIENT_SERVER_SIDE,"-e",SO_NONE }, - { OPT_NO_CLEAN_FLOW_CLOSE,"--nc",SO_NONE }, - { OPT_LIMT_NUM_OF_PORTS,"--limit-ports", SO_REQ_SEP }, { OPT_CORES , "-c", SO_REQ_SEP }, { OPT_NODE_DUMP , "-v", SO_REQ_SEP }, { OPT_LATENCY , "-l", SO_REQ_SEP }, - { OPT_DURATION , "-d", SO_REQ_SEP }, { OPT_PLATFORM_FACTOR , "-pm", SO_REQ_SEP }, - { OPT_PUB_DISABLE , "-pubd", SO_NONE }, - - { OPT_BW_FACTOR , "-m", SO_REQ_SEP }, { OPT_LATENCY_MASK , "--lm", SO_REQ_SEP }, { OPT_ONLY_LATENCY, "--lo", SO_NONE }, - { OPT_1G_MODE, "-1g", SO_NONE }, { OPT_LATENCY_PREVIEW , "-k", SO_REQ_SEP }, { OPT_WAIT_BEFORE_TRAFFIC , "-w", SO_REQ_SEP }, @@ -615,14 +606,10 @@ static CSimpleOpt::SOption parser_options[] = { OPT_NO_WATCHDOG , "--no-watchdog", SO_NONE }, { OPT_ALLOW_COREDUMP , "--allow-coredump", SO_NONE }, { OPT_CHECKSUM_OFFLOAD, "--checksum-offload", SO_NONE }, - - + { OPT_NO_CLOSE, "--no-close", SO_NONE }, SO_END_OF_OPTIONS }; - - - static int usage(){ printf(" Usage: t-rex-64 [MODE] [OPTION] -f cfg.yaml -c cores \n"); @@ -711,6 +698,9 @@ static int usage(){ printf(" --iom [mode] : io mode for interactive mode [0- silent, 1- normal , 2- short] \n"); printf(" this feature consume another thread \n"); printf(" \n"); + printf(" --no-close : Do not call rte_eth_dev_stop and close at exit. Calling this might cause link down issues when\n"); + printf(" running new version, then going back to old version. Work around is to run new version once with --no-close\n"); + printf(" This it temporary option. Will be removed in the future.\n"); printf(" --no-key : daemon mode, don't get input from keyboard \n"); printf(" --no-flow-control-change : By default TRex disables flow-control. If this option is given, it does not touch it\n"); printf(" --prefix : for multi trex, each instance should have a different name \n"); @@ -983,6 +973,9 @@ static int parse_options(int argc, char *argv[], CParserOption* po, bool first_t po->preview.setChecksumOffloadEnable(true); break; + case OPT_NO_CLOSE: + po->preview.setNoCloseEnable(true); + break; default: usage(); @@ -1430,17 +1423,13 @@ void CPhyEthIF::tx_queue_setup(uint16_t tx_queue_id, } - void CPhyEthIF::stop(){ -#if 0 - // allowing this causes bad things to happen. Especially on X710 cards. - // See trex-237 for details - rte_eth_dev_stop(m_port_id); - rte_eth_dev_close(m_port_id); -#endif + if (! CGlobalInfo::m_options.preview.getNoCloseEnable()) { + rte_eth_dev_stop(m_port_id); + rte_eth_dev_close(m_port_id); + } } - void CPhyEthIF::start(){ get_ex_drv()->clear_extended_stats(this); |