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.jos...@caviumnetworks.com> --- lib/librte_eventdev/rte_eventmode_helper.c | 3 +++ lib/librte_eventdev/rte_eventmode_helper.h | 7 +++++++ 2 files changed, 10 insertions(+) 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 */ }; -- 2.7.4