diff options
author | Scott Feldman <scofeldm@cisco.com> | 2009-09-03 13:02:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-03 23:19:19 -0400 |
commit | 6ba9cdc09678d6925c205ef0b0bd374e31589ecf (patch) | |
tree | cff6128e997b6945d77ad47dab3a23bc8de8a56a /drivers/net/enic/enic_res.c | |
parent | 350991e12ac1ac407850169a0d65f522a7fd029e (diff) |
enic: provision for multiple Rx/Tx queues; prepare for RSS support
Provision for multiple Rx/Tx queues. Max of 8 WQs and 8 RQs. Max for
completion queue is 8+8=16 and max for interrupt resources is 8+8+2.
Add driver/firmware interface for setting up RSS secret key and indirection
table.
Signed-off-by: Scott Feldman <scofeldm@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.c | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c index e5fc9384f8f5..32111144efc9 100644 --- a/drivers/net/enic/enic_res.c +++ b/drivers/net/enic/enic_res.c | |||
@@ -156,6 +156,22 @@ int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type, | |||
156 | return vnic_dev_cmd(enic->vdev, CMD_NIC_CFG, &a0, &a1, wait); | 156 | return vnic_dev_cmd(enic->vdev, CMD_NIC_CFG, &a0, &a1, wait); |
157 | } | 157 | } |
158 | 158 | ||
159 | int enic_set_rss_key(struct enic *enic, dma_addr_t key_pa, u64 len) | ||
160 | { | ||
161 | u64 a0 = (u64)key_pa, a1 = len; | ||
162 | int wait = 1000; | ||
163 | |||
164 | return vnic_dev_cmd(enic->vdev, CMD_RSS_KEY, &a0, &a1, wait); | ||
165 | } | ||
166 | |||
167 | int enic_set_rss_cpu(struct enic *enic, dma_addr_t cpu_pa, u64 len) | ||
168 | { | ||
169 | u64 a0 = (u64)cpu_pa, a1 = len; | ||
170 | int wait = 1000; | ||
171 | |||
172 | return vnic_dev_cmd(enic->vdev, CMD_RSS_CPU, &a0, &a1, wait); | ||
173 | } | ||
174 | |||
159 | void enic_free_vnic_resources(struct enic *enic) | 175 | void enic_free_vnic_resources(struct enic *enic) |
160 | { | 176 | { |
161 | unsigned int i; | 177 | unsigned int i; |
@@ -172,11 +188,18 @@ void enic_free_vnic_resources(struct enic *enic) | |||
172 | 188 | ||
173 | void enic_get_res_counts(struct enic *enic) | 189 | void enic_get_res_counts(struct enic *enic) |
174 | { | 190 | { |
175 | enic->wq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ); | 191 | enic->wq_count = min_t(int, |
176 | enic->rq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_RQ); | 192 | vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ), |
177 | enic->cq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_CQ); | 193 | ENIC_WQ_MAX); |
178 | enic->intr_count = vnic_dev_get_res_count(enic->vdev, | 194 | enic->rq_count = min_t(int, |
179 | RES_TYPE_INTR_CTRL); | 195 | vnic_dev_get_res_count(enic->vdev, RES_TYPE_RQ), |
196 | ENIC_RQ_MAX); | ||
197 | enic->cq_count = min_t(int, | ||
198 | vnic_dev_get_res_count(enic->vdev, RES_TYPE_CQ), | ||
199 | ENIC_CQ_MAX); | ||
200 | enic->intr_count = min_t(int, | ||
201 | vnic_dev_get_res_count(enic->vdev, RES_TYPE_INTR_CTRL), | ||
202 | ENIC_INTR_MAX); | ||
180 | 203 | ||
181 | printk(KERN_INFO PFX "vNIC resources avail: " | 204 | printk(KERN_INFO PFX "vNIC resources avail: " |
182 | "wq %d rq %d cq %d intr %d\n", | 205 | "wq %d rq %d cq %d intr %d\n", |