#define TOTAL_FREE_BLOCKS ( 50 * 12)
#define ALLOC_TRACK_SIZE ( 16384 )
-#define MEMORY_CORRUPTION_DETECT
+//#define MEMORY_CORRUPTION_DETECT
#define MEMORY_CORRUPTION_DETECT_FLAG (0xAB)
typedef struct wls_mac_mem_array
{
void *hWls;
void *pWlsMemBase;
+ void *pWlsMemBaseUsable;
WLS_MAC_MEM_SRUCT sWlsStruct;
- uint32_t nTotalMemorySize;
+ uint64_t nTotalMemorySize;
+ uint64_t nTotalMemorySizeUsable;
+ uint32_t nBlockSize;
uint32_t nTotalBlocks;
uint32_t nAllocBlocks;
uint32_t nTotalAllocCnt;
*
**/
//-------------------------------------------------------------------------------------------
-uint32_t wls_mac_init(char * wls_device_name, uint64_t nTotalMemorySize)
+uint32_t wls_mac_init(char * wls_device_name, uint64_t nBlockSize)
{
+ uint64_t nWlsMacMemSize;
+ uint64_t nWlsPhyMemSize;
uint32_t ret = FAILURE;
PWLS_MAC_CTX pWls = wls_mac_get_ctx();
uint8_t *pMemZone;
pWls->nTotalDlBufAllocCnt = 0;
pWls->nTotalDlBufFreeCnt = 0;
- pWls->hWls = WLS_Open(wls_device_name, WLS_MASTER_CLIENT, nTotalMemorySize);
+ pWls->hWls = WLS_Open(wls_device_name, WLS_MASTER_CLIENT, &nWlsMacMemSize, &nWlsPhyMemSize);
if (pWls->hWls)
{
/* allocate chuck of memory */
- pWls->pWlsMemBase = WLS_Alloc(pWls->hWls, nTotalMemorySize);
+ pWls->pWlsMemBase = WLS_Alloc(pWls->hWls, nWlsMacMemSize+nWlsPhyMemSize);
if (pWls->pWlsMemBase)
{
- pWls->nTotalMemorySize = (uint32_t) nTotalMemorySize;
+ pWls->nTotalMemorySize = nWlsMacMemSize;
+ // pWls->nBlockSize = wls_mac_check_block_size(nBlockSize);
ret = wls_mac_create_partition(pWls);
int argc = RTE_DIM(argv);
/* initialize EAL first */
- sprintf(whitelist, "-w %s", "0000:00:06.0");
+ sprintf(whitelist, "-a%s", "0000:00:06.0");
printf("[MAC] Calling rte_eal_init: ");
for (i = 0; i < RTE_DIM(argv); i++)