Lines Matching refs:cpu

201 					mtcp->ctx->cpu,  in PrintThreadNetworkStats()
236 mtcp->ctx->cpu, rs->rounds / ROUND_DIV, in PrintThreadRoundStats()
253 "select: (%4luus, %4luus)\n", mtcp->ctx->cpu, in PrintThreadRoundTime()
802 "CPU %d: Flushing remaining flows.\n", mtcp->ctx->cpu); in DestroyRemainingFlows()
807 "CPU %d: Destroying stream %d\n", mtcp->ctx->cpu, walk->id); in DestroyRemainingFlows()
846 sem_wait(&g_done_sem[mtcp->ctx->cpu]); in RunPassiveLoop()
847 sem_destroy(&g_done_sem[mtcp->ctx->cpu]); in RunPassiveLoop()
869 TRACE_DBG("CPU %d: mtcp thread running.\n", ctx->cpu); in RunMainLoop()
925 struct mtcp_context mctx = {.cpu = ctx->cpu}; in RunMainLoop()
1018 if (ctx->cpu == printer) { in RunMainLoop()
1041 TRACE_DBG("MTCP thread %d out of main loop.\n", ctx->cpu); in RunMainLoop()
1044 TRACE_DBG("MTCP thread %d flushed logs.\n", ctx->cpu); in RunMainLoop()
1046 TRACE_INFO("MTCP thread %d finished.\n", ctx->cpu); in RunMainLoop()
1093 g_mtcp[ctx->cpu] = mtcp; in InitializeMTCPManager()
1210 g_config.mos->mos_log, ctx->cpu); in InitializeMTCPManager()
1217 mtcp->sp_fd = g_logctx[ctx->cpu]->pair_sp_fd; in InitializeMTCPManager()
1218 mtcp->logger = g_logctx[ctx->cpu]; in InitializeMTCPManager()
1285 int cpu = mctx->cpu; in MTCPRunThread() local
1291 mtcp_core_affinitize(cpu); in MTCPRunThread()
1302 ctx->cpu = cpu; in MTCPRunThread()
1334 g_pctx[cpu] = ctx; in MTCPRunThread()
1340 sem_post(&g_init_sem[ctx->cpu]); in MTCPRunThread()
1341 TRACE_DBG("MTCP thread %d finished. Not attached any device\n", ctx->cpu); in MTCPRunThread()
1345 TRACE_DBG("CPU %d: initialization finished.\n", cpu); in MTCPRunThread()
1346 sem_post(&g_init_sem[ctx->cpu]); in MTCPRunThread()
1351 TRACE_DBG("MTCP thread %d finished.\n", ctx->cpu); in MTCPRunThread()
1354 sem_post(&g_done_sem[mctx->cpu]); in MTCPRunThread()
1369 mtcp_create_context(int cpu) in mtcp_create_context() argument
1374 if (cpu >= g_config.mos->num_cores) { in mtcp_create_context()
1377 cpu, g_config.mos->num_cores); in mtcp_create_context()
1382 if (g_logctx[cpu] != NULL) { in mtcp_create_context()
1388 ret = sem_init(&g_init_sem[cpu], 0, 0); in mtcp_create_context()
1394 ret = sem_init(&g_done_sem[cpu], 0, 0); in mtcp_create_context()
1405 mctx->cpu = cpu; in mtcp_create_context()
1406 g_ctx[cpu] = mctx; in mtcp_create_context()
1409 g_logctx[cpu] = (struct log_thread_context *) in mtcp_create_context()
1411 if (!g_logctx[cpu]) { in mtcp_create_context()
1416 InitLogThreadContext(g_logctx[cpu], cpu); in mtcp_create_context()
1417 if (pthread_create(&log_thread[cpu], in mtcp_create_context()
1418 NULL, ThreadLogMain, (void *)g_logctx[cpu])) { in mtcp_create_context()
1431 if (master == cpu) { in mtcp_create_context()
1434 if (pthread_create(&g_thread[cpu], in mtcp_create_context()
1440 rte_eal_remote_launch(MTCPDPDKRunThread, mctx, cpu); in mtcp_create_context()
1444 if (pthread_create(&g_thread[cpu], in mtcp_create_context()
1451 sem_wait(&g_init_sem[cpu]); in mtcp_create_context()
1452 sem_destroy(&g_init_sem[cpu]); in mtcp_create_context()
1454 running[cpu] = TRUE; in mtcp_create_context()
1459 printer = cpu; in mtcp_create_context()
1471 struct mtcp_thread_context *ctx = g_pctx[mctx->cpu]; in mtcp_destroy_context()
1476 m.cpu = mctx->cpu; in mtcp_destroy_context()
1487 struct mtcp_thread_context *ctx = g_pctx[mctx->cpu]; in mtcp_free_context()
1492 TRACE_DBG("CPU %d: mtcp_free_context()\n", mctx->cpu); in mtcp_free_context()
1494 if (g_pctx[mctx->cpu] == NULL) return; in mtcp_free_context()
1516 if (master == mctx->cpu) in mtcp_free_context()
1517 pthread_join(g_thread[mctx->cpu], NULL); in mtcp_free_context()
1519 rte_eal_wait_lcore(mctx->cpu); in mtcp_free_context()
1523 pthread_join(g_thread[mctx->cpu], NULL); in mtcp_free_context()
1526 TRACE_INFO("MTCP thread %d joined.\n", mctx->cpu); in mtcp_free_context()
1528 running[mctx->cpu] = FALSE; in mtcp_free_context()
1532 if (printer == mctx->cpu) { in mtcp_free_context()
1534 if (i != mctx->cpu && running[i]) { in mtcp_free_context()
1546 TRACE_ERROR("CPU %d: Fail to signal socket pair\n", mctx->cpu); in mtcp_free_context()
1548 if ((ret = pthread_join(log_thread[ctx->cpu], NULL) != 0)) { in mtcp_free_context()
1555 TRACE_LOG("Log thread %d joined.\n", mctx->cpu); in mtcp_free_context()
1614 if (g_logctx[mctx->cpu]) { in mtcp_free_context()
1615 free(g_logctx[mctx->cpu]); in mtcp_free_context()
1616 g_logctx[mctx->cpu] = NULL; in mtcp_free_context()
1619 g_pctx[mctx->cpu] = NULL; in mtcp_free_context()