event/sw: fix credit tracking in port dequeue
authorHarry van Haaren <harry.van.haaren@intel.com>
Thu, 1 Jun 2017 15:45:54 +0000 (16:45 +0100)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Wed, 21 Jun 2017 13:33:22 +0000 (15:33 +0200)
commit636615142baad5d5c27556942528e661f3586029
treed5eb382fe74a3f56159bad42af9ec11e5c6d3c0a
parent0b275d32a4d7eaf420dcb8e0fcca50c079f6fecf
event/sw: fix credit tracking in port dequeue

Single-link optimized ports previously did not correctly track
credits when dequeued, and re-enqueued as a FORWARD type. This
could "inflate" the number of credits in the system.

A unit test is added to reproduce and verify the issue, and the
fixed implementation counts FORWARD packets, and reduces the
number of credits the port has if it is of single-link type.

Fixes: 656af9180014 ("event/sw: add worker core functions")

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Gage Eads <gage.eads@intel.com>
drivers/event/sw/sw_evdev_worker.c
test/test/test_eventdev_sw.c