Question about packet-bricks

Hi all,

I am trying to use packet-bricks in a FreeBSD 10.1 host with netmap
enabled. Following README, I have executed the following commands:

[ pmain(): line 463] Executing (null)
[print_version(): line 345] BRICKS Version 0.1-alpha

BRICKS.help()

BRICKS Commands:
    help()
    print_status()
    show_stats()
    shutdown()
  Available subsystems within BRICKS have their own help() methods:
    PktEngine

utilObj:enable_nmpipes()

[ report(): line 222] stdin:1: attempt to index global 'utilObj'
(a nil value)
stack traceback:
    stdin:1: in main chunk
    [C]: ?bricks> pe = PktEngine.new("e0")

print_status()

[ report(): line 222] stdin:1: attempt to call global
'print_status' (a nil value)
stack traceback:
    stdin:1: in main chunk
    [C]: ?bricks> pe = PktEngine.new("e0", 1024, 1)
[pktengine_new(): line 178] Engine with name: e0 already exists

lb = Brick.new("LoadBalancer", 2)
lb:connect_input("vtnet2")
lb:connect_output("vtnet2{0", "vtnet2{1", "em0")
pe:link(lb)

546.982488 nm_open [444] overriding ARG3 0
546.982547 nm_open [457] overriding ifname vtnet2 ringid 0x0 flags 0x1
[netmap_link_iface(): line 175] Wait for 2 secs for phy reset
[brick_link(): line 101] Linking e0 with link vtnet2 with batch size:
512 and qid: -1
549.055808 nm_open [444] overriding ARG3 0
[netmap_create_channel(): line 761] zerocopy for vtnet2 --> vtnet2{0
(index: 0) enabled
[netmap_create_channel(): line 766] Created netmap:vtnet2{0 interface
549.101244 nm_open [444] overriding ARG3 0
[netmap_create_channel(): line 761] zerocopy for vtnet2 --> vtnet2{1
(index: 1) enabled
[netmap_create_channel(): line 766] Created netmap:vtnet2{1 interface
549.142483 nm_open [444] overriding ARG3 0
[netmap_create_channel(): line 761] zerocopy for vtnet2 --> em0
(index: 2) enabled
[netmap_create_channel(): line 766] Created netmap:em0 interface

pe:start()
[initiate_backend(): line 346] Engine e0 is listening on port 1239

pe.show_stats()
[ report(): line 222] stdin:1: bad argument #1 to 'show_stats'
(userdata expected, got no value)
stack traceback:
    [C]: in function 'show_stats'
    stdin:1: in main chunk
    [C]: ?bricks> show.stats()
[ report(): line 222] stdin:1: attempt to index global 'show' (a nil value)
stack traceback:
    stdin:1: in main chunk
    [C]: ?bricks>

dmesg shows me the following:

544.880658 [ 407] vtnet_netmap_config vtnet config txq=1,
txd=512 rxq=1, rxd=512
544.946020 [ 676] netmap_update_config configuration changed (but fine)
544.981566 [1219] netmap_mem_global_config reconfiguring
545.014116 [ 818] netmap_config_obj_allocator XXX aligning object by 1 bytes
546.288980 [ 407] vtnet_netmap_config vtnet config txq=1,
txd=512 rxq=1, rxd=512
546.353092 [ 79] vtnet_netmap_free_bufs freed 256 mbufs, 0 netmap
bufs on 1 queues
546.982572 [ 407] vtnet_netmap_config vtnet config txq=1,
txd=512 rxq=1, rxd=512
547.011973 [ 407] vtnet_netmap_config vtnet config txq=1,
txd=512 rxq=1, rxd=512
549.055837 [ 325] netmap_pipe_krings_create 0xfffff80110f9ac00: case
1, create everything
549.101272 [ 325] netmap_pipe_krings_create 0xfffff801105e0800: case
1, create everything
em0: link state changed to DOWN
em0: link state changed to UP

As you can see, stats failed. When I try to use tcpdump:

root@nsm02:/dev # tcpdump -i 'netmap:vtnet2{0'
tcpdump: netmap:vtnet2{0: No such device exists
(BIOCSETIF failed: Device not configured)

Please, any help??

Hi,

The utilObj functions are actually referenced in scripts/startup-one-thread.lua
startup script file. So you should start your packet-bricks using the following
command:

# bin/bricks -f scripts/startup-one-thread.lua

I suggest that you go through the scripts/startup-one-thread.lua and
scripts/utils.lua files (after reading the README file) before using
packet-bricks.

Thanks,
--Asim

Hi,

The utilObj functions are actually referenced in
scripts/startup-one-thread.lua
startup script file. So you should start your packet-bricks using the
following
command:

# bin/bricks -f scripts/startup-one-thread.lua

I suggest that you go through the scripts/startup-one-thread.lua and
scripts/utils.lua files (after reading the README file) before using
packet-bricks.

Thanks,
--Asim

Nothing ...

root@nsm02:/data/config/etc/packet-bricks #
/opt/packet-bricks/bin/bricks -f startup-one-thread.lua
[ pmain(): line 463] Executing startup-one-thread.lua
[print_version(): line 345] BRICKS Version 0.1-alpha

pe:start()

[ report(): line 222] stdin:1: attempt to index global 'pe' (a nil value)
stack traceback:
    stdin:1: in main chunk
    [C]: ?bricks>

show_stats()

[ report(): line 222] stdin:2: ambiguous syntax (function call x
new statement) near '('bricks>

I have attached my actual lua scripts

setup.lua (219 Bytes)

startup-one-thread.lua (2.02 KB)

utils.lua (2.06 KB)

pe is not a global variable.
You should type the following commands:

init()

.

start()

.
-- to stop packet-bricks

stop()

--Asim