Changeset 704229c


Ignore:
Timestamp:
09/04/14 16:38:39 (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:
66baa54
Parents:
354e54a
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

    rc70f59f r704229c  
    377377    struct rte_pci_addr use_addr; /* The only address that we don't blacklist */   
    378378    char cpu_number[10] = {0}; /* The CPU mask we want to bind to */
     379    char mem_map[20] = {0}; /* The memory name */
    379380    long nb_cpu; /* The number of CPUs in the system */
    380381    long my_cpu; /* The CPU number we want to bind to */
     
    385386    rte_set_log_level(RTE_LOG_WARNING);
    386387#endif
    387     /* Using proc-type auto allows this to be either primary or secondary
    388      * Secondary allows two intances of libtrace to be used on different
    389      * ports. However current version of DPDK doesn't support this on the
    390      * same card (My understanding is this should work with two seperate
    391      * cards).
     388    /*
     389     * Using unique file prefixes mean separate memory is used, unlinking
     390     * the two processes. However be careful we still cannot access a
     391     * port that already in use.
    392392     */
    393     char* argv[] = {"libtrace", "-c", NULL, "-n", "1", "--proc-type", "auto", NULL};
     393    char* argv[] = {"libtrace", "-c", cpu_number, "-n", "1", "--proc-type", "auto",
     394                "--file-prefix", mem_map, "-m", "256", NULL};
    394395    int argc = sizeof(argv) / sizeof(argv[0]) - 1;
    395396   
     
    438439    /* Make our mask */
    439440    snprintf(cpu_number, sizeof(cpu_number), "%x", 0x1 << (my_cpu - 1));
    440     argv[2] = cpu_number;
    441 
     441
     442
     443        /* Give the memory map a unique name */
     444        snprintf(mem_map, sizeof(mem_map), "libtrace-%d", (int) getpid());
    442445    /* rte_eal_init it makes a call to getopt so we need to reset the
    443446     * global optind variable of getopt otherwise this fails */
Note: See TracChangeset for help on using the changeset viewer.