diff --git a/DPDPU/Main/NetworkConfig.json b/DPDPU/Main/NetworkConfig.json index 85fd48f..bce16e1 100644 --- a/DPDPU/Main/NetworkConfig.json +++ b/DPDPU/Main/NetworkConfig.json @@ -1,5 +1,7 @@ { "doca_dpdk_flags":{ + // -c - Hexadecimal bitmask of cores to run on + "core-mask": "0xFF", // Additional DPDK (EAL) flags (if needed) "flags": "", }, @@ -22,13 +24,13 @@ "dpu-ipv4": "10.10.1.12", // -f - Set forwarding rules "fwd-rules": "10.10.1.1/32 b8:ce:f6:cc:96:e4", - // -c - Set the number of cores - "num-cores": 4, - // -l - Set the core list - "core-list": "0,1,2,3", // -p - Set the host port "host-port": 3232, // -d - Set if use DPDK "use-dpdk" : 1, + // -c - Set the number of cores + "num-cores": 1, + // -l - Set the core list + "core-list": "0", } } diff --git a/DPDPU/Main/Run.sh b/DPDPU/Main/Run.sh index 2f1d4dc..83ef652 100755 --- a/DPDPU/Main/Run.sh +++ b/DPDPU/Main/Run.sh @@ -1 +1 @@ -./build/DDSMain --json NetworkConfig.json --json StorageConfig.json +./build/DDSMain -c "0xff" --json StorageConfig.json --json NetworkConfig.json diff --git a/DPDPU/Main/Source/Main.c b/DPDPU/Main/Source/Main.c index d67329e..3b325f0 100644 --- a/DPDPU/Main/Source/Main.c +++ b/DPDPU/Main/Source/Main.c @@ -36,19 +36,22 @@ main( // pthread_t sEng; StorageEnginePara sEngPara; - char* argv[3]; + char* argvStorage[5]; + char* argvNetwork[3]; int ret; - if (Argc != 5) { - fprintf(stderr, "Usage: %s --json [network config] --json [storage config]\n", Argv[0]); + if (Argc != 7) { + fprintf(stderr, "Usage: %s -c [core mask] --json [storage config] --json [network config] \n", Argv[0]); return -1; } - argv[0] = Argv[0]; - argv[1] = Argv[3]; - argv[2] = Argv[4]; - sEngPara.Argc = 3; - sEngPara.Argv = argv; + argvStorage[0] = Argv[0]; + argvStorage[1] = Argv[1]; + argvStorage[2] = Argv[2]; + argvStorage[3] = Argv[3]; + argvStorage[4] = Argv[4]; + sEngPara.Argc = 5; + sEngPara.Argv = argvStorage; fprintf(stdout, "Starting storage engine...\n"); ret = pthread_create(&sEng, NULL, StorageEngine, (void*)&sEngPara); @@ -63,16 +66,17 @@ main( // Wait a few seconds before DPDK is initialized in SPDK // // - sleep(5); + sleep(10); fprintf(stdout, "Starting network engine...\n"); // // Run network engine // // - argv[1] = Argv[1]; - argv[2] = Argv[2]; - ret = RunBOW(3, argv); + argvNetwork[0] = Argv[0]; + argvNetwork[1] = Argv[5]; + argvNetwork[2] = Argv[6]; + ret = RunBOW(3, argvNetwork); fprintf(stdout, "Network engine exited\n"); // diff --git a/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c b/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c index aa5ad47..8a6ae66 100644 --- a/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c +++ b/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c @@ -25,11 +25,11 @@ static const uint64_t PEPOTxOffload = DEV_TX_OFFLOAD_IPV4_CKSUM | DEV_TX_OFFLOAD static const uint32_t PEPOMtuSize = RTE_ETHER_MAX_LEN - RTE_ETHER_CRC_LEN; static const uint32_t PEPONumPorts = 1; static const uint32_t PEPOPortId = 0; -static const char PEPOIPv4Addr[16]; static const char* ClientIPv4Addr = "0.0.0.0"; static const uint16_t ClientTCPPort = 0; static const char* ClientEtherAddr = "ff:ff:ff:ff:ff:ff"; +static char PEPOIPv4Addr[16]; static char GlobalHostIPv4Addr[16]; static uint16_t GlobalHostTCPPort;