DPDK patches and discussions
 help / color / mirror / Atom feed
* Re: [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload
@ 2019-10-29  8:42 Pavan Nikhilesh Bhagavatula
  0 siblings, 0 replies; 3+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2019-10-29  8:42 UTC (permalink / raw)
  To: Andrew Rybchenko, ferruh.yigit, Jerin Jacob Kollanukkaran,
	John McNamara, Marko Kovacevic, Thomas Monjalon
  Cc: dev

>On 10/29/19 8:03 AM, pbhagavatula@marvell.com wrote:
>> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>>
>> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be
>used to
>> enable/disable PMDs write to `rte_mbuf::hash::rss`.
>> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
>> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
>>
>> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>
>[snip]
>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c
>b/lib/librte_ethdev/rte_ethdev.c
>> index 6ce8f5e75..fef1dbb61 100644
>
>[snip]
>
>> @@ -1303,6 +1304,16 @@ rte_eth_dev_configure(uint16_t port_id,
>uint16_t nb_rx_q, uint16_t nb_tx_q,
>>   		goto rollback;
>>   	}
>>
>> +	/* Check if Rx*/
>> +	if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_NONE) &&
>
>ETH_MQ_RX_NONE is 0 so above condition is always false.

My bad didn’t realize ETH_MQ_RX_NONE is 0, will fix in next version.

>It should be
>if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0 &&
>
>> +	    (dev_conf->rxmode.offloads &
>DEV_RX_OFFLOAD_RSS_HASH)) {
>> +		RTE_ETHDEV_LOG(ERR,
>> +			"Ethdev port_id=%u config invalid mq_mode %s
>with offloads %s\n",
>> +			port_id, "ETH_MQ_RX_NONE",
>"DEV_RX_OFFLOAD_RSS_HASH");
>
>I think the error message is a bit misleading. It should be:
>
>"Ethdev port_id=%u config invalid mq_mode without RSS but %s
>offload is requested\n"
>
>rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH) should
>be used
>to log offload name.
>
>> +		ret = -EINVAL;
>> +		goto rollback;
>> +	}
>> +
>>   	/*
>>   	 * Setup new number of RX/TX queues and reconfigure device.
>>   	 */
>
>[snip]


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-29  5:03   ` [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
@ 2019-10-29  7:13     ` Andrew Rybchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Rybchenko @ 2019-10-29  7:13 UTC (permalink / raw)
  To: pbhagavatula, ferruh.yigit, jerinj, John McNamara,
	Marko Kovacevic, Thomas Monjalon
  Cc: dev

On 10/29/19 8:03 AM, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
> enable/disable PMDs write to `rte_mbuf::hash::rss`.
> PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
> by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

[snip]

> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 6ce8f5e75..fef1dbb61 100644

[snip]

> @@ -1303,6 +1304,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
>   		goto rollback;
>   	}
>   
> +	/* Check if Rx*/
> +	if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_NONE) &&

ETH_MQ_RX_NONE is 0 so above condition is always false.
It should be
if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0 &&

> +	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> +		RTE_ETHDEV_LOG(ERR,
> +			"Ethdev port_id=%u config invalid mq_mode %s with offloads %s\n",
> +			port_id, "ETH_MQ_RX_NONE", "DEV_RX_OFFLOAD_RSS_HASH");

I think the error message is a bit misleading. It should be:

"Ethdev port_id=%u config invalid mq_mode without RSS but %s offload is requested\n"

rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH) should be used
to log offload name.

> +		ret = -EINVAL;
> +		goto rollback;
> +	}
> +
>   	/*
>   	 * Setup new number of RX/TX queues and reconfigure device.
>   	 */

[snip]


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload
  2019-10-29  5:03 ` [dpdk-dev] [PATCH v14 " pbhagavatula
@ 2019-10-29  5:03   ` pbhagavatula
  2019-10-29  7:13     ` Andrew Rybchenko
  0 siblings, 1 reply; 3+ messages in thread
From: pbhagavatula @ 2019-10-29  5:03 UTC (permalink / raw)
  To: ferruh.yigit, arybchenko, jerinj, John McNamara, Marko Kovacevic,
	Thomas Monjalon
  Cc: dev, Pavan Nikhilesh

From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
PMDs notify the validity of `rte_mbuf::hash:rss` to the applcation
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 doc/guides/nics/features.rst           |  2 ++
 doc/guides/rel_notes/release_19_11.rst |  7 +++++++
 lib/librte_ethdev/rte_ethdev.c         | 11 +++++++++++
 lib/librte_ethdev/rte_ethdev.h         |  1 +
 4 files changed, 21 insertions(+)

diff --git a/doc/guides/nics/features.rst b/doc/guides/nics/features.rst
index 6e20bee5f..9d45e927d 100644
--- a/doc/guides/nics/features.rst
+++ b/doc/guides/nics/features.rst
@@ -274,6 +274,7 @@ Supports RSS hashing on RX.
 
 * **[uses]     user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
 * **[uses]     user config**: ``dev_conf.rx_adv_conf.rss_conf``.
+* **[uses]     rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
@@ -286,6 +287,7 @@ Inner RSS
 Supports RX RSS hashing on Inner headers.
 
 * **[uses]    rte_flow_action_rss**: ``level``.
+* **[uses]    rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
 * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
 
 
diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 60f565401..8b829ba11 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -232,6 +232,13 @@ New Features
   *  This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
      and thereby improve Rx performance if application wishes do so.
 
+* **Added Rx offload flag to enable or disable RSS update**
+
+  *  Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
+     enable/disable PMDs write to `rte_mbuf::hash::rss`.
+  *  PMDs notify the validity of `rte_mbuf::hash:rss` to the application
+     by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
+
 
 Removed Items
 -------------
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 6ce8f5e75..fef1dbb61 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -129,6 +129,7 @@ static const struct {
 	RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
 	RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
 	RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
+	RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
 };
 
 #undef RTE_RX_OFFLOAD_BIT2STR
@@ -1303,6 +1304,16 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 		goto rollback;
 	}
 
+	/* Check if Rx*/
+	if ((dev_conf->rxmode.mq_mode & ETH_MQ_RX_NONE) &&
+	    (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
+		RTE_ETHDEV_LOG(ERR,
+			"Ethdev port_id=%u config invalid mq_mode %s with offloads %s\n",
+			port_id, "ETH_MQ_RX_NONE", "DEV_RX_OFFLOAD_RSS_HASH");
+		ret = -EINVAL;
+		goto rollback;
+	}
+
 	/*
 	 * Setup new number of RX/TX queues and reconfigure device.
 	 */
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index c4ec36ea7..a85e5bb0d 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1048,6 +1048,7 @@ struct rte_eth_conf {
 #define DEV_RX_OFFLOAD_KEEP_CRC		0x00010000
 #define DEV_RX_OFFLOAD_SCTP_CKSUM	0x00020000
 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM  0x00040000
+#define DEV_RX_OFFLOAD_RSS_HASH		0x00080000
 
 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
 				 DEV_RX_OFFLOAD_UDP_CKSUM | \
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-29  8:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29  8:42 [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload Pavan Nikhilesh Bhagavatula
  -- strict thread matches above, loose matches on Subject: below --
2019-10-25 14:33 [dpdk-dev] [PATCH v13 0/6] ethdev: add new Rx offload flags pbhagavatula
2019-10-29  5:03 ` [dpdk-dev] [PATCH v14 " pbhagavatula
2019-10-29  5:03   ` [dpdk-dev] [PATCH v14 2/7] ethdev: add mbuf RSS update as an offload pbhagavatula
2019-10-29  7:13     ` Andrew Rybchenko

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).