Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2013 20:32:18 -0700
From:      hiren panchasara <hiren.panchasara@gmail.com>
To:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   netmap: understanding pkg-gen.c
Message-ID:  <CALCpEUHj_Mke_njM0NwzCUa1f_pXZdCy3_aaqJtKz5NUJUU8Mg@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
I am new to netmap so thought of confirming my understanding.

I was trying to associate ixgbe interface with netmap and blast pkts to it
using tools/tools/netmap/pkg-gen.c

My setup looks like this:

FreeBSD 10.0-ALPHA1 #2: Sun Sep 22 18:08:18 UTC 2013
-bash-4.2$ sysctl hw.physmem
hw.physmem: 51505954816
-bash-4.2$ sysctl hw.ncpu
hw.ncpu: 24
-bash-4.2$ sysctl hw.ix
hw.ix.enable_aim: 1
hw.ix.max_interrupt_rate: 31250
hw.ix.rx_process_limit: 256
hw.ix.tx_process_limit: 256
hw.ix.enable_msix: 1
hw.ix.num_queues: 8
hw.ix.txd: 2048
hw.ix.rxd: 2048
-bash-4.2$

On this box, I have 2 interfaces igb0 (10.73.149.28) and ix1 (10.73.149.17)
and this is how I am using this binary:

-bash-4.2$ sudo ./pkt-gen -i ix1 -f tx -n 100000000 -c 8 -p 8 -d
10.73.149.17 -s 10.73.149.28
extract_ip_range [143] extract IP range from 10.73.149.28
extract_ip_range [178] range is 10.73.149.28 0 to 10.73.149.28 0
extract_ip_range [143] extract IP range from 10.73.149.17
extract_ip_range [178] range is 10.73.149.17 0 to 10.73.149.17 0
extract_mac_range [184] extract MAC range from 90:e2:ba:30:68:c5
extract_mac_range [199] 90:e2:ba:30:68:c5 starts at 90:e2:ba:30:68:c5
extract_mac_range [184] extract MAC range from ff:ff:ff:ff:ff:ff
extract_mac_range [199] ff:ff:ff:ff:ff:ff starts at ff:ff:ff:ff:ff:ff
main [1530] map size is 334980 Kb
main [1552] mapping 334980 Kbytes
Sending on ix1: 8 queues, 8 threads and 8 cpus.
10.73.149.28 -> 10.73.149.17 (90:e2:ba:30:68:c5 -> ff:ff:ff:ff:ff:ff)
main [1622] Sending 512 packets every  0.000000000 ns
main [1624] Wait 2 secs for phy reset
main [1626] Ready...
sender_body [775] start
sender_body [775] start
sender_body [775] start
sender_body [775] start
sender_body [775] start
sender_body [775] start
sender_body [775] start
sender_body [775] start
sender_body [848] drop copy
sender_body [848] drop copy
sender_body [848] drop copy
sender_body [848] drop copy
sender_body [848] drop copy
sender_body [848] drop copy
sender_body [848] drop copy
sender_body [848] drop copy
main_thread [1192] 15024157 pps (15050104 pkts in 1001727 usec)
main_thread [1192] 14882290 pps (14900223 pkts in 1001205 usec)
main_thread [1192] 14879515 pps (14903798 pkts in 1001632 usec)
main_thread [1192] 14880924 pps (15795952 pkts in 1061490 usec)
main_thread [1192] 14881411 pps (15821633 pkts in 1063181 usec)
main_thread [1192] 14880095 pps (15427549 pkts in 1036791 usec)
main_thread [1192] 7986707 pps (8100741 pkts in 1014278 usec)
Sent 100000000 packets, 60 bytes each, in 6.71 seconds.
Speed: 14.90 Mpps Bandwidth: 7.15 Gbps (raw 10.01 Gbps)

$ top -H shows:

25853 root      24    0   348M 35692K select 16   0:01   7.28%
pkt-gen{pkt-gen}
25853 root      25    0   348M 35692K select 21   0:01   7.28%
pkt-gen{pkt-gen}
25853 root      25    0   348M 35692K select 15   0:01   7.28%
pkt-gen{pkt-gen}
25853 root      23    0   348M 35692K select 12   0:01   6.40%
pkt-gen{pkt-gen}
25853 root      24    0   348M 35692K select 22   0:01   6.30%
pkt-gen{pkt-gen}
25853 root      23    0   348M 35692K select  9   0:01   5.66%
pkt-gen{pkt-gen}
25853 root      23    0   348M 35692K select  7   0:01   5.57%
pkt-gen{pkt-gen}
25853 root      23    0   348M 35692K CPU0    0   0:01   5.27%
pkt-gen{pkt-gen}
   12 root     -92    -     0K  1184K WAIT    6   0:10   5.08% intr{irq290:
ix1:que }
   12 root     -92    -     0K  1184K WAIT    7   0:09   4.98% intr{irq291:
ix1:que }
   12 root     -92    -     0K  1184K WAIT    5   0:08   4.79% intr{irq289:
ix1:que }
   12 root     -92    -     0K  1184K WAIT    2   0:15   4.69% intr{irq286:
ix1:que }
   12 root     -92    -     0K  1184K WAIT    3   0:08   4.69% intr{irq287:
ix1:que }
   12 root     -92    -     0K  1184K WAIT    4   0:14   4.59% intr{irq288:
ix1:que }
   12 root     -92    -     0K  1184K WAIT    1   0:06   3.96% intr{irq285:
ix1:que }
   12 root     -92    -     0K  1184K WAIT    0   0:05   0.98% intr{irq284:
ix1:que }

I can only specify -p (threads) upto 8 because it cannot be more than the
hw.ix.num_queues=8, is that correct?

Cheers,
Hiren



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALCpEUHj_Mke_njM0NwzCUa1f_pXZdCy3_aaqJtKz5NUJUU8Mg>