Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion drivers/net/cnxk/cnxk_rep.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,12 @@ cnxk_ethdev_is_representor(const char *if_name)
regex_t regex;
int val;

val = regcomp(&regex, "net_.*_representor_.*", 0);
if (regcomp(&regex, "net_.*_representor_.*", 0) != 0)
return 0;

val = regexec(&regex, if_name, 0, NULL, 0);
regfree(&regex);

return (val == 0);
}

Expand Down
1 change: 1 addition & 0 deletions lib/eal/freebsd/eal.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,7 @@ rte_eal_cleanup(void)
rte_eal_memory_detach();
eal_cleanup_config(internal_conf);
eal_lcore_var_cleanup();
rte_eal_log_cleanup();
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions lib/eal/windows/eal.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ rte_eal_cleanup(void)
rte_eal_memory_detach();
eal_cleanup_config(internal_conf);
eal_lcore_var_cleanup();
rte_eal_log_cleanup();
return 0;
}

Expand Down
17 changes: 17 additions & 0 deletions lib/log/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,21 @@ log_save_level(uint32_t priority, const char *regex, const char *pattern)
return -1;
}

static void
log_free_saved_levels(void)
{
struct rte_eal_opt_loglevel *opt_ll;

while ((opt_ll = TAILQ_FIRST(&opt_loglevel_list)) != NULL) {
TAILQ_REMOVE(&opt_loglevel_list, opt_ll, next);
if (opt_ll->pattern != NULL)
free(opt_ll->pattern);
else
regfree(&opt_ll->re_match);
free(opt_ll);
}
}

RTE_EXPORT_INTERNAL_SYMBOL(eal_log_save_regexp)
int
eal_log_save_regexp(const char *regex, uint32_t level)
Expand Down Expand Up @@ -578,6 +593,8 @@ RTE_EXPORT_INTERNAL_SYMBOL(rte_eal_log_cleanup)
void
rte_eal_log_cleanup(void)
{
log_free_saved_levels();

if (rte_logs.is_internal_file && rte_logs.file != NULL)
fclose(rte_logs.file);
rte_logs.file = NULL;
Expand Down