examples/l2fwd-event: fix ethdev RSS setup
authorPavan Nikhilesh <pbhagavatula@marvell.com>
Tue, 14 Jan 2020 05:52:23 +0000 (11:22 +0530)
committerJerin Jacob <jerinj@marvell.com>
Tue, 14 Jan 2020 20:37:51 +0000 (21:37 +0100)
Setup RSS configuration based on underlying device capabilities.

Fixes: 4ff457986f76 ("examples/l2fwd-event: add default poll mode routines")
Cc: stable@dpdk.org
Signed-off-by: Satananda Burla <sburla@marvell.com>
Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
examples/l2fwd-event/l2fwd_common.c

index 181301f..ab341e5 100644 (file)
@@ -50,6 +50,17 @@ l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
                if (ret != 0)
                        rte_panic("Error during getting device (port %u) info: %s\n",
                                  port_id, strerror(-ret));
+               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"",
+                               port_id,
+                               port_conf.rx_adv_conf.rss_conf.rss_hf,
+                               local_port_conf.rx_adv_conf.rss_conf.rss_hf);
+               }
+
                if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
                        local_port_conf.txmode.offloads |=
                                DEV_TX_OFFLOAD_MBUF_FAST_FREE;