linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] hinic: Fix a irq affinity bug
@ 2020-02-18 19:40 Luo bin
  2020-02-18 19:40 ` [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt Luo bin
  2020-02-19 18:47 ` [PATCH net-next 1/2] hinic: Fix a irq affinity bug David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Luo bin @ 2020-02-18 19:40 UTC (permalink / raw)
  To: davem; +Cc: linux-kernel, netdev, aviad.krawczyk, luobin9, luoxianjun

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

Signed-off-by: Luo bin <luobin9@huawei.com>
---
 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(-)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h
index f4a339b10b10..79091e131418 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h
@@ -94,6 +94,7 @@ struct hinic_rq {
 
 	struct hinic_wq         *wq;
 
+	struct cpumask		affinity_mask;
 	u32                     irq;
 	u16                     msix_entry;
 
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_rx.c b/drivers/net/ethernet/huawei/hinic/hinic_rx.c
index 56ea6d692f1c..2695ad69fca6 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_rx.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_rx.c
@@ -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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt
  2020-02-18 19:40 [PATCH net-next 1/2] hinic: Fix a irq affinity bug Luo bin
@ 2020-02-18 19:40 ` Luo bin
  2020-02-19 18:48   ` David Miller
  2020-02-19 18:47 ` [PATCH net-next 1/2] hinic: Fix a irq affinity bug David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Luo bin @ 2020-02-18 19:40 UTC (permalink / raw)
  To: davem; +Cc: linux-kernel, netdev, aviad.krawczyk, luobin9, luoxianjun

This patch fix the bug of setting hw_ioctxt failed randomly

Signed-off-by: Luo bin <luobin9@huawei.com>
---
 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(-)

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
index 6f2cf569a283..79b3d53f2fbf 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.c
@@ -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;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h
index b069045de416..1265c11e8da8 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h
@@ -151,7 +151,7 @@ struct hinic_cmd_hw_ioctxt {
 
 	u8      lro_en;
 	u8      rsvd3;
-	u8      rsvd4;
+	u8      ppf_idx;
 	u8      rsvd5;
 
 	u16     rq_depth;
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h
index 517794509eb2..c7bb9ceca72c 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h
+++ b/drivers/net/ethernet/huawei/hinic/hinic_hw_if.h
@@ -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)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/2] hinic: Fix a irq affinity bug
  2020-02-18 19:40 [PATCH net-next 1/2] hinic: Fix a irq affinity bug Luo bin
  2020-02-18 19:40 ` [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt Luo bin
@ 2020-02-19 18:47 ` David Miller
  2020-02-27  8:39   ` luobin (L)
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2020-02-19 18:47 UTC (permalink / raw)
  To: luobin9; +Cc: linux-kernel, netdev, aviad.krawczyk, luoxianjun

From: Luo bin <luobin9@huawei.com>
Date: Tue, 18 Feb 2020 19:40:12 +0000

> do not use a local variable as an input parameter of irq_set_affinity_hint
> 
> Signed-off-by: Luo bin <luobin9@huawei.com>

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt
  2020-02-18 19:40 ` [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt Luo bin
@ 2020-02-19 18:48   ` David Miller
  2020-02-27  8:39     ` luobin (L)
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2020-02-19 18:48 UTC (permalink / raw)
  To: luobin9; +Cc: linux-kernel, netdev, aviad.krawczyk, luoxianjun

From: Luo bin <luobin9@huawei.com>
Date: Tue, 18 Feb 2020 19:40:13 +0000

> This patch fix the bug of setting hw_ioctxt failed randomly
> 
> Signed-off-by: Luo bin <luobin9@huawei.com>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 1/2] hinic: Fix a irq affinity bug
  2020-02-19 18:47 ` [PATCH net-next 1/2] hinic: Fix a irq affinity bug David Miller
@ 2020-02-27  8:39   ` luobin (L)
  0 siblings, 0 replies; 6+ messages in thread
From: luobin (L) @ 2020-02-27  8:39 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, netdev, aviad.krawczyk, luoxianjun

Hi David:

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

On 2020/2/20 2:47, David Miller wrote:
> From: Luo bin <luobin9@huawei.com>
> Date: Tue, 18 Feb 2020 19:40:12 +0000
>
>> do not use a local variable as an input parameter of irq_set_affinity_hint
>>
>> Signed-off-by: Luo bin <luobin9@huawei.com>
> Bug fixes should target 'net' instead of 'net-next'.
>
> Every patch series containing more than one patch should have an appropriate
> header posting.
> .

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt
  2020-02-19 18:48   ` David Miller
@ 2020-02-27  8:39     ` luobin (L)
  0 siblings, 0 replies; 6+ messages in thread
From: luobin (L) @ 2020-02-27  8:39 UTC (permalink / raw)
  To: David Miller; +Cc: linux-kernel, netdev, aviad.krawczyk, luoxianjun

Hi David:

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

On 2020/2/20 2:48, David Miller wrote:
> From: Luo bin <luobin9@huawei.com>
> Date: Tue, 18 Feb 2020 19:40:13 +0000
>
>> This patch fix the bug of setting hw_ioctxt failed randomly
>>
>> Signed-off-by: Luo bin <luobin9@huawei.com>
> This does not explain what the bug is, how you decided to fix it,
> and why you decided to fix it that way.
> .

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-27  8:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 19:40 [PATCH net-next 1/2] hinic: Fix a irq affinity bug Luo bin
2020-02-18 19:40 ` [PATCH net-next 2/2] hinic: Fix a bug of setting hw_ioctxt Luo bin
2020-02-19 18:48   ` David Miller
2020-02-27  8:39     ` luobin (L)
2020-02-19 18:47 ` [PATCH net-next 1/2] hinic: Fix a irq affinity bug David Miller
2020-02-27  8:39   ` luobin (L)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).