hinic: fix a irq affinity bug
authorLuo bin <luobin9@huawei.com>
Thu, 27 Feb 2020 06:34:42 +0000 (06:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Feb 2020 19:08:01 +0000 (11:08 -0800)
can not use a local variable as an input parameter of
irq_set_affinity_hint

Signed-off-by: Luo bin <luobin9@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/huawei/hinic/hinic_hw_qp.h
drivers/net/ethernet/huawei/hinic/hinic_rx.c

index f4a339b10b10b55c86da6080adf12b3248b58534..79091e1314181e3493c9e54760ca4671936337e1 100644 (file)
@@ -94,6 +94,7 @@ struct hinic_rq {
 
        struct hinic_wq         *wq;
 
+       struct cpumask          affinity_mask;
        u32                     irq;
        u16                     msix_entry;
 
index 56ea6d692f1c3dda7fd329c555d1a70696c0dd1a..2695ad69fca600c469762643ebd804f6bdfade1d 100644 (file)
@@ -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)