aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/enic/enic_res.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/enic/enic_res.c')
-rw-r--r--drivers/net/enic/enic_res.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 04cfc4e3f06..478928b7cc0 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -46,7 +46,8 @@ int enic_get_vnic_config(struct enic *enic)
46 46
47 err = vnic_dev_mac_addr(enic->vdev, enic->mac_addr); 47 err = vnic_dev_mac_addr(enic->vdev, enic->mac_addr);
48 if (err) { 48 if (err) {
49 printk(KERN_ERR PFX "Error getting MAC addr, %d\n", err); 49 dev_err(enic_get_dev(enic),
50 "Error getting MAC addr, %d\n", err);
50 return err; 51 return err;
51 } 52 }
52 53
@@ -56,7 +57,7 @@ int enic_get_vnic_config(struct enic *enic)
56 offsetof(struct vnic_enet_config, m), \ 57 offsetof(struct vnic_enet_config, m), \
57 sizeof(c->m), &c->m); \ 58 sizeof(c->m), &c->m); \
58 if (err) { \ 59 if (err) { \
59 printk(KERN_ERR PFX \ 60 dev_err(enic_get_dev(enic), \
60 "Error getting %s, %d\n", #m, err); \ 61 "Error getting %s, %d\n", #m, err); \
61 return err; \ 62 return err; \
62 } \ 63 } \
@@ -92,10 +93,10 @@ int enic_get_vnic_config(struct enic *enic)
92 INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX), 93 INTR_COALESCE_HW_TO_USEC(VNIC_INTR_TIMER_MAX),
93 c->intr_timer_usec); 94 c->intr_timer_usec);
94 95
95 printk(KERN_INFO PFX "vNIC MAC addr %pM wq/rq %d/%d\n", 96 dev_info(enic_get_dev(enic), "vNIC MAC addr %pM wq/rq %d/%d\n",
96 enic->mac_addr, c->wq_desc_count, c->rq_desc_count); 97 enic->mac_addr, c->wq_desc_count, c->rq_desc_count);
97 printk(KERN_INFO PFX "vNIC mtu %d csum tx/rx %d/%d tso/lro %d/%d " 98 dev_info(enic_get_dev(enic), "vNIC mtu %d csum tx/rx %d/%d "
98 "intr timer %d usec\n", 99 "tso/lro %d/%d intr timer %d usec\n",
99 c->mtu, ENIC_SETTING(enic, TXCSUM), 100 c->mtu, ENIC_SETTING(enic, TXCSUM),
100 ENIC_SETTING(enic, RXCSUM), ENIC_SETTING(enic, TSO), 101 ENIC_SETTING(enic, RXCSUM), ENIC_SETTING(enic, TSO),
101 ENIC_SETTING(enic, LRO), c->intr_timer_usec); 102 ENIC_SETTING(enic, LRO), c->intr_timer_usec);
@@ -111,7 +112,7 @@ int enic_add_vlan(struct enic *enic, u16 vlanid)
111 112
112 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_ADD, &a0, &a1, wait); 113 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_ADD, &a0, &a1, wait);
113 if (err) 114 if (err)
114 printk(KERN_ERR PFX "Can't add vlan id, %d\n", err); 115 dev_err(enic_get_dev(enic), "Can't add vlan id, %d\n", err);
115 116
116 return err; 117 return err;
117} 118}
@@ -124,7 +125,7 @@ int enic_del_vlan(struct enic *enic, u16 vlanid)
124 125
125 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_DEL, &a0, &a1, wait); 126 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_DEL, &a0, &a1, wait);
126 if (err) 127 if (err)
127 printk(KERN_ERR PFX "Can't delete vlan id, %d\n", err); 128 dev_err(enic_get_dev(enic), "Can't delete vlan id, %d\n", err);
128 129
129 return err; 130 return err;
130} 131}
@@ -192,8 +193,8 @@ void enic_get_res_counts(struct enic *enic)
192 vnic_dev_get_res_count(enic->vdev, RES_TYPE_INTR_CTRL), 193 vnic_dev_get_res_count(enic->vdev, RES_TYPE_INTR_CTRL),
193 ENIC_INTR_MAX); 194 ENIC_INTR_MAX);
194 195
195 printk(KERN_INFO PFX "vNIC resources avail: " 196 dev_info(enic_get_dev(enic),
196 "wq %d rq %d cq %d intr %d\n", 197 "vNIC resources avail: wq %d rq %d cq %d intr %d\n",
197 enic->wq_count, enic->rq_count, 198 enic->wq_count, enic->rq_count,
198 enic->cq_count, enic->intr_count); 199 enic->cq_count, enic->intr_count);
199} 200}
@@ -308,15 +309,14 @@ int enic_alloc_vnic_resources(struct enic *enic)
308 309
309 intr_mode = vnic_dev_get_intr_mode(enic->vdev); 310 intr_mode = vnic_dev_get_intr_mode(enic->vdev);
310 311
311 printk(KERN_INFO PFX "vNIC resources used: " 312 dev_info(enic_get_dev(enic), "vNIC resources used: "
312 "wq %d rq %d cq %d intr %d intr mode %s\n", 313 "wq %d rq %d cq %d intr %d intr mode %s\n",
313 enic->wq_count, enic->rq_count, 314 enic->wq_count, enic->rq_count,
314 enic->cq_count, enic->intr_count, 315 enic->cq_count, enic->intr_count,
315 intr_mode == VNIC_DEV_INTR_MODE_INTX ? "legacy PCI INTx" : 316 intr_mode == VNIC_DEV_INTR_MODE_INTX ? "legacy PCI INTx" :
316 intr_mode == VNIC_DEV_INTR_MODE_MSI ? "MSI" : 317 intr_mode == VNIC_DEV_INTR_MODE_MSI ? "MSI" :
317 intr_mode == VNIC_DEV_INTR_MODE_MSIX ? "MSI-X" : 318 intr_mode == VNIC_DEV_INTR_MODE_MSIX ? "MSI-X" :
318 "unknown" 319 "unknown");
319 );
320 320
321 /* Allocate queue resources 321 /* Allocate queue resources
322 */ 322 */
@@ -362,7 +362,8 @@ int enic_alloc_vnic_resources(struct enic *enic)
362 enic->legacy_pba = vnic_dev_get_res(enic->vdev, 362 enic->legacy_pba = vnic_dev_get_res(enic->vdev,
363 RES_TYPE_INTR_PBA_LEGACY, 0); 363 RES_TYPE_INTR_PBA_LEGACY, 0);
364 if (!enic->legacy_pba && intr_mode == VNIC_DEV_INTR_MODE_INTX) { 364 if (!enic->legacy_pba && intr_mode == VNIC_DEV_INTR_MODE_INTX) {
365 printk(KERN_ERR PFX "Failed to hook legacy pba resource\n"); 365 dev_err(enic_get_dev(enic),
366 "Failed to hook legacy pba resource\n");
366 err = -ENODEV; 367 err = -ENODEV;
367 goto err_out_cleanup; 368 goto err_out_cleanup;
368 } 369 }