Date: Wed, 5 Nov 2014 20:25:37 -0200 From: Evandro Nunes <evandronunes12@gmail.com> To: Luigi Rizzo <rizzo@iet.unipi.it> Cc: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: Re: netmap-ipfw on em0 em1 Message-ID: <CAG4HiT5YqnnVW3dSzn3tpP4VAkGY7Qg3ZZuZ=vmwGznX8m7u2A@mail.gmail.com> In-Reply-To: <20141104221216.GA17502@onelab2.iet.unipi.it> References: <CAG4HiT4KHG%2Bb2um6-p4szWio8qmxN%2BadO5hO9J5UGPmsa%2BZC5g@mail.gmail.com> <CA%2BhQ2%2BhAJZk-Y1Yw2xmHmxSMHpFN_byX94Bq33-th2vrp7q2JA@mail.gmail.com> <CAG4HiT7Mtedoxvc69nEyKp1ZYBidZTBcEKG1L9Mkj_Rqeh4bpA@mail.gmail.com> <CA%2BhQ2%2BjOnHX-x=k5=iZtR3=OWfcFBD8WTD_d_VicicJzPevcSw@mail.gmail.com> <CAG4HiT5fVCpmJ8uDh4SvVown7-vLCMKJP8-QcaW9LQfpWZEiBA@mail.gmail.com> <20141104221216.GA17502@onelab2.iet.unipi.it>
next in thread | previous in thread | raw e-mail | index | archive | help
dear luigi sadly it still did not work, I have the scenario set, please see below: On Tue, Nov 4, 2014 at 8:12 PM, Luigi Rizzo <rizzo@iet.unipi.it> wrote: > On Tue, Nov 04, 2014 at 05:44:43PM -0200, Evandro Nunes wrote: > > On Tue, Nov 4, 2014 at 5:26 PM, Luigi Rizzo <rizzo@iet.unipi.it> wrote: > ... > > >> i gues I am missing a piece of the architecture... > > >> > > > > > > ???probably yes :) > > > > > > kipfw em1 em2 connects the two interfaces to each other, keeping the > > > rest ??? > > > > > > ???of the host stack completely out of the game. > > > > > > > got it > > uhmmm... probably not, see below: > > > however it's still not counting any packets coming in or out of the > > interfaces > > > > > > > ???I am not sure where you are running pkt-gen (is it on a separate > > > machine ?) and what the 'em1' used in ??? > > > ??? > > > ???pkt-gen is connected to. > > > > > > > > > I am running one pkt-gen in TX mode on the same machine, and another one > in > > RX mode in a separate machine, but this is just for reference, to make > sure > > packets are actually getting transmitted, and it is... > > you cannot run two netmap clients on the same NIC at the same time > (unless you know how to do that, and avoid they stomp on each other). > > In this particular case it means that you should test things as follows > > machine A: pkt-gen -i em1 -f tx ... > > machine B kipfw em1 em2 > > machine C pkt-gen -i em3 -f rx > > And the connection between the ports is the following > > [A em1] <--> [em1 B em2] <--> [em3 C] > 1) added a couple count rules to ipfw (kernel): # ipfw add count all from any to any via em1 00100 count ip from any to any via em1 # ipfw add count all from any to any via em2 00200 count ip from any to any via em2 2) connected kipfw to the NICs # ./kipfw em1 em2 > & /tmp/kipfw.log & [1] 64845 3) added the same count rules to netmap-ipfw # ipfw/ipfw add count all from any to any via em1 connected to 127.0.0.1:5555 00100 count ip from any to any via em1 # ipfw/ipfw add count all from any to any via em2 connected to 127.0.0.1:5555 00200 count ip from any to any via em2 4) machine A started to ping machine C, both have machine B (netmap-ipfw host) as a gateway) 5) checked netmap-ipfw stats and nothing is counting: # ipfw/ipfw show connected to 127.0.0.1:5555 nalloc 2248 nbytes 216 ptr 0x0 00100 0 0 count ip from any to any via em1 00200 0 0 count ip from any to any via em2 65535 0 0 allow ip from any to any 6) checked kernel-stack ipfw and it does count: # ipfw show 00100 251 22168 count ip from any to any via em1 00200 143 13984 count ip from any to any via em2 65535 3272 365840 allow ip from any to any 7) started to generate high rate of pps via pkg-gen 8) ipfw kernel stack is counting: # ipfw show 00100 11976801 552000119 count ip from any to any via em1 00200 11975703 551008127 count ip from any to any via em2 65535 11989680 552505771 allow ip from any to any 9) while netmap-ipfw stills wont filter: # ipfw/ipfw show connected to 127.0.0.1:5555 nalloc 2248 nbytes 216 ptr 0x0 00100 0 0 count ip from any to any via em1 00200 0 0 count ip from any to any via em2 65535 0 0 allow ip from any to any 10) ./kipfw output reads: 642.000022] session.c:mainloop [624] callouts 3531236 skipped 16 [ 643.000214] session.c:mainloop [624] callouts 3535582 skipped 16 [ 644.000043] session.c:mainloop [624] callouts 3539934 skipped 16 [ 645.000203] session.c:mainloop [624] callouts 3544275 skipped 16 [ 646.000140] session.c:mainloop [624] callouts 3548639 skipped 16 [ 647.000155] session.c:mainloop [624] callouts 3552987 skipped 16 [ 648.000071] session.c:mainloop [624] callouts 3557311 skipped 16 [ 649.000112] session.c:mainloop [624] callouts 3561621 skipped 16 [ 650.000135] session.c:mainloop [624] callouts 3565505 skipped 16 [ 651.000110] session.c:mainloop [624] callouts 3569867 skipped 16 [ 652.000180] session.c:mainloop [624] callouts 3574215 skipped 16 [ 653.000156] session.c:mainloop [624] callouts 3578457 skipped 16 [ 654.000098] session.c:mainloop [624] callouts 3582747 skipped 16 [ 654.171717] missing.c:callout_run [378] running 0x61e9d0 due at 4289151 now 4289306 [ 654.277852] missing.c:callout_run [378] running 0x61e9d0 due at 4289652 now 4289836 [ 654.380216] missing.c:callout_run [378] running 0x61e9d0 due at 4290129 now 4290348 [ 654.419590] missing.c:callout_run [378] running 0x61e9d0 due at 4290430 now 4290545 [ 654.451089] missing.c:callout_run [378] running 0x61e9d0 due at 4290573 now 4290702 [ 654.482725] missing.c:callout_run [378] running 0x61e9d0 due at 4290751 now 4290861 [ 654.508343] missing.c:callout_run [378] running 0x61e9d0 due at 4290862 now 4290989 [ 655.000026] session.c:mainloop [624] callouts 3585292 skipped 16 [ 656.000042] session.c:mainloop [624] callouts 3589583 skipped 16 [ 657.000137] session.c:mainloop [624] callouts 3593939 skipped 16 [ 658.000011] session.c:mainloop [624] callouts 3598242 skipped 16 next, I have up on FreeBSD base's netmap and decided to try the latest code from: 11) stopped kipfw and unloaded netmap: # killall -9 kipfw [1] + Killed ./kipfw em1 em2 >& /tmp/kipfw.log # kldunload netmap 12) loaded the new just-built kernel module: # kldload ../netmap-7e9e5e7602f5/sys/modules/netmap/netmap.ko 13) started to generate traffic from machine A to machine C again and tried again to see some packets getting netmap filtered: # ./kipfw em1 em2 > & /tmp/kipfw.log & [1] 66583 # ipfw/ipfw show connected to 127.0.0.1:5555 nalloc 2248 nbytes 56 ptr 0x0 65535 0 0 allow ip from any to any # ipfw/ipfw show connected to 127.0.0.1:5555 nalloc 2248 nbytes 56 ptr 0x0 65535 0 0 allow ip from any to any # ipfw/ipfw add count all from any to any connected to 127.0.0.1:5555 00100 count ip from any to any # ipfw/ipfw add deny all from any to any connected to 127.0.0.1:5555 00200 deny ip from any to any # ipfw/ipfw show connected to 127.0.0.1:5555 nalloc 2248 nbytes 168 ptr 0x0 00100 0 0 count ip from any to any 00200 0 0 deny ip from any to any 65535 0 0 allow ip from any to any and still not counting (only the default rule this time) how can I debug from this point? NIC is em(4) controlled and has 82574L chipset... > cheers > luigi >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG4HiT5YqnnVW3dSzn3tpP4VAkGY7Qg3ZZuZ=vmwGznX8m7u2A>