diff --git a/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c b/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c index 8d5cbd2..ebf63a6 100644 --- a/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c +++ b/DPDPU/NetworkEngine/Source/PEPOTLDKTCP.c @@ -14,6 +14,7 @@ #define RSS_RETA_CONF_ARRAY_SIZE (ETH_RSS_RETA_SIZE_512/RTE_RETA_GROUP_SIZE) #define TCP_SEQ_HASH_SEC_KEY "deadbeefbeefdead" #define TCP_MAX_PROCESS 0x20 +#define STORAGE_ENGINE_CORE 1 RTE_DEFINE_PER_LCORE(struct NetbeLcore *, _be); RTE_DEFINE_PER_LCORE(struct NetfeLcore *, _fe); @@ -2987,7 +2988,7 @@ NetfeHostRxTxProcess( // static int PEPOLcoreMain( - void *arg + void *Arg ) { int32_t result; struct LcoreParam *param; @@ -3016,7 +3017,7 @@ PEPOLcoreMain( int32_t errorCodes[MAX_PKT_BURST]; struct rte_mbuf **memBufs; - param = (struct LcoreParam*)arg; + param = (struct LcoreParam*)Arg; lcore = rte_lcore_id(); result = 0; @@ -3659,6 +3660,26 @@ PEPOLcoreMain( return result; } +// +// Storage engine execution +// +// +typedef struct { + void (*StorageEngine)(void*); + void* StorageEngineArg; +} StorageEngineT; + +static int +StorageEngineThread( + void *Arg +) { + StorageEngineT* sEng = (StorageEngineT*)Arg; + + sEng->StorageEngine(sEng->StorageEngineArg); + + return 0; +} + // // Run the PEPO // @@ -3696,18 +3717,27 @@ PEPOTLDKTCPRun( // Launch the storage engine on the master lcore // // - i = rte_get_master_lcore(); #ifdef DDS_VERBOSE + i = rte_get_master_lcore(); printf("Master lcore = %d\n", i); #endif - StorageEngine(StorageEngineArg); + StorageEngineT sEng; + sEng.StorageEngine = StorageEngine; + sEng.StorageEngineArg = StorageEngineArg; + + result = rte_eal_remote_launch(StorageEngineThread, &sEng, STORAGE_ENGINE_CORE); + if (result != 0) { + RTE_LOG(ERR, USER1, "rte_eal_remote_launch failed for storage engine: err = %d, lcore = %u\n", result, STORAGE_ENGINE_CORE); + } // // Wait for all lcores to finish // // + fprintf(stdout, "Waiting for all lcores to exit...\n"); rte_eal_mp_wait_lcore(); + fprintf(stdout, "All lcores have exited\n"); return 0; }