Skip to contentSkip to conversation

hinic: Fix a irq affinity bug

PATCH In review Luo bin 2 participants 6 messages Feb 19, 2020 – Feb 27, 2020

Subsystems (3)
lore
Share & tools
lore
author
#1 lore raw

PATCH 2/2 hinic: Fix a bug of setting hw_ioctxt

In reply to Luo bin

This patch fix the bug of setting hw_ioctxt failed randomly

---
 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c | 1 +
 drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h | 2 +-
 drivers/net/ethernet/huawei/hinic/hinic_hw_if.h  | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c +1 -0
index 6f2cf569a283..79b3d53f2fbf 100644
@@ -297,6 +297,7 @@ static int set_hw_ioctxt(struct hinic_hwdev *hwdev, unsigned int rq_depth,
 	}
 
 	hw_ioctxt.func_idx = HINIC_HWIF_FUNC_IDX(hwif);
+	hw_ioctxt.ppf_idx = HINIC_HWIF_PPF_IDX(hwif);
 
 	hw_ioctxt.set_cmdq_depth = HW_IOCTXT_SET_CMDQ_DEPTH_DEFAULT;
 	hw_ioctxt.cmdq_depth = 0;
drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h +1 -1
index b069045de416..1265c11e8da8 100644
@@ -151,7 +151,7 @@ struct hinic_cmd_hw_ioctxt {
 
 	u8      lro_en;
 	u8      rsvd3;
-	u8      rsvd4;
+	u8      ppf_idx;
 	u8      rsvd5;
 
 	u16     rq_depth;
drivers/net/ethernet/huawei/hinic/hinic_hw_if.h +1 -0
index 517794509eb2..c7bb9ceca72c 100644
@@ -137,6 +137,7 @@
 #define HINIC_HWIF_FUNC_IDX(hwif)       ((hwif)->attr.func_idx)
 #define HINIC_HWIF_PCI_INTF(hwif)       ((hwif)->attr.pci_intf_idx)
 #define HINIC_HWIF_PF_IDX(hwif)         ((hwif)->attr.pf_idx)
+#define HINIC_HWIF_PPF_IDX(hwif)        ((hwif)->attr.ppf_idx)
 
 #define HINIC_FUNC_TYPE(hwif)           ((hwif)->attr.func_type)
 #define HINIC_IS_PF(hwif)               (HINIC_FUNC_TYPE(hwif) == HINIC_PF)
Signature · 1 line
2.17.1

Luo bin

author
#0 lore raw

PATCH 1/2 hinic: Fix a irq affinity bug

do not use a local variable as an input parameter of irq_set_affinity_hint

---
 drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h | 1 +
 drivers/net/ethernet/huawei/hinic/hinic_rx.c    | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h +1 -0
index f4a339b10b10..79091e131418 100644
@@ -94,6 +94,7 @@ struct hinic_rq {
 
 	struct hinic_wq         *wq;
 
+	struct cpumask		affinity_mask;
 	u32                     irq;
 	u16                     msix_entry;
 
drivers/net/ethernet/huawei/hinic/hinic_rx.c +2 -3
index 56ea6d692f1c..2695ad69fca6 100644
@@ -475,7 +475,6 @@ static int rx_request_irq(struct hinic_rxq *rxq)
 	struct hinic_hwdev *hwdev = nic_dev->hwdev;
 	struct hinic_rq *rq = rxq->rq;
 	struct hinic_qp *qp;
-	struct cpumask mask;
 	int err;
 
 	rx_add_napi(rxq);
@@ -492,8 +491,8 @@ static int rx_request_irq(struct hinic_rxq *rxq)
 	}
 
 	qp = container_of(rq, struct hinic_qp, rq);
-	cpumask_set_cpu(qp->q_id % num_online_cpus(), &mask);
-	return irq_set_affinity_hint(rq->irq, &mask);
+	cpumask_set_cpu(qp->q_id % num_online_cpus(), &rq->affinity_mask);
+	return irq_set_affinity_hint(rq->irq, &rq->affinity_mask);
 }
 
 static void rx_free_irq(struct hinic_rxq *rxq)
Signature · 1 line
2.17.1
maintainer
#4 lore raw

From: Luo bin <[email protected]>
Date: Tue, 18 Feb 2020 19:40:12 +0000

Quoted 3 lines

do not use a local variable as an input parameter of irq_set_affinity_hint

Bug fixes should target 'net' instead of 'net-next'.

Every patch series containing more than one patch should have an appropriate header posting.

maintainer
#2 lore raw

Re: [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt

In reply to Luo bin

From: Luo bin <[email protected]>
Date: Tue, 18 Feb 2020 19:40:13 +0000

Quoted 3 lines

This patch fix the bug of setting hw_ioctxt failed randomly

This does not explain what the bug is, how you decided to fix it, and why you decided to fix it that way.

author
#5 lore raw
In reply to David Miller

Hi David:

Thanks for your reply, we'll fix and resubmit.

Quoted 11 lines · David Miller

From: Luo bin <[email protected]>
Date: Tue, 18 Feb 2020 19:40:12 +0000

Quoted 3 lines

do not use a local variable as an input parameter of irq_set_affinity_hint

Bug fixes should target 'net' instead of 'net-next'.

Every patch series containing more than one patch should have an appropriate header posting.
.

author
#3 lore raw

Re: [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt

In reply to David Miller

Hi David:

Thanks for your reply, we'll fix and resubmit.

Quoted 9 lines · David Miller

From: Luo bin <[email protected]>
Date: Tue, 18 Feb 2020 19:40:13 +0000

Quoted 3 lines

This patch fix the bug of setting hw_ioctxt failed randomly

This does not explain what the bug is, how you decided to fix it, and why you decided to fix it that way.
.