app/testpmd: fix dcb config failure

Message ID 1532431954-123708-1-git-send-email-xiaoyun.li@intel.com (mailing list archive)
State Rejected, archived
Headers
Series app/testpmd: fix dcb config failure |

Checks

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

Commit Message

Li, Xiaoyun July 24, 2018, 11:32 a.m. UTC
After adding RSS hash offload check, default rss_hf will fail on devices
that do not support all bits. This will lead to dcb config failure. The
patch fixes this issue by taking rss_hf as a suggested value and only
setting bits that the device supports based on rte_eth_dev_get_info.

Fixes: 8863a1fbfc66 ("ethdev: add supported hash function check")
Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic class")
Cc: stable@dpdk.org

Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Iremonger, Bernard July 24, 2018, 4:16 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xiaoyun Li
> Sent: Tuesday, July 24, 2018 12:33 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Wu, Jingjing
> <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Li, Xiaoyun <xiaoyun.li@intel.com>; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] app/testpmd: fix dcb config failure
> 
> After adding RSS hash offload check, default rss_hf will fail on devices that do
> not support all bits. This will lead to dcb config failure. The patch fixes this
> issue by taking rss_hf as a suggested value and only setting bits that the
> device supports based on rte_eth_dev_get_info.
> 
> Fixes: 8863a1fbfc66 ("ethdev: add supported hash function check")
> Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic
> class")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>

Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
  
Thomas Monjalon July 26, 2018, 5:18 p.m. UTC | #2
> > After adding RSS hash offload check, default rss_hf will fail on devices that do
> > not support all bits. This will lead to dcb config failure. The patch fixes this
> > issue by taking rss_hf as a suggested value and only setting bits that the
> > device supports based on rte_eth_dev_get_info.
> > 
> > Fixes: 8863a1fbfc66 ("ethdev: add supported hash function check")
> > Fixes: 1a572499beb6 ("app/testpmd: setup DCB forwarding based on traffic
> > class")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com>
> 
> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>

NACK

testpmd is a test application for developpers.
It must fail if the PMD cannot support user-requested features.

For other applications, there can be a smooth fallback
if and only if there are appropriate logs.
This is what Ferruh did for examples:
	http://git.dpdk.org/dpdk/commit/?id=4f5701f28bd
  

Patch

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f504ca3..d221469 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2575,6 +2575,9 @@  init_port_dcb_config(portid_t pid,
 	if (retval < 0)
 		return retval;
 	port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
+	rte_eth_dev_info_get(pid, &rte_port->dev_info);
+	port_conf.rx_adv_conf.rss_conf.rss_hf &=
+			rte_port->dev_info.flow_type_rss_offloads;
 
 	/* re-configure the device . */
 	rte_eth_dev_configure(pid, nb_rxq, nb_rxq, &port_conf);