Json: Fix a bug in (const_)?array_iterator
const_array_iterator::live() was not checking for null _cjson; this was causing
segfaults/kernel panics trying to iterate over an empty, non-uniqueified array.
Merge pull request #67 from asazernik/json_array_iterator_fix

Json: Fix a bug in (const_)?array_iterator
Don't lock the TX queue of a device in newer Linux kernels.

This bug was revealed by commit 5b88803. Regardless of the
NETIF_F_LLTX flag, we should not lock the TX queue of the device
ourselves with newer kernels, since we call the dev_queue_xmit()
function that locks the queue if needed.
classification.hh: fix bug when matching with an empty program

Any Classifier whose first argument is '-' or '0/??' (or similar I guess) aborts
with:
    vector.hh:288: T& Vector<T>::operator[](int) [with T =
    Classification::Wordwise::Insn]: Assertion `(unsigned) i < (unsigned) vm_.n_'
    failed.

Classifier-02.testie demonstrates the bug.

I think what's going on is that the resulting Program is empty for such cases,
but match() nevertheless tries to initialize a variable with the first
instruction in the Program.  This change just moves the variable declaration and
initialisation to where we know the Program isn't empty, namely the point where
match() would have returned on _output_everything >= 0 for an empty Program.

Cliff Frey reviewed this and made a correction to my initial fix.

Signed-off-by: Patrick Verkaik <patrick@meraki.net>
Trivial clarification.
Avoid compilation warnings.
Add documentation for ProbeRequester
Merge pull request #70 from lalithsuresh/probereq-doc

Add documentation for ProbeRequester
linuxmodule/todevce: don't attempt to defer packet after dev_queue_xmit

After dev_queue_xmit, the packet has been consumed regardless of ret. If ret
were not zero, _q = p despite this fact and it will be Packet::kill'd by
ToDevice::cleanup.  We could skb_clone but that seems wasteful; instead,
drop.

We could also skb_get and then consume_skb on success except that there are
some network drivers (e.g. ppp_generic) that assume the skb it unshared and
will BUG otherwise.
Update LICENSE.
add CLICK_COLD #define for rarely used functions

Signed-off-by: Cliff Frey <cliff@meraki.com>
Mark many initialization-related functions as COLD

This was done by running
    sed -i -r -e 's/\b(configure\(.*\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/\b(initialize\(.*\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/\b(add_handlers\(.*\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/\b(cleanup\(.*\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/\b(read_param\(.*\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/\b(write_param\(.*\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/^( *[A-Z][a-zA-Z]+\(\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/^( *~[A-Z][a-zA-Z]+\(\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
    sed -i -r -e 's/\b([a-z_]*(write|read)_handler\(.*\));/\1 CLICK_COLD;/' `find elements/ -name '*.hh'`
and then manually fixing up directiplookup.hh

On some workloads at Meraki, we have seen bad performance caused by
instruction TLB misses.  This change drastically reduces the number of
instruction TLB misses on those workloads, leading to ~30% faster
performance (as measured on a powerpc 44x machine).

Signed-off-by: Cliff Frey <cliff@meraki.com>
test: add a simple performance test

I added this hoping for it to show that the CLICK_COLD change made a
noticable performance different on x86.  However, I could not get it to.
It may be that I need more unique click elements in order to put the
instruction TLB under more pressure.

Signed-off-by: Cliff Frey <cliff@meraki.com>
ethernet: add functionality for storing enet addrs in anno area

This roughly correspond to the get/set/store ipaddress elements.

Signed-off-by: Cliff Frey <cliff@meraki.com>
Uninitialized timestamp variable fix
Fix Args::read_or_set.

Signed-off-by: Eddie Kohler <ekohler@gmail.com>
Fix Args::read_or_set the right way.

And add a test.
Linuxmodule: Fixincludes works for Linux 3.5.

- Double asmlinkage considered stupid
- Give up on fixing notrace
- G++, why?
Merge pull request #68 from srcman/linuxmodule-patches

TX queue locking fix
Improve compilability on Linux 3.5.