examples: fix RSS hash function configuration
Checks
Commit Message
ethdev layer introduced checks for application requested RSS hash
functions and returns error for ones unsupported by hardware
This check breaks some sample applications which blindly configures
RSS hash functions without checking underlying hardware support.
Updated examples to mask out unsupported RSS has functions during device
configuration.
Prints a log if configuration values updated by this check.
Fixes: aa1a6d87f15d ("ethdev: force RSS offload rules again")
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Return error added in this release, so no need to backport the fix to
previous versions.
Cc: David Hunt <david.hunt@intel.com>
Cc: Liang Ma <liang.j.ma@intel.com>
Cc: Xueming Li <xuemingl@mellanox.com>
---
examples/bond/main.c | 12 ++++++++++
examples/distributor/main.c | 11 ++++++++++
examples/eventdev_pipeline/main.c | 11 ++++++++++
examples/ip_pipeline/link.c | 8 +++++--
examples/ip_reassembly/main.c | 12 ++++++++++
examples/ipsec-secgw/ipsec-secgw.c | 12 ++++++++++
examples/l3fwd-acl/main.c | 12 ++++++++++
examples/l3fwd-power/main.c | 14 ++++++++++--
examples/l3fwd-vf/main.c | 12 ++++++++++
examples/l3fwd/main.c | 12 ++++++++++
examples/load_balancer/init.c | 12 ++++++++++
examples/multi_process/symmetric_mp/main.c | 12 ++++++++++
.../performance-thread/l3fwd-thread/main.c | 12 ++++++++++
examples/qos_meter/main.c | 22 +++++++++++++++++++
examples/vmdq_dcb/main.c | 13 +++++++++++
15 files changed, 183 insertions(+), 4 deletions(-)
Comments
Hi Ferruh,
On 20/6/2018 4:01 PM, Ferruh Yigit wrote:
> ethdev layer introduced checks for application requested RSS hash
> functions and returns error for ones unsupported by hardware
>
> This check breaks some sample applications which blindly configures
> RSS hash functions without checking underlying hardware support.
>
> Updated examples to mask out unsupported RSS has functions during device
> configuration.
> Prints a log if configuration values updated by this check.
>
> Fixes: aa1a6d87f15d ("ethdev: force RSS offload rules again")
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Return error added in this release, so no need to backport the fix to
> previous versions.
>
> Cc: David Hunt <david.hunt@intel.com>
> Cc: Liang Ma <liang.j.ma@intel.com>
> Cc: Xueming Li <xuemingl@mellanox.com>
> ---
> examples/bond/main.c | 12 ++++++++++
> examples/distributor/main.c | 11 ++++++++++
> examples/eventdev_pipeline/main.c | 11 ++++++++++
> examples/ip_pipeline/link.c | 8 +++++--
> examples/ip_reassembly/main.c | 12 ++++++++++
> examples/ipsec-secgw/ipsec-secgw.c | 12 ++++++++++
> examples/l3fwd-acl/main.c | 12 ++++++++++
> examples/l3fwd-power/main.c | 14 ++++++++++--
> examples/l3fwd-vf/main.c | 12 ++++++++++
> examples/l3fwd/main.c | 12 ++++++++++
> examples/load_balancer/init.c | 12 ++++++++++
> examples/multi_process/symmetric_mp/main.c | 12 ++++++++++
> .../performance-thread/l3fwd-thread/main.c | 12 ++++++++++
> examples/qos_meter/main.c | 22 +++++++++++++++++++
> examples/vmdq_dcb/main.c | 13 +++++++++++
> 15 files changed, 183 insertions(+), 4 deletions(-)
>
>
--snip--
I tested distributor_app, l3-fwd and l3-fwd-power, they all started OK,
giving the additional message that some flags were not available on my
hardware.
Looks good.
Regards,
Dave.
Hi Ferruh,
Thanks for this.. I had started working on a patch to do this as well
because I got bit by this error.
Shouldn't all of the example applications also add the code to strip
the unsupported Tx and Rx offload bits as well? It would help new
users (like me!) to understand that this is a requirement for all
callers of rte_eth_dev_configure().
rte_eth_dev_info_get(port_id, &dev_info);
/* Only set the offload bits which are actually supported */
port_conf.txmode.offloads &= dev_info.tx_offload_capa;
port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
thanks
dan
On Wed, Jun 20, 2018 at 8:11 AM, Hunt, David <david.hunt@intel.com> wrote:
> Hi Ferruh,
> On 20/6/2018 4:01 PM, Ferruh Yigit wrote:
>>
>> ethdev layer introduced checks for application requested RSS hash
>> functions and returns error for ones unsupported by hardware
>>
>> This check breaks some sample applications which blindly configures
>> RSS hash functions without checking underlying hardware support.
>>
>> Updated examples to mask out unsupported RSS has functions during device
>> configuration.
>> Prints a log if configuration values updated by this check.
>>
>> Fixes: aa1a6d87f15d ("ethdev: force RSS offload rules again")
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> Return error added in this release, so no need to backport the fix to
>> previous versions.
>>
>> Cc: David Hunt <david.hunt@intel.com>
>> Cc: Liang Ma <liang.j.ma@intel.com>
>> Cc: Xueming Li <xuemingl@mellanox.com>
Hi Ferruh,
The documentation for rte_eth_dev_configure() should get updated as
well to document this requirement to strip the unsupported RSS hash
function bits. The current documentation only refers to the tx/rx
offload bits:
* - Any offloading set in eth_conf->[rt]xmode.offloads must be within
* the [rt]x_offload_capa returned from rte_eth_dev_infos_get().
* Any type of device supported offloading set in the input argument
* eth_conf->[rt]xmode.offloads to rte_eth_dev_configure() is enabled
* on all queues and it can't be disabled in rte_eth_[rt]x_queue_setup().
thanks
dan
On Wed, Jun 20, 2018 at 10:03 AM, Dan Gora <dg@adax.com> wrote:
> Hi Ferruh,
>
> Thanks for this.. I had started working on a patch to do this as well
> because I got bit by this error.
>
> Shouldn't all of the example applications also add the code to strip
> the unsupported Tx and Rx offload bits as well? It would help new
> users (like me!) to understand that this is a requirement for all
> callers of rte_eth_dev_configure().
>
> rte_eth_dev_info_get(port_id, &dev_info);
>
> /* Only set the offload bits which are actually supported */
> port_conf.txmode.offloads &= dev_info.tx_offload_capa;
> port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
>
> thanks
> dan
On 6/20/2018 6:03 PM, Dan Gora wrote:
> Hi Ferruh,
>
> Thanks for this.. I had started working on a patch to do this as well
> because I got bit by this error.
>
> Shouldn't all of the example applications also add the code to strip
> the unsupported Tx and Rx offload bits as well? It would help new
> users (like me!) to understand that this is a requirement for all
> callers of rte_eth_dev_configure().
>
> rte_eth_dev_info_get(port_id, &dev_info);
>
> /* Only set the offload bits which are actually supported */
> port_conf.txmode.offloads &= dev_info.tx_offload_capa;
> port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
Yes similar thing required for offloads but not in this patch. There will be
already a patch to remove old offload API, perhaps this can be part of that patch.
>
> thanks
> dan
>
>
> On Wed, Jun 20, 2018 at 8:11 AM, Hunt, David <david.hunt@intel.com> wrote:
>> Hi Ferruh,
>> On 20/6/2018 4:01 PM, Ferruh Yigit wrote:
>>>
>>> ethdev layer introduced checks for application requested RSS hash
>>> functions and returns error for ones unsupported by hardware
>>>
>>> This check breaks some sample applications which blindly configures
>>> RSS hash functions without checking underlying hardware support.
>>>
>>> Updated examples to mask out unsupported RSS has functions during device
>>> configuration.
>>> Prints a log if configuration values updated by this check.
>>>
>>> Fixes: aa1a6d87f15d ("ethdev: force RSS offload rules again")
>>>
>>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>>> ---
>>> Return error added in this release, so no need to backport the fix to
>>> previous versions.
>>>
>>> Cc: David Hunt <david.hunt@intel.com>
>>> Cc: Liang Ma <liang.j.ma@intel.com>
>>> Cc: Xueming Li <xuemingl@mellanox.com>
On 6/20/2018 6:07 PM, Dan Gora wrote:
> Hi Ferruh,
>
> The documentation for rte_eth_dev_configure() should get updated as
> well to document this requirement to strip the unsupported RSS hash
> function bits. The current documentation only refers to the tx/rx
> offload bits:
>
> * - Any offloading set in eth_conf->[rt]xmode.offloads must be within
> * the [rt]x_offload_capa returned from rte_eth_dev_infos_get().
> * Any type of device supported offloading set in the input argument
> * eth_conf->[rt]xmode.offloads to rte_eth_dev_configure() is enabled
> * on all queues and it can't be disabled in rte_eth_[rt]x_queue_setup().
Agreed, will update the patch according.
>
> thanks
> dan
>
>
> On Wed, Jun 20, 2018 at 10:03 AM, Dan Gora <dg@adax.com> wrote:
>> Hi Ferruh,
>>
>> Thanks for this.. I had started working on a patch to do this as well
>> because I got bit by this error.
>>
>> Shouldn't all of the example applications also add the code to strip
>> the unsupported Tx and Rx offload bits as well? It would help new
>> users (like me!) to understand that this is a requirement for all
>> callers of rte_eth_dev_configure().
>>
>> rte_eth_dev_info_get(port_id, &dev_info);
>>
>> /* Only set the offload bits which are actually supported */
>> port_conf.txmode.offloads &= dev_info.tx_offload_capa;
>> port_conf.rxmode.offloads &= dev_info.rx_offload_capa;
>>
>> thanks
>> dan
Hi Ferruh,
On Wed, Jun 20, 2018 at 04:01:22PM +0100, Ferruh Yigit wrote:
> ethdev layer introduced checks for application requested RSS hash
> functions and returns error for ones unsupported by hardware
>
> This check breaks some sample applications which blindly configures
> RSS hash functions without checking underlying hardware support.
>
> Updated examples to mask out unsupported RSS has functions during device
> configuration.
> Prints a log if configuration values updated by this check.
>
> Fixes: aa1a6d87f15d ("ethdev: force RSS offload rules again")
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> Return error added in this release, so no need to backport the fix to
> previous versions.
>
> Cc: David Hunt <david.hunt@intel.com>
> Cc: Liang Ma <liang.j.ma@intel.com>
> Cc: Xueming Li <xuemingl@mellanox.com>
> ---
> examples/bond/main.c | 12 ++++++++++
> examples/distributor/main.c | 11 ++++++++++
> examples/eventdev_pipeline/main.c | 11 ++++++++++
> examples/ip_pipeline/link.c | 8 +++++--
> examples/ip_reassembly/main.c | 12 ++++++++++
> examples/ipsec-secgw/ipsec-secgw.c | 12 ++++++++++
> examples/l3fwd-acl/main.c | 12 ++++++++++
> examples/l3fwd-power/main.c | 14 ++++++++++--
> examples/l3fwd-vf/main.c | 12 ++++++++++
> examples/l3fwd/main.c | 12 ++++++++++
> examples/load_balancer/init.c | 12 ++++++++++
> examples/multi_process/symmetric_mp/main.c | 12 ++++++++++
> .../performance-thread/l3fwd-thread/main.c | 12 ++++++++++
> examples/qos_meter/main.c | 22 +++++++++++++++++++
> examples/vmdq_dcb/main.c | 13 +++++++++++
> 15 files changed, 183 insertions(+), 4 deletions(-)
>
As we are fixing it for examples can we include fix for app/test-eventdev too?
diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index d00f91802..79d755b6f 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -706,6 +706,12 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
}
RTE_ETH_FOREACH_DEV(i) {
+ struct rte_eth_dev_info dev_info;
+
+ memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
+ rte_eth_dev_info_get(i, &dev_info);
+ port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
if (rte_eth_dev_configure(i, 1, 1,
&port_conf)
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 719518ff3..386ba14d1 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -249,6 +249,9 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
rx_conf = dev_info.default_rxconf;
rx_conf.offloads = port_conf.rxmode.offloads;
+ port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+
if (rte_eth_dev_configure(i, nb_queues, nb_queues,
&port_conf)
< 0) {
Thanks,
Pavan
On 6/21/2018 5:54 PM, Pavan Nikhilesh wrote:
> Hi Ferruh,
>
> On Wed, Jun 20, 2018 at 04:01:22PM +0100, Ferruh Yigit wrote:
>> ethdev layer introduced checks for application requested RSS hash
>> functions and returns error for ones unsupported by hardware
>>
>> This check breaks some sample applications which blindly configures
>> RSS hash functions without checking underlying hardware support.
>>
>> Updated examples to mask out unsupported RSS has functions during device
>> configuration.
>> Prints a log if configuration values updated by this check.
>>
>> Fixes: aa1a6d87f15d ("ethdev: force RSS offload rules again")
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>> Return error added in this release, so no need to backport the fix to
>> previous versions.
>>
>> Cc: David Hunt <david.hunt@intel.com>
>> Cc: Liang Ma <liang.j.ma@intel.com>
>> Cc: Xueming Li <xuemingl@mellanox.com>
>> ---
>> examples/bond/main.c | 12 ++++++++++
>> examples/distributor/main.c | 11 ++++++++++
>> examples/eventdev_pipeline/main.c | 11 ++++++++++
>> examples/ip_pipeline/link.c | 8 +++++--
>> examples/ip_reassembly/main.c | 12 ++++++++++
>> examples/ipsec-secgw/ipsec-secgw.c | 12 ++++++++++
>> examples/l3fwd-acl/main.c | 12 ++++++++++
>> examples/l3fwd-power/main.c | 14 ++++++++++--
>> examples/l3fwd-vf/main.c | 12 ++++++++++
>> examples/l3fwd/main.c | 12 ++++++++++
>> examples/load_balancer/init.c | 12 ++++++++++
>> examples/multi_process/symmetric_mp/main.c | 12 ++++++++++
>> .../performance-thread/l3fwd-thread/main.c | 12 ++++++++++
>> examples/qos_meter/main.c | 22 +++++++++++++++++++
>> examples/vmdq_dcb/main.c | 13 +++++++++++
>> 15 files changed, 183 insertions(+), 4 deletions(-)
>>
>
> As we are fixing it for examples can we include fix for app/test-eventdev too?
Yes we should, thanks for reminding, I will update the patch to include below.
>
> diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
> index d00f91802..79d755b6f 100644
> --- a/app/test-eventdev/test_perf_common.c
> +++ b/app/test-eventdev/test_perf_common.c
> @@ -706,6 +706,12 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
> }
>
> RTE_ETH_FOREACH_DEV(i) {
> + struct rte_eth_dev_info dev_info;
> +
> + memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
> + rte_eth_dev_info_get(i, &dev_info);
> + port_conf.rx_adv_conf.rss_conf.rss_hf &=
> + dev_info.flow_type_rss_offloads;
>
> if (rte_eth_dev_configure(i, 1, 1,
> &port_conf)
> diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
> index 719518ff3..386ba14d1 100644
> --- a/app/test-eventdev/test_pipeline_common.c
> +++ b/app/test-eventdev/test_pipeline_common.c
> @@ -249,6 +249,9 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
> rx_conf = dev_info.default_rxconf;
> rx_conf.offloads = port_conf.rxmode.offloads;
>
> + port_conf.rx_adv_conf.rss_conf.rss_hf &=
> + dev_info.flow_type_rss_offloads;
> +
> if (rte_eth_dev_configure(i, nb_queues, nb_queues,
> &port_conf)
> < 0) {
>
>
> Thanks,
> Pavan
>
20/06/2018 19:15, Ferruh Yigit:
> On 6/20/2018 6:07 PM, Dan Gora wrote:
> > Hi Ferruh,
> >
> > The documentation for rte_eth_dev_configure() should get updated as
> > well to document this requirement to strip the unsupported RSS hash
> > function bits. The current documentation only refers to the tx/rx
> > offload bits:
> >
> > * - Any offloading set in eth_conf->[rt]xmode.offloads must be within
> > * the [rt]x_offload_capa returned from rte_eth_dev_infos_get().
> > * Any type of device supported offloading set in the input argument
> > * eth_conf->[rt]xmode.offloads to rte_eth_dev_configure() is enabled
> > * on all queues and it can't be disabled in rte_eth_[rt]x_queue_setup().
>
> Agreed, will update the patch according.
I don't see the doc updated in your v2.
On 6/29/2018 12:55 AM, Thomas Monjalon wrote:
> 20/06/2018 19:15, Ferruh Yigit:
>> On 6/20/2018 6:07 PM, Dan Gora wrote:
>>> Hi Ferruh,
>>>
>>> The documentation for rte_eth_dev_configure() should get updated as
>>> well to document this requirement to strip the unsupported RSS hash
>>> function bits. The current documentation only refers to the tx/rx
>>> offload bits:
>>>
>>> * - Any offloading set in eth_conf->[rt]xmode.offloads must be within
>>> * the [rt]x_offload_capa returned from rte_eth_dev_infos_get().
>>> * Any type of device supported offloading set in the input argument
>>> * eth_conf->[rt]xmode.offloads to rte_eth_dev_configure() is enabled
>>> * on all queues and it can't be disabled in rte_eth_[rt]x_queue_setup().
>>
>> Agreed, will update the patch according.
>
> I don't see the doc updated in your v2.
I have missed it, sending new version with the update.
@@ -154,6 +154,18 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
retval = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
if (retval != 0)
rte_exit(EXIT_FAILURE, "port %u: configuration failed (res=%d)\n",
@@ -124,6 +124,17 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+ port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port,
+ port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+ port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
retval = rte_eth_dev_configure(port, rxRings, txRings, &port_conf);
if (retval != 0)
return retval;
@@ -293,6 +293,17 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+ port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf_default.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port,
+ port_conf_default.rx_adv_conf.rss_conf.rss_hf,
+ port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
/* Configure the Ethernet device. */
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
if (retval != 0)
@@ -161,8 +161,12 @@ link_create(const char *name, struct link_params *params)
memcpy(&port_conf, &port_conf_default, sizeof(port_conf));
if (rss) {
port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
- port_conf.rx_adv_conf.rss_conf.rss_hf =
- ETH_RSS_IPV4 | ETH_RSS_IPV6;
+ if (port_info.flow_type_rss_offloads & ETH_RSS_IPV4)
+ port_conf.rx_adv_conf.rss_conf.rss_hf |=
+ ETH_RSS_IPV4;
+ if (port_info.flow_type_rss_offloads & ETH_RSS_IPV6)
+ port_conf.rx_adv_conf.rss_conf.rss_hf |=
+ ETH_RSS_IPV6;
}
cpu_id = (uint32_t) rte_eth_dev_socket_id(port_id);
@@ -1083,6 +1083,18 @@ main(int argc, char **argv)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue,
&local_port_conf);
if (ret < 0) {
@@ -1566,6 +1566,18 @@ port_init(uint16_t portid)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue,
&local_port_conf);
if (ret < 0)
@@ -1926,6 +1926,18 @@ main(int argc, char **argv)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(portid, nb_rx_queue,
(uint16_t)n_tx_queue, &local_port_conf);
if (ret < 0)
@@ -185,8 +185,6 @@ static struct rte_eth_conf port_conf = {
.max_rx_pkt_len = ETHER_MAX_LEN,
.split_hdr_size = 0,
.ignore_offload_bitfield = 1,
- .offloads = (DEV_RX_OFFLOAD_CRC_STRIP |
- DEV_RX_OFFLOAD_CHECKSUM),
},
.rx_adv_conf = {
.rss_conf = {
@@ -1693,6 +1691,18 @@ main(int argc, char **argv)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(portid, nb_rx_queue,
(uint16_t)n_tx_queue, &local_port_conf);
if (ret < 0)
@@ -981,6 +981,18 @@ main(int argc, char **argv)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(portid, nb_rx_queue,
n_tx_queue, &local_port_conf);
if (ret < 0)
@@ -861,6 +861,18 @@ main(int argc, char **argv)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(portid, nb_rx_queue,
(uint16_t)n_tx_queue, &local_port_conf);
if (ret < 0)
@@ -417,6 +417,18 @@ app_init_nics(void)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(
port,
(uint8_t) n_rx_queues,
@@ -200,6 +200,7 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
uint16_t q;
uint16_t nb_rxd = RX_RING_SIZE;
uint16_t nb_txd = TX_RING_SIZE;
+ uint64_t rss_hf_tmp;
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
return 0;
@@ -216,6 +217,17 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool,
if (info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+ port_conf.rx_adv_conf.rss_conf.rss_hf &= info.flow_type_rss_offloads;
+ if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port,
+ rss_hf_tmp,
+ port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);
if (retval < 0)
return retval;
@@ -3551,6 +3551,18 @@ main(int argc, char **argv)
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
local_port_conf.txmode.offloads |=
DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (local_port_conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ portid,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(portid, nb_rx_queue,
(uint16_t)n_tx_queue, &local_port_conf);
if (ret < 0)
@@ -333,6 +333,17 @@ main(int argc, char **argv)
rte_eth_dev_info_get(port_rx, &dev_info);
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads;
+ if (conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port_rx,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(port_rx, 1, 1, &conf);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_rx, ret);
@@ -363,6 +374,17 @@ main(int argc, char **argv)
rte_eth_dev_info_get(port_tx, &dev_info);
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ conf.rx_adv_conf.rss_conf.rss_hf &= dev_info.flow_type_rss_offloads;
+ if (conf.rx_adv_conf.rss_conf.rss_hf !=
+ port_conf.rx_adv_conf.rss_conf.rss_hf) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port_tx,
+ port_conf.rx_adv_conf.rss_conf.rss_hf,
+ conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
ret = rte_eth_dev_configure(port_tx, 1, 1, &conf);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_tx, ret);
@@ -197,6 +197,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
uint16_t queues_per_pool;
uint32_t max_nb_pools;
struct rte_eth_txconf txq_conf;
+ uint64_t rss_hf_tmp;
/*
* The max pool number from dev_info will be used to validate the pool
@@ -257,6 +258,18 @@ port_init(uint16_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;
+
+ rss_hf_tmp = port_conf.rx_adv_conf.rss_conf.rss_hf;
+ port_conf.rx_adv_conf.rss_conf.rss_hf &=
+ dev_info.flow_type_rss_offloads;
+ if (port_conf.rx_adv_conf.rss_conf.rss_hf != rss_hf_tmp) {
+ printf("Port %u modified RSS hash function based on hardware support,"
+ "requested:%#"PRIx64" configured:%#"PRIx64"\n",
+ port,
+ rss_hf_tmp,
+ port_conf.rx_adv_conf.rss_conf.rss_hf);
+ }
+
/*
* Though in this example, all queues including pf queues are setup.
* This is because VMDQ queues doesn't always start from zero, and the