[7/7] examples/eventdev_pipeline: add new Rx RSS hash offload

Message ID 20190816055511.2322-8-pbhagavatula@marvell.com
State Superseded
Delegated to: Ferruh Yigit
Headers show
Series
  • ethdev: add new Rx offload flags
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Bhagavatula Aug. 16, 2019, 5:55 a.m.
From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload
flag `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
into the mbuf.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 examples/eventdev_pipeline/main.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jerin Jacob Kollanukkaran Aug. 16, 2019, 6:01 a.m. | #1
> -----Original Message-----
> From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
> Sent: Friday, August 16, 2019 11:25 AM
> To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; ferruh.yigit@intel.com;
> Harry van Haaren <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula
> <pbhagavatula@marvell.com>
> Subject: [dpdk-dev] [PATCH 7/7] examples/eventdev_pipeline: add new Rx
> RSS hash offload
> 
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Since pipeline_generic uses `rte_mbuf::hash::rss` add the new Rx offload flag
> `DEV_RX_OFFLOAD_RSS_HASH` to inform PMD to copy the RSS hash result
> into the mbuf.
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> ---
>  examples/eventdev_pipeline/main.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/examples/eventdev_pipeline/main.c
> b/examples/eventdev_pipeline/main.c
> index f4e57f541..f08253cc3 100644
> --- a/examples/eventdev_pipeline/main.c
> +++ b/examples/eventdev_pipeline/main.c
> @@ -278,6 +278,10 @@ port_init(uint8_t port, struct rte_mempool
> *mbuf_pool)
>  	if (dev_info.tx_offload_capa &
> DEV_TX_OFFLOAD_MBUF_FAST_FREE)
>  		port_conf.txmode.offloads |=
>  			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
> +
> +	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
> +		port_conf.rxmode.offloads |=
> DEV_RX_OFFLOAD_RSS_HASH;

We need this only when Rx adapter in SW mode.

> +
>  	rx_conf = dev_info.default_rxconf;
>  	rx_conf.offloads = port_conf.rxmode.offloads;
> 
> --
> 2.22.0

Patch

diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index f4e57f541..f08253cc3 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -278,6 +278,10 @@  port_init(uint8_t port, struct rte_mempool *mbuf_pool)
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+	if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_RSS_HASH)
+		port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
 	rx_conf = dev_info.default_rxconf;
 	rx_conf.offloads = port_conf.rxmode.offloads;