diff options
author | Vasanthy Kolluri <vkolluri@cisco.com> | 2011-06-17 09:56:48 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-01 05:43:38 +0200 |
commit | ea7ea65a3b37bf207d5c352ac6254506b3dc3901 (patch) | |
tree | 5eed17f071404155e7a76f8f3415bf031a4d656a /drivers/net/enic/vnic_intr.c | |
parent | virtio-net: per cpu 64 bit stats (v2) (diff) | |
download | linux-ea7ea65a3b37bf207d5c352ac6254506b3dc3901.tar.xz linux-ea7ea65a3b37bf207d5c352ac6254506b3dc3901.zip |
enic: Add support to configure hardware interrupt coalesce timers in a platform independent way
enic driver and the underlying hardware use different units for representing the interrupt coalesce timer.
Driver converts the interrupt coalesce timer in usec to hardware cycles while setting the relevant hardware
registers. The conversion factor can be different for each of the adapter hardware types. So it is dynamically
learnt from the adapter firmware using the devcmd CMD_INTR_COAL_CONVERT. This allows the driver to configure
the hardware interrupt coalesce timers in a platform independent way.
Signed-off-by: Danny Guo <dannguo@cisco.com>
Signed-off-by: Vasanthy Kolluri <vkolluri@cisco.com>
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
Diffstat (limited to 'drivers/net/enic/vnic_intr.c')
-rw-r--r-- | drivers/net/enic/vnic_intr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/enic/vnic_intr.c b/drivers/net/enic/vnic_intr.c index 3873771d75cc..0ca107f7bc8c 100644 --- a/drivers/net/enic/vnic_intr.c +++ b/drivers/net/enic/vnic_intr.c @@ -46,7 +46,7 @@ int vnic_intr_alloc(struct vnic_dev *vdev, struct vnic_intr *intr, return 0; } -void vnic_intr_init(struct vnic_intr *intr, unsigned int coalescing_timer, +void vnic_intr_init(struct vnic_intr *intr, u32 coalescing_timer, unsigned int coalescing_type, unsigned int mask_on_assertion) { vnic_intr_coalescing_timer_set(intr, coalescing_timer); @@ -56,9 +56,10 @@ void vnic_intr_init(struct vnic_intr *intr, unsigned int coalescing_timer, } void vnic_intr_coalescing_timer_set(struct vnic_intr *intr, - unsigned int coalescing_timer) + u32 coalescing_timer) { - iowrite32(coalescing_timer, &intr->ctrl->coalescing_timer); + iowrite32(vnic_dev_intr_coal_timer_usec_to_hw(intr->vdev, + coalescing_timer), &intr->ctrl->coalescing_timer); } void vnic_intr_clean(struct vnic_intr *intr) |