Changeset 4631115 for lib/format_dpdk.c


Ignore:
Timestamp:
02/13/15 13:23:34 (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:
de74f88
Parents:
0b01fea (diff), 92d5f15 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into develop.

Update to include fixes/features etc from the 3.0.22 release.

Conflicts:

README
lib/format_dag25.c
lib/format_dpdk.c
lib/format_linux.c
lib/trace.c
test/Makefile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dpdk.c

    r12ae766 r4631115  
     1
    12/*
    23 * This file is part of libtrace
     
    7677 * code (that we still attempt to support).
    7778 *
    78  * Currently 1.5 to 1.7 is supported.
     79 * DPDK v1.7.1 is recommended.
     80 * However 1.5 to 1.8 are likely supported.
    7981 */
    8082#include <rte_eal.h>
     
    118120#else
    119121#       define DPDK_USE_PMD_INIT 0
     122#endif
     123
     124/* 1.7.0-rc3 :
     125 *
     126 * Since 1.7.0-rc3 rte_eal_pci_probe is called as part of rte_eal_init.
     127 * Somewhere between 1.7 and 1.8 calling it twice broke so we should not call
     128 * it twice.
     129 */
     130#if RTE_VERSION < RTE_VERSION_NUM(1, 7, 0, 3)
     131#       define DPDK_USE_PCI_PROBE 1
     132#else
     133#       define DPDK_USE_PCI_PROBE 0
     134#endif
     135
     136/* 1.8.0-rc1 :
     137 * LOG LEVEL is a command line option which overrides what
     138 * we previously set it to.
     139 */
     140#if RTE_VERSION >= RTE_VERSION_NUM(1, 8, 0, 1)
     141#       define DPDK_USE_LOG_LEVEL 1
     142#else
     143#       define DPDK_USE_LOG_LEVEL 0
    120144#endif
    121145
     
    390414    int matches;
    391415    assert(str);
    392     matches = sscanf(str, "%4"SCNx16":%2"SCNx8":%2"SCNx8".%2"SCNx8"-%ld", &addr->domain, &addr->bus, &addr->devid, &addr->function, core);
     416    matches = sscanf(str, "%4"SCNx16":%2"SCNx8":%2"SCNx8".%2"SCNx8"-%ld",
     417                     &addr->domain, &addr->bus, &addr->devid, &addr->function, core);
    393418    if (matches >= 4) {
    394         return 0;
     419        return 0;
    395420    } else {
    396         return -1;
     421        return -1;
    397422    }
    398423}
     
    584609     * port that already in use.
    585610     */
    586     char* argv[] = {"libtrace", "-c", cpu_number, "-n", "1", "--proc-type", "auto",
    587                 "--file-prefix", mem_map, "-m", "980", NULL};
     611    char* argv[] = {"libtrace",
     612                    "-c", cpu_number,
     613                    "-n", "1",
     614                    "--proc-type", "auto",
     615                    "--file-prefix", mem_map,
     616                    "-m", "256",
     617#if DPDK_USE_LOG_LEVEL
     618#       if DEBUG
     619                    "--log-level", "8", /* RTE_LOG_DEBUG */
     620#       else
     621                    "--log-level", "5", /* RTE_LOG_WARNING */
     622#       endif
     623#endif
     624                    NULL};
    588625    int argc = sizeof(argv) / sizeof(argv[0]) - 1;
    589626
     
    709746
    710747#if DPDK_USE_BLACKLIST
    711     /* Black list all ports besides the one that we want to use */
     748    /* Blacklist all ports besides the one that we want to use */
    712749        if ((ret = blacklist_devices(format_data, &use_addr)) < 0) {
    713750                snprintf(err, errlen, "Intel DPDK - Whitelisting PCI device failed,"
     
    717754#endif
    718755
     756#if DPDK_USE_PCI_PROBE
    719757    /* This loads DPDK drivers against all ports that are not blacklisted */
    720758        if ((ret = rte_eal_pci_probe()) < 0) {
     
    723761        return -1;
    724762    }
     763#endif
    725764
    726765    format_data->nb_ports = rte_eth_dev_count();
     
    18431882
    18441883#if GET_MAC_CRC_CHECKSUM
     1884<<<<<<< HEAD
    18451885                /* Add back in the CRC sum */
    18461886                pkts[i]->pkt.pkt_len += ETHER_CRC_LEN;
    18471887                pkts[i]->pkt.data_len += ETHER_CRC_LEN;
    18481888                hdr->flags |= INCLUDES_CHECKSUM;
     1889=======
     1890    /* Add back in the CRC sum */
     1891    rte_pktmbuf_pkt_len(pkt) += ETHER_CRC_LEN;
     1892    rte_pktmbuf_data_len(pkt) += ETHER_CRC_LEN;
     1893    hdr->flags |= INCLUDES_CHECKSUM;
     1894>>>>>>> master
    18491895#endif
    18501896
Note: See TracChangeset for help on using the changeset viewer.