Changeset e3d534f
- Timestamp:
- 03/16/15 14:23:51 (6 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- 6c84681
- Parents:
- a978dec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_dpdk.c
r6a6e6a8 re3d534f 295 295 #endif 296 296 } ALIGN_STRUCT(CACHE_LINE_SIZE); 297 298 #if HAS_HW_TIMESTAMPS_82580 299 #define DPDK_EMPTY_STREAM {-1, 0, NULL, -1, 0, 0} 300 #else 301 #define DPDK_EMPTY_STREAM {-1, 0, NULL, -1} 302 #endif 297 303 298 304 typedef struct dpdk_per_stream_t dpdk_per_stream_t; … … 789 795 790 796 static int dpdk_init_input (libtrace_t *libtrace) { 791 dpdk_per_stream_t stream = {0};797 dpdk_per_stream_t stream = DPDK_EMPTY_STREAM; 792 798 char err[500]; 793 799 err[0] = 0; … … 1268 1274 int ret, i; 1269 1275 struct rte_eth_link link_info; /* Wait for link */ 1270 dpdk_per_stream_t empty_stream = {0};1276 dpdk_per_stream_t empty_stream = DPDK_EMPTY_STREAM; 1271 1277 1272 1278 /* Already started */ … … 1367 1373 stream->queue_id = i; 1368 1374 1369 /* TODO we don't use this in the single threaded framework - 1370 * So we should not reserve this */ 1371 stream->lcore = dpdk_reserve_lcore(true, format_data->nic_numa_node); 1375 if (stream->lcore == -1) 1376 stream->lcore = dpdk_reserve_lcore(true, format_data->nic_numa_node); 1372 1377 1373 1378 if (stream->lcore == -1) { … … 1409 1414 fprintf(stderr, "Doing start device\n"); 1410 1415 #endif 1416 rte_eth_stats_reset(format_data->port); 1411 1417 /* Start device */ 1412 1418 ret = rte_eth_dev_start(format_data->port); … … 1456 1462 err[0] = 0; 1457 1463 1464 /* Make sure we don't reserve an extra thread for this */ 1465 FORMAT_DATA_FIRST(libtrace)->queue_id = rte_lcore_id(); 1466 1458 1467 if (dpdk_start_streams(FORMAT(libtrace), err, sizeof(err), 1) != 0) { 1459 1468 trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "%s", err); … … 1483 1492 int i=0, phys_cores=0; 1484 1493 int tot = libtrace->perpkt_thread_count; 1494 libtrace_list_node_t *n; 1485 1495 err[0] = 0; 1486 1496 … … 1499 1509 for (i = 0; i < RTE_MAX_LCORE; ++i) { 1500 1510 if (lcore_config[i].detected) { 1501 if (rte_lcore_is_enabled(i)) 1511 if (rte_lcore_is_enabled(i)) { 1512 #if DEBUG 1502 1513 fprintf(stderr, "Found core %d already in use!\n", i); 1503 else 1514 #endif 1515 } else { 1504 1516 phys_cores++; 1505 } 1517 } 1518 } 1519 } 1520 /* If we are restarting we have already allocated some threads as such 1521 * we add these back to the count for this calculation */ 1522 for (n = FORMAT_DATA_HEAD(libtrace); n; n = n->next) { 1523 dpdk_per_stream_t * stream = n->data; 1524 if (stream->lcore != -1) 1525 phys_cores++; 1506 1526 } 1507 1527
Note: See TracChangeset
for help on using the changeset viewer.