RDMA/bnxt_re: Remove unnecessary sched count
Since the lifetime of bnxt_re_task is controlled by the kref of device, sched_count is no longer required. Remove it. Link: https://lore.kernel.org/r/1584117207-2664-4-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
committed by
Jason Gunthorpe
parent
8a6c617047
commit
4e88cef11d
@ -176,7 +176,6 @@ struct bnxt_re_dev {
|
|||||||
atomic_t srq_count;
|
atomic_t srq_count;
|
||||||
atomic_t mr_count;
|
atomic_t mr_count;
|
||||||
atomic_t mw_count;
|
atomic_t mw_count;
|
||||||
atomic_t sched_count;
|
|
||||||
/* Max of 2 lossless traffic class supported per port */
|
/* Max of 2 lossless traffic class supported per port */
|
||||||
u16 cosq[2];
|
u16 cosq[2];
|
||||||
|
|
||||||
|
@ -1667,8 +1667,6 @@ static void bnxt_re_task(struct work_struct *work)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ib_device_put(&rdev->ibdev);
|
ib_device_put(&rdev->ibdev);
|
||||||
smp_mb__before_atomic();
|
|
||||||
atomic_dec(&rdev->sched_count);
|
|
||||||
exit:
|
exit:
|
||||||
put_device(&rdev->ibdev.dev);
|
put_device(&rdev->ibdev.dev);
|
||||||
kfree(re_work);
|
kfree(re_work);
|
||||||
@ -1720,11 +1718,6 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case NETDEV_UNREGISTER:
|
case NETDEV_UNREGISTER:
|
||||||
/* netdev notifier will call NETDEV_UNREGISTER again later since
|
|
||||||
* we are still holding the reference to the netdev
|
|
||||||
*/
|
|
||||||
if (atomic_read(&rdev->sched_count) > 0)
|
|
||||||
goto exit;
|
|
||||||
ib_unregister_device_queued(&rdev->ibdev);
|
ib_unregister_device_queued(&rdev->ibdev);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1742,7 +1735,6 @@ static int bnxt_re_netdev_event(struct notifier_block *notifier,
|
|||||||
re_work->vlan_dev = (real_dev == netdev ?
|
re_work->vlan_dev = (real_dev == netdev ?
|
||||||
NULL : netdev);
|
NULL : netdev);
|
||||||
INIT_WORK(&re_work->work, bnxt_re_task);
|
INIT_WORK(&re_work->work, bnxt_re_task);
|
||||||
atomic_inc(&rdev->sched_count);
|
|
||||||
queue_work(bnxt_re_wq, &re_work->work);
|
queue_work(bnxt_re_wq, &re_work->work);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user