[17/39] eventdev: allow application to set ethernet portmask

Message ID 1559583160-13944-18-git-send-email-anoobj@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: Jerin Jacob
Headers
Series adding eventmode helper library |

Checks

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

Commit Message

Anoob Joseph June 3, 2019, 5:32 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 <anoobj@marvell.com>
Signed-off-by: Lukasz Bartosik <lbartosik@marvell.com>
---
 lib/librte_eventdev/rte_eventmode_helper.c | 3 +++
 lib/librte_eventdev/rte_eventmode_helper.h | 6 ++++++
 2 files changed, 9 insertions(+)
  

Patch

diff --git a/lib/librte_eventdev/rte_eventmode_helper.c b/lib/librte_eventdev/rte_eventmode_helper.c
index 8119306..dc2c934 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 2a0cb30..77e69d0 100644
--- a/lib/librte_eventdev/rte_eventmode_helper.h
+++ b/lib/librte_eventdev/rte_eventmode_helper.h
@@ -8,6 +8,7 @@ 
 extern "C" {
 #endif
 
+#include <rte_common.h>
 #include <rte_compat.h>
 
 /* Packet transfer mode of the application */
@@ -19,6 +20,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 */
 };