examples/l2fwd-event: add missing SPDX license header
[dpdk.git] / examples / l2fwd-event / l2fwd_common.c
index c206415..181301f 100644 (file)
@@ -1,3 +1,7 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2019 Marvell International Ltd.
+ */
+
 #include "l2fwd_common.h"
 
 int
@@ -18,6 +22,12 @@ l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
        uint16_t port_id;
        int ret;
 
+       if (rsrc->event_mode) {
+               port_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;
+               port_conf.rx_adv_conf.rss_conf.rss_key = NULL;
+               port_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP;
+       }
+
        /* Initialise each port */
        RTE_ETH_FOREACH_DEV(port_id) {
                struct rte_eth_conf local_port_conf = port_conf;
@@ -35,7 +45,11 @@ l2fwd_event_init_ports(struct l2fwd_resources *rsrc)
                /* init port */
                printf("Initializing port %u... ", port_id);
                fflush(stdout);
-               rte_eth_dev_info_get(port_id, &dev_info);
+
+               ret = rte_eth_dev_info_get(port_id, &dev_info);
+               if (ret != 0)
+                       rte_panic("Error during getting device (port %u) info: %s\n",
+                                 port_id, strerror(-ret));
                if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
                        local_port_conf.txmode.offloads |=
                                DEV_TX_OFFLOAD_MBUF_FAST_FREE;