Changeset 6d17620 for lib


Ignore:
Timestamp:
04/30/18 14:01:04 (3 years ago)
Author:
Richard Sanger <rsanger@…>
Branches:
cachetimestamps, develop, etsilive, master, rc-4.0.4, ringdecrementfix, ringperformance
Children:
1f7f10c, bd51874
Parents:
c22a4bb
Message:

Updates to DPDK to build with 18.02.1

  • Updates to improve backwards compatibility
  • Update to use a new portid_t as the size has changed between releases
  • Fix bug with variable order in tx, both values were zero so this didn't matter
  • Update build script to test newer dpdk versions, remove older versions no longer supported by new kernels
Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dpdk.c

    r8ed07df r6d17620  
    9090struct dpdk_format_data_t {
    9191        int8_t promisc; /* promiscuous mode - RX only */
    92         uint8_t port; /* Always 0 we only whitelist a single port - Shared TX & RX */
    93         uint8_t nb_ports; /* Total number of usable ports on system should be 1 */
    9492        uint8_t paused; /* See paused_state */
     93        portid_t port; /* Always 0 we only whitelist a single port - Shared TX & RX */
     94        portid_t nb_ports; /* Total number of usable ports on system should be 1 */
    9595        uint16_t link_speed; /* Link speed 10,100,1000,10000 etc. */
    9696        int snaplen; /* The snap length for the capture - RX only */
     
    214214        int matches;
    215215        assert(str);
     216#if RTE_VERSION >= RTE_VERSION_NUM(17, 8, 0, 1)
    216217        matches = sscanf(str, "%8"SCNx32":%2"SCNx8":%2"SCNx8".%2"SCNx8"-%ld",
    217218                         &addr->domain, &addr->bus, &addr->devid,
    218219                         &addr->function, core);
     220#else
     221        matches = sscanf(str, "%4"SCNx16":%2"SCNx8":%2"SCNx8".%2"SCNx8"-%ld",
     222                         &addr->domain, &addr->bus, &addr->devid,
     223                         &addr->function, core);
     224#endif
    219225        if (matches >= 4) {
    220226                return 0;
     
    816822 * @param cb_arg The dpdk_format_data_t structure associated with the format
    817823 */
    818 static int dpdk_lsc_callback(uint16_t port, enum rte_eth_event_type event,
     824#if RTE_VERSION >= RTE_VERSION_NUM(17, 8, 0, 1)
     825static int dpdk_lsc_callback(portid_t port, enum rte_eth_event_type event,
    819826                              void *cb_arg, void *retparam UNUSED) {
     827#else
     828static void dpdk_lsc_callback(portid_t port, enum rte_eth_event_type event,
     829                              void *cb_arg) {
     830#endif
    820831        struct dpdk_format_data_t * format_data = cb_arg;
    821832        struct rte_eth_link link_info;
     
    852863        }
    853864#endif
     865#if RTE_VERSION >= RTE_VERSION_NUM(17, 8, 0, 1)
    854866        return 0;
     867#endif
    855868}
    856869
     
    11711184        if (ret < 0) {
    11721185                snprintf(err, errlen, "Intel DPDK - Cannot configure TX queue"
    1173                          " on port %"PRIu8" : %s", format_data->port,
     1186                         " on port %d : %s", (int)format_data->port,
    11741187                         strerror(-ret));
    11751188                return -1;
     
    12201233                if (ret < 0) {
    12211234                        snprintf(err, errlen, "Intel DPDK - Cannot configure"
    1222                                  " RX queue on port %"PRIu8" : %s",
    1223                                  format_data->port,
     1235                                 " RX queue on port %d : %s",
     1236                                 (int)format_data->port,
    12241237                                 strerror(-ret));
    12251238                        return -1;
     
    12901303}
    12911304
    1292 static inline size_t dpdk_get_max_rx_queues (uint8_t port_id) {
     1305static inline size_t dpdk_get_max_rx_queues (portid_t port_id) {
    12931306        struct rte_eth_dev_info dev_info;
    12941307        rte_eth_dev_info_get(port_id, &dev_info);
     
    15111524                memcpy(rte_pktmbuf_append(m_buff[0], caplen), packet->payload, caplen);
    15121525                do {
    1513                         ret = rte_eth_tx_burst(0 /*queue TODO*/, FORMAT(trace)->port, m_buff, 1);
     1526                        ret = rte_eth_tx_burst(FORMAT(trace)->port, 0 /*queue TODO*/, m_buff, 1);
    15141527                } while (ret != 1);
    15151528        }
  • lib/format_dpdk.h

    r8efa986 r6d17620  
    113113#define rte_mempool_in_use_count rte_mempool_free_count
    114114#endif
     115
     116/* 17.05-rc1 deprecated, 17.08 removed
     117 * rte_set_log_level -> rte_log_set_global_level
     118 */
     119#if RTE_VERSION < RTE_VERSION_NUM(17, 5, 0, 1)
     120#define rte_log_set_global_level rte_set_log_level
     121#endif
     122
     123/* 17.11-rc1 increases port size from 8 to 16bits
     124 */
     125#if RTE_VERSION >= RTE_VERSION_NUM(17, 11, 0, 1)
     126typedef uint16_t portid_t;
     127#else
     128typedef uint8_t portid_t;
     129#endif
     130
    115131
    116132#include <rte_per_lcore.h>
Note: See TracChangeset for help on using the changeset viewer.