hmbdc
simplify-high-performance-messaging-programming
DefaultUserConfig.hpp
1 #include "hmbdc/Copyright.hpp"
2 #pragma once
3 
4 namespace hmbdc { namespace app { namespace netmap {
5 /**
6  * the send and recv engine config parameters and its default values used in this module
7  * each module comes with a performance tool (perf-xxxx) that the user could experiment each of the
8  * following settings on a hardware environment
9  */
10 char const* const DefaultUserConfig = R"|(
11 {
12  "doChecksum" : false, "__doChecksum" :"calculating checksum when sending or receiving",
13  "netmapPort" : "netmapPort UNSPECIFIED", "__netmapPort" :"the default netmap device for sending/receiving, no default value",
14  "nmResetWaitSec": 2, "__nmResetWaitSec" :"when starting the engine, netmap dev is reset for read and write this is the delay for it to finish",
15  "schedPolicy" : "SCHED_OTHER", "__schedPolicy" :"engine thread schedule policy - check man page for allowed values",
16  "schedPriority" : 0, "__schedPriority" :"engine thread schedule priority - check man page for allowed values",
17  "tx" :
18  {
19  "dstEthAddr" : "ff:ff:ff:ff:ff:ff", "__dstEthAddr" :"used in the ethernet frame composed by the send engine",
20  "dstIp" : "10.1.0.1", "__dstIp" :"used in the ethernet frame composed by the send engine",
21  "dstPort" : 1234, "__dstPort" :"used in the ethernet frame composed by the send engine",
22  "hmbdcName" : "netmap-tx", "__hmbdcName" :"engine thread name",
23  "maxSendBatch" : 60, "__maxSendBatch" :"up to how many messages to send in a batch (within one udp packet)",
24  "mtu" : 1500, "__mtu" :"mtu, check ifconfig output for this value for each NIC in use",
25  "nmOpenFlags" : 4096, "__nmOpenFlags" :"flags when open the netmap device for sending, default to be 0x1000, which is NETMAP_NO_TX_POLL",
26  "outBufferSizePower2" : 0, "__outBufferSizePower2" :"2^outBufferSizePower2 is the number of message that can be buffered in the engine, default 0 means automatically calculated based on 16KB as the low bound",
27  "sendBytesBurst" : 0, "__sendBytesBurst" :"rate control for how many bytes can be sent in a burst, us the OS buffer size (131071) as reference, 0 means no rate control.",
28  "sendBytesPerSec" : 110000000, "__sendBytesPerSec" :"rate control for how many bytes per second - it is turned off by sendBytesBurst==0.",
29  "srcEthAddr" : "00:00:00:00:00:00", "__srcEthAddr" :"used in the ethernet frame composed by the send engine",
30  "srcIp" : "10.0.0.1", "__srcIp" :"used in the ethernet frame composed by the send engine",
31  "srcPort" : 1234, "__srcPort" :"used in the ethernet frame composed by the send engine",
32  "topicRegex" : ".*", "__topicRegex" :"the topic regex pattern this send engine covers, there shall NOT be an overlap of this pattern between differt send engines in the NetContext, otherwise the first engine is used",
33  "ttl" : 1, "__ttl" :"the switch hop number"
34  },
35  "rx" :
36  {
37  "busyWait" : true, "__busyWait" :"when true, busy wit for the packet to arrive",
38  "cmdBufferSizePower2" : 10, "__cmdBufferSizePower2" :"2^cmdBufferSizePower2 is the engine command buffer size - rarely need to change",
39  "hmbdcName" : "netmap-rx", "__hmbdcName" :"engine thread name",
40  "nmOpenFlags" : 0, "__nmOpenFlags" :"flags when open the netmap device for recving",
41  "pollWaitTimeMillisec" : 10, "__pollWaitTimeMillisec" :"when busyWait == false, this is the time limit used for each polling "
42  }
43 }
44 )|";
45 }}}
46 
char const *const DefaultUserConfig
Definition: DefaultUserConfig.hpp:10
Definition: Base.hpp:12