From: Vamsi Attunuru Date: Tue, 28 Apr 2020 12:40:11 +0000 (+0530) Subject: event/octeontx: support VLAN filter offload X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=45231cc6fa4e0dc84745942e981212f3fd94fcac;p=dpdk.git event/octeontx: support VLAN filter offload Adding rx burst function pointer hooks for vlan filter offload in event PMD. Signed-off-by: Vamsi Attunuru Acked-by: Jerin Jacob --- diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c index b5873c3fa9..a276269d70 100644 --- a/drivers/event/octeontx/ssovf_worker.c +++ b/drivers/event/octeontx/ssovf_worker.c @@ -91,7 +91,7 @@ ssows_release_event(struct ssows *ws) ssows_swtag_untag(ws); } -#define R(name, f0, flags) \ +#define R(name, f1, f0, flags) \ static uint16_t __rte_noinline __rte_hot \ ssows_deq_ ##name(void *port, struct rte_event *ev, uint64_t timeout_ticks) \ { \ @@ -347,49 +347,53 @@ SSO_TX_ADPTR_ENQ_FASTPATH_FUNC dev->txa_enqueue_same_dest = dev->txa_enqueue; /* Assigning dequeue func pointers */ - const event_dequeue_t ssow_deq[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_ ##name, + const event_dequeue_t ssow_deq[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; dev->dequeue = ssow_deq + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; - const event_dequeue_burst_t ssow_deq_burst[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_burst_ ##name, + const event_dequeue_burst_t ssow_deq_burst[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_burst_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; dev->dequeue_burst = ssow_deq_burst + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; if (edev->is_timeout_deq) { - const event_dequeue_t ssow_deq_timeout[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_timeout_ ##name, + const event_dequeue_t ssow_deq_timeout[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_timeout_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; - dev->dequeue = ssow_deq_timeout - [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; + dev->dequeue = ssow_deq_timeout + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] + [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; - const event_dequeue_burst_t ssow_deq_timeout_burst[2] = { -#define R(name, f0, flags) \ - [f0] = ssows_deq_timeout_burst_ ##name, + const event_dequeue_burst_t ssow_deq_timeout_burst[2][2] = { +#define R(name, f1, f0, flags) \ + [f1][f0] = ssows_deq_timeout_burst_ ##name, SSO_RX_ADPTR_ENQ_FASTPATH_FUNC #undef R }; - dev->dequeue_burst = ssow_deq_timeout_burst - [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; + dev->dequeue_burst = ssow_deq_timeout_burst + [!!(edev->rx_offload_flags & OCCTX_RX_VLAN_FLTR_F)] + [!!(edev->rx_offload_flags & OCCTX_RX_MULTI_SEG_F)]; } } diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index ccc6fc88ca..04c831514d 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -78,6 +78,15 @@ ssovf_octeontx_wqe_to_pkt(uint64_t work, uint16_t port_info, mbuf->data_len = mbuf->pkt_len; } + if (!!(flag & OCCTX_RX_VLAN_FLTR_F)) { + if (likely(wqe->s.w2.vv)) { + mbuf->ol_flags |= PKT_RX_VLAN; + mbuf->vlan_tci = + ntohs(*((uint16_t *)((char *)mbuf->buf_addr + + mbuf->data_off + wqe->s.w4.vlptr + 2))); + } + } + mbuf->port = rte_octeontx_pchan_map[port_info >> 4][port_info & 0xF]; rte_mbuf_refcnt_set(mbuf, 1); diff --git a/drivers/net/octeontx/octeontx_rxtx.h b/drivers/net/octeontx/octeontx_rxtx.h index 144ae055b8..3f2147a028 100644 --- a/drivers/net/octeontx/octeontx_rxtx.h +++ b/drivers/net/octeontx/octeontx_rxtx.h @@ -485,10 +485,13 @@ T(noff_ol3ol4csum_l3l4csum_mseg, 1, 1, 1, 1, 14, \ MULT_F) /* RX offload macros */ +#define VLAN_FLTR_F OCCTX_RX_VLAN_FLTR_F #define MULT_RX_F OCCTX_RX_MULTI_SEG_F -/* [MULTI_SEG] */ -#define OCCTX_RX_FASTPATH_MODES \ -R(no_offload, 0, OCCTX_RX_OFFLOAD_NONE) \ -R(mseg, 1, MULT_RX_F) \ +/* [VLAN_FLTR][MULTI_SEG] */ +#define OCCTX_RX_FASTPATH_MODES \ +R(no_offload, 0, 0, OCCTX_RX_OFFLOAD_NONE) \ +R(mseg, 0, 1, MULT_RX_F) \ +R(vlan, 1, 0, VLAN_FLTR_F) \ +R(vlan_mseg, 1, 1, VLAN_FLTR_F | MULT_RX_F) #endif /* __OCTEONTX_RXTX_H__ */