Commit a9fd686a authored by Luo bin's avatar Luo bin Committed by David S. Miller

hinic: modify irq name

Make a distinction between different irqs by netdev name or pci name.
Signed-off-by: default avatarLuo bin <luobin9@huawei.com>
Reviewed-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f313edfe
...@@ -793,12 +793,15 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwif *hwif, ...@@ -793,12 +793,15 @@ static int init_eq(struct hinic_eq *eq, struct hinic_hwif *hwif,
HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT, HINIC_EQ_MSIX_LLI_CREDIT_LIMIT_DEFAULT,
HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT); HINIC_EQ_MSIX_RESEND_TIMER_DEFAULT);
if (type == HINIC_AEQ) if (type == HINIC_AEQ) {
err = request_irq(entry.vector, aeq_interrupt, 0, snprintf(eq->irq_name, sizeof(eq->irq_name), "hinic_aeq%d@pci:%s", eq->q_id,
"hinic_aeq", eq); pci_name(pdev));
else if (type == HINIC_CEQ) err = request_irq(entry.vector, aeq_interrupt, 0, eq->irq_name, eq);
err = request_irq(entry.vector, ceq_interrupt, 0, } else if (type == HINIC_CEQ) {
"hinic_ceq", eq); snprintf(eq->irq_name, sizeof(eq->irq_name), "hinic_ceq%d@pci:%s", eq->q_id,
pci_name(pdev));
err = request_irq(entry.vector, ceq_interrupt, 0, eq->irq_name, eq);
}
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to request irq for the EQ\n"); dev_err(&pdev->dev, "Failed to request irq for the EQ\n");
......
...@@ -186,6 +186,7 @@ struct hinic_eq { ...@@ -186,6 +186,7 @@ struct hinic_eq {
int num_elem_in_pg; int num_elem_in_pg;
struct msix_entry msix_entry; struct msix_entry msix_entry;
char irq_name[64];
dma_addr_t *dma_addr; dma_addr_t *dma_addr;
void **virt_addr; void **virt_addr;
......
...@@ -588,7 +588,7 @@ int hinic_init_rxq(struct hinic_rxq *rxq, struct hinic_rq *rq, ...@@ -588,7 +588,7 @@ int hinic_init_rxq(struct hinic_rxq *rxq, struct hinic_rq *rq,
rxq_stats_init(rxq); rxq_stats_init(rxq);
rxq->irq_name = devm_kasprintf(&netdev->dev, GFP_KERNEL, rxq->irq_name = devm_kasprintf(&netdev->dev, GFP_KERNEL,
"hinic_rxq%d", qp->q_id); "%s_rxq%d", netdev->name, qp->q_id);
if (!rxq->irq_name) if (!rxq->irq_name)
return -ENOMEM; return -ENOMEM;
......
...@@ -894,14 +894,14 @@ int hinic_init_txq(struct hinic_txq *txq, struct hinic_sq *sq, ...@@ -894,14 +894,14 @@ int hinic_init_txq(struct hinic_txq *txq, struct hinic_sq *sq,
goto err_alloc_free_sges; goto err_alloc_free_sges;
} }
irqname_len = snprintf(NULL, 0, "hinic_txq%d", qp->q_id) + 1; irqname_len = snprintf(NULL, 0, "%s_txq%d", netdev->name, qp->q_id) + 1;
txq->irq_name = devm_kzalloc(&netdev->dev, irqname_len, GFP_KERNEL); txq->irq_name = devm_kzalloc(&netdev->dev, irqname_len, GFP_KERNEL);
if (!txq->irq_name) { if (!txq->irq_name) {
err = -ENOMEM; err = -ENOMEM;
goto err_alloc_irqname; goto err_alloc_irqname;
} }
sprintf(txq->irq_name, "hinic_txq%d", qp->q_id); sprintf(txq->irq_name, "%s_txq%d", netdev->name, qp->q_id);
err = hinic_hwdev_hw_ci_addr_set(hwdev, sq, CI_UPDATE_NO_PENDING, err = hinic_hwdev_hw_ci_addr_set(hwdev, sq, CI_UPDATE_NO_PENDING,
CI_UPDATE_NO_COALESC); CI_UPDATE_NO_COALESC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment