• Robert Olsson's avatar
    pktgen: multiqueue etc. · e6fce5b9
    Robert Olsson authored
    Sofar far pktgen have had a restriction to only use one device per kernel 
    thread. With the new multiqueue architecture this is no longer adequate.
    
    The patch below is an effort to remove this by in pktgen configuration 
    adding a tag to  the device name a la eth0@0 etc. The tag is used for 
    usual device config just as before. Also a new flag is introduced to mirror 
    queue_map with sending threads smp_processor_id() QUEUE_MAP_CPU.
    
    An example: We use 4 CPU's to send to one 10g interface (eth0)
     and we use the new tagging to send a mix of packet sizes, 64, 576 and
     1500 bytes. Also we use TX queues according to smp_processor_id()
    
     PGDEV=/proc/net/pktgen/kpktgend_0
     pgset "add_device eth0@0" 
    
     PGDEV=/proc/net/pktgen/kpktgend_1
     pgset "add_device eth0@1" 
    
     PGDEV=/proc/net/pktgen/kpktgend_2
     pgset "add_device eth0@2" 
    
     PGDEV=/proc/net/pktgen/kpktgend_3
     pgset "add_device eth0@3" 
    ....
    PGDEV=/proc/net/pktgen/eth0@0 
    pgset "pkt_size 64"
    pgset "flag QUEUE_MAP_CPU"
    
    PGDEV=/proc/net/pktgen/eth0@1
    pgset "pkt_size 572"
    pgset "flag QUEUE_MAP_CPU"
    
    PGDEV=/proc/net/pktgen/eth0@2
    pgset "pkt_size 1496"
    
    PGDEV=/proc/net/pktgen/eth0@3
    pgset "pkt_size 1496"
    pgset "flag QUEUE_MAP_CPU"
    Signed-off-by: default avatarRobert Olsson <robert.olsson@its.uu.se>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e6fce5b9
pktgen.c 91.7 KB