event/sw: remove stale IQ references when reconfigured
authorGage Eads <gage.eads@intel.com>
Tue, 9 Jan 2018 16:19:35 +0000 (10:19 -0600)
committerJerin Jacob <jerin.jacob@caviumnetworks.com>
Fri, 19 Jan 2018 15:09:56 +0000 (16:09 +0100)
commit45219005264946d1a24a7764013a51b0e5c2de9a
treeeeccd6e6fd04c103f22e63608b96b1e3d6bce171
parentc7aa67f5a9e4a59a816a6506aa87cfb133981315
event/sw: remove stale IQ references when reconfigured

This commit fixes a bug in which, when the sw PMD is reconfigured, it would
leave stale IQ chunk pointers in each queue's IQ structure. Now, the PMD
initializes all IQs at eventdev start time and releases all IQ chunk
pointers at eventdev stop time (which has the consequence that any events
in a queue when the eventdev is stopped will be lost). This approach should
be resilient to any reconfiguration done between the stop and start, such
as adding or removing queues.

This commit also fixes two potential issues in iq_chunk.h. iq_init()
now initializes the IQ's count field to 0, and iq_dequeue_burst() sets
iq->head to the appropriate next pointer.

Fixes: dca926ca9faa ("event/sw: use dynamically-sized IQs")

Reported-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Signed-off-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Harry van Haaren <harry.van.haaren@intel.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
drivers/event/sw/iq_chunk.h
drivers/event/sw/sw_evdev.c