提交 f97c4d82 编写于 作者: Y Yonglong Liu 提交者: David S. Miller

net: hns3: modify the IRQ name of misc vectors

The misc IRQ of all the devices have the same name, so it's
hard to find the right misc IRQ of the device.

This patch modifies the misc IRQ names as "hclge/hclgevf"-misc-
"pci name". And now the IRQ name is not related to net device
name anymore, so change the HNAE3_INT_NAME_LEN to 32 bytes, and
that is enough.
Signed-off-by: NYonglong Liu <liuyonglong@huawei.com>
Signed-off-by: NHuazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7ab2b53e
...@@ -575,8 +575,7 @@ struct hnae3_ae_algo { ...@@ -575,8 +575,7 @@ struct hnae3_ae_algo {
const struct pci_device_id *pdev_id_table; const struct pci_device_id *pdev_id_table;
}; };
#define HNAE3_INT_NAME_EXT_LEN 32 /* Max extra information length */ #define HNAE3_INT_NAME_LEN 32
#define HNAE3_INT_NAME_LEN (IFNAMSIZ + HNAE3_INT_NAME_EXT_LEN)
#define HNAE3_ITR_COUNTDOWN_START 100 #define HNAE3_ITR_COUNTDOWN_START 100
struct hnae3_tc_info { struct hnae3_tc_info {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include "hnae3.h"
#define HCLGE_CMDQ_TX_TIMEOUT 30000 #define HCLGE_CMDQ_TX_TIMEOUT 30000
#define HCLGE_DESC_DATA_LEN 6 #define HCLGE_DESC_DATA_LEN 6
...@@ -63,6 +64,7 @@ enum hclge_cmd_status { ...@@ -63,6 +64,7 @@ enum hclge_cmd_status {
struct hclge_misc_vector { struct hclge_misc_vector {
u8 __iomem *addr; u8 __iomem *addr;
int vector_irq; int vector_irq;
char name[HNAE3_INT_NAME_LEN];
}; };
struct hclge_cmq { struct hclge_cmq {
......
...@@ -3177,8 +3177,10 @@ static int hclge_misc_irq_init(struct hclge_dev *hdev) ...@@ -3177,8 +3177,10 @@ static int hclge_misc_irq_init(struct hclge_dev *hdev)
hclge_get_misc_vector(hdev); hclge_get_misc_vector(hdev);
/* this would be explicitly freed in the end */ /* this would be explicitly freed in the end */
snprintf(hdev->misc_vector.name, HNAE3_INT_NAME_LEN, "%s-misc-%s",
HCLGE_NAME, pci_name(hdev->pdev));
ret = request_irq(hdev->misc_vector.vector_irq, hclge_misc_irq_handle, ret = request_irq(hdev->misc_vector.vector_irq, hclge_misc_irq_handle,
0, "hclge_misc", hdev); 0, hdev->misc_vector.name, hdev);
if (ret) { if (ret) {
hclge_free_vector(hdev, 0); hclge_free_vector(hdev, 0);
dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n", dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n",
......
...@@ -2376,8 +2376,10 @@ static int hclgevf_misc_irq_init(struct hclgevf_dev *hdev) ...@@ -2376,8 +2376,10 @@ static int hclgevf_misc_irq_init(struct hclgevf_dev *hdev)
hclgevf_get_misc_vector(hdev); hclgevf_get_misc_vector(hdev);
snprintf(hdev->misc_vector.name, HNAE3_INT_NAME_LEN, "%s-misc-%s",
HCLGEVF_NAME, pci_name(hdev->pdev));
ret = request_irq(hdev->misc_vector.vector_irq, hclgevf_misc_irq_handle, ret = request_irq(hdev->misc_vector.vector_irq, hclgevf_misc_irq_handle,
0, "hclgevf_cmd", hdev); 0, hdev->misc_vector.name, hdev);
if (ret) { if (ret) {
dev_err(&hdev->pdev->dev, "VF failed to request misc irq(%d)\n", dev_err(&hdev->pdev->dev, "VF failed to request misc irq(%d)\n",
hdev->misc_vector.vector_irq); hdev->misc_vector.vector_irq);
......
...@@ -221,6 +221,7 @@ struct hclgevf_rss_cfg { ...@@ -221,6 +221,7 @@ struct hclgevf_rss_cfg {
struct hclgevf_misc_vector { struct hclgevf_misc_vector {
u8 __iomem *addr; u8 __iomem *addr;
int vector_irq; int vector_irq;
char name[HNAE3_INT_NAME_LEN];
}; };
struct hclgevf_rst_stats { struct hclgevf_rst_stats {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册