common/cnxk: remove BPHY IRQ stack

Add support for removing existing IRQ stack.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Signed-off-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
This commit is contained in:
Tomasz Duszynski 2021-06-21 17:04:36 +02:00 committed by Thomas Monjalon
parent 1da18cb444
commit 3a0abb7102
3 changed files with 32 additions and 0 deletions

View File

@ -110,6 +110,36 @@ roc_bphy_intr_fini(struct roc_bphy_irq_chip *irq_chip)
plt_free(irq_chip);
}
void
roc_bphy_irq_stack_remove(int cpu)
{
struct roc_bphy_irq_stack *curr_stack;
if (pthread_mutex_lock(&stacks_mutex))
return;
STAILQ_FOREACH(curr_stack, &irq_stacks, entries) {
if (curr_stack->cpu == cpu)
break;
}
if (curr_stack == NULL)
goto leave;
if (curr_stack->inuse > 0)
curr_stack->inuse--;
if (curr_stack->inuse == 0) {
STAILQ_REMOVE(&irq_stacks, curr_stack, roc_bphy_irq_stack,
entries);
plt_free(curr_stack->sp_buffer);
plt_free(curr_stack);
}
leave:
pthread_mutex_unlock(&stacks_mutex);
}
void *
roc_bphy_irq_stack_get(int cpu)
{

View File

@ -23,6 +23,7 @@ struct roc_bphy_irq_chip {
__roc_api struct roc_bphy_irq_chip *roc_bphy_intr_init(void);
__roc_api void roc_bphy_intr_fini(struct roc_bphy_irq_chip *irq_chip);
__roc_api void roc_bphy_irq_stack_remove(int cpu);
__roc_api void *roc_bphy_irq_stack_get(int cpu);
__roc_api bool roc_bphy_intr_available(struct roc_bphy_irq_chip *irq_chip,
int irq_num);

View File

@ -26,6 +26,7 @@ INTERNAL {
roc_bphy_intr_fini;
roc_bphy_intr_init;
roc_bphy_irq_stack_get;
roc_bphy_irq_stack_remove;
roc_clk_freq_get;
roc_error_msg_get;
roc_idev_lmt_base_addr_get;