argparse: add version in symbols map

Message ID 20240305103640.3051399-1-david.marchand@redhat.com (mailing list archive)
State Not Applicable, archived
Delegated to: David Marchand
Headers
Series argparse: add version in symbols map |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

David Marchand March 5, 2024, 10:36 a.m. UTC
  Fixes: e3e579f5bab5 ("argparse: introduce argparse library")

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/argparse/version.map | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Bruce Richardson March 5, 2024, 10:48 a.m. UTC | #1
On Tue, Mar 05, 2024 at 11:36:40AM +0100, David Marchand wrote:
> Fixes: e3e579f5bab5 ("argparse: introduce argparse library")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
fengchengwen March 5, 2024, 11:35 a.m. UTC | #2
Acked-by: Chengwen Feng <fengchengwen@huawei.com>

BTW: which tool detects this problem?

On 2024/3/5 18:36, David Marchand wrote:
> Fixes: e3e579f5bab5 ("argparse: introduce argparse library")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/argparse/version.map | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/argparse/version.map b/lib/argparse/version.map
> index 9b68464600..46da99a3e2 100644
> --- a/lib/argparse/version.map
> +++ b/lib/argparse/version.map
> @@ -1,6 +1,7 @@
>  EXPERIMENTAL {
>  	global:
>  
> +	# added in 24.03
>  	rte_argparse_parse;
>  	rte_argparse_parse_type;
>  
>
  
David Marchand March 5, 2024, 12:14 p.m. UTC | #3
On Tue, Mar 5, 2024 at 12:35 PM fengchengwen <fengchengwen@huawei.com> wrote:
>
> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>
> BTW: which tool detects this problem?

I found out about those issues while manually inspecting the changes
on **/version.map since v23.11.

At the moment, there is no tool enforcing that experimental symbols
must be in a block with a version comment.

Adding a check could be done:

$ git diff
diff --git a/buildtools/map-list-symbol.sh b/buildtools/map-list-symbol.sh
index a834399816..b76e2417c5 100755
--- a/buildtools/map-list-symbol.sh
+++ b/buildtools/map-list-symbol.sh
@@ -61,8 +61,12 @@ for file in $@; do
                if (current_section == "") {
                        next;
                }
-               if ("'$version'" != "" && "'$version'" != current_version) {
-                       next;
+               if ("'$version'" != "") {
+                       if ("'$version'" == "unset" && current_version != "") {
+                               next;
+                       } else if ("'$version'" != "unset" &&
"'$version'" != current_version) {
+                               next;
+                       }
                }
                gsub(";","");
                if ("'$symbol'" == "all" || $1 == "'$symbol'") {


And it catches more issues:
$ find lib -name 'version.map' -exec ./buildtools/map-list-symbol.sh
-S EXPERIMENTAL -V unset {} \;
lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_encode_json_format
lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_reg_all_ethdev
lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_get_global_stats
lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_get_port_stats_ids
lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_get_ports_stats_json
lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_extract_data
lib/regexdev/version.map EXPERIMENTAL rte_regex_devices
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_attr_get
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_attr_set
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_close
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_configure
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_count
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_dequeue_burst
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_dump
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_enqueue_burst
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_get_dev_id
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_info_get
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_is_valid_dev
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_logtype
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_queue_pair_setup
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_compile_activate
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_export
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_import
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_update
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_selftest
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_start
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_stop
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_by_name_get
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_get
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_names_get
lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_reset
lib/reorder/version.map EXPERIMENTAL rte_reorder_seqn_dynfield_offset
lib/mldev/version.map EXPERIMENTAL rte_ml_dequeue_burst
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_close
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_configure
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_count
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_dump
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_info_get
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_init
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_is_valid_dev
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_logtype
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_queue_pair_setup
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_selftest
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_socket_id
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_start
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_stats_get
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_stats_reset
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_stop
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_by_name_get
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_get
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_names_get
lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_reset
lib/mldev/version.map EXPERIMENTAL rte_ml_enqueue_burst
lib/mldev/version.map EXPERIMENTAL rte_ml_io_dequantize
lib/mldev/version.map EXPERIMENTAL rte_ml_io_quantize
lib/mldev/version.map EXPERIMENTAL rte_ml_model_info_get
lib/mldev/version.map EXPERIMENTAL rte_ml_model_load
lib/mldev/version.map EXPERIMENTAL rte_ml_model_params_update
lib/mldev/version.map EXPERIMENTAL rte_ml_model_start
lib/mldev/version.map EXPERIMENTAL rte_ml_model_stop
lib/mldev/version.map EXPERIMENTAL rte_ml_model_unload
lib/mldev/version.map EXPERIMENTAL rte_ml_op_error_get
lib/mldev/version.map EXPERIMENTAL rte_ml_op_pool_create
lib/mldev/version.map EXPERIMENTAL rte_ml_op_pool_free
lib/argparse/version.map EXPERIMENTAL rte_argparse_parse
lib/argparse/version.map EXPERIMENTAL rte_argparse_parse_type


However... if you look at the other fix I sent:
https://patchwork.dpdk.org/project/dpdk/patch/20240305103651.3051448-1-david.marchand@redhat.com/
In this case, the symbols were added to an incorrect version block and
checking this is a bit more difficult.
For this, I have no simple check.
  
David Marchand March 5, 2024, 3:02 p.m. UTC | #4
On Tue, Mar 5, 2024 at 1:14 PM David Marchand <david.marchand@redhat.com> wrote:
>
> On Tue, Mar 5, 2024 at 12:35 PM fengchengwen <fengchengwen@huawei.com> wrote:
> >
> > Acked-by: Chengwen Feng <fengchengwen@huawei.com>
> >
> > BTW: which tool detects this problem?
>
> I found out about those issues while manually inspecting the changes
> on **/version.map since v23.11.
>
> At the moment, there is no tool enforcing that experimental symbols
> must be in a block with a version comment.
>
> Adding a check could be done:
>
> $ git diff
> diff --git a/buildtools/map-list-symbol.sh b/buildtools/map-list-symbol.sh
> index a834399816..b76e2417c5 100755
> --- a/buildtools/map-list-symbol.sh
> +++ b/buildtools/map-list-symbol.sh
> @@ -61,8 +61,12 @@ for file in $@; do
>                 if (current_section == "") {
>                         next;
>                 }
> -               if ("'$version'" != "" && "'$version'" != current_version) {
> -                       next;
> +               if ("'$version'" != "") {
> +                       if ("'$version'" == "unset" && current_version != "") {
> +                               next;
> +                       } else if ("'$version'" != "unset" &&
> "'$version'" != current_version) {
> +                               next;
> +                       }
>                 }
>                 gsub(";","");
>                 if ("'$symbol'" == "all" || $1 == "'$symbol'") {
>
>
> And it catches more issues:
> $ find lib -name 'version.map' -exec ./buildtools/map-list-symbol.sh
> -S EXPERIMENTAL -V unset {} \;
> lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_encode_json_format
> lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_reg_all_ethdev
> lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_get_global_stats
> lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_get_port_stats_ids
> lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_get_ports_stats_json
> lib/metrics/version.map EXPERIMENTAL rte_metrics_tel_extract_data
> lib/regexdev/version.map EXPERIMENTAL rte_regex_devices
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_attr_get
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_attr_set
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_close
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_configure
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_count
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_dequeue_burst
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_dump
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_enqueue_burst
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_get_dev_id
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_info_get
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_is_valid_dev
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_logtype
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_queue_pair_setup
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_compile_activate
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_export
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_import
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_rule_db_update
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_selftest
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_start
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_stop
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_by_name_get
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_get
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_names_get
> lib/regexdev/version.map EXPERIMENTAL rte_regexdev_xstats_reset
> lib/reorder/version.map EXPERIMENTAL rte_reorder_seqn_dynfield_offset
> lib/mldev/version.map EXPERIMENTAL rte_ml_dequeue_burst
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_close
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_configure
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_count
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_dump
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_info_get
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_init
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_is_valid_dev
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_logtype
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_queue_pair_setup
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_selftest
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_socket_id
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_start
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_stats_get
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_stats_reset
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_stop
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_by_name_get
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_get
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_names_get
> lib/mldev/version.map EXPERIMENTAL rte_ml_dev_xstats_reset
> lib/mldev/version.map EXPERIMENTAL rte_ml_enqueue_burst
> lib/mldev/version.map EXPERIMENTAL rte_ml_io_dequantize
> lib/mldev/version.map EXPERIMENTAL rte_ml_io_quantize
> lib/mldev/version.map EXPERIMENTAL rte_ml_model_info_get
> lib/mldev/version.map EXPERIMENTAL rte_ml_model_load
> lib/mldev/version.map EXPERIMENTAL rte_ml_model_params_update
> lib/mldev/version.map EXPERIMENTAL rte_ml_model_start
> lib/mldev/version.map EXPERIMENTAL rte_ml_model_stop
> lib/mldev/version.map EXPERIMENTAL rte_ml_model_unload
> lib/mldev/version.map EXPERIMENTAL rte_ml_op_error_get
> lib/mldev/version.map EXPERIMENTAL rte_ml_op_pool_create
> lib/mldev/version.map EXPERIMENTAL rte_ml_op_pool_free
> lib/argparse/version.map EXPERIMENTAL rte_argparse_parse
> lib/argparse/version.map EXPERIMENTAL rte_argparse_parse_type
>

I sent a respin, fixing all existing issues.
If the respin has no objection, I will discard this current patch.
  

Patch

diff --git a/lib/argparse/version.map b/lib/argparse/version.map
index 9b68464600..46da99a3e2 100644
--- a/lib/argparse/version.map
+++ b/lib/argparse/version.map
@@ -1,6 +1,7 @@ 
 EXPERIMENTAL {
 	global:
 
+	# added in 24.03
 	rte_argparse_parse;
 	rte_argparse_parse_type;