diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-11-11 13:42:02 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-11-11 13:42:02 +0200 |
commit | 6d80194380143cc12ef46c4d430f21e7a1ba2a18 (patch) | |
tree | 6107442169d386f8803e546713b0cf1b52611295 | |
parent | 8d0a50a3512593aa2036b297a83ad486349845a1 (diff) |
mlx5 stateless latency support
Signed-off-by: Hanoh Haim <hhaim@cisco.com>
-rwxr-xr-x | src/common/Network/Packet/IPHeader.h | 9 | ||||
-rw-r--r-- | src/flow_stat_parser.cpp | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/common/Network/Packet/IPHeader.h b/src/common/Network/Packet/IPHeader.h index da9ba52c..0bf97fbb 100755 --- a/src/common/Network/Packet/IPHeader.h +++ b/src/common/Network/Packet/IPHeader.h @@ -91,6 +91,15 @@ public: */ inline void setHeaderLength (uint8_t); + inline uint16_t getFirstWord(){ + return PKT_NTOHS(*((uint16_t *)&myVer_HeaderLength)); + } + + inline void setFirstWord (uint16_t word){ + *((uint16_t *)&myVer_HeaderLength) = PKT_NTOHS(word); + } + + inline uint8_t getTOS (); inline void setTOS (uint8_t); diff --git a/src/flow_stat_parser.cpp b/src/flow_stat_parser.cpp index 7335a6a2..c0813c3e 100644 --- a/src/flow_stat_parser.cpp +++ b/src/flow_stat_parser.cpp @@ -27,6 +27,7 @@ #include "common/Network/Packet/TcpHeader.h" #include "pkt_gen.h" #include "flow_stat_parser.h" +#include "bp_sim.h" void CFlowStatParser::reset() { m_start = 0; @@ -120,8 +121,10 @@ int CFlowStatParser::get_ip_id(uint32_t &ip_id) { int CFlowStatParser::set_ip_id(uint32_t new_id) { if (m_ipv4) { // Updating checksum, not recalculating, so if someone put bad checksum on purpose, it will stay bad + m_ipv4->updateCheckSum(PKT_NTOHS(m_ipv4->getFirstWord()), PKT_NTOHS(m_ipv4->getFirstWord() |TOS_TTL_RESERVE_DUPLICATE)); m_ipv4->updateCheckSum(PKT_NTOHS(m_ipv4->getId()), PKT_NTOHS(new_id)); m_ipv4->setId(new_id); + m_ipv4->setTOS(m_ipv4->getTOS()|TOS_TTL_RESERVE_DUPLICATE); return 0; } |