diff mbox

[PATCHv3,2/7] linux-generic: schedule pktin_poll: account pktio stop state

Message ID 1439990341-12037-3-git-send-email-maxim.uvarov@linaro.org
State Superseded
Headers show

Commit Message

Maxim Uvarov Aug. 19, 2015, 1:18 p.m. UTC
If pktio in state stop return 0, which means no packets was
received but that pktio is good to be sheduled next time.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/odp_packet_io.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-generic/odp_packet_io.c
index 532c264..84485a9 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -610,6 +610,9 @@  int pktin_poll(pktio_entry_t *entry)
 	if (odp_unlikely(entry->s.inq_default == ODP_QUEUE_INVALID))
 		return -1;
 
+	if (entry->s.state == STATE_STOP)
+		return 0;
+
 	num = odp_pktio_recv(entry->s.handle, pkt_tbl, QUEUE_MULTI_MAX);
 
 	if (num < 0) {