[dpdk-dev,04/20] eventdev: allow application to set ethernet portmask
Checks
Commit Message
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(+)
@@ -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 *
@@ -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 */
};