Changeset 95364aa for lib/format_dpdk.c


Ignore:
Timestamp:
09/04/14 16:58:11 (6 years ago)
Author:
Richard Sanger <rsangerarj@…>
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
Message:

Change thresholds to work with e1000 series cards

  • Fix some typos
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dpdk.c

    r66baa54 r95364aa  
    372372#endif
    373373
    374 static inline int dpdk_init_enviroment(char * uridata, struct dpdk_format_data_t * format_data,
     374static inline int dpdk_init_environment(char * uridata, struct dpdk_format_data_t * format_data,
    375375                                        char * err, int errlen) {
    376376    int ret; /* Returned error codes */
     
    395395    int argc = sizeof(argv) / sizeof(argv[0]) - 1;
    396396   
    397     /* This initilises the Enviroment Abstraction Layer (EAL)
     397    /* This initialises the Environment Abstraction Layer (EAL)
     398    /* This initialises the Environment Abstraction Layer (EAL)
    398399     * If we had slave workers these are put into WAITING state
    399400     *
    400401     * Basically binds this thread to a fixed core, which we choose as
    401402     * 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 om
     403     * "-c" controls the cpu mask 0x1=1st core 0x2=2nd 0x4=3rd and so on
    403404     * "-n" the number of memory channels into the CPU (hardware specific)
    404405     *      - Most likely to be half the number of ram slots in your machine.
     
    508509#endif
    509510
    510     if (dpdk_init_enviroment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) {
     511    if (dpdk_init_environment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) {
    511512        trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "%s", err);
    512513        free(libtrace->format_data);
     
    541542#endif
    542543
    543     if (dpdk_init_enviroment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) {
     544    if (dpdk_init_environment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) {
    544545        trace_set_err_out(libtrace, TRACE_ERR_INIT_FAILED, "%s", err);
    545546        free(libtrace->format_data);
     
    637638static const struct rte_eth_txconf tx_conf = {
    638639        .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,
    642663        },
    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,
    645679};
    646680
     
    656690
    657691    /* First time started we need to alloc our memory, doing this here
    658      * rather than in enviroment setup because we don't have snaplen then */
     692     * rather than in environment setup because we don't have snaplen then */
    659693    if (format_data->paused == DPDK_NEVER_STARTED) {
    660694        if (format_data->snaplen == 0) {
     
    722756        return -1;
    723757    }
    724     /* Initilise the TX queue a minimum value if using this port for
     758    /* Initialise the TX queue a minimum value if using this port for
    725759     * receiving. Otherwise a larger size if writing packets.
    726760     */
     
    733767        return -1;
    734768    }
    735     /* Initilise the RX queue with some packets from memory */
     769    /* Initialise the RX queue with some packets from memory */
    736770    ret = rte_eth_rx_queue_setup(format_data->port, format_data->queue_id,
    737771                            format_data->nb_rx_buf, SOCKET_ID_ANY,
     
    768802#endif
    769803
    770     /* We have now successfully started/unpased */
     804    /* We have now successfully started/unpaused */
    771805    format_data->paused = DPDK_RUNNING;
    772806   
Note: See TracChangeset for help on using the changeset viewer.