I forgot to Cc the list

On 31/03/16 17:03, Zoltan Kiss wrote:
Hi,

I ran into a problem when pktio_test_pktin_queue_config_direct() plays
with queue config then call close. That calls flush_in_queues(), which
tries to receive on a device which was never started, therefore run into
a segfault when trying to access the queues never created.
I've used the pkt_dpdk->started variable to avoid that in
recv_pkt_dpdk_queue(), but I wonder if that's the proper way. I guess
odp-linux would have the same issue on DPDK pktio. Any better idea?
I would also prefer avoiding branching on a hotpath like this. And we
should check if we need a similar check on send side.

diff --git a/platform/linux-dpdk/odp_packet_dpdk.c
b/platform/linux-dpdk/odp_packet_dpdk.c
index 7ddbac6..fdc461e 100644
--- a/platform/linux-dpdk/odp_packet_dpdk.c
+++ b/platform/linux-dpdk/odp_packet_dpdk.c
@@ -352,6 +352,9 @@ static int recv_pkt_dpdk_queue(pktio_entry_t
*pktio_entry, int index,
         pkt_dpdk_t * const pkt_dpdk = &pktio_entry->s.pkt_dpdk;
         uint8_t min = pkt_dpdk->min_rx_burst;

+       if (!pkt_dpdk->started)
+               return 0;
+
         if (odp_unlikely(min > len)) {
                 ODP_DBG("PMD requires >%d buffers burst. "
                         "Current %d, dropped %d\n", min, len, min - len);


Regards,

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

Reply via email to