Changeset 95364aa
- Timestamp:
- 09/04/14 16:58:11 (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:
- 3f58e38
- Parents:
- 66baa54
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/format_dpdk.c
r66baa54 r95364aa 372 372 #endif 373 373 374 static inline int dpdk_init_enviro ment(char * uridata, struct dpdk_format_data_t * format_data,374 static inline int dpdk_init_environment(char * uridata, struct dpdk_format_data_t * format_data, 375 375 char * err, int errlen) { 376 376 int ret; /* Returned error codes */ … … 395 395 int argc = sizeof(argv) / sizeof(argv[0]) - 1; 396 396 397 /* This initilises the Enviroment Abstraction Layer (EAL) 397 /* This initialises the Environment Abstraction Layer (EAL) 398 /* This initialises the Environment Abstraction Layer (EAL) 398 399 * If we had slave workers these are put into WAITING state 399 400 * 400 401 * Basically binds this thread to a fixed core, which we choose as 401 402 * the last core on the machine (assuming fewer interrupts mapped here). 402 * "-c" controls the cpu mask 0x1=1st core 0x2=2nd 0x4=3rd and so o m403 * "-c" controls the cpu mask 0x1=1st core 0x2=2nd 0x4=3rd and so on 403 404 * "-n" the number of memory channels into the CPU (hardware specific) 404 405 * - Most likely to be half the number of ram slots in your machine. … … 508 509 #endif 509 510 510 if (dpdk_init_enviro ment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) {511 if (dpdk_init_environment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) { 511 512 trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "%s", err); 512 513 free(libtrace->format_data); … … 541 542 #endif 542 543 543 if (dpdk_init_enviro ment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) {544 if (dpdk_init_environment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) { 544 545 trace_set_err_out(libtrace, TRACE_ERR_INIT_FAILED, "%s", err); 545 546 free(libtrace->format_data); … … 637 638 static const struct rte_eth_txconf tx_conf = { 638 639 .tx_thresh = { 639 .pthresh = 36,/* TX_PTHRESH prefetch */ 640 .hthresh = 0,/* TX_HTHRESH host */ 641 .wthresh = 4,/* TX_WTHRESH writeback */ 640 /** 641 * TX_PTHRESH prefetch 642 * Set on the NIC, if the number of unprocessed descriptors to queued on 643 * the card fall below this try grab at least hthresh more unprocessed 644 * descriptors. 645 */ 646 .pthresh = 36, 647 648 /* TX_HTHRESH host 649 * Set on the NIC, the batch size to prefetch unprocessed tx descriptors. 650 */ 651 .hthresh = 0, 652 653 /* TX_WTHRESH writeback 654 * Set on the NIC, the number of sent descriptors before writing back 655 * status to confirm the transmission. This is done more efficiently as 656 * a bulk DMA-transfer rather than writing one at a time. 657 * Similar to tx_free_thresh however this is applied to the NIC, where 658 * as tx_free_thresh is when DPDK will check these. This is extended 659 * upon by tx_rs_thresh (10Gbit cards) which doesn't write all 660 * descriptors rather only every n'th item, reducing DMA memory bandwidth. 661 */ 662 .wthresh = 4, 642 663 }, 643 .tx_free_thresh = 0, /* Use PMD default values */ 644 .tx_rs_thresh = 0, /* Use PMD default values */ 664 665 /* Used internally by DPDK rather than passed to the NIC. The number of 666 * packet descriptors to send before checking for any responses written 667 * back (to confirm the transmission). Default = 32 if set to 0) 668 */ 669 .tx_free_thresh = 0, 670 671 /* This is the Report Status threshold, used by 10Gbit cards, 672 * This signals the card to only write back status (such as 673 * transmission successful) after this minimum number of transmit 674 * descriptors are seen. The default is 32 (if set to 0) however if set 675 * to greater than 1 TX wthresh must be set to zero, because this is kindof 676 * a replacement. See the dpdk programmers guide for more restrictions. 677 */ 678 .tx_rs_thresh = 1, 645 679 }; 646 680 … … 656 690 657 691 /* First time started we need to alloc our memory, doing this here 658 * rather than in enviro ment setup because we don't have snaplen then */692 * rather than in environment setup because we don't have snaplen then */ 659 693 if (format_data->paused == DPDK_NEVER_STARTED) { 660 694 if (format_data->snaplen == 0) { … … 722 756 return -1; 723 757 } 724 /* Initi lise the TX queue a minimum value if using this port for758 /* Initialise the TX queue a minimum value if using this port for 725 759 * receiving. Otherwise a larger size if writing packets. 726 760 */ … … 733 767 return -1; 734 768 } 735 /* Initi lise the RX queue with some packets from memory */769 /* Initialise the RX queue with some packets from memory */ 736 770 ret = rte_eth_rx_queue_setup(format_data->port, format_data->queue_id, 737 771 format_data->nb_rx_buf, SOCKET_ID_ANY, … … 768 802 #endif 769 803 770 /* We have now successfully started/unpa sed */804 /* We have now successfully started/unpaused */ 771 805 format_data->paused = DPDK_RUNNING; 772 806
Note: See TracChangeset
for help on using the changeset viewer.