summaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_res.c
diff options
context:
space:
mode:
authorVasanthy Kolluri <vkolluri@cisco.com>2011-06-17 07:56:48 +0000
committerDavid S. Miller <davem@davemloft.net>2011-06-30 20:43:38 -0700
commitea7ea65a3b37bf207d5c352ac6254506b3dc3901 (patch)
tree5eed17f071404155e7a76f8f3415bf031a4d656a /drivers/net/enic/enic_res.c
parent3fa2a1df909482cc234524906e4bd30dee3514df (diff)
downloadop-kernel-dev-ea7ea65a3b37bf207d5c352ac6254506b3dc3901.zip
op-kernel-dev-ea7ea65a3b37bf207d5c352ac6254506b3dc3901.tar.gz
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/enic_res.c')
-rw-r--r--drivers/net/enic/enic_res.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 34f4207..4a35367 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -90,9 +90,8 @@ int enic_get_vnic_config(struct enic *enic)
max_t(u16, ENIC_MIN_MTU,
c->mtu));
- c->intr_timer_usec = min_t(u32,
- INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX),
- c->intr_timer_usec);
+ c->intr_timer_usec = min_t(u32, c->intr_timer_usec,
+ vnic_dev_get_intr_coal_timer_max(enic->vdev));
dev_info(enic_get_dev(enic),
"vNIC MAC addr %pM wq/rq %d/%d mtu %d\n",
@@ -303,7 +302,7 @@ void enic_init_vnic_resources(struct enic *enic)
for (i = 0; i < enic->intr_count; i++) {
vnic_intr_init(&enic->intr[i],
- INTR_COALESCE_USEC_TO_HW(enic->config.intr_timer_usec),
+ enic->config.intr_timer_usec,
enic->config.intr_timer_type,
mask_on_assertion);
}
OpenPOWER on IntegriCloud