@@ -2294,37 +2294,30 @@ ucs_thread_mode_t ucp_worker_get_thread_mode(uint64_t worker_flags)
22942294 return UCS_THREAD_MODE_SINGLE ;
22952295}
22962296
2297- static void ucp_warn_unused_config_modifications ( const ucp_context_h context )
2297+ static void ucp_warn_unused_uct_config ( ucp_context_h context )
22982298{
2299- const ucs_config_cached_key_t * key ;
2300- ucs_string_buffer_t unused_modifications ;
2301- unsigned num_unused_modifications ;
2299+ unsigned num_unused_cached_kv = 0 ;
2300+ ucs_string_buffer_t unused_cached_uct_cfg ;
2301+ ucs_config_cached_key_t * key_val ;
23022302
2303- if (!context -> config .ext .warn_unused_config_modifications ) {
2304- return ;
2305- }
2306-
2307- ucs_string_buffer_init (& unused_modifications );
2308- num_unused_modifications = 0 ;
2303+ ucs_string_buffer_init (& unused_cached_uct_cfg );
23092304
2310- ucs_list_for_each (key , & context -> cached_key_list , list ) {
2311- if (!key -> used ) {
2312- ucs_string_buffer_appendf (& unused_modifications , "%s=%s," , key -> key ,
2313- key -> value );
2314- ++ num_unused_modifications ;
2305+ ucs_list_for_each (key_val , & context -> cached_key_list , list ) {
2306+ if (!key_val -> used ) {
2307+ ucs_string_buffer_appendf (& unused_cached_uct_cfg , "%s=%s," ,
2308+ key_val -> key , key_val -> value );
2309+ ++ num_unused_cached_kv ;
23152310 }
23162311 }
23172312
2318- if (num_unused_modifications > 0 ) {
2319- ucs_string_buffer_rtrim (& unused_modifications , "," );
2320- ucs_warn ("unused configuration%s: %s\n"
2321- "(set %s%s=n to suppress this warning)" ,
2322- (num_unused_modifications > 1 ) ? "s" : "" ,
2323- ucs_string_buffer_cstr (& unused_modifications ),
2324- UCS_DEFAULT_ENV_PREFIX , UCP_WARN_UNUSED_CONFIG_MODIFICATIONS );
2313+ if (num_unused_cached_kv > 0 ) {
2314+ ucs_string_buffer_rtrim (& unused_cached_uct_cfg , "," );
2315+ ucs_warn ("invalid configuration%s: %s" ,
2316+ (num_unused_cached_kv > 1 ) ? "s" : "" ,
2317+ ucs_string_buffer_cstr (& unused_cached_uct_cfg ));
23252318 }
23262319
2327- ucs_string_buffer_cleanup (& unused_modifications );
2320+ ucs_string_buffer_cleanup (& unused_cached_uct_cfg );
23282321}
23292322
23302323static void
@@ -2684,7 +2677,8 @@ ucs_status_t ucp_worker_create(ucp_context_h context,
26842677 */
26852678 ucs_config_parser_print_env_vars_once (context -> config .env_prefix );
26862679
2687- ucp_warn_unused_config_modifications (context );
2680+ /* Warn unused cached uct configuration */
2681+ ucp_warn_unused_uct_config (context );
26882682
26892683 ucp_worker_set_max_am_header (worker );
26902684
0 commit comments