Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Commit

Permalink
[WIP] Run DDS all together
Browse files Browse the repository at this point in the history
  • Loading branch information
qizzz committed Dec 10, 2023
1 parent 69432cb commit a3b0044
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
10 changes: 6 additions & 4 deletions DPDPU/Main/NetworkConfig.json
Original file line number Diff line number Diff line change
@@ -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": "",
},
Expand All @@ -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",
}
}
2 changes: 1 addition & 1 deletion DPDPU/Main/Run.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
./build/DDSMain --json NetworkConfig.json --json StorageConfig.json
./build/DDSMain -c "0xff" --json StorageConfig.json --json NetworkConfig.json
28 changes: 16 additions & 12 deletions DPDPU/Main/Source/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");

//
Expand Down
2 changes: 1 addition & 1 deletion DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit a3b0044

Please sign in to comment.