summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-12-01 15:24:58 +0200
committerimarom <imarom@cisco.com>2016-12-01 15:30:29 +0200
commit452e9d470b09513fff00b4a0c3600c33c3e4f76a (patch)
tree90d100a4d84de5b1009a277fa29857d2c697acc4
parentc420d1fd8c17118f2ccaee4b05b81ec3dd515fa6 (diff)
bug found by valgrind
also an issue with 40G deleting no exisiting rules with recv_all Signed-off-by: imarom <imarom@cisco.com>
-rwxr-xr-xscripts/t-rex-64-valgrind8
-rw-r--r--src/flow_stat.cpp6
-rw-r--r--src/main_dpdk.cpp6
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_general.cpp2
4 files changed, 16 insertions, 6 deletions
diff --git a/scripts/t-rex-64-valgrind b/scripts/t-rex-64-valgrind
index a770895d..5ac2becf 100755
--- a/scripts/t-rex-64-valgrind
+++ b/scripts/t-rex-64-valgrind
@@ -31,6 +31,7 @@ export LD_LIBRARY_PATH=$PWD:$PWD/dumy_libs
fi
export VALGRIND_LIB=/auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/lib/valgrind
+export VALGRIND_BIN="/auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/bin/valgrind --leak-check=full"
if [ -t 0 ] && [ -t 1 ]; then
export is_tty=true
@@ -41,17 +42,18 @@ fi
# if we have a new core run optimized trex
if grep -q avx /proc/cpuinfo ; then
- /auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/bin/valgrind ./_t-rex-64 $INPUT_ARGS
+ $VALGRIND_BIN ./_t-rex-64 $INPUT_ARGS
RESULT=$?
if [ $RESULT -eq 132 ]; then
echo " WARNING this program is optimized for the new Intel processors. "
echo " try the ./t-rex-64-o application that should work for any Intel processor but might be slower. "
echo " try to run t-rex-64-o .. "
- /auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/bin/valgrind ./_t-rex-64-o $INPUT_ARGS
+
+ $VALGRIND_BIN ./_t-rex-64 $INPUT_ARGS
RESULT=$?
fi
else
- /auto/proj-pcube-b/apps/PL-b/tools/valgrind-dpdk/bin/valgrind ./_t-rex-64-o $INPUT_ARGS
+ $VALGRIND_BIN ./_t-rex-64 $INPUT_ARGS
RESULT=$?
fi
diff --git a/src/flow_stat.cpp b/src/flow_stat.cpp
index ba125df2..e1e2f011 100644
--- a/src/flow_stat.cpp
+++ b/src/flow_stat.cpp
@@ -804,7 +804,6 @@ int CFlowStatRuleMgr::start_stream(TrexStream * stream) {
if (m_num_started_streams == 0) {
send_start_stop_msg_to_rx(true); // First transmitting stream. Rx core should start reading packets;
- assert(m_rx_core->is_working());
//also good time to zero global counters
memset(m_rx_cant_count_err, 0, sizeof(m_rx_cant_count_err));
@@ -981,7 +980,10 @@ void CFlowStatRuleMgr::send_start_stop_msg_to_rx(bool is_start) {
m_ring_to_rx->Enqueue((CGenNode *)msg);
/* hold until message was ack'ed - otherwise we might lose packets */
- reply.wait_for_reply();
+ if (m_rx_core) {
+ reply.wait_for_reply();
+ assert(m_rx_core->is_working());
+ }
} else {
msg = new TrexStatelessRxDisableLatency();
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index c02d6760..2fa5af85 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -132,7 +132,7 @@ static char global_master_id_str[10];
class CTRexExtendedDriverBase {
public:
-
+
/* by default NIC driver adds CRC */
virtual bool has_crc_added() {
return true;
@@ -7341,6 +7341,10 @@ TRexPortAttr *TrexDpdkPlatformApi::getPortAttrObj(uint8_t port_id) const {
int DpdkTRexPortAttr::set_rx_filter_mode(rx_filter_mode_e rx_filter_mode) {
+ if (rx_filter_mode == m_rx_filter_mode) {
+ return (0);
+ }
+
CPhyEthIF *_if = &g_trex.m_ports[m_port_id];
bool recv_all = (rx_filter_mode == RX_FILTER_MODE_ALL);
int rc = CTRexExtendedDriverDb::Ins()->get_drv()->set_rcv_all(_if, recv_all);
diff --git a/src/rpc-server/commands/trex_rpc_cmd_general.cpp b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
index 107b7b4b..3d541fe5 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_general.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
@@ -820,6 +820,8 @@ TrexRpcCmdGetRxQueuePkts::_run(const Json::Value &params, Json::Value &result) {
const RXPacketBuffer *pkt_buffer = port->get_rx_queue_pkts();
if (pkt_buffer) {
result["result"]["pkts"] = pkt_buffer->to_json();
+ delete pkt_buffer;
+
} else {
result["result"]["pkts"] = Json::arrayValue;
}