Changeset 9b69b49 for lib


Ignore:
Timestamp:
07/01/14 19:17:25 (7 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:
09dc6dc
Parents:
dafe86a
Message:

Allows multiple instances of libtrace to use the DPDK format simultaneously

  • Each must be bound to a separate port (And currently either reading or writing but not both)
  • Each process tries to allocate 250Mb of huge pages and will fail if it cannot (this should be configurable in the future)
  • It's up to the user to ensure they don't try bind to the same port twice
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_dpdk.c

    rb13b939 r9b69b49  
    392392    struct rte_pci_addr use_addr; /* The only address that we don't blacklist */   
    393393    char cpu_number[10] = {0}; /* The CPU mask we want to bind to */
     394    char mem_map[20] = {0}; /* The memory name */
    394395    long nb_cpu; /* The number of CPUs in the system */
    395396    long my_cpu; /* The CPU number we want to bind to */
     
    405406     * same card (My understanding is this should work with two seperate
    406407     * cards).
     408     *
     409     * Using unique file prefixes mean separate memory is used, unlinking
     410     * the two processes. However be careful we still cannot access a
     411     * port that already in use.
    407412     */
    408     char* argv[] = {"libtrace", "-c", NULL, "-n", "1", "--proc-type", "auto", NULL};
     413    char* argv[] = {"libtrace", "-c", cpu_number, "-n", "1", "--proc-type", "auto",
     414                "--file-prefix", mem_map, "-m", "256", NULL};
    409415    int argc = sizeof(argv) / sizeof(argv[0]) - 1;
    410416   
     
    453459    /* Make our mask */ //  0x1 << (my_cpu - 1)
    454460    snprintf(cpu_number, sizeof(cpu_number), "%x", 0x3);
    455     argv[2] = cpu_number;
    456 
     461
     462        /* Give this a name */
     463        snprintf(mem_map, sizeof(mem_map), "libtrace-%d", (int) getpid());
    457464    /* rte_eal_init it makes a call to getopt so we need to reset the
    458465     * global optind variable of getopt otherwise this fails */
Note: See TracChangeset for help on using the changeset viewer.