aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_res.c
diff options
context:
space:
mode:
authorVasanthy Kolluri <vkolluri@cisco.com>2010-10-20 06:16:59 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-21 04:26:47 -0400
commit717258ba4b3ecca9c7c0ef2b76d7aa5800242bad (patch)
treed82deb82352401aa9b3877c2b99fec348e3b583d /drivers/net/enic/enic_res.c
parente0e8ab596012d8c2147beb3c8b70d2d6ab90acda (diff)
enic: Add support for multiple hardware receive queues
Add support for multiple hardware receive queues. The ingress traffic is hashed into one of the receive queues based on IP or TCP or both headers. The max no. of receive queues supported is 8. 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@davemloft.net>
Diffstat (limited to 'drivers/net/enic/enic_res.c')
-rw-r--r--drivers/net/enic/enic_res.c49
1 files changed, 30 insertions, 19 deletions
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 19a276cf7681..f111a37419ce 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -35,6 +35,7 @@
35#include "vnic_intr.h" 35#include "vnic_intr.h"
36#include "vnic_stats.h" 36#include "vnic_stats.h"
37#include "vnic_nic.h" 37#include "vnic_nic.h"
38#include "vnic_rss.h"
38#include "enic_res.h" 39#include "enic_res.h"
39#include "enic.h" 40#include "enic.h"
40 41
@@ -93,13 +94,14 @@ int enic_get_vnic_config(struct enic *enic)
93 INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX), 94 INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX),
94 c->intr_timer_usec); 95 c->intr_timer_usec);
95 96
96 dev_info(enic_get_dev(enic), "vNIC MAC addr %pM wq/rq %d/%d\n", 97 dev_info(enic_get_dev(enic),
97 enic->mac_addr, c->wq_desc_count, c->rq_desc_count); 98 "vNIC MAC addr %pM wq/rq %d/%d mtu %d\n",
98 dev_info(enic_get_dev(enic), "vNIC mtu %d csum tx/rx %d/%d " 99 enic->mac_addr, c->wq_desc_count, c->rq_desc_count, c->mtu);
99 "tso/lro %d/%d intr timer %d usec\n", 100 dev_info(enic_get_dev(enic), "vNIC csum tx/rx %d/%d "
100 c->mtu, ENIC_SETTING(enic, TXCSUM), 101 "tso/lro %d/%d intr timer %d usec rss %d\n",
101 ENIC_SETTING(enic, RXCSUM), ENIC_SETTING(enic, TSO), 102 ENIC_SETTING(enic, TXCSUM), ENIC_SETTING(enic, RXCSUM),
102 ENIC_SETTING(enic, LRO), c->intr_timer_usec); 103 ENIC_SETTING(enic, TSO), ENIC_SETTING(enic, LRO),
104 c->intr_timer_usec, ENIC_SETTING(enic, RSS));
103 105
104 return 0; 106 return 0;
105} 107}
@@ -148,6 +150,22 @@ int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type,
148 return vnic_dev_cmd(enic->vdev, CMD_NIC_CFG, &a0, &a1, wait); 150 return vnic_dev_cmd(enic->vdev, CMD_NIC_CFG, &a0, &a1, wait);
149} 151}
150 152
153int enic_set_rss_key(struct enic *enic, dma_addr_t key_pa, u64 len)
154{
155 u64 a0 = (u64)key_pa, a1 = len;
156 int wait = 1000;
157
158 return vnic_dev_cmd(enic->vdev, CMD_RSS_KEY, &a0, &a1, wait);
159}
160
161int enic_set_rss_cpu(struct enic *enic, dma_addr_t cpu_pa, u64 len)
162{
163 u64 a0 = (u64)cpu_pa, a1 = len;
164 int wait = 1000;
165
166 return vnic_dev_cmd(enic->vdev, CMD_RSS_CPU, &a0, &a1, wait);
167}
168
151void enic_free_vnic_resources(struct enic *enic) 169void enic_free_vnic_resources(struct enic *enic)
152{ 170{
153 unsigned int i; 171 unsigned int i;
@@ -164,18 +182,11 @@ void enic_free_vnic_resources(struct enic *enic)
164 182
165void enic_get_res_counts(struct enic *enic) 183void enic_get_res_counts(struct enic *enic)
166{ 184{
167 enic->wq_count = min_t(int, 185 enic->wq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ);
168 vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ), 186 enic->rq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_RQ);
169 ENIC_WQ_MAX); 187 enic->cq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_CQ);
170 enic->rq_count = min_t(int, 188 enic->intr_count = vnic_dev_get_res_count(enic->vdev,
171 vnic_dev_get_res_count(enic->vdev, RES_TYPE_RQ), 189 RES_TYPE_INTR_CTRL);
172 ENIC_RQ_MAX);
173 enic->cq_count = min_t(int,
174 vnic_dev_get_res_count(enic->vdev, RES_TYPE_CQ),
175 ENIC_CQ_MAX);
176 enic->intr_count = min_t(int,
177 vnic_dev_get_res_count(enic->vdev, RES_TYPE_INTR_CTRL),
178 ENIC_INTR_MAX);
179 190
180 dev_info(enic_get_dev(enic), 191 dev_info(enic_get_dev(enic),
181 "vNIC resources avail: wq %d rq %d cq %d intr %d\n", 192 "vNIC resources avail: wq %d rq %d cq %d intr %d\n",