summaryrefslogtreecommitdiff
path: root/examples/l3fwd-vf
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2018-07-04 21:02:21 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-07-05 15:46:48 +0200
commit4f5701f28bd41cbe582a03af4d82d1fa6c1cab91 (patch)
treea1193884f6c8657678b2305135bd0eeae571ecd2 /examples/l3fwd-vf
parent69bce062132bd2b4a943fafbb710215a7999d198 (diff)
downloaddpdk-4f5701f28bd41cbe582a03af4d82d1fa6c1cab91.zip
dpdk-4f5701f28bd41cbe582a03af4d82d1fa6c1cab91.tar.gz
dpdk-4f5701f28bd41cbe582a03af4d82d1fa6c1cab91.tar.xz
examples: fix RSS hash function configuration
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> Tested-by: Meijuan Zhao <meijuanx.zhao@intel.com> Tested-by: Yingya Han <yingyax.han@intel.com> Acked-by: David Hunt <david.hunt@intel.com>
Diffstat (limited to 'examples/l3fwd-vf')
-rw-r--r--examples/l3fwd-vf/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 43e6298..5edd91a 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -980,6 +980,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)