eal: make eal_parse_coremask external

Message ID 20220915033919.4134000-1-abdullah.sevincer@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series eal: make eal_parse_coremask external |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS

Commit Message

Abdullah Sevincer Sept. 15, 2022, 3:39 a.m. UTC
DLB2 has a need to parse a user supplied coremask as part
of an optimization that associates optimal core/resource
pairs.  Therefore eal_parse_coremask has been renamed
to rte_eal_parse_coremask and exported.

Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
---
 lib/eal/common/eal_common_options.c | 6 +++---
 lib/eal/common/eal_options.h        | 2 ++
 lib/eal/version.map                 | 1 +
 3 files changed, 6 insertions(+), 3 deletions(-)
  

Comments

David Marchand Sept. 23, 2022, 10:36 a.m. UTC | #1
Hello Abdullah,

On Thu, Sep 15, 2022 at 5:39 AM Abdullah Sevincer
<abdullah.sevincer@intel.com> wrote:
>
> DLB2 has a need to parse a user supplied coremask as part
> of an optimization that associates optimal core/resource
> pairs.  Therefore eal_parse_coremask has been renamed
> to rte_eal_parse_coremask and exported.

Please version new revisions of a patch for your next contributions.


>
> Signed-off-by: Abdullah Sevincer <abdullah.sevincer@intel.com>
> ---
>  lib/eal/common/eal_common_options.c | 6 +++---
>  lib/eal/common/eal_options.h        | 2 ++
>  lib/eal/version.map                 | 1 +
>  3 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
> index 4c2def0155..2d6535781b 100644
> --- a/lib/eal/common/eal_common_options.c
> +++ b/lib/eal/common/eal_common_options.c
> @@ -742,8 +742,8 @@ check_core_list(int *lcores, unsigned int count)
>         return -1;
>  }
>
> -static int
> -eal_parse_coremask(const char *coremask, int *cores)
> +int
> +rte_eal_parse_coremask(const char *coremask, int *cores)
>  {
>         const char *coremask_orig = coremask;
>         int lcores[RTE_MAX_LCORE];
> @@ -1649,7 +1649,7 @@ eal_parse_common_option(int opt, const char *optarg,
>                 if (eal_service_cores_parsed())
>                         RTE_LOG(WARNING, EAL,
>                                 "Service cores parsed before dataplane cores. Please ensure -c is before -s or -S\n");
> -               if (eal_parse_coremask(optarg, lcore_indexes) < 0) {
> +               if (rte_eal_parse_coremask(optarg, lcore_indexes) < 0) {
>                         RTE_LOG(ERR, EAL, "invalid coremask syntax\n");
>                         return -1;
>                 }
> diff --git a/lib/eal/common/eal_options.h b/lib/eal/common/eal_options.h
> index 3cc9cb6412..0cfb57cd1f 100644
> --- a/lib/eal/common/eal_options.h
> +++ b/lib/eal/common/eal_options.h
> @@ -108,5 +108,7 @@ int eal_plugins_init(void);
>  int eal_save_args(int argc, char **argv);
>  int handle_eal_info_request(const char *cmd, const char *params __rte_unused,
>                 struct rte_tel_data *d);
> +__rte_internal
> +int rte_eal_parse_coremask(const char *coremask, int *cores);

I moved this to rte_eal.h and added a (doxygen) description of what
this helper does.

>
>  #endif /* EAL_OPTIONS_H */
> diff --git a/lib/eal/version.map b/lib/eal/version.map
> index 1f293e768b..c643bc1612 100644
> --- a/lib/eal/version.map
> +++ b/lib/eal/version.map
> @@ -464,4 +464,5 @@ INTERNAL {
>         rte_mem_map;
>         rte_mem_page_size;
>         rte_mem_unmap;
> +       rte_eal_parse_coremask;

Fixed to alphabetical order.


Applied, thanks.
  

Patch

diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 4c2def0155..2d6535781b 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -742,8 +742,8 @@  check_core_list(int *lcores, unsigned int count)
 	return -1;
 }
 
-static int
-eal_parse_coremask(const char *coremask, int *cores)
+int
+rte_eal_parse_coremask(const char *coremask, int *cores)
 {
 	const char *coremask_orig = coremask;
 	int lcores[RTE_MAX_LCORE];
@@ -1649,7 +1649,7 @@  eal_parse_common_option(int opt, const char *optarg,
 		if (eal_service_cores_parsed())
 			RTE_LOG(WARNING, EAL,
 				"Service cores parsed before dataplane cores. Please ensure -c is before -s or -S\n");
-		if (eal_parse_coremask(optarg, lcore_indexes) < 0) {
+		if (rte_eal_parse_coremask(optarg, lcore_indexes) < 0) {
 			RTE_LOG(ERR, EAL, "invalid coremask syntax\n");
 			return -1;
 		}
diff --git a/lib/eal/common/eal_options.h b/lib/eal/common/eal_options.h
index 3cc9cb6412..0cfb57cd1f 100644
--- a/lib/eal/common/eal_options.h
+++ b/lib/eal/common/eal_options.h
@@ -108,5 +108,7 @@  int eal_plugins_init(void);
 int eal_save_args(int argc, char **argv);
 int handle_eal_info_request(const char *cmd, const char *params __rte_unused,
 		struct rte_tel_data *d);
+__rte_internal
+int rte_eal_parse_coremask(const char *coremask, int *cores);
 
 #endif /* EAL_OPTIONS_H */
diff --git a/lib/eal/version.map b/lib/eal/version.map
index 1f293e768b..c643bc1612 100644
--- a/lib/eal/version.map
+++ b/lib/eal/version.map
@@ -464,4 +464,5 @@  INTERNAL {
 	rte_mem_map;
 	rte_mem_page_size;
 	rte_mem_unmap;
+	rte_eal_parse_coremask;
 };