20 #include <linux/kernel.h>
21 #include <linux/errno.h>
22 #include <linux/types.h>
23 #include <linux/pci.h>
24 #include <linux/netdevice.h>
50 "Error getting MAC addr, %d\n", err);
54 #define GET_CONFIG(m) \
56 err = vnic_dev_spec(enic->vdev, \
57 offsetof(struct vnic_enet_config, m), \
58 sizeof(c->m), &c->m); \
60 dev_err(enic_get_dev(enic), \
61 "Error getting %s, %d\n", #m, err); \
97 "vNIC MAC addr %pM wq/rq %d/%d mtu %d\n",
100 dev_info(enic_get_dev(enic),
"vNIC csum tx/rx %s/%s "
101 "tso/lro %s/%s rss %s intr mode %s type %s timer %d usec "
102 "loopback tag 0x%04x\n",
129 dev_err(enic_get_dev(enic),
"Can't add vlan id, %d\n", err);
142 dev_err(enic_get_dev(enic),
"Can't delete vlan id, %d\n", err);
148 u8 rss_hash_bits,
u8 rss_base_cpu,
u8 rss_enable,
u8 tso_ipid_split_en,
156 rss_hash_type, rss_hash_bits, rss_base_cpu,
157 rss_enable, tso_ipid_split_en, ig_vlan_strip_en);
185 for (i = 0; i < enic->
wq_count; i++)
187 for (i = 0; i < enic->
rq_count; i++)
189 for (i = 0; i < enic->
cq_count; i++)
204 "vNIC resources avail: wq %d rq %d cq %d intr %d\n",
212 unsigned int mask_on_assertion;
213 unsigned int interrupt_offset;
214 unsigned int error_interrupt_enable;
215 unsigned int error_interrupt_offset;
216 unsigned int cq_index;
232 error_interrupt_enable = 1;
233 error_interrupt_offset = enic->
intr_count - 2;
236 error_interrupt_enable = 0;
237 error_interrupt_offset = 0;
241 for (i = 0; i < enic->
rq_count; i++) {
245 error_interrupt_enable,
246 error_interrupt_offset);
249 for (i = 0; i < enic->
wq_count; i++) {
253 error_interrupt_enable,
254 error_interrupt_offset);
263 for (i = 0; i < enic->
cq_count; i++) {
267 interrupt_offset =
i;
270 interrupt_offset = 0;
296 mask_on_assertion = 1;
299 mask_on_assertion = 0;
305 enic->
config.intr_timer_usec,
306 enic->
config.intr_timer_type,
319 dev_info(enic_get_dev(enic),
"vNIC resources used: "
320 "wq %d rq %d cq %d intr %d intr mode %s\n",
331 for (i = 0; i < enic->
wq_count; i++) {
333 enic->
config.wq_desc_count,
336 goto err_out_cleanup;
339 for (i = 0; i < enic->
rq_count; i++) {
341 enic->
config.rq_desc_count,
344 goto err_out_cleanup;
347 for (i = 0; i < enic->
cq_count; i++) {
348 if (i < enic->rq_count)
350 enic->
config.rq_desc_count,
354 enic->
config.wq_desc_count,
357 goto err_out_cleanup;
363 goto err_out_cleanup;
373 "Failed to hook legacy pba resource\n");
375 goto err_out_cleanup;