X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fevent%2Focteontx%2Fssovf_worker.h;h=bf76ac8806bded2494f016bcda2bc37e56bf3966;hb=f1b7c6b7f5eb51809aaec66a3fa31e600f2dcd12;hp=b76a199250353678546acf5ab6cbd9752a64583f;hpb=9a8269d56942c5a59b4358b19b0dc6392b7b6bf9;p=dpdk.git diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index b76a199250..bf76ac8806 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -1,7 +1,7 @@ /* * BSD LICENSE * - * Copyright (C) Cavium networks Ltd. 2017. + * Copyright (C) Cavium, Inc. 2017. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -13,7 +13,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * * Neither the name of Cavium networks nor the names of its + * * Neither the name of Cavium, Inc nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -34,7 +34,10 @@ #include #include +#include + #include "ssovf_evdev.h" +#include "octeontx_rxtx.h" enum { SSO_SYNC_ORDERED, @@ -49,6 +52,28 @@ enum { /* SSO Operations */ +static __rte_always_inline struct rte_mbuf * +ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_id) +{ + struct rte_mbuf *mbuf; + octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work; + rte_prefetch_non_temporal(wqe); + + /* Get mbuf from wqe */ + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - + OCTTX_PACKET_WQE_SKIP); + mbuf->packet_type = + ptype_table[wqe->s.w2.lcty][wqe->s.w2.lety][wqe->s.w2.lfty]; + mbuf->data_off = RTE_PTR_DIFF(wqe->s.w3.addr, mbuf->buf_addr); + mbuf->pkt_len = wqe->s.w1.len; + mbuf->data_len = mbuf->pkt_len; + mbuf->nb_segs = 1; + mbuf->ol_flags = 0; + mbuf->port = port_id; + rte_mbuf_refcnt_set(mbuf, 1); + return mbuf; +} + static __rte_always_inline uint16_t ssows_get_work(struct ssows *ws, struct rte_event *ev) { @@ -61,9 +86,14 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev) ws->cur_tt = sched_type_queue & 0x3; ws->cur_grp = sched_type_queue >> 2; sched_type_queue = sched_type_queue << 38; - ev->event = sched_type_queue | (get_work0 & 0xffffffff); - ev->u64 = get_work1; + if (get_work1 && ev->event_type == RTE_EVENT_TYPE_ETHDEV) { + ev->mbuf = ssovf_octeontx_wqe_to_pkt(get_work1, + (ev->event >> 20) & 0xF); + } else { + ev->u64 = get_work1; + } + return !!get_work1; }