From owner-freebsd-net@FreeBSD.ORG Wed Sep 25 03:32:20 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E43EAB68 for ; Wed, 25 Sep 2013 03:32:20 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ee0-x232.google.com (mail-ee0-x232.google.com [IPv6:2a00:1450:4013:c00::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6AAC0228C for ; Wed, 25 Sep 2013 03:32:20 +0000 (UTC) Received: by mail-ee0-f50.google.com with SMTP id d51so2834763eek.23 for ; Tue, 24 Sep 2013 20:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=QZ0JEsCe+NRMEOYB8MO3pMvUpcoYKZUd6n3Gm4vaEec=; b=fK9fPJfQwc+gzg1q8OHBIEeA/xH3PjOw7jY9+9pnp5n5mPqqeHmYx9PHwXnkrSEnhF HOcgo+gMQAwe/KVpIoi7LL1JeyuBYxkVSO+Et2IWleGmfj5GepiW/VGlXhsQCoKdUyRe dmCFGIVmRbXxt9AH0xsmORG208dtXmZXea9KoaeJ6dTVO7XEcnl4emPjRplXOtdSI5f9 OizlrL3vxRpgiBAa/o3XTArNfa3Bk5+JdWN7MsXK+FyT9DnyiAVTT4w6KmpDA76bsb98 zFIKpjoPjLH/stzYPc3aR4SSWvxyL+OKL/2zxIlr6lIFtpmojN2EKP30mFQuZpDMnx4y 4RUQ== MIME-Version: 1.0 X-Received: by 10.14.181.194 with SMTP id l42mr62719eem.63.1380079938619; Tue, 24 Sep 2013 20:32:18 -0700 (PDT) Received: by 10.14.105.137 with HTTP; Tue, 24 Sep 2013 20:32:18 -0700 (PDT) Date: Tue, 24 Sep 2013 20:32:18 -0700 Message-ID: Subject: netmap: understanding pkg-gen.c From: hiren panchasara To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Sep 2013 03:32:21 -0000 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