X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=blobdiff_plain;f=wls_lib%2Fwls_lib_dpdk.c;h=2da223765eb475d8eeb4771571d66f85835b7520;hp=f05b12c22d9c34a4d20c7f5e8036cf8c7c133185;hb=601bdead8ae15a0c7ca5dee02675808b51477269;hpb=62f80e30407337464c28193f44a5b09521a6def9 diff --git a/wls_lib/wls_lib_dpdk.c b/wls_lib/wls_lib_dpdk.c index f05b12c..2da2237 100644 --- a/wls_lib/wls_lib_dpdk.c +++ b/wls_lib/wls_lib_dpdk.c @@ -788,7 +788,7 @@ void* WLS_Alloc(void* h, unsigned int size) hp_memzone = (struct rte_memzone *)mng_memzone; pvirtAddr = (void *)hp_memzone->addr; - PLIB_DEBUG("pvirtAddr is %p\n", pvirtAddr); + if (rte_eal_process_type() == RTE_PROC_PRIMARY) { memset(pvirtAddr, 0, sizeof (wls_drv_ctx_t)); } @@ -862,6 +862,7 @@ int WLS_Put(void *h, unsigned long long pMsg, unsigned int MsgSize, unsigned sho { wls_us_ctx_t* pWls_us = (wls_us_ctx_t*) h; int ret = 0; + unsigned short nFlags = Flags & (~WLS_TF_URLLC); if (wls_check_ctx(h)) return -1; @@ -873,22 +874,22 @@ int WLS_Put(void *h, unsigned long long pMsg, unsigned int MsgSize, unsigned sho wls_mutex_lock(&wls_put_lock); - if ((WLS_FLAGS_MASK & Flags)) { // multi block transaction - if (Flags & WLS_TF_SYN) { + if ((WLS_FLAGS_MASK & nFlags)) { // multi block transaction + if (nFlags & WLS_TF_SYN) { PLIB_DEBUG("WLS_SG_FIRST\n"); if (WLS_MsgEnqueue(&pWls_us->put_queue, pMsg, MsgSize, MsgTypeID, Flags, NULL, (void*) pWls_us)) { PLIB_DEBUG("WLS_Get %lx %d type %d\n", (U64) pMsg, MsgSize, MsgTypeID); } - } else if ((Flags & WLS_TF_SCATTER_GATHER) - && !(Flags & WLS_TF_SYN) - && !(Flags & WLS_TF_FIN)) { + } else if ((nFlags & WLS_TF_SCATTER_GATHER) + && !(nFlags & WLS_TF_SYN) + && !(nFlags & WLS_TF_FIN)) { PLIB_DEBUG("WLS_SG_NEXT\n"); if (WLS_MsgEnqueue(&pWls_us->put_queue, pMsg, MsgSize, MsgTypeID, Flags, NULL, (void*) pWls_us)) { PLIB_DEBUG("WLS_Put %lx %d type %d\n", (U64) pMsg, MsgSize, MsgTypeID); } - } else if (Flags & WLS_TF_FIN) { + } else if (nFlags & WLS_TF_FIN) { if (WLS_MsgEnqueue(&pWls_us->put_queue, pMsg, MsgSize, MsgTypeID, Flags, NULL, (void*) pWls_us)) { PLIB_DEBUG("WLS_Put %lx %d type %d\n", (U64) pMsg, MsgSize, MsgTypeID); @@ -903,7 +904,7 @@ int WLS_Put(void *h, unsigned long long pMsg, unsigned int MsgSize, unsigned sho } } } else - PLIB_ERR("unsaported flags %x\n", WLS_FLAGS_MASK & Flags); + PLIB_ERR("unsupported flags %x\n", WLS_FLAGS_MASK & Flags); } else { // one block transaction if (WLS_MsgEnqueue(&pWls_us->put_queue, pMsg, MsgSize, MsgTypeID, Flags, NULL, (void*) pWls_us)) { @@ -932,6 +933,7 @@ int WLS_Put1(void *h, unsigned long long pMsg, unsigned int MsgSize, unsigned sh { wls_us_ctx_t* pWls_us = (wls_us_ctx_t*) h; int ret = 0; + unsigned short nFlags = Flags & (~WLS_TF_URLLC); if (wls_check_ctx1(h)) return -1; @@ -943,22 +945,22 @@ int WLS_Put1(void *h, unsigned long long pMsg, unsigned int MsgSize, unsigned sh wls_mutex_lock(&wls_put_lock1); - if ((WLS_FLAGS_MASK & Flags)) { // multi block transaction - if (Flags & WLS_TF_SYN) { + if ((WLS_FLAGS_MASK & nFlags)) { // multi block transaction + if (nFlags & WLS_TF_SYN) { PLIB_DEBUG("WLS_SG_FIRST\n"); if (WLS_MsgEnqueue(&pWls_us->put_queue, pMsg, MsgSize, MsgTypeID, Flags, NULL, (void*) pWls_us)) { PLIB_DEBUG("WLS_Get %lx %d type %d\n", (U64) pMsg, MsgSize, MsgTypeID); } - } else if ((Flags & WLS_TF_SCATTER_GATHER) - && !(Flags & WLS_TF_SYN) - && !(Flags & WLS_TF_FIN)) { + } else if ((nFlags & WLS_TF_SCATTER_GATHER) + && !(nFlags & WLS_TF_SYN) + && !(nFlags & WLS_TF_FIN)) { PLIB_DEBUG("WLS_SG_NEXT\n"); if (WLS_MsgEnqueue(&pWls_us->put_queue, pMsg, MsgSize, MsgTypeID, Flags, NULL, (void*) pWls_us)) { PLIB_DEBUG("WLS_Put %lx %d type %d\n", (U64) pMsg, MsgSize, MsgTypeID); } - } else if (Flags & WLS_TF_FIN) { + } else if (nFlags & WLS_TF_FIN) { if (WLS_MsgEnqueue(&pWls_us->put_queue, pMsg, MsgSize, MsgTypeID, Flags, NULL, (void*) pWls_us)) { PLIB_DEBUG("WLS_Put %lx %d type %d\n", (U64) pMsg, MsgSize, MsgTypeID);