summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2017-03-16 16:35:42 +0200
committerIdo Barnea <ibarnea@cisco.com>2017-03-16 16:38:28 +0200
commit0d3f6dff2af1325c4e5cf8143e4f4567c30c159e (patch)
treec7066e7ebb60df75674fc281f0a060ea2dc28001
parent284c6cd80086c00a7312f2ccffa686a679620cd3 (diff)
Fixes for v2.21 --software mode issues
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
-rwxr-xr-xsrc/bp_sim.h2
-rw-r--r--src/main_dpdk.cpp18
-rwxr-xr-xsrc/platform_cfg.cpp2
-rw-r--r--src/pre_test.cpp7
-rw-r--r--src/stateless/rx/trex_stateless_rx_core.cpp2
5 files changed, 24 insertions, 7 deletions
diff --git a/src/bp_sim.h b/src/bp_sim.h
index d8f620ed..fd4e6627 100755
--- a/src/bp_sim.h
+++ b/src/bp_sim.h
@@ -1388,7 +1388,7 @@ static inline bool get_is_rx_filter_enable(){
uint32_t latency_rate=CGlobalInfo::m_options.m_latency_rate;
return ( ( get_is_rx_check_mode() || CGlobalInfo::is_learn_mode() || latency_rate != 0
|| get_is_stateless()) && ((CGlobalInfo::get_queues_mode() != CGlobalInfo::Q_MODE_RSS)
- || (CGlobalInfo::get_queues_mode() != CGlobalInfo::Q_MODE_ONE_QUEUE))
+ && (CGlobalInfo::get_queues_mode() != CGlobalInfo::Q_MODE_ONE_QUEUE))
?true:false );
}
static inline uint16_t get_rx_check_hops() {
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index ecd1ca96..3e149ee1 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -185,9 +185,16 @@ public:
virtual int set_rcv_all(CPhyEthIF * _if, bool set_on)=0;
virtual TRexPortAttr * create_port_attr(uint8_t port_id) = 0;
+ virtual rte_mempool_t * get_rx_mem_pool(int socket_id) {
+ return CGlobalInfo::m_mem_pool[socket_id].m_mbuf_pool_9k;
+ }
virtual void get_dpdk_drv_params(CTrexDpdkParams &p) {
p.rx_data_q_num = 1;
- p.rx_drop_q_num = 1;
+ if (CGlobalInfo::get_queues_mode() == CGlobalInfo::Q_MODE_ONE_QUEUE) {
+ p.rx_drop_q_num = 0;
+ } else {
+ p.rx_drop_q_num = 1;
+ }
p.rx_desc_num_data_q = RX_DESC_NUM_DATA_Q;
p.rx_desc_num_drop_q = RX_DESC_NUM_DROP_Q;
p.tx_desc_num = TX_DESC_NUM;
@@ -256,7 +263,10 @@ public:
p.rx_desc_num_drop_q = RX_DESC_NUM_DROP_Q;
p.tx_desc_num = TX_DESC_NUM;
}
-
+ virtual rte_mempool_t * get_rx_mem_pool(int socket_id) {
+ // In VMs there is usually less memory available
+ return CGlobalInfo::m_mem_pool[socket_id].m_mbuf_pool_2048;
+ }
virtual void update_configuration(port_cfg_t * cfg);
virtual int configure_rx_filter_rules(CPhyEthIF * _if);
virtual int stop_queue(CPhyEthIF * _if, uint16_t q_num);
@@ -867,7 +877,7 @@ static int usage(){
printf(" -s : Single core. Run only one data path core. For debug \n");
printf(" --send-debug-pkt <proto> : Do not run traffic generator. Just send debug packet and dump receive queues \n");
printf(" Supported protocols are 1 for icmp, 2 for UDP, 3 for TCP, 4 for ARP, 5 for 9K UDP \n");
- printf(" --software : Do not configure any hardare rules. In this mode we used 1 core, and one RX queue and one TX queue per port\n");
+ printf(" --software : Do not configure any hardware rules. In this mode we use 1 core, and one RX queue and one TX queue per port\n");
printf(" -v <verbosity level> : The higher the value, print more debug information \n");
printf(" --vlan : Relevant only for stateless mode with Intel 82599 10G NIC \n");
printf(" When configuring flow stat and latency per stream rules, assume all streams uses VLAN \n");
@@ -5114,7 +5124,7 @@ void CPhyEthIF::conf_queues() {
// Only 1 rx queue, so use it for everything
g_trex.m_rx_core_tx_q_id = 0;
rx_queue_setup(0, dpdk_p.rx_desc_num_data_q, socket_id, &g_trex.m_port_cfg.m_rx_conf,
- CGlobalInfo::m_mem_pool[socket_id].m_mbuf_pool_2048);
+ get_ex_drv()->get_rx_mem_pool(socket_id));
set_rx_queue(0);
} else {
// no drop q. Many rcv queues. RSS mode.
diff --git a/src/platform_cfg.cpp b/src/platform_cfg.cpp
index 92b4e7e9..8a2a9486 100755
--- a/src/platform_cfg.cpp
+++ b/src/platform_cfg.cpp
@@ -257,6 +257,8 @@ void operator >> (const YAML::Node& node, CMacYamlInfo & mac_info) {
}
if (! utl_yaml_read_uint16(node, "vlan", mac_info.m_vlan)) {
mac_info.m_vlan = 0;
+ } else {
+ mac_info.m_vlan &= 0x0fff; // we only care about the vlan ID
}
}
diff --git a/src/pre_test.cpp b/src/pre_test.cpp
index a72b7e8e..9316d371 100644
--- a/src/pre_test.cpp
+++ b/src/pre_test.cpp
@@ -211,6 +211,9 @@ void CPretestOnePortInfo::send_arp_req_all() {
if (verbose >= 3) {
fprintf(stdout, "TX ARP request on port %d - " , m_port_id);
(*it)->dump(stdout, "");
+ if (verbose >= 7) {
+ utl_DumpBuffer(stdout, p, rte_pktmbuf_pkt_len(m[0]), 0);
+ }
}
num_sent = rte_eth_tx_burst(m_port_id, 0, m, 1);
@@ -387,7 +390,7 @@ bool CPretest::is_arp(const uint8_t *p, uint16_t pkt_size, ArpHdr *&arp, uint16_
if (m_ether->getVlanProtocol() != EthernetHeader::Protocol::ARP) {
return false;
} else {
- vlan_tag = m_ether->getVlanTag();
+ vlan_tag = m_ether->getVlanTag() & 0xfff;
arp = (ArpHdr *)(p + 18);
}
}
@@ -428,6 +431,8 @@ int CPretest::handle_rx(int port_id, int queue_id) {
, ip_to_str(ntohl(arp->m_arp_sip)).c_str()
, ip_to_str(ntohl(arp->m_arp_tip)).c_str()
, vlan_tag);
+ if (verbose >= 7)
+ utl_DumpBuffer(stdout, p, rte_pktmbuf_pkt_len(m), 0);
}
// is this request for our IP?
COneIPv4Info *src_addr;
diff --git a/src/stateless/rx/trex_stateless_rx_core.cpp b/src/stateless/rx/trex_stateless_rx_core.cpp
index 016b7193..30458b32 100644
--- a/src/stateless/rx/trex_stateless_rx_core.cpp
+++ b/src/stateless/rx/trex_stateless_rx_core.cpp
@@ -175,7 +175,7 @@ void CRxCoreStateless::hot_state_loop() {
*
*/
void CRxCoreStateless::cold_state_loop() {
- const uint32_t COLD_LIMIT_ITER = 1000;
+ const uint32_t COLD_LIMIT_ITER = 10000000;
const uint32_t COLD_SLEEP_MS = 10;
int counter = 0;