net: hns3: modify the IRQ name of misc vectors
authorYonglong Liu <liuyonglong@huawei.com>
Sat, 4 Jan 2020 02:49:28 +0000 (10:49 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jan 2020 21:26:25 +0000 (13:26 -0800)
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: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h

index 3b5e2d7251e75ce34b4b5584f7d24a7c22f375fb..ed97bd6c03e63a9416d17d026e6d446b59df4729 100644 (file)
@@ -575,8 +575,7 @@ struct hnae3_ae_algo {
        const struct pci_device_id *pdev_id_table;
 };
 
-#define HNAE3_INT_NAME_EXT_LEN    32    /* Max extra information length */
-#define HNAE3_INT_NAME_LEN        (IFNAMSIZ + HNAE3_INT_NAME_EXT_LEN)
+#define HNAE3_INT_NAME_LEN        32
 #define HNAE3_ITR_COUNTDOWN_START 100
 
 struct hnae3_tc_info {
index d97da67f07a1fdb4239458dc592beae9d350989c..96498d9b4754cd635c749be1480df81a3d158093 100644 (file)
@@ -6,6 +6,7 @@
 #include <linux/types.h>
 #include <linux/io.h>
 #include <linux/etherdevice.h>
+#include "hnae3.h"
 
 #define HCLGE_CMDQ_TX_TIMEOUT          30000
 #define HCLGE_DESC_DATA_LEN            6
@@ -63,6 +64,7 @@ enum hclge_cmd_status {
 struct hclge_misc_vector {
        u8 __iomem *addr;
        int vector_irq;
+       char name[HNAE3_INT_NAME_LEN];
 };
 
 struct hclge_cmq {
index b696127369562884f41f0d933536a60f3500010f..4a15510a4babbc05bfa349b9bfa468160310f3f7 100644 (file)
@@ -3177,8 +3177,10 @@ static int hclge_misc_irq_init(struct hclge_dev *hdev)
        hclge_get_misc_vector(hdev);
 
        /* 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,
-                         0, "hclge_misc", hdev);
+                         0, hdev->misc_vector.name, hdev);
        if (ret) {
                hclge_free_vector(hdev, 0);
                dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n",
index c33b8027f80120945cd154450f7bef6e1ee3d8f9..cfa797ef990676f743829d1fba1cc6ec4131430f 100644 (file)
@@ -2376,8 +2376,10 @@ static int hclgevf_misc_irq_init(struct hclgevf_dev *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,
-                         0, "hclgevf_cmd", hdev);
+                         0, hdev->misc_vector.name, hdev);
        if (ret) {
                dev_err(&hdev->pdev->dev, "VF failed to request misc irq(%d)\n",
                        hdev->misc_vector.vector_irq);
index 003114f6db6cfa9b666196bf31c149bcbc5b07e0..2cbc7dfe2f91db8816bec0b03fb3aaadd0dcb8fa 100644 (file)
@@ -221,6 +221,7 @@ struct hclgevf_rss_cfg {
 struct hclgevf_misc_vector {
        u8 __iomem *addr;
        int vector_irq;
+       char name[HNAE3_INT_NAME_LEN];
 };
 
 struct hclgevf_rst_stats {