alf_queue_helper: yet another enqueue/dequeue helper function "mask_less2"

Still searching for the optimal helper function, both fast and small in
code size.

This helper is slightly larger than "mask_less":
 helper_alf_enqueue_store_mask_less2: 110 bytes
 helper_alf_dequeue_load_mask_less2 : 110 bytes

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
alf_queue_concurrency: fix bug, dequeue returns 0 on empty queue

The dequeue call returns 0 when the queue is empty, not as the code
assumed < 0.  This is clearly a bug, and caused measurement always
run all "loops" and add the cost of the empty dequeue calls.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
alf_queue: changing return semantics of enqueue

Notice the ALF queue return semantics is different from the DPDK
ring_queue semantics.  Also after this change.

The ALF enqueue function's return value is inconsistent with the
dequeue return value (which returns 0 in case it cannot dequeue).

Change enqueue to return 0 instead of -ENOBUFS, when it cannot enqueue
the elements requested.

Even-though current API have the "fixed" semantics of aborting if it
cannot enqueue the full bulk size.  Users of this API should check on
the returned number of enqueue elements match, to verify enqueue was
successful.  This allow us to introduce a "variable" enqueue scheme
later.

Notice this change also fix up the wrong checks on the return value of
dequeue, which tested on return < 0, which dequeue will never return.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
alf_queue_concurrency: adjust the test and explain some defines

Adjusting the test a bit and try to explain the reasoning behind some
of the defines, which can be used for adjusting the behavior of the
test.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
qmempool: convert qmempool to use alf_queue (from ring_queue)

Converted qmempool to use the ALF-queue instead of the DPDK ported
ring_queue.

Notice, ring_queue and ALF-queue have different return semantics, thus
be careful when replacing one with the other.

Qmempool performance on E5-2695, cost of alloc+free:

                 SLUB     -> ring_queue -> alf_queue
fastpath-reuse: 20.071 ns ->   9.675 ns ->  9.659 ns
N-pattern(128): 44.918 ns ->  12.876 ns -> 13.206 ns

Notice this test is on a PREEMPT enabled kernel, thus remember the
cost for preempt_{disable,enable} adds approx 4.291 ns.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
alf_queue_helper: yet another enqueue/dequeue helper function "nomask"

Still searching for the optimal helper function, both fast and small in
code size.  Was hoping this would produce smaller code, but it did not.

It is faster for the fast-reuse case, but slower for bulking.
 qmempool:  "unroll"   -> "nomask"
 fastpath  :  9.659 ns ->  9.333 ns
 N-pattern : 13.303 ns -> 14.479 ns

This helper is larger than "mask_less2" (110 bytes):
 helper_alf_enqueue_store_nomask: 127 bytes
 helper_alf_dequeue_load_nomask : 122 bytes

Thus, not enabling this helper by default, still keeping "unroll".

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>