diff mbox series

[dpdk-dev,04/20] eventdev: allow application to set ethernet portmask

Message ID 1528478659-15859-5-git-send-email-anoob.joseph@caviumnetworks.com (mailing list archive)
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers show
Series add eventmode helper functions | expand

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Anoob Joseph June 8, 2018, 5:24 p.m. UTC
Application would be required to restrict helper functions to use only
certain ports. The field eth_portmask field in the conf could be used
for this.

Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
---
 lib/librte_eventdev/rte_eventmode_helper.c | 3 +++
 lib/librte_eventdev/rte_eventmode_helper.h | 7 +++++++
 2 files changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c
index 14ea493..9282682 100644
--- a/lib/librte_eventdev/rte_eventmode_helper.c
+++ b/lib/librte_eventdev/rte_eventmode_helper.c
@@ -87,6 +87,9 @@  em_initialize_helper_conf(struct rte_eventmode_helper_conf *conf)
 
 	/* Packet transfer mode: poll */
 	conf->mode = RTE_EVENTMODE_HELPER_PKT_TRANSFER_MODE_POLL;
+
+	/* Keep all ethernet ports enabled by default */
+	conf->eth_portmask = -1;
 }
 
 struct rte_eventmode_helper_conf *
diff --git a/lib/librte_eventdev/rte_eventmode_helper.h b/lib/librte_eventdev/rte_eventmode_helper.h
index bfe4fa9..7500f0c 100644
--- a/lib/librte_eventdev/rte_eventmode_helper.h
+++ b/lib/librte_eventdev/rte_eventmode_helper.h
@@ -4,6 +4,8 @@ 
 #ifndef _RTE_EVENTMODE_HELPER_H_
 #define _RTE_EVENTMODE_HELPER_H_
 
+#include <rte_common.h>
+
 /* Packet transfer mode of the application */
 enum rte_eventmode_helper_pkt_transfer_mode {
 	RTE_EVENTMODE_HELPER_PKT_TRANSFER_MODE_POLL = 0,
@@ -13,6 +15,11 @@  enum rte_eventmode_helper_pkt_transfer_mode {
 struct rte_eventmode_helper_conf {
 	enum rte_eventmode_helper_pkt_transfer_mode mode;
 		/**< Packet transfer mode of the application */
+	uint32_t eth_portmask;
+		/**<
+		 * Mask of the eth ports to be used. This portmask would be
+		 * checked while initializing devices using helper routines.
+		 */
 	void *mode_params;
 		/**< Mode specific parameters */
 };