X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fevent%2Focteontx%2Fssovf_worker.h;h=c4f886d63a92984e5fdf2a91e590bdfd429c82d9;hb=27fb5dd2850c60b46660b93c2fe14da6841b142c;hp=f165242a116d97c44eb35523117a2b845d6d2084;hpb=aaf4363e1e9e518c034c7ff9938a2faefde9854d;p=dpdk.git diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index f165242a11..c4f886d63a 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -24,15 +24,14 @@ enum { /* SSO Operations */ static __rte_always_inline struct rte_mbuf * -ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_id) +ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info) { 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 = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP); + rte_prefetch_non_temporal(mbuf); 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); @@ -40,11 +39,22 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_id) mbuf->data_len = mbuf->pkt_len; mbuf->nb_segs = 1; mbuf->ol_flags = 0; - mbuf->port = port_id; + mbuf->port = rte_octeontx_pchan_map[port_info >> 4][port_info & 0xF]; rte_mbuf_refcnt_set(mbuf, 1); + return mbuf; } +static __rte_always_inline void +ssovf_octeontx_wqe_free(uint64_t work) +{ + octtx_wqe_t *wqe = (octtx_wqe_t *)(uintptr_t)work; + struct rte_mbuf *mbuf; + + mbuf = (struct rte_mbuf *)((uintptr_t)wqe - OCTTX_PACKET_WQE_SKIP); + rte_pktmbuf_free(mbuf); +} + static __rte_always_inline uint16_t ssows_get_work(struct ssows *ws, struct rte_event *ev) { @@ -58,9 +68,13 @@ ssows_get_work(struct ssows *ws, struct rte_event *ev) ws->cur_grp = sched_type_queue >> 2; sched_type_queue = sched_type_queue << 38; ev->event = sched_type_queue | (get_work0 & 0xffffffff); + if (get_work1 && ev->event_type == RTE_EVENT_TYPE_ETHDEV) { ev->mbuf = ssovf_octeontx_wqe_to_pkt(get_work1, - (ev->event >> 20) & 0xF); + (ev->event >> 20) & 0x7F); + } else if (unlikely((get_work0 & 0xFFFFFFFF) == 0xFFFFFFFF)) { + ssovf_octeontx_wqe_free(get_work1); + return 0; } else { ev->u64 = get_work1; }