On Wed, Jan 14, 2015 at 08:50:26PM +0000, Taras Kondratiuk wrote:
> On 01/14/2015 09:07 PM, Stuart Haslam wrote:
> > On Thu, Dec 18, 2014 at 10:27:43AM +0000, Taras Kondratiuk wrote:
> >> PKTIN queue was not handled correctly. Check queue status instead of
> >> queue type.
> >>
> > 
> > I just had cause to want to destroy a PKTIN queue and remembered this
> > patch. I applied it and tested but get a SEGV in queue_deq_multi_destroy
> > when trying to free queue->s.sched_buf as it's ODP_BUFFER_INVALID, which
> > seems to be due to it being called twice for the same queue.
> 
> Could you please push your test code somewhere?

Patch below to the pktio cunit (not a fix, just bodge to provoke this).
I run it like this;

sudo ODP_PLATFORM=linux-generic ./test/validation/odp_pktio_run setup
sudo ODP_PKTIO_IF0=pktio-p0 ODP_PKTIO_IF1=pktio-p1 gdb --args 
./test/validation/odp_pktio

> I don't see where it can be called twice.
> 

I just looked a bit more closely. The problem is that in schedule() the
odp_queue_deq_multi() call for a destroyed queue frees the sched_buf and
modifies the status from DESTROYED to FREE, which causes the
!queue_is_destroyed() check shortly afterwards to fail and the free
queue to be rescheduled. Not sure what the best fix is, but there is
obviously some overlap with Maxim's changes for odp_pktio_inq_remdef().

--
Stuart.


diff --git a/test/validation/odp_pktio.c b/test/validation/odp_pktio.c
index d1eb0d5..20a8899 100644
--- a/test/validation/odp_pktio.c
+++ b/test/validation/odp_pktio.c
@@ -379,6 +379,8 @@ static void pktio_test_txrx(odp_queue_type_t q_type, int 
num_pkts)
        pktio_txrx_multi(&pktios[0], &pktios[if_b], num_pkts);
 
        for (i = 0; i < num_ifaces; ++i) {
+               if (pktios[i].inq != ODP_QUEUE_INVALID)
+                       CU_ASSERT(odp_queue_destroy(pktios[i].inq) == 0);
                ret = odp_pktio_close(pktios[i].id);
                CU_ASSERT(ret == 0);
        }


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to