UlsoTest.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. /*
  2. * Copyright (c) 2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are
  6. * met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above
  10. * copyright notice, this list of conditions and the following
  11. * disclaimer in the documentation and/or other materials provided
  12. * with the distribution.
  13. * * Neither the name of The Linux Foundation nor the names of its
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
  18. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
  20. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  21. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  22. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  23. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  24. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  25. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  26. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  27. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. #include <stdio.h>
  30. #include <stdlib.h>
  31. #include <unistd.h>
  32. #include <string.h>
  33. #include <stdint.h>
  34. #include <cstring> // for memcpy
  35. #include "hton.h" // for htonl
  36. #include "InterfaceAbstraction.h"
  37. #include "Constants.h"
  38. #include "Logger.h"
  39. #include "TestsUtils.h"
  40. #include "UlsoTestFixture.h"
  41. #include "HeaderInsertion.h"
  42. #define ARRAY_SIZE(A) (sizeof(ArraySizeHelper(A)))
  43. template <typename T, size_t N>
  44. char (&ArraySizeHelper(T (&a)[N]))[N];
  45. using std::cout;
  46. using std::endl;
  47. using std::string;
  48. using I4 = IPv4Header;
  49. using I6 = IPv6Header;
  50. using UDPH = UdpHeader;
  51. using TCPH = TcpHeader;
  52. /* Packet modification function objects */
  53. template<typename PacketType> class PacketModifier {public:virtual void operator()(PacketType& p) const = 0;};
  54. template<typename PacketType> class NullPacketModifier: public PacketModifier<PacketType> {public:void operator()(PacketType& p) const override {}};
  55. template<typename PacketType> class ZeroChecksumPacketModifier: public PacketModifier<PacketType>
  56. {public:void operator()(PacketType& p) const override {p.mQmapHeader.setmZeroChecksum(1);}};
  57. template<typename PacketType> class OutOfBoundsPacketModifier: public PacketModifier<PacketType>
  58. {public:void operator()(PacketType& p) const override {p.mQmapHeader.setmIpIdCfg(0);p.setIpId(65530);}};
  59. template<typename Transport, typename Internet, const size_t* SegmentSizesArr, size_t SegmentSizesArrSize, const float* SegmentsNumsArr,
  60. size_t SegmentsNumsArrSize, typename Modifier = NullPacketModifier<UlsoPacket<Transport, Internet>>>
  61. class PacketsGeneratorClass {
  62. protected:
  63. using PacketType = UlsoPacket<Transport, Internet>;
  64. public:
  65. vector<PacketType> operator()(){
  66. vector<PacketType> outVec;
  67. Modifier m;
  68. for(size_t i=0; i<SegmentSizesArrSize; i++){
  69. for(size_t j=0; j<SegmentsNumsArrSize; j++){
  70. PacketType p(SegmentSizesArr[i], static_cast<size_t>(SegmentSizesArr[i] * SegmentsNumsArr[j]), true);
  71. m(p);
  72. outVec.emplace_back(p);
  73. }
  74. }
  75. return outVec;
  76. }
  77. };
  78. template<typename Transport, typename Internet, typename PacketsGenerator>
  79. class UlsoTest: public UlsoTestFixture {
  80. private:
  81. using PacketType = UlsoPacket<Transport, Internet>;
  82. bool singlePacketRun(PacketType& p){
  83. memset(m_sendBuf, 0, sizeof(m_sendBuf));
  84. size_t packetSize = p.asArray(m_sendBuf);
  85. size_t numSent = m_producer.SendData(m_sendBuf, packetSize);
  86. if(numSent == 0){
  87. return false;
  88. }
  89. vector<PacketType> segmentedPacketsVec = p.segment();
  90. for(auto& segmentedPacket: segmentedPacketsVec){
  91. memset(m_receiveBuf, 0, sizeof(m_receiveBuf));
  92. memset(m_segmentBuf, 0, sizeof(m_segmentBuf));
  93. packetSize = segmentedPacket.asArray(m_segmentBuf);
  94. size_t recievedBytes = m_consumer.ReceiveSingleDataChunk(m_receiveBuf, packetSize);
  95. if(packetSize != recievedBytes || memcmp(m_segmentBuf, m_receiveBuf, packetSize)){
  96. return fail(numSent, packetSize, recievedBytes);
  97. }
  98. }
  99. return clearPipe() == 0;
  100. }
  101. public:
  102. UlsoTest(const char* name){
  103. m_name = name;
  104. string title = string("ULSO Test");
  105. string packetStructure = string("Structure: ") + string ("QMAP + Ethernet 2 + ")
  106. + string(Internet().name()) + string(" ") + string(Transport().name());
  107. string testProcess = string(
  108. "1. Config IPA->APPS test pipe\n"
  109. "2. Generate a vector of ULSO packets\n"
  110. "3. For each packet in the packets vector\n"
  111. " a. Send the packet over the APPS->IPA pipe using ipa_tx_dp\n"
  112. " b. Segment the packet using the software simulation and store it in a segments vector\n"
  113. " c. For each segment in the segments vector in order\n"
  114. " # Receive a segment over IPA->APPS test pipe\n"
  115. " # Compare the received segment to the software simulated segment\n"
  116. "4. Clear the IPA->USB pipe and verify there were no bytes left in the pipe");
  117. m_description = string(title + "\n" + packetStructure + "\n" + testProcess + "\n").c_str();
  118. m_minIPAHwType = IPA_HW_v5_0;
  119. Register(*this);
  120. }
  121. virtual bool Run() override {
  122. vector<PacketType> packetsVec = PacketsGenerator()();
  123. for(auto& p: packetsVec){
  124. if(!singlePacketRun(p)){
  125. cout << "Failed With the following packet:" << endl;
  126. cout << p << endl;
  127. return false;
  128. }
  129. }
  130. return true;
  131. }
  132. };
  133. template<typename Transport, typename Internet, typename PacketsGenerator>
  134. class UlsoHPCTest: public UlsoTestFixture {
  135. private:
  136. using PacketType = UlsoPacket<Transport, Internet>;
  137. static constexpr size_t rndisHdrLen {44};
  138. HeaderInsertion m_HeaderInsertion;
  139. uint8_t mRndisHeader[rndisHdrLen] = {0};
  140. bool fail(size_t sendSize=0, size_t totalSegmentsSize=0, size_t recievedBytes=0){
  141. printBuf(m_sendBuf, sendSize, "Sent:");
  142. printBuf(m_receiveBuf, recievedBytes, string("Rceived ")
  143. + std::to_string(recievedBytes) + string(" Bytes:"));
  144. printBuf(m_segmentBuf, totalSegmentsSize, string("Expected to receive ")
  145. + std::to_string(totalSegmentsSize) + string(" Bytes:"));
  146. clearPipe();
  147. return false;
  148. }
  149. bool singlePacketRun(PacketType& p){
  150. cout << p << endl;
  151. memset(m_sendBuf, 0, sizeof(m_sendBuf));
  152. size_t sendSize = p.asArray(m_sendBuf);
  153. if(!m_producer.SendData(m_sendBuf, sendSize)){
  154. return fail(sendSize);
  155. }
  156. vector<PacketType> segmentedPacketsVec = p.segment();
  157. memset(m_segmentBuf, 0, sizeof(m_segmentBuf));
  158. uint8_t *segmentBufPtr = m_segmentBuf;
  159. size_t totalSegmentsSize = 0;
  160. vector<size_t> comparisionIntervalsSizesVec;
  161. for(auto& segmentedPacket: segmentedPacketsVec){
  162. memcpy(segmentBufPtr, mRndisHeader, sizeof(mRndisHeader));
  163. segmentBufPtr += sizeof(mRndisHeader);
  164. comparisionIntervalsSizesVec.emplace_back(sizeof(mRndisHeader));
  165. totalSegmentsSize += sizeof(mRndisHeader);
  166. size_t n = segmentedPacket.asArray(segmentBufPtr);
  167. segmentBufPtr += n;
  168. totalSegmentsSize += n;
  169. comparisionIntervalsSizesVec.emplace_back(n);
  170. }
  171. memset(m_receiveBuf, 0, sizeof(m_receiveBuf));
  172. size_t recievedBytes = m_consumer.ReceiveSingleDataChunk(m_receiveBuf, totalSegmentsSize);
  173. if(totalSegmentsSize != recievedBytes){
  174. return fail(sendSize, totalSegmentsSize, recievedBytes);
  175. }
  176. segmentBufPtr = m_segmentBuf;
  177. uint8_t *recieveBufPtr = m_receiveBuf;
  178. while(!comparisionIntervalsSizesVec.empty()){
  179. size_t skipSize = comparisionIntervalsSizesVec.front();
  180. recieveBufPtr += skipSize;
  181. segmentBufPtr += skipSize;
  182. comparisionIntervalsSizesVec.erase(comparisionIntervalsSizesVec.begin());
  183. if(comparisionIntervalsSizesVec.empty()){
  184. return fail(sendSize, totalSegmentsSize, recievedBytes);
  185. }
  186. size_t compareSize = comparisionIntervalsSizesVec.front();
  187. if(memcmp(segmentBufPtr, recieveBufPtr, compareSize)){
  188. return fail(sendSize, totalSegmentsSize, recievedBytes);
  189. }
  190. segmentBufPtr += compareSize;
  191. recieveBufPtr += compareSize;
  192. comparisionIntervalsSizesVec.erase(comparisionIntervalsSizesVec.begin());
  193. }
  194. if(clearPipe()){
  195. return fail(sendSize, totalSegmentsSize, recievedBytes);
  196. }
  197. return true;
  198. }
  199. protected:
  200. virtual void configFromEp(struct test_ipa_ep_cfg *ep_cfg){
  201. ep_cfg->hdr.hdr_len = ETH_HLEN + rndisHdrLen;
  202. ep_cfg->hdr.hdr_additional_const_len = ETH_HLEN;
  203. ep_cfg->hdr.hdr_ofst_pkt_size_valid = true;
  204. ep_cfg->hdr.hdr_ofst_pkt_size = 3 * sizeof(uint32_t);
  205. ep_cfg->hdr_ext.hdr_total_len_or_pad_offset = sizeof(uint32_t);
  206. ep_cfg->hdr_ext.hdr_total_len_or_pad = IPA_HDR_TOTAL_LEN;
  207. ep_cfg->hdr_ext.hdr_total_len_or_pad_valid = true;
  208. ep_cfg->hdr_ext.hdr_little_endian = true;
  209. ep_cfg->aggr.aggr_en = IPA_ENABLE_AGGR;
  210. ep_cfg->aggr.aggr = IPA_GENERIC;
  211. ep_cfg->aggr.aggr_byte_limit = 4;
  212. ep_cfg->aggr.aggr_time_limit = 1000;
  213. }
  214. public:
  215. UlsoHPCTest(const char* name, const char* description){
  216. m_name = name;
  217. m_description = description;
  218. m_minIPAHwType = IPA_HW_v5_0;
  219. for(size_t i=0; i<rndisHdrLen; i++){
  220. mRndisHeader[i] = i;
  221. }
  222. Register(*this);
  223. }
  224. virtual bool Run() override {
  225. string headerName("rndis");
  226. if(!m_HeaderInsertion.addHeaderHpc(headerName, mRndisHeader, rndisHdrLen, false, IPA_CLIENT_TEST_CONS)){
  227. LOG_MSG_ERROR("!m_HeaderInsertion.addHeaderHpc(headerName, mRndisHeader, 44, false, true) Failed.");
  228. return false;
  229. }
  230. vector<PacketType> packetsVec = PacketsGenerator()();
  231. for(auto& p: packetsVec){
  232. if(!singlePacketRun(p)){
  233. return false;
  234. }
  235. }
  236. if(!m_HeaderInsertion.DeleteHeader(headerName)){
  237. LOG_MSG_ERROR("Delete rndis header failed");
  238. return false;
  239. }
  240. return true;
  241. }
  242. };
  243. /* Tests Macros */
  244. #define PACKETS_GEN_MODIFY(T, I, a, b, m) PacketsGeneratorClass<T, I, a, ARRAY_SIZE(a), b, ARRAY_SIZE(b), m<UlsoPacket<T, I>>>
  245. #define PACKETS_GEN(T, I, a, b) PACKETS_GEN_MODIFY(T, I, a, b, NullPacketModifier)//todo: change macro parameters to meaningfull names
  246. ////////////////////////////////////////////////////////////////////////////////
  247. /////////// Simple Single Packet Tests //////////////
  248. ////////////////////////////////////////////////////////////////////////////////
  249. /*
  250. * Send a single packet and compare the received segments to the software simulation
  251. */
  252. constexpr size_t segmentSizes1[] = {20};
  253. constexpr float segmentsNum1[] = {5};
  254. static UlsoTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes1, segmentsNum1)> ulsoTest0 {"Single Packet: IPV4 UDP"};
  255. static UlsoTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes1, segmentsNum1)> ulsoTest1 {"Single Packet: IPV4 TCP"};
  256. static UlsoTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes1, segmentsNum1)> ulsoTest2 {"Single Packet: IPV6 UDP"};
  257. static UlsoTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes1, segmentsNum1)> ulsoTest3 {"Single Packet: IPV6 TCP"};
  258. ////////////////////////////////////////////////////////////////////////////////
  259. /////////// Segmentation & Non-Segmentation mix //////////////
  260. ////////////////////////////////////////////////////////////////////////////////
  261. /*
  262. * Send a sequence of [large, small, large, small, ...] packets and compare the received segments to the software simulation
  263. */
  264. constexpr size_t segmentSizes2[] = {10, 50, 100, 500, 1460};
  265. constexpr float segmentsNum2[] = {1, 4};
  266. static UlsoTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes2, segmentsNum2)> ulsoTest10 {"Segmentation No Segmentation IPV4 UDP"};
  267. static UlsoTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes2, segmentsNum2)> ulsoTest11 {"Segmentation No Segmentation IPV4 TCP"};
  268. static UlsoTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes2, segmentsNum2)> ulsoTest12 {"Segmentation No Segmentation IPV6 UDP"};
  269. static UlsoTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes2, segmentsNum2)> ulsoTest13 {"Segmentation No Segmentation IPV6 TCP"};
  270. ////////////////////////////////////////////////////////////////////////////////
  271. //////////////////// Zero Checksum ////////////////////
  272. ////////////////////////////////////////////////////////////////////////////////
  273. /*
  274. * Send a sequence of large packets with zero checksum=1 and compare the received segments to the software simulation
  275. */
  276. constexpr size_t segmentSizes3[] = {10, 50, 100, 500, 1460};
  277. constexpr float numSegments3[] = {4};
  278. static UlsoTest<UDPH, I4, PACKETS_GEN_MODIFY(UDPH, I4, segmentSizes3, numSegments3, ZeroChecksumPacketModifier)>
  279. ulsoTest20 {"Zero Checksum IPV4 UDP"};
  280. static UlsoTest<TCPH, I4, PACKETS_GEN_MODIFY(TCPH, I4, segmentSizes3, numSegments3, ZeroChecksumPacketModifier)>
  281. ulsoTest21 {"Zero Checksum IPV4 TCP"};
  282. static UlsoTest<UDPH, I6, PACKETS_GEN_MODIFY(UDPH, I6, segmentSizes3, numSegments3, ZeroChecksumPacketModifier)>
  283. ulsoTest22 {"Zero Checksum IPV6 UDP"};
  284. static UlsoTest<TCPH, I6, PACKETS_GEN_MODIFY(TCPH, I6, segmentSizes3, numSegments3, ZeroChecksumPacketModifier)>
  285. ulsoTest23 {"Zero Checksum IPV6 TCP"};
  286. ////////////////////////////////////////////////////////////////////////////////
  287. ///////// Segment Size Greater Than Payload Size /////////////////
  288. ////////////////////////////////////////////////////////////////////////////////
  289. /*
  290. * Send a single packet with payload size and MSS matching an edge case and edge case and compare the received segments to the software simulation.
  291. * Edge cases:
  292. * 1. payload size < MSS ==> No segmentation
  293. * 2. payload size == MSS - epsilon ==> No segmentation
  294. * 3. payload size == MSS ==> Segmentation
  295. */
  296. /* Segment Size = 100 Payload Size = 50 */
  297. constexpr size_t segmentSizes4[] = {100};
  298. constexpr float numSegments4[] = {0.5};
  299. static UlsoTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes4, numSegments4)> ulsoTest30 {"Payload Smaller Than MSS IPV4 UDP"};
  300. static UlsoTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes4, numSegments4)> ulsoTest31 {"Payload Smaller Than MSS IPV4 TCP"};
  301. static UlsoTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes4, numSegments4)> ulsoTest32 {"Payload Smaller Than MSS IPV6 UDP"};
  302. static UlsoTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes4, numSegments4)> ulsoTest33 {"Payload Smaller Than MSS IPV6 TCP"};
  303. /* Segment Size = 100 Payload Size = 99 */
  304. constexpr size_t segmentSizes5[] = {100};
  305. constexpr float numSegments5[] = {0.99};
  306. static UlsoTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes5, numSegments5)> ulsoTest40 {"Payload slightly Smaller Than MSS IPV4 UDP"};
  307. static UlsoTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes5, numSegments5)> ulsoTest41 {"Payload slightly Smaller Than MSS IPV4 TCP"};
  308. static UlsoTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes5, numSegments5)> ulsoTest42 {"Payload slightly Smaller Than MSS IPV6 UDP"};
  309. static UlsoTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes5, numSegments5)> ulsoTest43 {"Payload slightly Smaller Than MSS IPV6 TCP"};
  310. /* Segment Size = 20 Payload Size = 20 */
  311. constexpr size_t segmentSizes6[] = {100};
  312. constexpr float numSegments6[] = {1};
  313. static UlsoTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes6, numSegments6)> ulsoTest50 {"Payload Equals MSS IPV4 UDP"};
  314. static UlsoTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes6, numSegments6)> ulsoTest51 {"Payload Equals MSS IPV4 TCP"};
  315. static UlsoTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes6, numSegments6)> ulsoTest52 {"Payload Equals MSS IPV6 UDP"};
  316. static UlsoTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes6, numSegments6)> ulsoTest53 {"Payload Equals MSS IPV6 TCP"};
  317. ////////////////////////////////////////////////////////////////////////////////
  318. ////////////// Valid Segment Sizes /////////////////////
  319. ////////////////////////////////////////////////////////////////////////////////
  320. /*
  321. * Send a sequence of packets with different valid sizes and compare the received segments to the software simulation
  322. */
  323. constexpr size_t segmentSizes7[] = {1460, 1220, 512, 1};
  324. static UlsoTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes7, segmentsNum1)> ulsoTest60 {"Valid Segment Sizes IPV4 UDP"};
  325. static UlsoTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes7, segmentsNum1)> ulsoTest61 {"Valid Segment Sizes IPV4 TCP"};
  326. static UlsoTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes7, segmentsNum1)> ulsoTest62 {"Valid Segment Sizes IPV6 UDP"};
  327. static UlsoTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes7, segmentsNum1)> ulsoTest63 {"Valid Segment Sizes IPV6 TCP"};
  328. ////////////////////////////////////////////////////////////////////////////////
  329. //////////////// Big Segment Sizes /////////////////////
  330. ////////////////////////////////////////////////////////////////////////////////
  331. /*
  332. * Send a sequence of very large packets and compare the received segments to the software simulation
  333. */
  334. constexpr size_t segmentSizes8[] = {2000, 3000, 4000, 5000, 6000, 10000};
  335. static UlsoTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes8, segmentsNum1)> ulsoTest70 {"Big Segment Sizes IPV4 UDP"};
  336. static UlsoTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes8, segmentsNum1)> ulsoTest71 {"Big Segment Sizes IPV4 TCP"};
  337. static UlsoTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes8, segmentsNum1)> ulsoTest72 {"Big Segment Sizes IPV6 UDP"};
  338. static UlsoTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes8, segmentsNum1)> ulsoTest73 {"Big Segment Sizes IPV6 TCP"};
  339. ////////////////////////////////////////////////////////////////////////////////
  340. //////////////// IP ID wrapp around min/max bounds ///////////////
  341. ////////////////////////////////////////////////////////////////////////////////
  342. /*
  343. * Send a single packet such that:
  344. * IPID + #segments < MAX IPID
  345. * and compare the received segments to the software simulation
  346. */
  347. constexpr size_t segmentSizes9[] = {2000};
  348. constexpr float numSegments9[] = {10};
  349. static UlsoTest<UDPH, I4, PACKETS_GEN_MODIFY(UDPH, I4, segmentSizes9, numSegments9, OutOfBoundsPacketModifier)> ulsoTest80 {"IPID CFG IPV4 UDP"};
  350. static UlsoTest<TCPH, I4, PACKETS_GEN_MODIFY(TCPH, I4, segmentSizes9, numSegments9, OutOfBoundsPacketModifier)> ulsoTest81 {"IPID CFG IPV4 UDP"};
  351. ////////////////////////////////////////////////////////////////////////////////
  352. //////////////// HPC RNDIS Header Insertion //////////////////////
  353. ////////////////////////////////////////////////////////////////////////////////
  354. static UlsoHPCTest<UDPH, I4, PACKETS_GEN(UDPH, I4, segmentSizes1, segmentsNum1)> Ipv4UdpHpcRndisTest {"Ipv4UdpHpcRndisTest", "IPv4 + UDP"};
  355. static UlsoHPCTest<TCPH, I4, PACKETS_GEN(TCPH, I4, segmentSizes1, segmentsNum1)> Ipv4TcpHpcRndisTest {"Ipv4TcpHpcRndisTest", "IPv4 + TCP"};
  356. static UlsoHPCTest<UDPH, I6, PACKETS_GEN(UDPH, I6, segmentSizes1, segmentsNum1)> Ipv6UdpHpcRndisTest {"Ipv6UdpHpcRndisTest", "IPv6 + UDP"};
  357. static UlsoHPCTest<TCPH, I6, PACKETS_GEN(TCPH, I6, segmentSizes1, segmentsNum1)> Ipv6TcpHpcRndisTest {"Ipv6TcpHpcRndisTest", "IPv6 + TCP"};