[dpdk-dev,RFC,2/5] added --enable-representor command line argument in EAL to load representor broker infrastructure.
Checks
Commit Message
Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Signed-off-by: Remy Horton <remy.horton@intel.com>
Signed-off-by: Declan Doherty <declan.doherty@intel.com>
---
lib/librte_eal/bsdapp/eal/eal.c | 6 ++++++
lib/librte_eal/common/eal_common_options.c | 1 +
lib/librte_eal/common/eal_internal_cfg.h | 2 ++
lib/librte_eal/common/eal_options.h | 2 ++
lib/librte_eal/common/include/rte_eal.h | 8 ++++++++
lib/librte_eal/linuxapp/eal/eal.c | 9 +++++++++
6 files changed, 28 insertions(+)
@@ -698,3 +698,9 @@ rte_eal_process_type(void)
{
return rte_config.process_type;
}
+
+/* return non-zero if port-representor is enabled. */
+int rte_representor_enabled(void)
+{
+ return internal_config.enable_representor;
+}
@@ -78,6 +78,7 @@ const struct option
eal_long_options[] = {
{OPT_BASE_VIRTADDR, 1, NULL, OPT_BASE_VIRTADDR_NUM },
{OPT_CREATE_UIO_DEV, 0, NULL, OPT_CREATE_UIO_DEV_NUM },
+ {OPT_ENABLE_REPRESENTOR, 0, NULL, OPT_ENABLE_REPRESENTOR_NUM },
{OPT_FILE_PREFIX, 1, NULL, OPT_FILE_PREFIX_NUM },
{OPT_HELP, 0, NULL, OPT_HELP_NUM },
{OPT_HUGE_DIR, 1, NULL, OPT_HUGE_DIR_NUM },
@@ -72,6 +72,8 @@ struct internal_config {
* instead of native TSC */
volatile unsigned no_shconf; /**< true if there is no shared config */
volatile unsigned create_uio_dev; /**< true to create /dev/uioX devices */
+ volatile unsigned enable_representor;
+ /**< true to enable port representor broker for all PFs */
volatile enum rte_proc_type_t process_type; /**< multi-process proc type */
/** true to try allocating memory on specific sockets */
volatile unsigned force_sockets;
@@ -49,6 +49,8 @@ enum {
OPT_BASE_VIRTADDR_NUM,
#define OPT_CREATE_UIO_DEV "create-uio-dev"
OPT_CREATE_UIO_DEV_NUM,
+#define OPT_ENABLE_REPRESENTOR "enable-representor"
+ OPT_ENABLE_REPRESENTOR_NUM,
#define OPT_FILE_PREFIX "file-prefix"
OPT_FILE_PREFIX_NUM,
#define OPT_HUGE_DIR "huge-dir"
@@ -287,6 +287,14 @@ static inline int rte_gettid(void)
return RTE_PER_LCORE(_thread_id);
}
+/**
+ * Get flag for port representor should be enabled or not.
+ *
+ * @return
+ * Returns the enable-representor flag.
+ */
+int rte_representor_enabled(void);
+
#define RTE_INIT(func) \
static void __attribute__((constructor, used)) func(void)
@@ -610,6 +610,10 @@ eal_parse_args(int argc, char **argv)
internal_config.create_uio_dev = 1;
break;
+ case OPT_ENABLE_REPRESENTOR_NUM:
+ internal_config.enable_representor = 1;
+ break;
+
default:
if (opt < OPT_LONG_MIN_NUM && isprint(opt)) {
RTE_LOG(ERR, EAL, "Option %c is not supported "
@@ -1016,3 +1020,8 @@ rte_eal_check_module(const char *module_name)
/* Module has been found */
return 1;
}
+
+int rte_representor_enabled(void)
+{
+ return internal_config.enable_representor;
+}