DPDK patches and discussions
 help / color / mirror / Atom feed
From: Harman Kalra <hkalra@marvell.com>
To: <jerinj@marvell.com>
Cc: <dev@dpdk.org>, <vattunuru@marvell.com>
Subject: Re: [dpdk-dev] [PATCH 3/4] event/octeontx: add VLAN filter offload support
Date: Mon, 6 Apr 2020 15:23:27 +0530	[thread overview]
Message-ID: <20200406095326.GA174491@outlook.office365.com> (raw)
In-Reply-To: <1584372553-28710-4-git-send-email-hkalra@marvell.com>

On Mon, Mar 16, 2020 at 08:59:12PM +0530, Harman Kalra wrote:
> From: Vamsi Attunuru <vattunuru@marvell.com>
> 
> Adding rx burst function pointer hooks for vlan filter
> offload in event PMD.
> 
> Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>

Acked-by: Harman Kalra <hkalra@marvell.com>

> ---
>  drivers/event/octeontx/ssovf_worker.c | 38 +++++++++++++++------------
>  drivers/event/octeontx/ssovf_worker.h |  9 +++++++
>  drivers/net/octeontx/octeontx_rxtx.h  | 11 +++++---
>  3 files changed, 37 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c
> index 5d8e213ce..093f6f000 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	__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 61332304a..e23bd057e 100644
> --- a/drivers/event/octeontx/ssovf_worker.h
> +++ b/drivers/event/octeontx/ssovf_worker.h
> @@ -84,6 +84,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 e7656f333..515c4699a 100644
> --- a/drivers/net/octeontx/octeontx_rxtx.h
> +++ b/drivers/net/octeontx/octeontx_rxtx.h
> @@ -489,10 +489,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__ */
> -- 
> 2.18.0
> 

  reply	other threads:[~2020-04-06  9:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 15:29 [dpdk-dev] [PATCH 0/4] event/octeontx: support new features Harman Kalra
2020-03-16 15:29 ` [dpdk-dev] [PATCH 1/4] event/octeontx: add multi segment support to eventdev Harman Kalra
2020-03-16 15:29 ` [dpdk-dev] [PATCH 2/4] event/octeontx: add framework for Rx/Tx offloads Harman Kalra
2020-03-16 15:29 ` [dpdk-dev] [PATCH 3/4] event/octeontx: add VLAN filter offload support Harman Kalra
2020-04-06  9:53   ` Harman Kalra [this message]
2020-03-16 15:29 ` [dpdk-dev] [PATCH 4/4] event/octeontx: support Rx Tx checksum offload Harman Kalra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200406095326.GA174491@outlook.office365.com \
    --to=hkalra@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=vattunuru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).