aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>2016-03-24 19:52:03 +0200
committerIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>2016-03-24 20:06:44 +0200
commitf2f7ae2710bbbe08fd5ebbb034730a856a7f4c23 (patch)
tree2cc24de47a6cd00ae2d335b92f97fecc9ff7bc46
parent4e5a6cfecbeb5432c6dd37e1a54bb4d96c443e01 (diff)
downloadodp-keystone2-master.tar.gz
linux-ks2: queue: update packet header while polling queueHEADmaster
It can happen that some thread is polling a queue of CoS that receives packets from pktio as a source. In this case packet can be not parsed. So, here is reason to parse packet if it has been not done yet. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
-rw-r--r--platform/linux-keystone2/odp_queue.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/platform/linux-keystone2/odp_queue.c b/platform/linux-keystone2/odp_queue.c
index f161b8a..8a88a8c 100644
--- a/platform/linux-keystone2/odp_queue.c
+++ b/platform/linux-keystone2/odp_queue.c
@@ -429,13 +429,19 @@ int queue_poll_enq_multi(queue_entry_t *entry, const odp_event_t ev[], int num)
odp_event_t queue_poll_deq(queue_entry_t *entry)
{
+ odp_event_t ev;
Cppi_HostDesc *desc;
desc = (void *)QMSS_DESC_PTR(Qmss_queuePop(entry->qmss_queue));
odp_pr_vdbg("queue: %s, buf: %p, qmss_queue: %d\n",
entry->name, desc, entry->qmss_queue);
- return _cppi_desc_to_odp_ev(desc);
+ ev = _cppi_desc_to_odp_ev(desc);
+
+ if (ev != ODP_EVENT_INVALID)
+ pktin_update_event(ev, entry);
+
+ return ev;
}
int queue_poll_deq_multi(queue_entry_t *entry, odp_event_t ev[], int num)
@@ -446,8 +452,12 @@ int queue_poll_deq_multi(queue_entry_t *entry, odp_event_t ev[], int num)
/** @todo: Implement multi dequeue a lower level */
desc = Qmss_queuePop(entry->qmss_queue);
desc = (void *)QMSS_DESC_PTR(desc);
+
ev[i] = _cppi_desc_to_odp_ev(desc);
- if (!ev[i])
+
+ if (ev[i] != ODP_EVENT_INVALID)
+ pktin_update_event(ev[i], entry);
+ else
break;
}