diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-06-01 09:59:58 +0300 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-06-01 09:59:58 +0300 |
commit | 92b58ef2f1840dd26be981342f08482d4b321b24 (patch) | |
tree | 246a2f7a3f0243541f6fb6cffa78731e36313285 | |
parent | 62f58acc01da2e941c7bdeaa6e3b4ecaeb6c781a (diff) |
Support for per flow latency with vm
-rw-r--r-- | src/main_dpdk.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index c02c04d8..bd3cac64 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -3178,7 +3178,13 @@ int CGlobalTRex::ixgbe_start(void){ */ int port_offset=0; - int lat_q_id = get_cores_tx() / get_base_num_cores(); + uint8_t lat_q_id; + + if ( get_vm_one_queue_enable() ) { + lat_q_id = 0; + } else { + lat_q_id = get_cores_tx() / get_base_num_cores(); + } for (i=0; i<get_cores_tx(); i++) { int j=(i+1); int queue_id=((j-1)/get_base_num_cores() ); /* for the first min core queue 0 , then queue 1 etc */ @@ -4298,6 +4304,16 @@ bool CCoreEthIF::process_rx_pkt(pkt_dir_t dir, // In stateless RX, we only care about flow stat packets if ((parser.getIpId() & 0xff00) == IP_ID_RESERVE_BASE) { send = true; + if (parser.getIpId() == FLOW_STAT_PAYLOAD_IP_ID) { + // e1000 on ESXI appends 4 bytes to the packet. + // This is a best effort hack to get our latency info which we put at the end of the packet + uint8_t *p = rte_pktmbuf_mtod(m, uint8_t*); + struct flow_stat_payload_header *fsp_head = (struct flow_stat_payload_header *) + (p + m->pkt_len - sizeof(struct flow_stat_payload_header)); + if (fsp_head->magic != FLOW_STAT_PAYLOAD_MAGIC) { + rte_pktmbuf_trim(m, 4); + } + } } } else { CLatencyPktMode *c_l_pkt_mode = g_trex.m_mg.c_l_pkt_mode; |