Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dpdk.c

    rb13b939 r50ce607  
    4141 */
    4242
     43#define _GNU_SOURCE
     44
    4345#include "config.h"
    4446#include "libtrace.h"
     
    7678#include <rte_lcore.h>
    7779#include <rte_per_lcore.h>
     80#include <pthread.h>
    7881
    7982/* The default size of memory buffers to use - This is the max size of standard
     
    111114#define MBUF_PKTDATA(x) ((char *) x + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
    112115#define FORMAT(x) ((struct dpdk_format_data_t*)(x->format_data))
     116#define PERPKT_FORMAT(x) ((struct dpdk_per_lcore_t*)(x->format_data))
     117
    113118#define TV_TO_NS(tv) ((uint64_t) tv.tv_sec*1000000000ull + \
    114119                        (uint64_t) tv.tv_usec*1000ull)
     
    182187};
    183188
    184 struct per_lcore_t
     189struct dpdk_per_lcore_t
    185190{
    186191        // TODO move time stamp stuff here
    187192        uint16_t queue_id;
    188193        uint8_t port;
    189         uint8_t enabled;
    190194};
    191195
     
    213217    uint32_t wrap_count; /* Number of times the NIC clock has wrapped around completely */
    214218#endif
    215         // DPDK normally seems to have a limit of
    216         struct per_lcore_t per_lcore[RTE_MAX_LCORE];
     219        // DPDK normally seems to have a limit of 8 queues for a given card
     220        struct dpdk_per_lcore_t per_lcore[RTE_MAX_LCORE];
    217221};
    218222
     
    351355    if (global_config != NULL) {
    352356        int i;
    353         printf("Intel DPDK setup\n"
     357        fprintf(stderr, "Intel DPDK setup\n"
    354358               "---Version      : %"PRIu32"\n"
    355359               "---Magic        : %"PRIu32"\n"
     
    360364       
    361365        for (i = 0 ; i < nb_cpu; i++) {
    362             printf("   ---Core %d : %s\n", i,
     366            fprintf(stderr, "   ---Core %d : %s\n", i,
    363367                   global_config->lcore_role[i] == ROLE_RTE ? "on" : "off");
    364368        }
     
    381385                proc_type = "something worse than invalid!!";
    382386        }
    383         printf("---Process Type : %s\n", proc_type);
    384     }
    385    
    386 }
    387 #endif
     387        fprintf(stderr, "---Process Type : %s\n", proc_type);
     388    }
     389   
     390}
     391#endif
     392
     393/**
     394 * Expects to be called from the master lcore and moves it to the given dpdk id
     395 * @param core (zero indexed) If core is on the physical system affinity is bound otherwise
     396 *               affinity is set to all cores. Must be less than RTE_MAX_LCORE
     397 *               and not already in use.
     398 * @return 0 is successful otherwise -1 on error.
     399 */
     400static inline int dpdk_move_master_lcore(size_t core) {
     401    struct rte_config *cfg = rte_eal_get_configuration();
     402    cpu_set_t cpuset;
     403    int i;
     404
     405    assert (core < RTE_MAX_LCORE);
     406    assert (rte_get_master_lcore() == rte_lcore_id());
     407
     408    if (core == rte_lcore_id())
     409        return 0;
     410
     411    // Make sure we are not overwriting someone else
     412    assert(!rte_lcore_is_enabled(core));
     413
     414    // Move the core
     415    cfg->lcore_role[rte_lcore_id()] = ROLE_OFF;
     416    cfg->lcore_role[core] = ROLE_RTE;
     417    lcore_config[core].thread_id = lcore_config[rte_lcore_id()].thread_id;
     418    rte_eal_get_configuration()->master_lcore = core;
     419    RTE_PER_LCORE(_lcore_id) = core;
     420
     421    // Now change the affinity
     422    CPU_ZERO(&cpuset);
     423
     424    if (lcore_config[core].detected) {
     425        CPU_SET(core, &cpuset);
     426    } else {
     427        for (i = 0; i < RTE_MAX_LCORE; ++i) {
     428            if (lcore_config[i].detected)
     429                CPU_SET(i, &cpuset);
     430        }
     431    }
     432
     433    i = pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
     434    if (i != 0) {
     435        // TODO proper libtrace style error here!!
     436        fprintf(stderr, "pthread_setaffinity_np failed\n");
     437        return -1;
     438    }
     439    return 0;
     440}
     441
    388442
    389443static inline int dpdk_init_enviroment(char * uridata, struct dpdk_format_data_t * format_data,
     
    392446    struct rte_pci_addr use_addr; /* The only address that we don't blacklist */   
    393447    char cpu_number[10] = {0}; /* The CPU mask we want to bind to */
     448    char mem_map[20] = {0}; /* The memory name */
    394449    long nb_cpu; /* The number of CPUs in the system */
    395450    long my_cpu; /* The CPU number we want to bind to */
     451    int i;
     452    struct rte_config *cfg = rte_eal_get_configuration();
    396453   
    397454#if DEBUG
     
    401458#endif
    402459    /* Using proc-type auto allows this to be either primary or secondary
    403      * Secondary allows two intances of libtrace to be used on different
     460     * Secondary allows two instances of libtrace to be used on different
    404461     * ports. However current version of DPDK doesn't support this on the
    405      * same card (My understanding is this should work with two seperate
     462     * same card (My understanding is this should work with two separate
    406463     * cards).
     464     *
     465     * Using unique file prefixes mean separate memory is used, unlinking
     466     * the two processes. However be careful we still cannot access a
     467     * port that already in use.
    407468     */
    408     char* argv[] = {"libtrace", "-c", NULL, "-n", "1", "--proc-type", "auto", NULL};
     469    char* argv[] = {"libtrace", "-c", cpu_number, "-n", "1", "--proc-type", "auto",
     470                "--file-prefix", mem_map, "-m", "256", NULL};
    409471    int argc = sizeof(argv) / sizeof(argv[0]) - 1;
    410472   
    411     /* This initilises the Enviroment Abstraction Layer (EAL)
     473    /* This initialises the Environment Abstraction Layer (EAL)
    412474     * If we had slave workers these are put into WAITING state
    413475     *
     
    451513    }
    452514
    453     /* Make our mask */ //  0x1 << (my_cpu - 1)
    454     snprintf(cpu_number, sizeof(cpu_number), "%x", 0x3);
    455     argv[2] = cpu_number;
    456 
     515    /* Make our mask with all cores turned on this is so that DPDK to gets CPU
     516       info older versions */
     517    snprintf(cpu_number, sizeof(cpu_number), "%x", ~(UINT32_MAX<<MIN(31, nb_cpu)));
     518    //snprintf(cpu_number, sizeof(cpu_number), "%x", 0x1 << (my_cpu - 1));
     519
     520        /* Give this a name */
     521        snprintf(mem_map, sizeof(mem_map), "libtrace-%d", (int) getpid());
    457522    /* rte_eal_init it makes a call to getopt so we need to reset the
    458523     * global optind variable of getopt otherwise this fails */
     
    463528        return -1;
    464529    }
     530
     531    // These are still running but will never do anything with DPDK v1.7 we
     532    // should remove this XXX in the future
     533    for(i = 0; i < RTE_MAX_LCORE; ++i) {
     534        if (rte_lcore_is_enabled(i) && i != rte_get_master_lcore()) {
     535            cfg->lcore_role[i] = ROLE_OFF;
     536            cfg->lcore_count--;
     537        }
     538    }
     539    // Only the master should be running
     540    assert(cfg->lcore_count == 1);
     541
     542    dpdk_move_master_lcore(my_cpu-1);
     543
    465544#if DEBUG
    466545    dump_configuration();
     
    505584    char err[500];
    506585    err[0] = 0;
    507     int i;
    508586   
    509587    libtrace->format_data = (struct dpdk_format_data_t *)
     
    525603    FORMAT(libtrace)->wrap_count = 0;
    526604#endif
    527         for (i = 0;i < RTE_MAX_LCORE; i++) {
    528                 // Disabled by default
    529                 FORMAT(libtrace)->per_lcore[i].enabled = 0;
    530         }
    531605       
    532606    if (dpdk_init_enviroment(libtrace->uridata, FORMAT(libtrace), err, sizeof(err)) != 0) {
     
    591665                                        return -1;
    592666                        }
     667        break;
    593668        }
    594669        return -1;
     
    688763static const struct rte_eth_txconf tx_conf = {
    689764        .tx_thresh = {
    690                 .pthresh = 36,/* TX_PTHRESH prefetch */
    691                 .hthresh = 0,/* TX_HTHRESH host */
    692                 .wthresh = 4,/* TX_WTHRESH writeback */
     765        /**
     766         * TX_PTHRESH prefetch
     767         * Set on the NIC, if the number of unprocessed descriptors to queued on
     768         * the card fall below this try grab at least hthresh more unprocessed
     769         * descriptors.
     770         */
     771                .pthresh = 36,
     772
     773        /* TX_HTHRESH host
     774         * Set on the NIC, the batch size to prefetch unprocessed tx descriptors.
     775         */
     776                .hthresh = 0,
     777       
     778        /* TX_WTHRESH writeback
     779         * Set on the NIC, the number of sent descriptors before writing back
     780         * status to confirm the transmission. This is done more efficiently as
     781         * a bulk DMA-transfer rather than writing one at a time.
     782         * Similar to tx_free_thresh however this is applied to the NIC, where
     783         * as tx_free_thresh is when DPDK will check these. This is extended
     784         * upon by tx_rs_thresh (10Gbit cards) which doesn't write all
     785         * descriptors rather only every n'th item, reducing DMA memory bandwidth.
     786         */
     787                .wthresh = 4,
    693788        },
    694         .tx_free_thresh = 0, /* Use PMD default values */
    695         .tx_rs_thresh = 0, /* Use PMD default values */
     789
     790    /* Used internally by DPDK rather than passed to the NIC. The number of
     791     * packet descriptors to send before checking for any responses written
     792     * back (to confirm the transmission). Default = 32 if set to 0)
     793     */
     794        .tx_free_thresh = 0,
     795
     796    /* This is the Report Status threshold, used by 10Gbit cards,
     797     * This signals the card to only write back status (such as
     798     * transmission successful) after this minimum number of transmit
     799     * descriptors are seen. The default is 32 (if set to 0) however if set
     800     * to greater than 1 TX wthresh must be set to zero, because this is kindof
     801     * a replacement. See the dpdk programmers guide for more restrictions.
     802     */
     803        .tx_rs_thresh = 1,
    696804};
    697805
     
    737845         */
    738846#if DEBUG
    739     printf("Creating mempool named %s\n", format_data->mempool_name);
     847    fprintf(stderr, "Creating mempool named %s\n", format_data->mempool_name);
    740848#endif
    741849        format_data->pktmbuf_pool =
     
    776884        return -1;
    777885    }
    778     /* Initilise the TX queue a minimum value if using this port for
     886    /* Initialise the TX queue a minimum value if using this port for
    779887     * receiving. Otherwise a larger size if writing packets.
    780888     */
     
    787895        return -1;
    788896    }
    789     /* Initilise the RX queue with some packets from memory */
     897    /* Initialise the RX queue with some packets from memory */
    790898    ret = rte_eth_rx_queue_setup(format_data->port, format_data->queue_id,
    791899                            format_data->nb_rx_buf, SOCKET_ID_ANY,
     
    818926    rte_eth_link_get(format_data->port, &link_info);
    819927#if DEBUG
    820     printf("Link status is %d %d %d\n", (int) link_info.link_status,
     928    fprintf(stderr, "Link status is %d %d %d\n", (int) link_info.link_status,
    821929            (int) link_info.link_duplex, (int) link_info.link_speed);
    822930#endif
    823931
    824     /* We have now successfully started/unpased */
     932    /* We have now successfully started/unpaused */
    825933    format_data->paused = DPDK_RUNNING;
    826934   
     
    828936}
    829937
    830 /* Attach memory to the port and start the port or restart the ports.
    831  */
    832 static int dpdk_start_port_queues (libtrace_t *libtrace, struct dpdk_format_data_t * format_data, char *err, int errlen, uint16_t rx_queues){
     938/* Attach memory to the port and start (or restart) the port/s.
     939 */
     940static int dpdk_start_port_queues (libtrace_t *libtrace, struct dpdk_format_data_t *format_data, char *err, int errlen, uint16_t rx_queues){
    833941    int ret, i; /* Check return values for errors */
    834942    struct rte_eth_link link_info; /* Wait for link */
     
    839947
    840948    /* First time started we need to alloc our memory, doing this here
    841      * rather than in enviroment setup because we don't have snaplen then */
     949     * rather than in environment setup because we don't have snaplen then */
    842950    if (format_data->paused == DPDK_NEVER_STARTED) {
    843951        if (format_data->snaplen == 0) {
     
    860968
    861969        /* Create the mbuf pool, which is the place our packets are allocated
    862          * from - TODO figure out if there is is a free function (I cannot see one) 
     970         * from - TODO figure out if there is is a free function (I cannot see one)
    863971         * NOTE: RX queue requires nb_packets + 1 otherwise it fails to
    864972         * allocate however that extra 1 packet is not used.
     
    9081016    printf("Doing dev configure\n");
    9091017#endif
    910     /* Initilise the TX queue a minimum value if using this port for
     1018    /* Initialise the TX queue a minimum value if using this port for
    9111019     * receiving. Otherwise a larger size if writing packets.
    9121020     */
     
    9241032    printf("Doing queue configure\n");
    9251033#endif 
    926                 /* Initilise the RX queue with some packets from memory */
     1034                /* Initialise the RX queue with some packets from memory */
    9271035                ret = rte_eth_rx_queue_setup(format_data->port, i,
    9281036                                                                format_data->nb_rx_buf, SOCKET_ID_ANY,
    9291037                                                                &rx_conf, format_data->pktmbuf_pool);
     1038        /* Init per_thread data structures */
     1039        format_data->per_lcore[i].port = format_data->port;
     1040        format_data->per_lcore[i].queue_id = i;
     1041
    9301042                if (ret < 0) {
    9311043                        snprintf(err, errlen, "Intel DPDK - Cannot configure RX queue on port"
     
    9371049   
    9381050#if DEBUG
    939     printf("Doing start device\n");
     1051    fprintf(stderr, "Doing start device\n");
    9401052#endif 
    9411053    /* Start device */
    9421054    ret = rte_eth_dev_start(format_data->port);
    9431055#if DEBUG
    944     printf("Done start device\n");
     1056    fprintf(stderr, "Done start device\n");
    9451057#endif 
    9461058    if (ret < 0) {
     
    9721084    rte_eth_link_get(format_data->port, &link_info);
    9731085#if DEBUG
    974     printf("Link status is %d %d %d\n", (int) link_info.link_status,
     1086    fprintf(stderr, "Link status is %d %d %d\n", (int) link_info.link_status,
    9751087            (int) link_info.link_duplex, (int) link_info.link_speed);
    9761088#endif
     
    9921104}
    9931105
     1106static inline size_t dpdk_get_max_rx_queues (uint8_t port_id) {
     1107    struct rte_eth_dev_info dev_info;
     1108    rte_eth_dev_info_get(port_id, &dev_info);
     1109    return dev_info.max_rx_queues;
     1110}
     1111
     1112static inline size_t dpdk_processor_count () {
     1113    long nb_cpu = sysconf(_SC_NPROCESSORS_ONLN);
     1114    if (nb_cpu <= 0)
     1115        return 1;
     1116    else
     1117        return (size_t) nb_cpu;
     1118}
     1119
    9941120static int dpdk_pstart_input (libtrace_t *libtrace) {
    9951121    char err[500];
    996     int enabled_lcore_count = 0, i=0;
     1122    int i=0, phys_cores=0;
    9971123    int tot = libtrace->perpkt_thread_count;
    9981124    err[0] = 0;
    999        
    1000         libtrace->perpkt_thread_count;
    1001        
    1002         for (i = 0; i < RTE_MAX_LCORE; i++)
    1003         {
    1004                 if (rte_lcore_is_enabled(i))
    1005                         enabled_lcore_count++;
    1006         }
    1007        
    1008         tot = MIN(libtrace->perpkt_thread_count, enabled_lcore_count);
    1009         tot = MIN(tot, 8);
    1010         printf("Running pstart DPDK %d %d %d %d\n", tot, libtrace->perpkt_thread_count, enabled_lcore_count, rte_lcore_count());
     1125
     1126    if (rte_lcore_id() != rte_get_master_lcore())
     1127        fprintf(stderr, "Warning dpdk_pstart_input should be called from the master DPDK thread!\n");
     1128
     1129    // If the master is not on the last thread we move it there
     1130    if (rte_get_master_lcore() != RTE_MAX_LCORE - 1) {
     1131        // Consider error handling here
     1132        dpdk_move_master_lcore(RTE_MAX_LCORE - 1) == -1;
     1133    }
     1134
     1135    // Don't exceed the number of cores in the system/detected by dpdk
     1136    // We don't have to force this but performance wont be good if we don't
     1137    for (i = 0; i < RTE_MAX_LCORE; ++i) {
     1138        if (lcore_config[i].detected) {
     1139            if (rte_lcore_is_enabled(i))
     1140                fprintf(stderr, "Found core %d already in use!\n", i);
     1141            else
     1142                phys_cores++;
     1143        }
     1144    }
     1145
     1146        tot = MIN(libtrace->perpkt_thread_count, dpdk_get_max_rx_queues(FORMAT(libtrace)->port));
     1147    tot = MIN(tot, phys_cores);
     1148
     1149        fprintf(stderr, "Running pstart DPDK tot=%d req=%d phys=%d\n", tot, libtrace->perpkt_thread_count, phys_cores);
    10111150       
    10121151    if (dpdk_start_port_queues(libtrace, FORMAT(libtrace), err, sizeof(err), tot) != 0) {
     
    10161155        return -1;
    10171156    }
    1018    
     1157
     1158    // Make sure we only start the number that we should
     1159    libtrace->perpkt_thread_count = tot;
    10191160    return 0;
    1020     return tot;
     1161}
     1162
     1163
     1164/**
     1165 * Register a thread with the DPDK system,
     1166 * When we start DPDK in parallel libtrace we move the 'main thread' to the
     1167 * MAXIMUM CPU core slot (32) and remove any affinity restrictions DPDK
     1168 * gives it.
     1169 *
     1170 * We then allow a mapper thread to be started on every real core as DPDK would
     1171 * we also bind these to the corresponding CPU cores.
     1172 *
     1173 * @param libtrace A pointer to the trace
     1174 * @param reading True if the thread will be used to read packets, i.e. will
     1175 *                call pread_packet(), false if thread used to process packet
     1176 *                in any other manner including statistics functions.
     1177 */
     1178static int dpdk_pregister_thread(libtrace_t *libtrace, libtrace_thread_t *t, bool reading)
     1179{
     1180    struct rte_config *cfg = rte_eal_get_configuration();
     1181    int i;
     1182    int new_id = -1;
     1183
     1184    // If 'reading packets' fill in cores from 0 up and bind affinity
     1185    // otherwise start from the MAX core (which is also the master) and work backwards
     1186    // in this case physical cores on the system will not exist so we don't bind
     1187    // these to any particular physical core
     1188    if (reading) {
     1189        for (i = 0; i < RTE_MAX_LCORE; ++i) {
     1190            if (!rte_lcore_is_enabled(i)) {
     1191                new_id = i;
     1192                if (!lcore_config[i].detected)
     1193                    fprintf(stderr, "Warning the number of 'reading' threads exceed cores on machine!!\n");
     1194                break;
     1195            }
     1196        }
     1197    } else {
     1198        for (i = RTE_MAX_LCORE-1; i >= 0; --i) {
     1199            if (!rte_lcore_is_enabled(i)) {
     1200                new_id = i;
     1201                break;
     1202            }
     1203        }
     1204    }
     1205
     1206    if (new_id == -1) {
     1207        assert(cfg->lcore_count == RTE_MAX_LCORE);
     1208        // TODO proper libtrace style error here!!
     1209        fprintf(stderr, "Too many threads for DPDK!!\n");
     1210        return -1;
     1211    }
     1212
     1213    // Enable the core in global DPDK structs
     1214    cfg->lcore_role[new_id] = ROLE_RTE;
     1215    cfg->lcore_count++;
     1216    // Set TLS to reflect our new number
     1217    assert(rte_lcore_id() == 0); // I think new threads are going get a default thread number of 0
     1218    fprintf(stderr, "original id%d", rte_lcore_id());
     1219    RTE_PER_LCORE(_lcore_id) = new_id;
     1220    fprintf(stderr, " new id%d\n", rte_lcore_id());
     1221
     1222    if (reading) {
     1223        // Set affinity bind to corresponding core
     1224        cpu_set_t cpuset;
     1225        CPU_ZERO(&cpuset);
     1226        CPU_SET(rte_lcore_id(), &cpuset);
     1227        i = pthread_setaffinity_np(pthread_self(), sizeof(cpuset), &cpuset);
     1228        if (i != 0) {
     1229            fprintf(stderr, "Warning pthread_setaffinity_np failed\n");
     1230            return -1;
     1231        }
     1232    }
     1233
     1234    // Map our TLS to the thread data
     1235    if (reading) {
     1236        if(t->type == THREAD_PERPKT) {
     1237            t->format_data = &FORMAT(libtrace)->per_lcore[t->perpkt_num];
     1238        } else {
     1239            t->format_data = &FORMAT(libtrace)->per_lcore[0];
     1240        }
     1241    }
     1242}
     1243
     1244
     1245/**
     1246 * Unregister a thread with the DPDK system.
     1247 *
     1248 * Only previously registered threads should be calling this just before
     1249 * they are destroyed.
     1250 */
     1251static int dpdk_punregister_thread(libtrace_t libtrace, libtrace_thread_t *t UNUSED)
     1252{
     1253    struct rte_config *cfg = rte_eal_get_configuration();
     1254
     1255    assert(rte_lcore_id() >= 0 && rte_lcore_id() < RTE_MAX_LCORE);
     1256
     1257    // Skip if master!!
     1258    if (rte_lcore_id() == rte_get_master_lcore()) {
     1259        fprintf(stderr, "INFO: we are skipping unregistering the master lcore\n");
     1260        return 0;
     1261    }
     1262
     1263    // Disable this core in global DPDK structs
     1264    cfg->lcore_role[rte_lcore_id()] = ROLE_OFF;
     1265    cfg->lcore_count--;
     1266    RTE_PER_LCORE(_lcore_id) = -1; // Might make the world burn if used again
     1267    assert(cfg->lcore_count >= 1); // We cannot unregister the master LCORE!!
     1268    return 0;
    10211269}
    10221270
     
    10391287    if (FORMAT(libtrace)->paused == DPDK_RUNNING) {
    10401288#if DEBUG     
    1041         printf("Pausing port\n");
     1289        fprintf(stderr, "Pausing port\n");
    10421290#endif
    10431291        rte_eth_dev_stop(FORMAT(libtrace)->port);
     
    13961644    return -1;
    13971645}
    1398 libtrace_thread_t * get_thread_table(libtrace_t *libtrace);
    1399 static int dpdk_pread_packet (libtrace_t *libtrace, libtrace_packet_t *packet) {
     1646
     1647static int dpdk_pread_packet (libtrace_t *libtrace, libtrace_thread_t *t, libtrace_packet_t *packet) {
    14001648    int nb_rx; /* Number of rx packets we've recevied */
    14011649    struct rte_mbuf* pkts_burst[1]; /* Array of 1 pointer(s) */
     
    14041652    if (packet->buffer != NULL) {
    14051653        /* Buffer is owned by DPDK */
    1406         if ( packet->buf_control == TRACE_CTRL_EXTERNAL ) {
     1654        if ( packet->buf_control == TRACE_CTRL_EXTERNAL) {
    14071655            rte_pktmbuf_free(packet->buffer);
    14081656            packet->buffer = NULL;
     
    14211669    while (1) {
    14221670        /* Poll for a single packet */
    1423         nb_rx = rte_eth_rx_burst(FORMAT(libtrace)->port,
    1424                             get_thread_table_num(libtrace), pkts_burst, 1);
     1671        nb_rx = rte_eth_rx_burst(PERPKT_FORMAT(t)->port,
     1672                            PERPKT_FORMAT(t)->queue_id, pkts_burst, 1);
    14251673        if (nb_rx > 0) { /* Got a packet - otherwise we keep spining */
    1426                         printf("Doing P READ PACKET port=%d q=%d\n", (int) FORMAT(libtrace)->port, (int) get_thread_table_num(libtrace));
     1674                        //fprintf(stderr, "Doing P READ PACKET port=%d q=%d\n", (int) FORMAT(libtrace)->port, (int) get_thread_table_num(libtrace));
    14271675            return dpdk_ready_pkt(libtrace, packet, pkts_burst[0]);
    14281676        }
    14291677        // Check the message queue this could be (Well it shouldn't but anyway) be less than 0
    1430         if (libtrace_message_queue_count(&(get_thread_table(libtrace)->messages)) > 0) {
     1678        if (libtrace_message_queue_count(&t->messages) > 0) {
    14311679                        printf("Extra message yay");
    14321680                        return -2;
     
    16411889        dpdk_pause_input, /* ppause */
    16421890        dpdk_fin_input, /* p_fin */
    1643         dpdk_pconfig_input /* pconfig_input */
     1891        dpdk_pconfig_input, /* pconfig_input */
     1892    dpdk_pregister_thread, /* pregister_thread */
     1893    dpdk_punregister_thread /* unpregister_thread */
    16441894};
    16451895
Note: See TracChangeset for help on using the changeset viewer.