diff options
Diffstat (limited to 'drivers/net/ehea')
-rw-r--r-- | drivers/net/ehea/ehea.h | 21 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_ethtool.c | 69 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 559 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_phyp.c | 40 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_qmr.c | 89 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_qmr.h | 1 |
6 files changed, 406 insertions, 373 deletions
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h index 1846623c6ae6..6c7257bd73fc 100644 --- a/drivers/net/ehea/ehea.h +++ b/drivers/net/ehea/ehea.h | |||
@@ -40,7 +40,7 @@ | |||
40 | #include <asm/io.h> | 40 | #include <asm/io.h> |
41 | 41 | ||
42 | #define DRV_NAME "ehea" | 42 | #define DRV_NAME "ehea" |
43 | #define DRV_VERSION "EHEA_0106" | 43 | #define DRV_VERSION "EHEA_0107" |
44 | 44 | ||
45 | /* eHEA capability flags */ | 45 | /* eHEA capability flags */ |
46 | #define DLPAR_PORT_ADD_REM 1 | 46 | #define DLPAR_PORT_ADD_REM 1 |
@@ -130,19 +130,6 @@ | |||
130 | 130 | ||
131 | /* utility functions */ | 131 | /* utility functions */ |
132 | 132 | ||
133 | #define ehea_info(fmt, args...) \ | ||
134 | printk(KERN_INFO DRV_NAME ": " fmt "\n", ## args) | ||
135 | |||
136 | #define ehea_error(fmt, args...) \ | ||
137 | printk(KERN_ERR DRV_NAME ": Error in %s: " fmt "\n", __func__, ## args) | ||
138 | |||
139 | #ifdef DEBUG | ||
140 | #define ehea_debug(fmt, args...) \ | ||
141 | printk(KERN_DEBUG DRV_NAME ": " fmt, ## args) | ||
142 | #else | ||
143 | #define ehea_debug(fmt, args...) do {} while (0) | ||
144 | #endif | ||
145 | |||
146 | void ehea_dump(void *adr, int len, char *msg); | 133 | void ehea_dump(void *adr, int len, char *msg); |
147 | 134 | ||
148 | #define EHEA_BMASK(pos, length) (((pos) << 16) + (length)) | 135 | #define EHEA_BMASK(pos, length) (((pos) << 16) + (length)) |
@@ -396,7 +383,9 @@ struct ehea_port_res { | |||
396 | int swqe_ll_count; | 383 | int swqe_ll_count; |
397 | u32 swqe_id_counter; | 384 | u32 swqe_id_counter; |
398 | u64 tx_packets; | 385 | u64 tx_packets; |
386 | u64 tx_bytes; | ||
399 | u64 rx_packets; | 387 | u64 rx_packets; |
388 | u64 rx_bytes; | ||
400 | u32 poll_counter; | 389 | u32 poll_counter; |
401 | struct net_lro_mgr lro_mgr; | 390 | struct net_lro_mgr lro_mgr; |
402 | struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS]; | 391 | struct net_lro_desc lro_desc[MAX_LRO_DESCRIPTORS]; |
@@ -491,6 +480,8 @@ struct ehea_port { | |||
491 | u8 full_duplex; | 480 | u8 full_duplex; |
492 | u8 autoneg; | 481 | u8 autoneg; |
493 | u8 num_def_qps; | 482 | u8 num_def_qps; |
483 | wait_queue_head_t swqe_avail_wq; | ||
484 | wait_queue_head_t restart_wq; | ||
494 | }; | 485 | }; |
495 | 486 | ||
496 | struct port_res_cfg { | 487 | struct port_res_cfg { |
@@ -511,6 +502,4 @@ void ehea_set_ethtool_ops(struct net_device *netdev); | |||
511 | int ehea_sense_port_attr(struct ehea_port *port); | 502 | int ehea_sense_port_attr(struct ehea_port *port); |
512 | int ehea_set_portspeed(struct ehea_port *port, u32 port_speed); | 503 | int ehea_set_portspeed(struct ehea_port *port, u32 port_speed); |
513 | 504 | ||
514 | extern struct work_struct ehea_rereg_mr_task; | ||
515 | |||
516 | #endif /* __EHEA_H__ */ | 505 | #endif /* __EHEA_H__ */ |
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c index 75b099ce49c9..7f642aef5e82 100644 --- a/drivers/net/ehea/ehea_ethtool.c +++ b/drivers/net/ehea/ehea_ethtool.c | |||
@@ -26,12 +26,15 @@ | |||
26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include "ehea.h" | 31 | #include "ehea.h" |
30 | #include "ehea_phyp.h" | 32 | #include "ehea_phyp.h" |
31 | 33 | ||
32 | static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | 34 | static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) |
33 | { | 35 | { |
34 | struct ehea_port *port = netdev_priv(dev); | 36 | struct ehea_port *port = netdev_priv(dev); |
37 | u32 speed; | ||
35 | int ret; | 38 | int ret; |
36 | 39 | ||
37 | ret = ehea_sense_port_attr(port); | 40 | ret = ehea_sense_port_attr(port); |
@@ -41,27 +44,44 @@ static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
41 | 44 | ||
42 | if (netif_carrier_ok(dev)) { | 45 | if (netif_carrier_ok(dev)) { |
43 | switch (port->port_speed) { | 46 | switch (port->port_speed) { |
44 | case EHEA_SPEED_10M: cmd->speed = SPEED_10; break; | 47 | case EHEA_SPEED_10M: |
45 | case EHEA_SPEED_100M: cmd->speed = SPEED_100; break; | 48 | speed = SPEED_10; |
46 | case EHEA_SPEED_1G: cmd->speed = SPEED_1000; break; | 49 | break; |
47 | case EHEA_SPEED_10G: cmd->speed = SPEED_10000; break; | 50 | case EHEA_SPEED_100M: |
51 | speed = SPEED_100; | ||
52 | break; | ||
53 | case EHEA_SPEED_1G: | ||
54 | speed = SPEED_1000; | ||
55 | break; | ||
56 | case EHEA_SPEED_10G: | ||
57 | speed = SPEED_10000; | ||
58 | break; | ||
59 | default: | ||
60 | speed = -1; | ||
61 | break; /* BUG */ | ||
48 | } | 62 | } |
49 | cmd->duplex = port->full_duplex == 1 ? | 63 | cmd->duplex = port->full_duplex == 1 ? |
50 | DUPLEX_FULL : DUPLEX_HALF; | 64 | DUPLEX_FULL : DUPLEX_HALF; |
51 | } else { | 65 | } else { |
52 | cmd->speed = -1; | 66 | speed = ~0; |
53 | cmd->duplex = -1; | 67 | cmd->duplex = -1; |
54 | } | 68 | } |
69 | ethtool_cmd_speed_set(cmd, speed); | ||
55 | 70 | ||
56 | cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full | 71 | if (cmd->speed == SPEED_10000) { |
57 | | SUPPORTED_100baseT_Full | SUPPORTED_100baseT_Half | 72 | cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE); |
58 | | SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Half | 73 | cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_FIBRE); |
59 | | SUPPORTED_Autoneg | SUPPORTED_FIBRE); | 74 | cmd->port = PORT_FIBRE; |
60 | 75 | } else { | |
61 | cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_Autoneg | 76 | cmd->supported = (SUPPORTED_1000baseT_Full | SUPPORTED_100baseT_Full |
62 | | ADVERTISED_FIBRE); | 77 | | SUPPORTED_100baseT_Half | SUPPORTED_10baseT_Full |
78 | | SUPPORTED_10baseT_Half | SUPPORTED_Autoneg | ||
79 | | SUPPORTED_TP); | ||
80 | cmd->advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_Autoneg | ||
81 | | ADVERTISED_TP); | ||
82 | cmd->port = PORT_TP; | ||
83 | } | ||
63 | 84 | ||
64 | cmd->port = PORT_FIBRE; | ||
65 | cmd->autoneg = port->autoneg == 1 ? AUTONEG_ENABLE : AUTONEG_DISABLE; | 85 | cmd->autoneg = port->autoneg == 1 ? AUTONEG_ENABLE : AUTONEG_DISABLE; |
66 | 86 | ||
67 | return 0; | 87 | return 0; |
@@ -118,10 +138,10 @@ doit: | |||
118 | ret = ehea_set_portspeed(port, sp); | 138 | ret = ehea_set_portspeed(port, sp); |
119 | 139 | ||
120 | if (!ret) | 140 | if (!ret) |
121 | ehea_info("%s: Port speed successfully set: %dMbps " | 141 | netdev_info(dev, |
122 | "%s Duplex", | 142 | "Port speed successfully set: %dMbps %s Duplex\n", |
123 | port->netdev->name, port->port_speed, | 143 | port->port_speed, |
124 | port->full_duplex == 1 ? "Full" : "Half"); | 144 | port->full_duplex == 1 ? "Full" : "Half"); |
125 | out: | 145 | out: |
126 | return ret; | 146 | return ret; |
127 | } | 147 | } |
@@ -134,10 +154,10 @@ static int ehea_nway_reset(struct net_device *dev) | |||
134 | ret = ehea_set_portspeed(port, EHEA_SPEED_AUTONEG); | 154 | ret = ehea_set_portspeed(port, EHEA_SPEED_AUTONEG); |
135 | 155 | ||
136 | if (!ret) | 156 | if (!ret) |
137 | ehea_info("%s: Port speed successfully set: %dMbps " | 157 | netdev_info(port->netdev, |
138 | "%s Duplex", | 158 | "Port speed successfully set: %dMbps %s Duplex\n", |
139 | port->netdev->name, port->port_speed, | 159 | port->port_speed, |
140 | port->full_duplex == 1 ? "Full" : "Half"); | 160 | port->full_duplex == 1 ? "Full" : "Half"); |
141 | return ret; | 161 | return ret; |
142 | } | 162 | } |
143 | 163 | ||
@@ -160,11 +180,6 @@ static void ehea_set_msglevel(struct net_device *dev, u32 value) | |||
160 | port->msg_enable = value; | 180 | port->msg_enable = value; |
161 | } | 181 | } |
162 | 182 | ||
163 | static u32 ehea_get_rx_csum(struct net_device *dev) | ||
164 | { | ||
165 | return 1; | ||
166 | } | ||
167 | |||
168 | static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = { | 183 | static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = { |
169 | {"sig_comp_iv"}, | 184 | {"sig_comp_iv"}, |
170 | {"swqe_refill_th"}, | 185 | {"swqe_refill_th"}, |
@@ -267,11 +282,9 @@ const struct ethtool_ops ehea_ethtool_ops = { | |||
267 | .get_msglevel = ehea_get_msglevel, | 282 | .get_msglevel = ehea_get_msglevel, |
268 | .set_msglevel = ehea_set_msglevel, | 283 | .set_msglevel = ehea_set_msglevel, |
269 | .get_link = ethtool_op_get_link, | 284 | .get_link = ethtool_op_get_link, |
270 | .set_tso = ethtool_op_set_tso, | ||
271 | .get_strings = ehea_get_strings, | 285 | .get_strings = ehea_get_strings, |
272 | .get_sset_count = ehea_get_sset_count, | 286 | .get_sset_count = ehea_get_sset_count, |
273 | .get_ethtool_stats = ehea_get_ethtool_stats, | 287 | .get_ethtool_stats = ehea_get_ethtool_stats, |
274 | .get_rx_csum = ehea_get_rx_csum, | ||
275 | .set_settings = ehea_set_settings, | 288 | .set_settings = ehea_set_settings, |
276 | .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ | 289 | .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ |
277 | }; | 290 | }; |
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 6372610ed240..3fd5a2400348 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/in.h> | 31 | #include <linux/in.h> |
30 | #include <linux/ip.h> | 32 | #include <linux/ip.h> |
31 | #include <linux/tcp.h> | 33 | #include <linux/tcp.h> |
@@ -39,6 +41,7 @@ | |||
39 | #include <linux/memory.h> | 41 | #include <linux/memory.h> |
40 | #include <asm/kexec.h> | 42 | #include <asm/kexec.h> |
41 | #include <linux/mutex.h> | 43 | #include <linux/mutex.h> |
44 | #include <linux/prefetch.h> | ||
42 | 45 | ||
43 | #include <net/ip.h> | 46 | #include <net/ip.h> |
44 | 47 | ||
@@ -101,7 +104,6 @@ MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, " | |||
101 | static int port_name_cnt; | 104 | static int port_name_cnt; |
102 | static LIST_HEAD(adapter_list); | 105 | static LIST_HEAD(adapter_list); |
103 | static unsigned long ehea_driver_flags; | 106 | static unsigned long ehea_driver_flags; |
104 | struct work_struct ehea_rereg_mr_task; | ||
105 | static DEFINE_MUTEX(dlpar_mem_lock); | 107 | static DEFINE_MUTEX(dlpar_mem_lock); |
106 | struct ehea_fw_handle_array ehea_fw_handles; | 108 | struct ehea_fw_handle_array ehea_fw_handles; |
107 | struct ehea_bcmc_reg_array ehea_bcmc_regs; | 109 | struct ehea_bcmc_reg_array ehea_bcmc_regs; |
@@ -136,8 +138,8 @@ void ehea_dump(void *adr, int len, char *msg) | |||
136 | int x; | 138 | int x; |
137 | unsigned char *deb = adr; | 139 | unsigned char *deb = adr; |
138 | for (x = 0; x < len; x += 16) { | 140 | for (x = 0; x < len; x += 16) { |
139 | printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg, | 141 | pr_info("%s adr=%p ofs=%04x %016llx %016llx\n", |
140 | deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); | 142 | msg, deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8])); |
141 | deb += 16; | 143 | deb += 16; |
142 | } | 144 | } |
143 | } | 145 | } |
@@ -180,7 +182,7 @@ static void ehea_update_firmware_handles(void) | |||
180 | num_portres * EHEA_NUM_PORTRES_FW_HANDLES; | 182 | num_portres * EHEA_NUM_PORTRES_FW_HANDLES; |
181 | 183 | ||
182 | if (num_fw_handles) { | 184 | if (num_fw_handles) { |
183 | arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL); | 185 | arr = kcalloc(num_fw_handles, sizeof(*arr), GFP_KERNEL); |
184 | if (!arr) | 186 | if (!arr) |
185 | goto out; /* Keep the existing array */ | 187 | goto out; /* Keep the existing array */ |
186 | } else | 188 | } else |
@@ -265,7 +267,7 @@ static void ehea_update_bcmc_registrations(void) | |||
265 | } | 267 | } |
266 | 268 | ||
267 | if (num_registrations) { | 269 | if (num_registrations) { |
268 | arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC); | 270 | arr = kcalloc(num_registrations, sizeof(*arr), GFP_ATOMIC); |
269 | if (!arr) | 271 | if (!arr) |
270 | goto out; /* Keep the existing array */ | 272 | goto out; /* Keep the existing array */ |
271 | } else | 273 | } else |
@@ -330,14 +332,14 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev) | |||
330 | struct ehea_port *port = netdev_priv(dev); | 332 | struct ehea_port *port = netdev_priv(dev); |
331 | struct net_device_stats *stats = &port->stats; | 333 | struct net_device_stats *stats = &port->stats; |
332 | struct hcp_ehea_port_cb2 *cb2; | 334 | struct hcp_ehea_port_cb2 *cb2; |
333 | u64 hret, rx_packets, tx_packets; | 335 | u64 hret, rx_packets, tx_packets, rx_bytes = 0, tx_bytes = 0; |
334 | int i; | 336 | int i; |
335 | 337 | ||
336 | memset(stats, 0, sizeof(*stats)); | 338 | memset(stats, 0, sizeof(*stats)); |
337 | 339 | ||
338 | cb2 = (void *)get_zeroed_page(GFP_KERNEL); | 340 | cb2 = (void *)get_zeroed_page(GFP_KERNEL); |
339 | if (!cb2) { | 341 | if (!cb2) { |
340 | ehea_error("no mem for cb2"); | 342 | netdev_err(dev, "no mem for cb2\n"); |
341 | goto out; | 343 | goto out; |
342 | } | 344 | } |
343 | 345 | ||
@@ -345,7 +347,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev) | |||
345 | port->logical_port_id, | 347 | port->logical_port_id, |
346 | H_PORT_CB2, H_PORT_CB2_ALL, cb2); | 348 | H_PORT_CB2, H_PORT_CB2_ALL, cb2); |
347 | if (hret != H_SUCCESS) { | 349 | if (hret != H_SUCCESS) { |
348 | ehea_error("query_ehea_port failed"); | 350 | netdev_err(dev, "query_ehea_port failed\n"); |
349 | goto out_herr; | 351 | goto out_herr; |
350 | } | 352 | } |
351 | 353 | ||
@@ -353,18 +355,22 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev) | |||
353 | ehea_dump(cb2, sizeof(*cb2), "net_device_stats"); | 355 | ehea_dump(cb2, sizeof(*cb2), "net_device_stats"); |
354 | 356 | ||
355 | rx_packets = 0; | 357 | rx_packets = 0; |
356 | for (i = 0; i < port->num_def_qps; i++) | 358 | for (i = 0; i < port->num_def_qps; i++) { |
357 | rx_packets += port->port_res[i].rx_packets; | 359 | rx_packets += port->port_res[i].rx_packets; |
360 | rx_bytes += port->port_res[i].rx_bytes; | ||
361 | } | ||
358 | 362 | ||
359 | tx_packets = 0; | 363 | tx_packets = 0; |
360 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) | 364 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { |
361 | tx_packets += port->port_res[i].tx_packets; | 365 | tx_packets += port->port_res[i].tx_packets; |
366 | tx_bytes += port->port_res[i].tx_bytes; | ||
367 | } | ||
362 | 368 | ||
363 | stats->tx_packets = tx_packets; | 369 | stats->tx_packets = tx_packets; |
364 | stats->multicast = cb2->rxmcp; | 370 | stats->multicast = cb2->rxmcp; |
365 | stats->rx_errors = cb2->rxuerr; | 371 | stats->rx_errors = cb2->rxuerr; |
366 | stats->rx_bytes = cb2->rxo; | 372 | stats->rx_bytes = rx_bytes; |
367 | stats->tx_bytes = cb2->txo; | 373 | stats->tx_bytes = tx_bytes; |
368 | stats->rx_packets = rx_packets; | 374 | stats->rx_packets = rx_packets; |
369 | 375 | ||
370 | out_herr: | 376 | out_herr: |
@@ -396,6 +402,7 @@ static void ehea_refill_rq1(struct ehea_port_res *pr, int index, int nr_of_wqes) | |||
396 | skb_arr_rq1[index] = netdev_alloc_skb(dev, | 402 | skb_arr_rq1[index] = netdev_alloc_skb(dev, |
397 | EHEA_L_PKT_SIZE); | 403 | EHEA_L_PKT_SIZE); |
398 | if (!skb_arr_rq1[index]) { | 404 | if (!skb_arr_rq1[index]) { |
405 | netdev_info(dev, "Unable to allocate enough skb in the array\n"); | ||
399 | pr->rq1_skba.os_skbs = fill_wqes - i; | 406 | pr->rq1_skba.os_skbs = fill_wqes - i; |
400 | break; | 407 | break; |
401 | } | 408 | } |
@@ -418,13 +425,20 @@ static void ehea_init_fill_rq1(struct ehea_port_res *pr, int nr_rq1a) | |||
418 | struct net_device *dev = pr->port->netdev; | 425 | struct net_device *dev = pr->port->netdev; |
419 | int i; | 426 | int i; |
420 | 427 | ||
421 | for (i = 0; i < pr->rq1_skba.len; i++) { | 428 | if (nr_rq1a > pr->rq1_skba.len) { |
429 | netdev_err(dev, "NR_RQ1A bigger than skb array len\n"); | ||
430 | return; | ||
431 | } | ||
432 | |||
433 | for (i = 0; i < nr_rq1a; i++) { | ||
422 | skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE); | 434 | skb_arr_rq1[i] = netdev_alloc_skb(dev, EHEA_L_PKT_SIZE); |
423 | if (!skb_arr_rq1[i]) | 435 | if (!skb_arr_rq1[i]) { |
436 | netdev_info(dev, "Not enough memory to allocate skb array\n"); | ||
424 | break; | 437 | break; |
438 | } | ||
425 | } | 439 | } |
426 | /* Ring doorbell */ | 440 | /* Ring doorbell */ |
427 | ehea_update_rq1a(pr->qp, nr_rq1a); | 441 | ehea_update_rq1a(pr->qp, i - 1); |
428 | } | 442 | } |
429 | 443 | ||
430 | static int ehea_refill_rq_def(struct ehea_port_res *pr, | 444 | static int ehea_refill_rq_def(struct ehea_port_res *pr, |
@@ -457,8 +471,9 @@ static int ehea_refill_rq_def(struct ehea_port_res *pr, | |||
457 | if (!skb) { | 471 | if (!skb) { |
458 | q_skba->os_skbs = fill_wqes - i; | 472 | q_skba->os_skbs = fill_wqes - i; |
459 | if (q_skba->os_skbs == q_skba->len - 2) { | 473 | if (q_skba->os_skbs == q_skba->len - 2) { |
460 | ehea_info("%s: rq%i ran dry - no mem for skb", | 474 | netdev_info(pr->port->netdev, |
461 | pr->port->netdev->name, rq_nr); | 475 | "rq%i ran dry - no mem for skb\n", |
476 | rq_nr); | ||
462 | ret = -ENOMEM; | 477 | ret = -ENOMEM; |
463 | } | 478 | } |
464 | break; | 479 | break; |
@@ -623,8 +638,8 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq, | |||
623 | 638 | ||
624 | if (cqe->status & EHEA_CQE_STAT_FAT_ERR_MASK) { | 639 | if (cqe->status & EHEA_CQE_STAT_FAT_ERR_MASK) { |
625 | if (netif_msg_rx_err(pr->port)) { | 640 | if (netif_msg_rx_err(pr->port)) { |
626 | ehea_error("Critical receive error for QP %d. " | 641 | pr_err("Critical receive error for QP %d. Resetting port.\n", |
627 | "Resetting port.", pr->qp->init_attr.qp_nr); | 642 | pr->qp->init_attr.qp_nr); |
628 | ehea_dump(cqe, sizeof(*cqe), "CQE"); | 643 | ehea_dump(cqe, sizeof(*cqe), "CQE"); |
629 | } | 644 | } |
630 | ehea_schedule_port_reset(pr->port); | 645 | ehea_schedule_port_reset(pr->port); |
@@ -671,7 +686,7 @@ static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, | |||
671 | int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && | 686 | int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && |
672 | pr->port->vgrp); | 687 | pr->port->vgrp); |
673 | 688 | ||
674 | if (use_lro) { | 689 | if (skb->dev->features & NETIF_F_LRO) { |
675 | if (vlan_extracted) | 690 | if (vlan_extracted) |
676 | lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, | 691 | lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, |
677 | pr->port->vgrp, | 692 | pr->port->vgrp, |
@@ -703,6 +718,7 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
703 | int skb_arr_rq2_len = pr->rq2_skba.len; | 718 | int skb_arr_rq2_len = pr->rq2_skba.len; |
704 | int skb_arr_rq3_len = pr->rq3_skba.len; | 719 | int skb_arr_rq3_len = pr->rq3_skba.len; |
705 | int processed, processed_rq1, processed_rq2, processed_rq3; | 720 | int processed, processed_rq1, processed_rq2, processed_rq3; |
721 | u64 processed_bytes = 0; | ||
706 | int wqe_index, last_wqe_index, rq, port_reset; | 722 | int wqe_index, last_wqe_index, rq, port_reset; |
707 | 723 | ||
708 | processed = processed_rq1 = processed_rq2 = processed_rq3 = 0; | 724 | processed = processed_rq1 = processed_rq2 = processed_rq3 = 0; |
@@ -725,13 +741,15 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
725 | skb_arr_rq1_len, | 741 | skb_arr_rq1_len, |
726 | wqe_index); | 742 | wqe_index); |
727 | if (unlikely(!skb)) { | 743 | if (unlikely(!skb)) { |
728 | if (netif_msg_rx_err(port)) | 744 | netif_info(port, rx_err, dev, |
729 | ehea_error("LL rq1: skb=NULL"); | 745 | "LL rq1: skb=NULL\n"); |
730 | 746 | ||
731 | skb = netdev_alloc_skb(dev, | 747 | skb = netdev_alloc_skb(dev, |
732 | EHEA_L_PKT_SIZE); | 748 | EHEA_L_PKT_SIZE); |
733 | if (!skb) | 749 | if (!skb) { |
750 | netdev_err(dev, "Not enough memory to allocate skb\n"); | ||
734 | break; | 751 | break; |
752 | } | ||
735 | } | 753 | } |
736 | skb_copy_to_linear_data(skb, ((char *)cqe) + 64, | 754 | skb_copy_to_linear_data(skb, ((char *)cqe) + 64, |
737 | cqe->num_bytes_transfered - 4); | 755 | cqe->num_bytes_transfered - 4); |
@@ -741,8 +759,8 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
741 | skb = get_skb_by_index(skb_arr_rq2, | 759 | skb = get_skb_by_index(skb_arr_rq2, |
742 | skb_arr_rq2_len, cqe); | 760 | skb_arr_rq2_len, cqe); |
743 | if (unlikely(!skb)) { | 761 | if (unlikely(!skb)) { |
744 | if (netif_msg_rx_err(port)) | 762 | netif_err(port, rx_err, dev, |
745 | ehea_error("rq2: skb=NULL"); | 763 | "rq2: skb=NULL\n"); |
746 | break; | 764 | break; |
747 | } | 765 | } |
748 | ehea_fill_skb(dev, skb, cqe); | 766 | ehea_fill_skb(dev, skb, cqe); |
@@ -752,14 +770,15 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
752 | skb = get_skb_by_index(skb_arr_rq3, | 770 | skb = get_skb_by_index(skb_arr_rq3, |
753 | skb_arr_rq3_len, cqe); | 771 | skb_arr_rq3_len, cqe); |
754 | if (unlikely(!skb)) { | 772 | if (unlikely(!skb)) { |
755 | if (netif_msg_rx_err(port)) | 773 | netif_err(port, rx_err, dev, |
756 | ehea_error("rq3: skb=NULL"); | 774 | "rq3: skb=NULL\n"); |
757 | break; | 775 | break; |
758 | } | 776 | } |
759 | ehea_fill_skb(dev, skb, cqe); | 777 | ehea_fill_skb(dev, skb, cqe); |
760 | processed_rq3++; | 778 | processed_rq3++; |
761 | } | 779 | } |
762 | 780 | ||
781 | processed_bytes += skb->len; | ||
763 | ehea_proc_skb(pr, cqe, skb); | 782 | ehea_proc_skb(pr, cqe, skb); |
764 | } else { | 783 | } else { |
765 | pr->p_stats.poll_receive_errors++; | 784 | pr->p_stats.poll_receive_errors++; |
@@ -771,10 +790,11 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
771 | } | 790 | } |
772 | cqe = ehea_poll_rq1(qp, &wqe_index); | 791 | cqe = ehea_poll_rq1(qp, &wqe_index); |
773 | } | 792 | } |
774 | if (use_lro) | 793 | if (dev->features & NETIF_F_LRO) |
775 | lro_flush_all(&pr->lro_mgr); | 794 | lro_flush_all(&pr->lro_mgr); |
776 | 795 | ||
777 | pr->rx_packets += processed; | 796 | pr->rx_packets += processed; |
797 | pr->rx_bytes += processed_bytes; | ||
778 | 798 | ||
779 | ehea_refill_rq1(pr, last_wqe_index, processed_rq1); | 799 | ehea_refill_rq1(pr, last_wqe_index, processed_rq1); |
780 | ehea_refill_rq2(pr, processed_rq2); | 800 | ehea_refill_rq2(pr, processed_rq2); |
@@ -793,6 +813,7 @@ static void reset_sq_restart_flag(struct ehea_port *port) | |||
793 | struct ehea_port_res *pr = &port->port_res[i]; | 813 | struct ehea_port_res *pr = &port->port_res[i]; |
794 | pr->sq_restart_flag = 0; | 814 | pr->sq_restart_flag = 0; |
795 | } | 815 | } |
816 | wake_up(&port->restart_wq); | ||
796 | } | 817 | } |
797 | 818 | ||
798 | static void check_sqs(struct ehea_port *port) | 819 | static void check_sqs(struct ehea_port *port) |
@@ -803,6 +824,7 @@ static void check_sqs(struct ehea_port *port) | |||
803 | 824 | ||
804 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { | 825 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { |
805 | struct ehea_port_res *pr = &port->port_res[i]; | 826 | struct ehea_port_res *pr = &port->port_res[i]; |
827 | int ret; | ||
806 | k = 0; | 828 | k = 0; |
807 | swqe = ehea_get_swqe(pr->qp, &swqe_index); | 829 | swqe = ehea_get_swqe(pr->qp, &swqe_index); |
808 | memset(swqe, 0, SWQE_HEADER_SIZE); | 830 | memset(swqe, 0, SWQE_HEADER_SIZE); |
@@ -816,17 +838,16 @@ static void check_sqs(struct ehea_port *port) | |||
816 | 838 | ||
817 | ehea_post_swqe(pr->qp, swqe); | 839 | ehea_post_swqe(pr->qp, swqe); |
818 | 840 | ||
819 | while (pr->sq_restart_flag == 0) { | 841 | ret = wait_event_timeout(port->restart_wq, |
820 | msleep(5); | 842 | pr->sq_restart_flag == 0, |
821 | if (++k == 100) { | 843 | msecs_to_jiffies(100)); |
822 | ehea_error("HW/SW queues out of sync"); | 844 | |
823 | ehea_schedule_port_reset(pr->port); | 845 | if (!ret) { |
824 | return; | 846 | pr_err("HW/SW queues out of sync\n"); |
825 | } | 847 | ehea_schedule_port_reset(pr->port); |
848 | return; | ||
826 | } | 849 | } |
827 | } | 850 | } |
828 | |||
829 | return; | ||
830 | } | 851 | } |
831 | 852 | ||
832 | 853 | ||
@@ -855,14 +876,14 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota) | |||
855 | } | 876 | } |
856 | 877 | ||
857 | if (cqe->status & EHEA_CQE_STAT_ERR_MASK) { | 878 | if (cqe->status & EHEA_CQE_STAT_ERR_MASK) { |
858 | ehea_error("Bad send completion status=0x%04X", | 879 | pr_err("Bad send completion status=0x%04X\n", |
859 | cqe->status); | 880 | cqe->status); |
860 | 881 | ||
861 | if (netif_msg_tx_err(pr->port)) | 882 | if (netif_msg_tx_err(pr->port)) |
862 | ehea_dump(cqe, sizeof(*cqe), "Send CQE"); | 883 | ehea_dump(cqe, sizeof(*cqe), "Send CQE"); |
863 | 884 | ||
864 | if (cqe->status & EHEA_CQE_STAT_RESET_MASK) { | 885 | if (cqe->status & EHEA_CQE_STAT_RESET_MASK) { |
865 | ehea_error("Resetting port"); | 886 | pr_err("Resetting port\n"); |
866 | ehea_schedule_port_reset(pr->port); | 887 | ehea_schedule_port_reset(pr->port); |
867 | break; | 888 | break; |
868 | } | 889 | } |
@@ -897,6 +918,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota) | |||
897 | pr->queue_stopped = 0; | 918 | pr->queue_stopped = 0; |
898 | } | 919 | } |
899 | spin_unlock_irqrestore(&pr->netif_queue, flags); | 920 | spin_unlock_irqrestore(&pr->netif_queue, flags); |
921 | wake_up(&pr->port->swqe_avail_wq); | ||
900 | 922 | ||
901 | return cqe; | 923 | return cqe; |
902 | } | 924 | } |
@@ -979,8 +1001,8 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param) | |||
979 | 1001 | ||
980 | while (eqe) { | 1002 | while (eqe) { |
981 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); | 1003 | qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); |
982 | ehea_error("QP aff_err: entry=0x%llx, token=0x%x", | 1004 | pr_err("QP aff_err: entry=0x%llx, token=0x%x\n", |
983 | eqe->entry, qp_token); | 1005 | eqe->entry, qp_token); |
984 | 1006 | ||
985 | qp = port->port_res[qp_token].qp; | 1007 | qp = port->port_res[qp_token].qp; |
986 | 1008 | ||
@@ -998,7 +1020,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param) | |||
998 | } | 1020 | } |
999 | 1021 | ||
1000 | if (reset_port) { | 1022 | if (reset_port) { |
1001 | ehea_error("Resetting port"); | 1023 | pr_err("Resetting port\n"); |
1002 | ehea_schedule_port_reset(port); | 1024 | ehea_schedule_port_reset(port); |
1003 | } | 1025 | } |
1004 | 1026 | ||
@@ -1026,7 +1048,7 @@ int ehea_sense_port_attr(struct ehea_port *port) | |||
1026 | /* may be called via ehea_neq_tasklet() */ | 1048 | /* may be called via ehea_neq_tasklet() */ |
1027 | cb0 = (void *)get_zeroed_page(GFP_ATOMIC); | 1049 | cb0 = (void *)get_zeroed_page(GFP_ATOMIC); |
1028 | if (!cb0) { | 1050 | if (!cb0) { |
1029 | ehea_error("no mem for cb0"); | 1051 | pr_err("no mem for cb0\n"); |
1030 | ret = -ENOMEM; | 1052 | ret = -ENOMEM; |
1031 | goto out; | 1053 | goto out; |
1032 | } | 1054 | } |
@@ -1118,7 +1140,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed) | |||
1118 | 1140 | ||
1119 | cb4 = (void *)get_zeroed_page(GFP_KERNEL); | 1141 | cb4 = (void *)get_zeroed_page(GFP_KERNEL); |
1120 | if (!cb4) { | 1142 | if (!cb4) { |
1121 | ehea_error("no mem for cb4"); | 1143 | pr_err("no mem for cb4\n"); |
1122 | ret = -ENOMEM; | 1144 | ret = -ENOMEM; |
1123 | goto out; | 1145 | goto out; |
1124 | } | 1146 | } |
@@ -1169,16 +1191,16 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed) | |||
1169 | break; | 1191 | break; |
1170 | } | 1192 | } |
1171 | } else { | 1193 | } else { |
1172 | ehea_error("Failed sensing port speed"); | 1194 | pr_err("Failed sensing port speed\n"); |
1173 | ret = -EIO; | 1195 | ret = -EIO; |
1174 | } | 1196 | } |
1175 | } else { | 1197 | } else { |
1176 | if (hret == H_AUTHORITY) { | 1198 | if (hret == H_AUTHORITY) { |
1177 | ehea_info("Hypervisor denied setting port speed"); | 1199 | pr_info("Hypervisor denied setting port speed\n"); |
1178 | ret = -EPERM; | 1200 | ret = -EPERM; |
1179 | } else { | 1201 | } else { |
1180 | ret = -EIO; | 1202 | ret = -EIO; |
1181 | ehea_error("Failed setting port speed"); | 1203 | pr_err("Failed setting port speed\n"); |
1182 | } | 1204 | } |
1183 | } | 1205 | } |
1184 | if (!prop_carrier_state || (port->phy_link == EHEA_PHY_LINK_UP)) | 1206 | if (!prop_carrier_state || (port->phy_link == EHEA_PHY_LINK_UP)) |
@@ -1195,80 +1217,78 @@ static void ehea_parse_eqe(struct ehea_adapter *adapter, u64 eqe) | |||
1195 | u8 ec; | 1217 | u8 ec; |
1196 | u8 portnum; | 1218 | u8 portnum; |
1197 | struct ehea_port *port; | 1219 | struct ehea_port *port; |
1220 | struct net_device *dev; | ||
1198 | 1221 | ||
1199 | ec = EHEA_BMASK_GET(NEQE_EVENT_CODE, eqe); | 1222 | ec = EHEA_BMASK_GET(NEQE_EVENT_CODE, eqe); |
1200 | portnum = EHEA_BMASK_GET(NEQE_PORTNUM, eqe); | 1223 | portnum = EHEA_BMASK_GET(NEQE_PORTNUM, eqe); |
1201 | port = ehea_get_port(adapter, portnum); | 1224 | port = ehea_get_port(adapter, portnum); |
1225 | dev = port->netdev; | ||
1202 | 1226 | ||
1203 | switch (ec) { | 1227 | switch (ec) { |
1204 | case EHEA_EC_PORTSTATE_CHG: /* port state change */ | 1228 | case EHEA_EC_PORTSTATE_CHG: /* port state change */ |
1205 | 1229 | ||
1206 | if (!port) { | 1230 | if (!port) { |
1207 | ehea_error("unknown portnum %x", portnum); | 1231 | netdev_err(dev, "unknown portnum %x\n", portnum); |
1208 | break; | 1232 | break; |
1209 | } | 1233 | } |
1210 | 1234 | ||
1211 | if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) { | 1235 | if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) { |
1212 | if (!netif_carrier_ok(port->netdev)) { | 1236 | if (!netif_carrier_ok(dev)) { |
1213 | ret = ehea_sense_port_attr(port); | 1237 | ret = ehea_sense_port_attr(port); |
1214 | if (ret) { | 1238 | if (ret) { |
1215 | ehea_error("failed resensing port " | 1239 | netdev_err(dev, "failed resensing port attributes\n"); |
1216 | "attributes"); | ||
1217 | break; | 1240 | break; |
1218 | } | 1241 | } |
1219 | 1242 | ||
1220 | if (netif_msg_link(port)) | 1243 | netif_info(port, link, dev, |
1221 | ehea_info("%s: Logical port up: %dMbps " | 1244 | "Logical port up: %dMbps %s Duplex\n", |
1222 | "%s Duplex", | 1245 | port->port_speed, |
1223 | port->netdev->name, | 1246 | port->full_duplex == 1 ? |
1224 | port->port_speed, | 1247 | "Full" : "Half"); |
1225 | port->full_duplex == | ||
1226 | 1 ? "Full" : "Half"); | ||
1227 | 1248 | ||
1228 | netif_carrier_on(port->netdev); | 1249 | netif_carrier_on(dev); |
1229 | netif_wake_queue(port->netdev); | 1250 | netif_wake_queue(dev); |
1230 | } | 1251 | } |
1231 | } else | 1252 | } else |
1232 | if (netif_carrier_ok(port->netdev)) { | 1253 | if (netif_carrier_ok(dev)) { |
1233 | if (netif_msg_link(port)) | 1254 | netif_info(port, link, dev, |
1234 | ehea_info("%s: Logical port down", | 1255 | "Logical port down\n"); |
1235 | port->netdev->name); | 1256 | netif_carrier_off(dev); |
1236 | netif_carrier_off(port->netdev); | 1257 | netif_stop_queue(dev); |
1237 | netif_stop_queue(port->netdev); | ||
1238 | } | 1258 | } |
1239 | 1259 | ||
1240 | if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) { | 1260 | if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) { |
1241 | port->phy_link = EHEA_PHY_LINK_UP; | 1261 | port->phy_link = EHEA_PHY_LINK_UP; |
1242 | if (netif_msg_link(port)) | 1262 | netif_info(port, link, dev, |
1243 | ehea_info("%s: Physical port up", | 1263 | "Physical port up\n"); |
1244 | port->netdev->name); | ||
1245 | if (prop_carrier_state) | 1264 | if (prop_carrier_state) |
1246 | netif_carrier_on(port->netdev); | 1265 | netif_carrier_on(dev); |
1247 | } else { | 1266 | } else { |
1248 | port->phy_link = EHEA_PHY_LINK_DOWN; | 1267 | port->phy_link = EHEA_PHY_LINK_DOWN; |
1249 | if (netif_msg_link(port)) | 1268 | netif_info(port, link, dev, |
1250 | ehea_info("%s: Physical port down", | 1269 | "Physical port down\n"); |
1251 | port->netdev->name); | ||
1252 | if (prop_carrier_state) | 1270 | if (prop_carrier_state) |
1253 | netif_carrier_off(port->netdev); | 1271 | netif_carrier_off(dev); |
1254 | } | 1272 | } |
1255 | 1273 | ||
1256 | if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PRIMARY, eqe)) | 1274 | if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PRIMARY, eqe)) |
1257 | ehea_info("External switch port is primary port"); | 1275 | netdev_info(dev, |
1276 | "External switch port is primary port\n"); | ||
1258 | else | 1277 | else |
1259 | ehea_info("External switch port is backup port"); | 1278 | netdev_info(dev, |
1279 | "External switch port is backup port\n"); | ||
1260 | 1280 | ||
1261 | break; | 1281 | break; |
1262 | case EHEA_EC_ADAPTER_MALFUNC: | 1282 | case EHEA_EC_ADAPTER_MALFUNC: |
1263 | ehea_error("Adapter malfunction"); | 1283 | netdev_err(dev, "Adapter malfunction\n"); |
1264 | break; | 1284 | break; |
1265 | case EHEA_EC_PORT_MALFUNC: | 1285 | case EHEA_EC_PORT_MALFUNC: |
1266 | ehea_info("Port malfunction: Device: %s", port->netdev->name); | 1286 | netdev_info(dev, "Port malfunction\n"); |
1267 | netif_carrier_off(port->netdev); | 1287 | netif_carrier_off(dev); |
1268 | netif_stop_queue(port->netdev); | 1288 | netif_stop_queue(dev); |
1269 | break; | 1289 | break; |
1270 | default: | 1290 | default: |
1271 | ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe); | 1291 | netdev_err(dev, "unknown event code %x, eqe=0x%llX\n", ec, eqe); |
1272 | break; | 1292 | break; |
1273 | } | 1293 | } |
1274 | } | 1294 | } |
@@ -1280,13 +1300,13 @@ static void ehea_neq_tasklet(unsigned long data) | |||
1280 | u64 event_mask; | 1300 | u64 event_mask; |
1281 | 1301 | ||
1282 | eqe = ehea_poll_eq(adapter->neq); | 1302 | eqe = ehea_poll_eq(adapter->neq); |
1283 | ehea_debug("eqe=%p", eqe); | 1303 | pr_debug("eqe=%p\n", eqe); |
1284 | 1304 | ||
1285 | while (eqe) { | 1305 | while (eqe) { |
1286 | ehea_debug("*eqe=%lx", eqe->entry); | 1306 | pr_debug("*eqe=%lx\n", (unsigned long) eqe->entry); |
1287 | ehea_parse_eqe(adapter, eqe->entry); | 1307 | ehea_parse_eqe(adapter, eqe->entry); |
1288 | eqe = ehea_poll_eq(adapter->neq); | 1308 | eqe = ehea_poll_eq(adapter->neq); |
1289 | ehea_debug("next eqe=%p", eqe); | 1309 | pr_debug("next eqe=%p\n", eqe); |
1290 | } | 1310 | } |
1291 | 1311 | ||
1292 | event_mask = EHEA_BMASK_SET(NELR_PORTSTATE_CHG, 1) | 1312 | event_mask = EHEA_BMASK_SET(NELR_PORTSTATE_CHG, 1) |
@@ -1310,9 +1330,7 @@ static int ehea_fill_port_res(struct ehea_port_res *pr) | |||
1310 | int ret; | 1330 | int ret; |
1311 | struct ehea_qp_init_attr *init_attr = &pr->qp->init_attr; | 1331 | struct ehea_qp_init_attr *init_attr = &pr->qp->init_attr; |
1312 | 1332 | ||
1313 | ehea_init_fill_rq1(pr, init_attr->act_nr_rwqes_rq1 | 1333 | ehea_init_fill_rq1(pr, pr->rq1_skba.len); |
1314 | - init_attr->act_nr_rwqes_rq2 | ||
1315 | - init_attr->act_nr_rwqes_rq3 - 1); | ||
1316 | 1334 | ||
1317 | ret = ehea_refill_rq2(pr, init_attr->act_nr_rwqes_rq2 - 1); | 1335 | ret = ehea_refill_rq2(pr, init_attr->act_nr_rwqes_rq2 - 1); |
1318 | 1336 | ||
@@ -1335,14 +1353,14 @@ static int ehea_reg_interrupts(struct net_device *dev) | |||
1335 | ehea_qp_aff_irq_handler, | 1353 | ehea_qp_aff_irq_handler, |
1336 | IRQF_DISABLED, port->int_aff_name, port); | 1354 | IRQF_DISABLED, port->int_aff_name, port); |
1337 | if (ret) { | 1355 | if (ret) { |
1338 | ehea_error("failed registering irq for qp_aff_irq_handler:" | 1356 | netdev_err(dev, "failed registering irq for qp_aff_irq_handler:ist=%X\n", |
1339 | "ist=%X", port->qp_eq->attr.ist1); | 1357 | port->qp_eq->attr.ist1); |
1340 | goto out_free_qpeq; | 1358 | goto out_free_qpeq; |
1341 | } | 1359 | } |
1342 | 1360 | ||
1343 | if (netif_msg_ifup(port)) | 1361 | netif_info(port, ifup, dev, |
1344 | ehea_info("irq_handle 0x%X for function qp_aff_irq_handler " | 1362 | "irq_handle 0x%X for function qp_aff_irq_handler registered\n", |
1345 | "registered", port->qp_eq->attr.ist1); | 1363 | port->qp_eq->attr.ist1); |
1346 | 1364 | ||
1347 | 1365 | ||
1348 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { | 1366 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { |
@@ -1354,14 +1372,13 @@ static int ehea_reg_interrupts(struct net_device *dev) | |||
1354 | IRQF_DISABLED, pr->int_send_name, | 1372 | IRQF_DISABLED, pr->int_send_name, |
1355 | pr); | 1373 | pr); |
1356 | if (ret) { | 1374 | if (ret) { |
1357 | ehea_error("failed registering irq for ehea_queue " | 1375 | netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n", |
1358 | "port_res_nr:%d, ist=%X", i, | 1376 | i, pr->eq->attr.ist1); |
1359 | pr->eq->attr.ist1); | ||
1360 | goto out_free_req; | 1377 | goto out_free_req; |
1361 | } | 1378 | } |
1362 | if (netif_msg_ifup(port)) | 1379 | netif_info(port, ifup, dev, |
1363 | ehea_info("irq_handle 0x%X for function ehea_queue_int " | 1380 | "irq_handle 0x%X for function ehea_queue_int %d registered\n", |
1364 | "%d registered", pr->eq->attr.ist1, i); | 1381 | pr->eq->attr.ist1, i); |
1365 | } | 1382 | } |
1366 | out: | 1383 | out: |
1367 | return ret; | 1384 | return ret; |
@@ -1392,16 +1409,16 @@ static void ehea_free_interrupts(struct net_device *dev) | |||
1392 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { | 1409 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { |
1393 | pr = &port->port_res[i]; | 1410 | pr = &port->port_res[i]; |
1394 | ibmebus_free_irq(pr->eq->attr.ist1, pr); | 1411 | ibmebus_free_irq(pr->eq->attr.ist1, pr); |
1395 | if (netif_msg_intr(port)) | 1412 | netif_info(port, intr, dev, |
1396 | ehea_info("free send irq for res %d with handle 0x%X", | 1413 | "free send irq for res %d with handle 0x%X\n", |
1397 | i, pr->eq->attr.ist1); | 1414 | i, pr->eq->attr.ist1); |
1398 | } | 1415 | } |
1399 | 1416 | ||
1400 | /* associated events */ | 1417 | /* associated events */ |
1401 | ibmebus_free_irq(port->qp_eq->attr.ist1, port); | 1418 | ibmebus_free_irq(port->qp_eq->attr.ist1, port); |
1402 | if (netif_msg_intr(port)) | 1419 | netif_info(port, intr, dev, |
1403 | ehea_info("associated event interrupt for handle 0x%X freed", | 1420 | "associated event interrupt for handle 0x%X freed\n", |
1404 | port->qp_eq->attr.ist1); | 1421 | port->qp_eq->attr.ist1); |
1405 | } | 1422 | } |
1406 | 1423 | ||
1407 | static int ehea_configure_port(struct ehea_port *port) | 1424 | static int ehea_configure_port(struct ehea_port *port) |
@@ -1470,7 +1487,7 @@ int ehea_gen_smrs(struct ehea_port_res *pr) | |||
1470 | out_free: | 1487 | out_free: |
1471 | ehea_rem_mr(&pr->send_mr); | 1488 | ehea_rem_mr(&pr->send_mr); |
1472 | out: | 1489 | out: |
1473 | ehea_error("Generating SMRS failed\n"); | 1490 | pr_err("Generating SMRS failed\n"); |
1474 | return -EIO; | 1491 | return -EIO; |
1475 | } | 1492 | } |
1476 | 1493 | ||
@@ -1487,12 +1504,10 @@ static int ehea_init_q_skba(struct ehea_q_skb_arr *q_skba, int max_q_entries) | |||
1487 | { | 1504 | { |
1488 | int arr_size = sizeof(void *) * max_q_entries; | 1505 | int arr_size = sizeof(void *) * max_q_entries; |
1489 | 1506 | ||
1490 | q_skba->arr = vmalloc(arr_size); | 1507 | q_skba->arr = vzalloc(arr_size); |
1491 | if (!q_skba->arr) | 1508 | if (!q_skba->arr) |
1492 | return -ENOMEM; | 1509 | return -ENOMEM; |
1493 | 1510 | ||
1494 | memset(q_skba->arr, 0, arr_size); | ||
1495 | |||
1496 | q_skba->len = max_q_entries; | 1511 | q_skba->len = max_q_entries; |
1497 | q_skba->index = 0; | 1512 | q_skba->index = 0; |
1498 | q_skba->os_skbs = 0; | 1513 | q_skba->os_skbs = 0; |
@@ -1507,16 +1522,27 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr, | |||
1507 | enum ehea_eq_type eq_type = EHEA_EQ; | 1522 | enum ehea_eq_type eq_type = EHEA_EQ; |
1508 | struct ehea_qp_init_attr *init_attr = NULL; | 1523 | struct ehea_qp_init_attr *init_attr = NULL; |
1509 | int ret = -EIO; | 1524 | int ret = -EIO; |
1525 | u64 tx_bytes, rx_bytes, tx_packets, rx_packets; | ||
1526 | |||
1527 | tx_bytes = pr->tx_bytes; | ||
1528 | tx_packets = pr->tx_packets; | ||
1529 | rx_bytes = pr->rx_bytes; | ||
1530 | rx_packets = pr->rx_packets; | ||
1510 | 1531 | ||
1511 | memset(pr, 0, sizeof(struct ehea_port_res)); | 1532 | memset(pr, 0, sizeof(struct ehea_port_res)); |
1512 | 1533 | ||
1534 | pr->tx_bytes = rx_bytes; | ||
1535 | pr->tx_packets = tx_packets; | ||
1536 | pr->rx_bytes = rx_bytes; | ||
1537 | pr->rx_packets = rx_packets; | ||
1538 | |||
1513 | pr->port = port; | 1539 | pr->port = port; |
1514 | spin_lock_init(&pr->xmit_lock); | 1540 | spin_lock_init(&pr->xmit_lock); |
1515 | spin_lock_init(&pr->netif_queue); | 1541 | spin_lock_init(&pr->netif_queue); |
1516 | 1542 | ||
1517 | pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0); | 1543 | pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0); |
1518 | if (!pr->eq) { | 1544 | if (!pr->eq) { |
1519 | ehea_error("create_eq failed (eq)"); | 1545 | pr_err("create_eq failed (eq)\n"); |
1520 | goto out_free; | 1546 | goto out_free; |
1521 | } | 1547 | } |
1522 | 1548 | ||
@@ -1524,7 +1550,7 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr, | |||
1524 | pr->eq->fw_handle, | 1550 | pr->eq->fw_handle, |
1525 | port->logical_port_id); | 1551 | port->logical_port_id); |
1526 | if (!pr->recv_cq) { | 1552 | if (!pr->recv_cq) { |
1527 | ehea_error("create_cq failed (cq_recv)"); | 1553 | pr_err("create_cq failed (cq_recv)\n"); |
1528 | goto out_free; | 1554 | goto out_free; |
1529 | } | 1555 | } |
1530 | 1556 | ||
@@ -1532,19 +1558,19 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr, | |||
1532 | pr->eq->fw_handle, | 1558 | pr->eq->fw_handle, |
1533 | port->logical_port_id); | 1559 | port->logical_port_id); |
1534 | if (!pr->send_cq) { | 1560 | if (!pr->send_cq) { |
1535 | ehea_error("create_cq failed (cq_send)"); | 1561 | pr_err("create_cq failed (cq_send)\n"); |
1536 | goto out_free; | 1562 | goto out_free; |
1537 | } | 1563 | } |
1538 | 1564 | ||
1539 | if (netif_msg_ifup(port)) | 1565 | if (netif_msg_ifup(port)) |
1540 | ehea_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d", | 1566 | pr_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d\n", |
1541 | pr->send_cq->attr.act_nr_of_cqes, | 1567 | pr->send_cq->attr.act_nr_of_cqes, |
1542 | pr->recv_cq->attr.act_nr_of_cqes); | 1568 | pr->recv_cq->attr.act_nr_of_cqes); |
1543 | 1569 | ||
1544 | init_attr = kzalloc(sizeof(*init_attr), GFP_KERNEL); | 1570 | init_attr = kzalloc(sizeof(*init_attr), GFP_KERNEL); |
1545 | if (!init_attr) { | 1571 | if (!init_attr) { |
1546 | ret = -ENOMEM; | 1572 | ret = -ENOMEM; |
1547 | ehea_error("no mem for ehea_qp_init_attr"); | 1573 | pr_err("no mem for ehea_qp_init_attr\n"); |
1548 | goto out_free; | 1574 | goto out_free; |
1549 | } | 1575 | } |
1550 | 1576 | ||
@@ -1569,18 +1595,18 @@ static int ehea_init_port_res(struct ehea_port *port, struct ehea_port_res *pr, | |||
1569 | 1595 | ||
1570 | pr->qp = ehea_create_qp(adapter, adapter->pd, init_attr); | 1596 | pr->qp = ehea_create_qp(adapter, adapter->pd, init_attr); |
1571 | if (!pr->qp) { | 1597 | if (!pr->qp) { |
1572 | ehea_error("create_qp failed"); | 1598 | pr_err("create_qp failed\n"); |
1573 | ret = -EIO; | 1599 | ret = -EIO; |
1574 | goto out_free; | 1600 | goto out_free; |
1575 | } | 1601 | } |
1576 | 1602 | ||
1577 | if (netif_msg_ifup(port)) | 1603 | if (netif_msg_ifup(port)) |
1578 | ehea_info("QP: qp_nr=%d\n act_nr_snd_wqe=%d\n nr_rwqe_rq1=%d\n " | 1604 | pr_info("QP: qp_nr=%d\n act_nr_snd_wqe=%d\n nr_rwqe_rq1=%d\n nr_rwqe_rq2=%d\n nr_rwqe_rq3=%d\n", |
1579 | "nr_rwqe_rq2=%d\n nr_rwqe_rq3=%d", init_attr->qp_nr, | 1605 | init_attr->qp_nr, |
1580 | init_attr->act_nr_send_wqes, | 1606 | init_attr->act_nr_send_wqes, |
1581 | init_attr->act_nr_rwqes_rq1, | 1607 | init_attr->act_nr_rwqes_rq1, |
1582 | init_attr->act_nr_rwqes_rq2, | 1608 | init_attr->act_nr_rwqes_rq2, |
1583 | init_attr->act_nr_rwqes_rq3); | 1609 | init_attr->act_nr_rwqes_rq3); |
1584 | 1610 | ||
1585 | pr->sq_skba_size = init_attr->act_nr_send_wqes + 1; | 1611 | pr->sq_skba_size = init_attr->act_nr_send_wqes + 1; |
1586 | 1612 | ||
@@ -1731,7 +1757,7 @@ static void write_swqe2_TSO(struct sk_buff *skb, | |||
1731 | swqe->descriptors++; | 1757 | swqe->descriptors++; |
1732 | } | 1758 | } |
1733 | } else | 1759 | } else |
1734 | ehea_error("cannot handle fragmented headers"); | 1760 | pr_err("cannot handle fragmented headers\n"); |
1735 | } | 1761 | } |
1736 | 1762 | ||
1737 | static void write_swqe2_nonTSO(struct sk_buff *skb, | 1763 | static void write_swqe2_nonTSO(struct sk_buff *skb, |
@@ -1827,8 +1853,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid) | |||
1827 | port->logical_port_id, | 1853 | port->logical_port_id, |
1828 | reg_type, port->mac_addr, 0, hcallid); | 1854 | reg_type, port->mac_addr, 0, hcallid); |
1829 | if (hret != H_SUCCESS) { | 1855 | if (hret != H_SUCCESS) { |
1830 | ehea_error("%sregistering bc address failed (tagged)", | 1856 | pr_err("%sregistering bc address failed (tagged)\n", |
1831 | hcallid == H_REG_BCMC ? "" : "de"); | 1857 | hcallid == H_REG_BCMC ? "" : "de"); |
1832 | ret = -EIO; | 1858 | ret = -EIO; |
1833 | goto out_herr; | 1859 | goto out_herr; |
1834 | } | 1860 | } |
@@ -1839,8 +1865,8 @@ static int ehea_broadcast_reg_helper(struct ehea_port *port, u32 hcallid) | |||
1839 | port->logical_port_id, | 1865 | port->logical_port_id, |
1840 | reg_type, port->mac_addr, 0, hcallid); | 1866 | reg_type, port->mac_addr, 0, hcallid); |
1841 | if (hret != H_SUCCESS) { | 1867 | if (hret != H_SUCCESS) { |
1842 | ehea_error("%sregistering bc address failed (vlan)", | 1868 | pr_err("%sregistering bc address failed (vlan)\n", |
1843 | hcallid == H_REG_BCMC ? "" : "de"); | 1869 | hcallid == H_REG_BCMC ? "" : "de"); |
1844 | ret = -EIO; | 1870 | ret = -EIO; |
1845 | } | 1871 | } |
1846 | out_herr: | 1872 | out_herr: |
@@ -1862,7 +1888,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa) | |||
1862 | 1888 | ||
1863 | cb0 = (void *)get_zeroed_page(GFP_KERNEL); | 1889 | cb0 = (void *)get_zeroed_page(GFP_KERNEL); |
1864 | if (!cb0) { | 1890 | if (!cb0) { |
1865 | ehea_error("no mem for cb0"); | 1891 | pr_err("no mem for cb0\n"); |
1866 | ret = -ENOMEM; | 1892 | ret = -ENOMEM; |
1867 | goto out; | 1893 | goto out; |
1868 | } | 1894 | } |
@@ -1910,11 +1936,11 @@ out: | |||
1910 | static void ehea_promiscuous_error(u64 hret, int enable) | 1936 | static void ehea_promiscuous_error(u64 hret, int enable) |
1911 | { | 1937 | { |
1912 | if (hret == H_AUTHORITY) | 1938 | if (hret == H_AUTHORITY) |
1913 | ehea_info("Hypervisor denied %sabling promiscuous mode", | 1939 | pr_info("Hypervisor denied %sabling promiscuous mode\n", |
1914 | enable == 1 ? "en" : "dis"); | 1940 | enable == 1 ? "en" : "dis"); |
1915 | else | 1941 | else |
1916 | ehea_error("failed %sabling promiscuous mode", | 1942 | pr_err("failed %sabling promiscuous mode\n", |
1917 | enable == 1 ? "en" : "dis"); | 1943 | enable == 1 ? "en" : "dis"); |
1918 | } | 1944 | } |
1919 | 1945 | ||
1920 | static void ehea_promiscuous(struct net_device *dev, int enable) | 1946 | static void ehea_promiscuous(struct net_device *dev, int enable) |
@@ -1923,12 +1949,12 @@ static void ehea_promiscuous(struct net_device *dev, int enable) | |||
1923 | struct hcp_ehea_port_cb7 *cb7; | 1949 | struct hcp_ehea_port_cb7 *cb7; |
1924 | u64 hret; | 1950 | u64 hret; |
1925 | 1951 | ||
1926 | if ((enable && port->promisc) || (!enable && !port->promisc)) | 1952 | if (enable == port->promisc) |
1927 | return; | 1953 | return; |
1928 | 1954 | ||
1929 | cb7 = (void *)get_zeroed_page(GFP_ATOMIC); | 1955 | cb7 = (void *)get_zeroed_page(GFP_ATOMIC); |
1930 | if (!cb7) { | 1956 | if (!cb7) { |
1931 | ehea_error("no mem for cb7"); | 1957 | pr_err("no mem for cb7\n"); |
1932 | goto out; | 1958 | goto out; |
1933 | } | 1959 | } |
1934 | 1960 | ||
@@ -1988,7 +2014,7 @@ static int ehea_drop_multicast_list(struct net_device *dev) | |||
1988 | hret = ehea_multicast_reg_helper(port, mc_entry->macaddr, | 2014 | hret = ehea_multicast_reg_helper(port, mc_entry->macaddr, |
1989 | H_DEREG_BCMC); | 2015 | H_DEREG_BCMC); |
1990 | if (hret) { | 2016 | if (hret) { |
1991 | ehea_error("failed deregistering mcast MAC"); | 2017 | pr_err("failed deregistering mcast MAC\n"); |
1992 | ret = -EIO; | 2018 | ret = -EIO; |
1993 | } | 2019 | } |
1994 | 2020 | ||
@@ -2011,7 +2037,8 @@ static void ehea_allmulti(struct net_device *dev, int enable) | |||
2011 | if (!hret) | 2037 | if (!hret) |
2012 | port->allmulti = 1; | 2038 | port->allmulti = 1; |
2013 | else | 2039 | else |
2014 | ehea_error("failed enabling IFF_ALLMULTI"); | 2040 | netdev_err(dev, |
2041 | "failed enabling IFF_ALLMULTI\n"); | ||
2015 | } | 2042 | } |
2016 | } else | 2043 | } else |
2017 | if (!enable) { | 2044 | if (!enable) { |
@@ -2020,7 +2047,8 @@ static void ehea_allmulti(struct net_device *dev, int enable) | |||
2020 | if (!hret) | 2047 | if (!hret) |
2021 | port->allmulti = 0; | 2048 | port->allmulti = 0; |
2022 | else | 2049 | else |
2023 | ehea_error("failed disabling IFF_ALLMULTI"); | 2050 | netdev_err(dev, |
2051 | "failed disabling IFF_ALLMULTI\n"); | ||
2024 | } | 2052 | } |
2025 | } | 2053 | } |
2026 | 2054 | ||
@@ -2031,7 +2059,7 @@ static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) | |||
2031 | 2059 | ||
2032 | ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC); | 2060 | ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC); |
2033 | if (!ehea_mcl_entry) { | 2061 | if (!ehea_mcl_entry) { |
2034 | ehea_error("no mem for mcl_entry"); | 2062 | pr_err("no mem for mcl_entry\n"); |
2035 | return; | 2063 | return; |
2036 | } | 2064 | } |
2037 | 2065 | ||
@@ -2044,7 +2072,7 @@ static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) | |||
2044 | if (!hret) | 2072 | if (!hret) |
2045 | list_add(&ehea_mcl_entry->list, &port->mc_list->list); | 2073 | list_add(&ehea_mcl_entry->list, &port->mc_list->list); |
2046 | else { | 2074 | else { |
2047 | ehea_error("failed registering mcast MAC"); | 2075 | pr_err("failed registering mcast MAC\n"); |
2048 | kfree(ehea_mcl_entry); | 2076 | kfree(ehea_mcl_entry); |
2049 | } | 2077 | } |
2050 | } | 2078 | } |
@@ -2055,7 +2083,7 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
2055 | struct netdev_hw_addr *ha; | 2083 | struct netdev_hw_addr *ha; |
2056 | int ret; | 2084 | int ret; |
2057 | 2085 | ||
2058 | if (dev->flags & IFF_PROMISC) { | 2086 | if (port->promisc) { |
2059 | ehea_promiscuous(dev, 1); | 2087 | ehea_promiscuous(dev, 1); |
2060 | return; | 2088 | return; |
2061 | } | 2089 | } |
@@ -2077,9 +2105,8 @@ static void ehea_set_multicast_list(struct net_device *dev) | |||
2077 | } | 2105 | } |
2078 | 2106 | ||
2079 | if (netdev_mc_count(dev) > port->adapter->max_mc_mac) { | 2107 | if (netdev_mc_count(dev) > port->adapter->max_mc_mac) { |
2080 | ehea_info("Mcast registration limit reached (0x%llx). " | 2108 | pr_info("Mcast registration limit reached (0x%llx). Use ALLMULTI!\n", |
2081 | "Use ALLMULTI!", | 2109 | port->adapter->max_mc_mac); |
2082 | port->adapter->max_mc_mac); | ||
2083 | goto out; | 2110 | goto out; |
2084 | } | 2111 | } |
2085 | 2112 | ||
@@ -2247,6 +2274,14 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2247 | memset(swqe, 0, SWQE_HEADER_SIZE); | 2274 | memset(swqe, 0, SWQE_HEADER_SIZE); |
2248 | atomic_dec(&pr->swqe_avail); | 2275 | atomic_dec(&pr->swqe_avail); |
2249 | 2276 | ||
2277 | if (vlan_tx_tag_present(skb)) { | ||
2278 | swqe->tx_control |= EHEA_SWQE_VLAN_INSERT; | ||
2279 | swqe->vlan_tag = vlan_tx_tag_get(skb); | ||
2280 | } | ||
2281 | |||
2282 | pr->tx_packets++; | ||
2283 | pr->tx_bytes += skb->len; | ||
2284 | |||
2250 | if (skb->len <= SWQE3_MAX_IMM) { | 2285 | if (skb->len <= SWQE3_MAX_IMM) { |
2251 | u32 sig_iv = port->sig_comp_iv; | 2286 | u32 sig_iv = port->sig_comp_iv; |
2252 | u32 swqe_num = pr->swqe_id_counter; | 2287 | u32 swqe_num = pr->swqe_id_counter; |
@@ -2277,15 +2312,10 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2277 | } | 2312 | } |
2278 | pr->swqe_id_counter += 1; | 2313 | pr->swqe_id_counter += 1; |
2279 | 2314 | ||
2280 | if (port->vgrp && vlan_tx_tag_present(skb)) { | 2315 | netif_info(port, tx_queued, dev, |
2281 | swqe->tx_control |= EHEA_SWQE_VLAN_INSERT; | 2316 | "post swqe on QP %d\n", pr->qp->init_attr.qp_nr); |
2282 | swqe->vlan_tag = vlan_tx_tag_get(skb); | 2317 | if (netif_msg_tx_queued(port)) |
2283 | } | ||
2284 | |||
2285 | if (netif_msg_tx_queued(port)) { | ||
2286 | ehea_info("post swqe on QP %d", pr->qp->init_attr.qp_nr); | ||
2287 | ehea_dump(swqe, 512, "swqe"); | 2318 | ehea_dump(swqe, 512, "swqe"); |
2288 | } | ||
2289 | 2319 | ||
2290 | if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) { | 2320 | if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) { |
2291 | netif_stop_queue(dev); | 2321 | netif_stop_queue(dev); |
@@ -2293,7 +2323,6 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2293 | } | 2323 | } |
2294 | 2324 | ||
2295 | ehea_post_swqe(pr->qp, swqe); | 2325 | ehea_post_swqe(pr->qp, swqe); |
2296 | pr->tx_packets++; | ||
2297 | 2326 | ||
2298 | if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) { | 2327 | if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) { |
2299 | spin_lock_irqsave(&pr->netif_queue, flags); | 2328 | spin_lock_irqsave(&pr->netif_queue, flags); |
@@ -2322,14 +2351,14 @@ static void ehea_vlan_rx_register(struct net_device *dev, | |||
2322 | 2351 | ||
2323 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); | 2352 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); |
2324 | if (!cb1) { | 2353 | if (!cb1) { |
2325 | ehea_error("no mem for cb1"); | 2354 | pr_err("no mem for cb1\n"); |
2326 | goto out; | 2355 | goto out; |
2327 | } | 2356 | } |
2328 | 2357 | ||
2329 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, | 2358 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, |
2330 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2359 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2331 | if (hret != H_SUCCESS) | 2360 | if (hret != H_SUCCESS) |
2332 | ehea_error("modify_ehea_port failed"); | 2361 | pr_err("modify_ehea_port failed\n"); |
2333 | 2362 | ||
2334 | free_page((unsigned long)cb1); | 2363 | free_page((unsigned long)cb1); |
2335 | out: | 2364 | out: |
@@ -2346,14 +2375,14 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
2346 | 2375 | ||
2347 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); | 2376 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); |
2348 | if (!cb1) { | 2377 | if (!cb1) { |
2349 | ehea_error("no mem for cb1"); | 2378 | pr_err("no mem for cb1\n"); |
2350 | goto out; | 2379 | goto out; |
2351 | } | 2380 | } |
2352 | 2381 | ||
2353 | hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id, | 2382 | hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id, |
2354 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2383 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2355 | if (hret != H_SUCCESS) { | 2384 | if (hret != H_SUCCESS) { |
2356 | ehea_error("query_ehea_port failed"); | 2385 | pr_err("query_ehea_port failed\n"); |
2357 | goto out; | 2386 | goto out; |
2358 | } | 2387 | } |
2359 | 2388 | ||
@@ -2363,7 +2392,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
2363 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, | 2392 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, |
2364 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2393 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2365 | if (hret != H_SUCCESS) | 2394 | if (hret != H_SUCCESS) |
2366 | ehea_error("modify_ehea_port failed"); | 2395 | pr_err("modify_ehea_port failed\n"); |
2367 | out: | 2396 | out: |
2368 | free_page((unsigned long)cb1); | 2397 | free_page((unsigned long)cb1); |
2369 | return; | 2398 | return; |
@@ -2381,14 +2410,14 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
2381 | 2410 | ||
2382 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); | 2411 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); |
2383 | if (!cb1) { | 2412 | if (!cb1) { |
2384 | ehea_error("no mem for cb1"); | 2413 | pr_err("no mem for cb1\n"); |
2385 | goto out; | 2414 | goto out; |
2386 | } | 2415 | } |
2387 | 2416 | ||
2388 | hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id, | 2417 | hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id, |
2389 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2418 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2390 | if (hret != H_SUCCESS) { | 2419 | if (hret != H_SUCCESS) { |
2391 | ehea_error("query_ehea_port failed"); | 2420 | pr_err("query_ehea_port failed\n"); |
2392 | goto out; | 2421 | goto out; |
2393 | } | 2422 | } |
2394 | 2423 | ||
@@ -2398,7 +2427,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
2398 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, | 2427 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, |
2399 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2428 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2400 | if (hret != H_SUCCESS) | 2429 | if (hret != H_SUCCESS) |
2401 | ehea_error("modify_ehea_port failed"); | 2430 | pr_err("modify_ehea_port failed\n"); |
2402 | out: | 2431 | out: |
2403 | free_page((unsigned long)cb1); | 2432 | free_page((unsigned long)cb1); |
2404 | } | 2433 | } |
@@ -2420,7 +2449,7 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | |||
2420 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, | 2449 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, |
2421 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); | 2450 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); |
2422 | if (hret != H_SUCCESS) { | 2451 | if (hret != H_SUCCESS) { |
2423 | ehea_error("query_ehea_qp failed (1)"); | 2452 | pr_err("query_ehea_qp failed (1)\n"); |
2424 | goto out; | 2453 | goto out; |
2425 | } | 2454 | } |
2426 | 2455 | ||
@@ -2429,14 +2458,14 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | |||
2429 | EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0, | 2458 | EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0, |
2430 | &dummy64, &dummy64, &dummy16, &dummy16); | 2459 | &dummy64, &dummy64, &dummy16, &dummy16); |
2431 | if (hret != H_SUCCESS) { | 2460 | if (hret != H_SUCCESS) { |
2432 | ehea_error("modify_ehea_qp failed (1)"); | 2461 | pr_err("modify_ehea_qp failed (1)\n"); |
2433 | goto out; | 2462 | goto out; |
2434 | } | 2463 | } |
2435 | 2464 | ||
2436 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, | 2465 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, |
2437 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); | 2466 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); |
2438 | if (hret != H_SUCCESS) { | 2467 | if (hret != H_SUCCESS) { |
2439 | ehea_error("query_ehea_qp failed (2)"); | 2468 | pr_err("query_ehea_qp failed (2)\n"); |
2440 | goto out; | 2469 | goto out; |
2441 | } | 2470 | } |
2442 | 2471 | ||
@@ -2445,14 +2474,14 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | |||
2445 | EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0, | 2474 | EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0, |
2446 | &dummy64, &dummy64, &dummy16, &dummy16); | 2475 | &dummy64, &dummy64, &dummy16, &dummy16); |
2447 | if (hret != H_SUCCESS) { | 2476 | if (hret != H_SUCCESS) { |
2448 | ehea_error("modify_ehea_qp failed (2)"); | 2477 | pr_err("modify_ehea_qp failed (2)\n"); |
2449 | goto out; | 2478 | goto out; |
2450 | } | 2479 | } |
2451 | 2480 | ||
2452 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, | 2481 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, |
2453 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); | 2482 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); |
2454 | if (hret != H_SUCCESS) { | 2483 | if (hret != H_SUCCESS) { |
2455 | ehea_error("query_ehea_qp failed (3)"); | 2484 | pr_err("query_ehea_qp failed (3)\n"); |
2456 | goto out; | 2485 | goto out; |
2457 | } | 2486 | } |
2458 | 2487 | ||
@@ -2461,14 +2490,14 @@ int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | |||
2461 | EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0, | 2490 | EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0, |
2462 | &dummy64, &dummy64, &dummy16, &dummy16); | 2491 | &dummy64, &dummy64, &dummy16, &dummy16); |
2463 | if (hret != H_SUCCESS) { | 2492 | if (hret != H_SUCCESS) { |
2464 | ehea_error("modify_ehea_qp failed (3)"); | 2493 | pr_err("modify_ehea_qp failed (3)\n"); |
2465 | goto out; | 2494 | goto out; |
2466 | } | 2495 | } |
2467 | 2496 | ||
2468 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, | 2497 | hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle, |
2469 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); | 2498 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0); |
2470 | if (hret != H_SUCCESS) { | 2499 | if (hret != H_SUCCESS) { |
2471 | ehea_error("query_ehea_qp failed (4)"); | 2500 | pr_err("query_ehea_qp failed (4)\n"); |
2472 | goto out; | 2501 | goto out; |
2473 | } | 2502 | } |
2474 | 2503 | ||
@@ -2489,7 +2518,7 @@ static int ehea_port_res_setup(struct ehea_port *port, int def_qps, | |||
2489 | EHEA_MAX_ENTRIES_EQ, 1); | 2518 | EHEA_MAX_ENTRIES_EQ, 1); |
2490 | if (!port->qp_eq) { | 2519 | if (!port->qp_eq) { |
2491 | ret = -EINVAL; | 2520 | ret = -EINVAL; |
2492 | ehea_error("ehea_create_eq failed (qp_eq)"); | 2521 | pr_err("ehea_create_eq failed (qp_eq)\n"); |
2493 | goto out_kill_eq; | 2522 | goto out_kill_eq; |
2494 | } | 2523 | } |
2495 | 2524 | ||
@@ -2570,27 +2599,27 @@ static int ehea_up(struct net_device *dev) | |||
2570 | ret = ehea_port_res_setup(port, port->num_def_qps, | 2599 | ret = ehea_port_res_setup(port, port->num_def_qps, |
2571 | port->num_add_tx_qps); | 2600 | port->num_add_tx_qps); |
2572 | if (ret) { | 2601 | if (ret) { |
2573 | ehea_error("port_res_failed"); | 2602 | netdev_err(dev, "port_res_failed\n"); |
2574 | goto out; | 2603 | goto out; |
2575 | } | 2604 | } |
2576 | 2605 | ||
2577 | /* Set default QP for this port */ | 2606 | /* Set default QP for this port */ |
2578 | ret = ehea_configure_port(port); | 2607 | ret = ehea_configure_port(port); |
2579 | if (ret) { | 2608 | if (ret) { |
2580 | ehea_error("ehea_configure_port failed. ret:%d", ret); | 2609 | netdev_err(dev, "ehea_configure_port failed. ret:%d\n", ret); |
2581 | goto out_clean_pr; | 2610 | goto out_clean_pr; |
2582 | } | 2611 | } |
2583 | 2612 | ||
2584 | ret = ehea_reg_interrupts(dev); | 2613 | ret = ehea_reg_interrupts(dev); |
2585 | if (ret) { | 2614 | if (ret) { |
2586 | ehea_error("reg_interrupts failed. ret:%d", ret); | 2615 | netdev_err(dev, "reg_interrupts failed. ret:%d\n", ret); |
2587 | goto out_clean_pr; | 2616 | goto out_clean_pr; |
2588 | } | 2617 | } |
2589 | 2618 | ||
2590 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { | 2619 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { |
2591 | ret = ehea_activate_qp(port->adapter, port->port_res[i].qp); | 2620 | ret = ehea_activate_qp(port->adapter, port->port_res[i].qp); |
2592 | if (ret) { | 2621 | if (ret) { |
2593 | ehea_error("activate_qp failed"); | 2622 | netdev_err(dev, "activate_qp failed\n"); |
2594 | goto out_free_irqs; | 2623 | goto out_free_irqs; |
2595 | } | 2624 | } |
2596 | } | 2625 | } |
@@ -2598,7 +2627,7 @@ static int ehea_up(struct net_device *dev) | |||
2598 | for (i = 0; i < port->num_def_qps; i++) { | 2627 | for (i = 0; i < port->num_def_qps; i++) { |
2599 | ret = ehea_fill_port_res(&port->port_res[i]); | 2628 | ret = ehea_fill_port_res(&port->port_res[i]); |
2600 | if (ret) { | 2629 | if (ret) { |
2601 | ehea_error("out_free_irqs"); | 2630 | netdev_err(dev, "out_free_irqs\n"); |
2602 | goto out_free_irqs; | 2631 | goto out_free_irqs; |
2603 | } | 2632 | } |
2604 | } | 2633 | } |
@@ -2621,7 +2650,7 @@ out_clean_pr: | |||
2621 | ehea_clean_all_portres(port); | 2650 | ehea_clean_all_portres(port); |
2622 | out: | 2651 | out: |
2623 | if (ret) | 2652 | if (ret) |
2624 | ehea_info("Failed starting %s. ret=%i", dev->name, ret); | 2653 | netdev_info(dev, "Failed starting. ret=%i\n", ret); |
2625 | 2654 | ||
2626 | ehea_update_bcmc_registrations(); | 2655 | ehea_update_bcmc_registrations(); |
2627 | ehea_update_firmware_handles(); | 2656 | ehea_update_firmware_handles(); |
@@ -2652,8 +2681,7 @@ static int ehea_open(struct net_device *dev) | |||
2652 | 2681 | ||
2653 | mutex_lock(&port->port_lock); | 2682 | mutex_lock(&port->port_lock); |
2654 | 2683 | ||
2655 | if (netif_msg_ifup(port)) | 2684 | netif_info(port, ifup, dev, "enabling port\n"); |
2656 | ehea_info("enabling port %s", dev->name); | ||
2657 | 2685 | ||
2658 | ret = ehea_up(dev); | 2686 | ret = ehea_up(dev); |
2659 | if (!ret) { | 2687 | if (!ret) { |
@@ -2685,8 +2713,7 @@ static int ehea_down(struct net_device *dev) | |||
2685 | 2713 | ||
2686 | ret = ehea_clean_all_portres(port); | 2714 | ret = ehea_clean_all_portres(port); |
2687 | if (ret) | 2715 | if (ret) |
2688 | ehea_info("Failed freeing resources for %s. ret=%i", | 2716 | netdev_info(dev, "Failed freeing resources. ret=%i\n", ret); |
2689 | dev->name, ret); | ||
2690 | 2717 | ||
2691 | ehea_update_firmware_handles(); | 2718 | ehea_update_firmware_handles(); |
2692 | 2719 | ||
@@ -2698,8 +2725,7 @@ static int ehea_stop(struct net_device *dev) | |||
2698 | int ret; | 2725 | int ret; |
2699 | struct ehea_port *port = netdev_priv(dev); | 2726 | struct ehea_port *port = netdev_priv(dev); |
2700 | 2727 | ||
2701 | if (netif_msg_ifdown(port)) | 2728 | netif_info(port, ifdown, dev, "disabling port\n"); |
2702 | ehea_info("disabling port %s", dev->name); | ||
2703 | 2729 | ||
2704 | set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags); | 2730 | set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags); |
2705 | cancel_work_sync(&port->reset_task); | 2731 | cancel_work_sync(&port->reset_task); |
@@ -2733,13 +2759,15 @@ static void ehea_flush_sq(struct ehea_port *port) | |||
2733 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { | 2759 | for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) { |
2734 | struct ehea_port_res *pr = &port->port_res[i]; | 2760 | struct ehea_port_res *pr = &port->port_res[i]; |
2735 | int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count; | 2761 | int swqe_max = pr->sq_skba_size - 2 - pr->swqe_ll_count; |
2736 | int k = 0; | 2762 | int ret; |
2737 | while (atomic_read(&pr->swqe_avail) < swqe_max) { | 2763 | |
2738 | msleep(5); | 2764 | ret = wait_event_timeout(port->swqe_avail_wq, |
2739 | if (++k == 20) { | 2765 | atomic_read(&pr->swqe_avail) >= swqe_max, |
2740 | ehea_error("WARNING: sq not flushed completely"); | 2766 | msecs_to_jiffies(100)); |
2741 | break; | 2767 | |
2742 | } | 2768 | if (!ret) { |
2769 | pr_err("WARNING: sq not flushed completely\n"); | ||
2770 | break; | ||
2743 | } | 2771 | } |
2744 | } | 2772 | } |
2745 | } | 2773 | } |
@@ -2774,7 +2802,7 @@ int ehea_stop_qps(struct net_device *dev) | |||
2774 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), | 2802 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), |
2775 | cb0); | 2803 | cb0); |
2776 | if (hret != H_SUCCESS) { | 2804 | if (hret != H_SUCCESS) { |
2777 | ehea_error("query_ehea_qp failed (1)"); | 2805 | pr_err("query_ehea_qp failed (1)\n"); |
2778 | goto out; | 2806 | goto out; |
2779 | } | 2807 | } |
2780 | 2808 | ||
@@ -2786,7 +2814,7 @@ int ehea_stop_qps(struct net_device *dev) | |||
2786 | 1), cb0, &dummy64, | 2814 | 1), cb0, &dummy64, |
2787 | &dummy64, &dummy16, &dummy16); | 2815 | &dummy64, &dummy16, &dummy16); |
2788 | if (hret != H_SUCCESS) { | 2816 | if (hret != H_SUCCESS) { |
2789 | ehea_error("modify_ehea_qp failed (1)"); | 2817 | pr_err("modify_ehea_qp failed (1)\n"); |
2790 | goto out; | 2818 | goto out; |
2791 | } | 2819 | } |
2792 | 2820 | ||
@@ -2794,14 +2822,14 @@ int ehea_stop_qps(struct net_device *dev) | |||
2794 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), | 2822 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), |
2795 | cb0); | 2823 | cb0); |
2796 | if (hret != H_SUCCESS) { | 2824 | if (hret != H_SUCCESS) { |
2797 | ehea_error("query_ehea_qp failed (2)"); | 2825 | pr_err("query_ehea_qp failed (2)\n"); |
2798 | goto out; | 2826 | goto out; |
2799 | } | 2827 | } |
2800 | 2828 | ||
2801 | /* deregister shared memory regions */ | 2829 | /* deregister shared memory regions */ |
2802 | dret = ehea_rem_smrs(pr); | 2830 | dret = ehea_rem_smrs(pr); |
2803 | if (dret) { | 2831 | if (dret) { |
2804 | ehea_error("unreg shared memory region failed"); | 2832 | pr_err("unreg shared memory region failed\n"); |
2805 | goto out; | 2833 | goto out; |
2806 | } | 2834 | } |
2807 | } | 2835 | } |
@@ -2870,7 +2898,7 @@ int ehea_restart_qps(struct net_device *dev) | |||
2870 | 2898 | ||
2871 | ret = ehea_gen_smrs(pr); | 2899 | ret = ehea_gen_smrs(pr); |
2872 | if (ret) { | 2900 | if (ret) { |
2873 | ehea_error("creation of shared memory regions failed"); | 2901 | netdev_err(dev, "creation of shared memory regions failed\n"); |
2874 | goto out; | 2902 | goto out; |
2875 | } | 2903 | } |
2876 | 2904 | ||
@@ -2881,7 +2909,7 @@ int ehea_restart_qps(struct net_device *dev) | |||
2881 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), | 2909 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), |
2882 | cb0); | 2910 | cb0); |
2883 | if (hret != H_SUCCESS) { | 2911 | if (hret != H_SUCCESS) { |
2884 | ehea_error("query_ehea_qp failed (1)"); | 2912 | netdev_err(dev, "query_ehea_qp failed (1)\n"); |
2885 | goto out; | 2913 | goto out; |
2886 | } | 2914 | } |
2887 | 2915 | ||
@@ -2893,7 +2921,7 @@ int ehea_restart_qps(struct net_device *dev) | |||
2893 | 1), cb0, &dummy64, | 2921 | 1), cb0, &dummy64, |
2894 | &dummy64, &dummy16, &dummy16); | 2922 | &dummy64, &dummy16, &dummy16); |
2895 | if (hret != H_SUCCESS) { | 2923 | if (hret != H_SUCCESS) { |
2896 | ehea_error("modify_ehea_qp failed (1)"); | 2924 | netdev_err(dev, "modify_ehea_qp failed (1)\n"); |
2897 | goto out; | 2925 | goto out; |
2898 | } | 2926 | } |
2899 | 2927 | ||
@@ -2901,7 +2929,7 @@ int ehea_restart_qps(struct net_device *dev) | |||
2901 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), | 2929 | EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), |
2902 | cb0); | 2930 | cb0); |
2903 | if (hret != H_SUCCESS) { | 2931 | if (hret != H_SUCCESS) { |
2904 | ehea_error("query_ehea_qp failed (2)"); | 2932 | netdev_err(dev, "query_ehea_qp failed (2)\n"); |
2905 | goto out; | 2933 | goto out; |
2906 | } | 2934 | } |
2907 | 2935 | ||
@@ -2938,8 +2966,7 @@ static void ehea_reset_port(struct work_struct *work) | |||
2938 | 2966 | ||
2939 | ehea_set_multicast_list(dev); | 2967 | ehea_set_multicast_list(dev); |
2940 | 2968 | ||
2941 | if (netif_msg_timer(port)) | 2969 | netif_info(port, timer, dev, "reset successful\n"); |
2942 | ehea_info("Device %s resetted successfully", dev->name); | ||
2943 | 2970 | ||
2944 | port_napi_enable(port); | 2971 | port_napi_enable(port); |
2945 | 2972 | ||
@@ -2949,12 +2976,12 @@ out: | |||
2949 | mutex_unlock(&dlpar_mem_lock); | 2976 | mutex_unlock(&dlpar_mem_lock); |
2950 | } | 2977 | } |
2951 | 2978 | ||
2952 | static void ehea_rereg_mrs(struct work_struct *work) | 2979 | static void ehea_rereg_mrs(void) |
2953 | { | 2980 | { |
2954 | int ret, i; | 2981 | int ret, i; |
2955 | struct ehea_adapter *adapter; | 2982 | struct ehea_adapter *adapter; |
2956 | 2983 | ||
2957 | ehea_info("LPAR memory changed - re-initializing driver"); | 2984 | pr_info("LPAR memory changed - re-initializing driver\n"); |
2958 | 2985 | ||
2959 | list_for_each_entry(adapter, &adapter_list, list) | 2986 | list_for_each_entry(adapter, &adapter_list, list) |
2960 | if (adapter->active_ports) { | 2987 | if (adapter->active_ports) { |
@@ -2986,8 +3013,7 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2986 | /* Unregister old memory region */ | 3013 | /* Unregister old memory region */ |
2987 | ret = ehea_rem_mr(&adapter->mr); | 3014 | ret = ehea_rem_mr(&adapter->mr); |
2988 | if (ret) { | 3015 | if (ret) { |
2989 | ehea_error("unregister MR failed - driver" | 3016 | pr_err("unregister MR failed - driver inoperable!\n"); |
2990 | " inoperable!"); | ||
2991 | goto out; | 3017 | goto out; |
2992 | } | 3018 | } |
2993 | } | 3019 | } |
@@ -2999,8 +3025,7 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
2999 | /* Register new memory region */ | 3025 | /* Register new memory region */ |
3000 | ret = ehea_reg_kernel_mr(adapter, &adapter->mr); | 3026 | ret = ehea_reg_kernel_mr(adapter, &adapter->mr); |
3001 | if (ret) { | 3027 | if (ret) { |
3002 | ehea_error("register MR failed - driver" | 3028 | pr_err("register MR failed - driver inoperable!\n"); |
3003 | " inoperable!"); | ||
3004 | goto out; | 3029 | goto out; |
3005 | } | 3030 | } |
3006 | 3031 | ||
@@ -3013,17 +3038,20 @@ static void ehea_rereg_mrs(struct work_struct *work) | |||
3013 | 3038 | ||
3014 | if (dev->flags & IFF_UP) { | 3039 | if (dev->flags & IFF_UP) { |
3015 | mutex_lock(&port->port_lock); | 3040 | mutex_lock(&port->port_lock); |
3016 | port_napi_enable(port); | ||
3017 | ret = ehea_restart_qps(dev); | 3041 | ret = ehea_restart_qps(dev); |
3018 | check_sqs(port); | 3042 | if (!ret) { |
3019 | if (!ret) | 3043 | check_sqs(port); |
3044 | port_napi_enable(port); | ||
3020 | netif_wake_queue(dev); | 3045 | netif_wake_queue(dev); |
3046 | } else { | ||
3047 | netdev_err(dev, "Unable to restart QPS\n"); | ||
3048 | } | ||
3021 | mutex_unlock(&port->port_lock); | 3049 | mutex_unlock(&port->port_lock); |
3022 | } | 3050 | } |
3023 | } | 3051 | } |
3024 | } | 3052 | } |
3025 | } | 3053 | } |
3026 | ehea_info("re-initializing driver complete"); | 3054 | pr_info("re-initializing driver complete\n"); |
3027 | out: | 3055 | out: |
3028 | return; | 3056 | return; |
3029 | } | 3057 | } |
@@ -3076,7 +3104,7 @@ int ehea_get_jumboframe_status(struct ehea_port *port, int *jumbo) | |||
3076 | /* (Try to) enable *jumbo frames */ | 3104 | /* (Try to) enable *jumbo frames */ |
3077 | cb4 = (void *)get_zeroed_page(GFP_KERNEL); | 3105 | cb4 = (void *)get_zeroed_page(GFP_KERNEL); |
3078 | if (!cb4) { | 3106 | if (!cb4) { |
3079 | ehea_error("no mem for cb4"); | 3107 | pr_err("no mem for cb4\n"); |
3080 | ret = -ENOMEM; | 3108 | ret = -ENOMEM; |
3081 | goto out; | 3109 | goto out; |
3082 | } else { | 3110 | } else { |
@@ -3138,13 +3166,13 @@ static struct device *ehea_register_port(struct ehea_port *port, | |||
3138 | 3166 | ||
3139 | ret = of_device_register(&port->ofdev); | 3167 | ret = of_device_register(&port->ofdev); |
3140 | if (ret) { | 3168 | if (ret) { |
3141 | ehea_error("failed to register device. ret=%d", ret); | 3169 | pr_err("failed to register device. ret=%d\n", ret); |
3142 | goto out; | 3170 | goto out; |
3143 | } | 3171 | } |
3144 | 3172 | ||
3145 | ret = device_create_file(&port->ofdev.dev, &dev_attr_log_port_id); | 3173 | ret = device_create_file(&port->ofdev.dev, &dev_attr_log_port_id); |
3146 | if (ret) { | 3174 | if (ret) { |
3147 | ehea_error("failed to register attributes, ret=%d", ret); | 3175 | pr_err("failed to register attributes, ret=%d\n", ret); |
3148 | goto out_unreg_of_dev; | 3176 | goto out_unreg_of_dev; |
3149 | } | 3177 | } |
3150 | 3178 | ||
@@ -3194,7 +3222,7 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3194 | dev = alloc_etherdev(sizeof(struct ehea_port)); | 3222 | dev = alloc_etherdev(sizeof(struct ehea_port)); |
3195 | 3223 | ||
3196 | if (!dev) { | 3224 | if (!dev) { |
3197 | ehea_error("no mem for net_device"); | 3225 | pr_err("no mem for net_device\n"); |
3198 | ret = -ENOMEM; | 3226 | ret = -ENOMEM; |
3199 | goto out_err; | 3227 | goto out_err; |
3200 | } | 3228 | } |
@@ -3235,17 +3263,25 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3235 | dev->netdev_ops = &ehea_netdev_ops; | 3263 | dev->netdev_ops = &ehea_netdev_ops; |
3236 | ehea_set_ethtool_ops(dev); | 3264 | ehea_set_ethtool_ops(dev); |
3237 | 3265 | ||
3266 | dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO | ||
3267 | | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | NETIF_F_LRO; | ||
3238 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO | 3268 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_TSO |
3239 | | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | 3269 | | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX |
3240 | | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER | 3270 | | NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER |
3241 | | NETIF_F_LLTX; | 3271 | | NETIF_F_LLTX | NETIF_F_RXCSUM; |
3242 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; | 3272 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; |
3243 | 3273 | ||
3274 | if (use_lro) | ||
3275 | dev->features |= NETIF_F_LRO; | ||
3276 | |||
3244 | INIT_WORK(&port->reset_task, ehea_reset_port); | 3277 | INIT_WORK(&port->reset_task, ehea_reset_port); |
3245 | 3278 | ||
3279 | init_waitqueue_head(&port->swqe_avail_wq); | ||
3280 | init_waitqueue_head(&port->restart_wq); | ||
3281 | |||
3246 | ret = register_netdev(dev); | 3282 | ret = register_netdev(dev); |
3247 | if (ret) { | 3283 | if (ret) { |
3248 | ehea_error("register_netdev failed. ret=%d", ret); | 3284 | pr_err("register_netdev failed. ret=%d\n", ret); |
3249 | goto out_unreg_port; | 3285 | goto out_unreg_port; |
3250 | } | 3286 | } |
3251 | 3287 | ||
@@ -3253,11 +3289,10 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3253 | 3289 | ||
3254 | ret = ehea_get_jumboframe_status(port, &jumbo); | 3290 | ret = ehea_get_jumboframe_status(port, &jumbo); |
3255 | if (ret) | 3291 | if (ret) |
3256 | ehea_error("failed determining jumbo frame status for %s", | 3292 | netdev_err(dev, "failed determining jumbo frame status\n"); |
3257 | port->netdev->name); | ||
3258 | 3293 | ||
3259 | ehea_info("%s: Jumbo frames are %sabled", dev->name, | 3294 | netdev_info(dev, "Jumbo frames are %sabled\n", |
3260 | jumbo == 1 ? "en" : "dis"); | 3295 | jumbo == 1 ? "en" : "dis"); |
3261 | 3296 | ||
3262 | adapter->active_ports++; | 3297 | adapter->active_ports++; |
3263 | 3298 | ||
@@ -3273,14 +3308,16 @@ out_free_ethdev: | |||
3273 | free_netdev(dev); | 3308 | free_netdev(dev); |
3274 | 3309 | ||
3275 | out_err: | 3310 | out_err: |
3276 | ehea_error("setting up logical port with id=%d failed, ret=%d", | 3311 | pr_err("setting up logical port with id=%d failed, ret=%d\n", |
3277 | logical_port_id, ret); | 3312 | logical_port_id, ret); |
3278 | return NULL; | 3313 | return NULL; |
3279 | } | 3314 | } |
3280 | 3315 | ||
3281 | static void ehea_shutdown_single_port(struct ehea_port *port) | 3316 | static void ehea_shutdown_single_port(struct ehea_port *port) |
3282 | { | 3317 | { |
3283 | struct ehea_adapter *adapter = port->adapter; | 3318 | struct ehea_adapter *adapter = port->adapter; |
3319 | |||
3320 | cancel_work_sync(&port->reset_task); | ||
3284 | unregister_netdev(port->netdev); | 3321 | unregister_netdev(port->netdev); |
3285 | ehea_unregister_port(port); | 3322 | ehea_unregister_port(port); |
3286 | kfree(port->mc_list); | 3323 | kfree(port->mc_list); |
@@ -3302,13 +3339,13 @@ static int ehea_setup_ports(struct ehea_adapter *adapter) | |||
3302 | dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no", | 3339 | dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no", |
3303 | NULL); | 3340 | NULL); |
3304 | if (!dn_log_port_id) { | 3341 | if (!dn_log_port_id) { |
3305 | ehea_error("bad device node: eth_dn name=%s", | 3342 | pr_err("bad device node: eth_dn name=%s\n", |
3306 | eth_dn->full_name); | 3343 | eth_dn->full_name); |
3307 | continue; | 3344 | continue; |
3308 | } | 3345 | } |
3309 | 3346 | ||
3310 | if (ehea_add_adapter_mr(adapter)) { | 3347 | if (ehea_add_adapter_mr(adapter)) { |
3311 | ehea_error("creating MR failed"); | 3348 | pr_err("creating MR failed\n"); |
3312 | of_node_put(eth_dn); | 3349 | of_node_put(eth_dn); |
3313 | return -EIO; | 3350 | return -EIO; |
3314 | } | 3351 | } |
@@ -3317,9 +3354,8 @@ static int ehea_setup_ports(struct ehea_adapter *adapter) | |||
3317 | *dn_log_port_id, | 3354 | *dn_log_port_id, |
3318 | eth_dn); | 3355 | eth_dn); |
3319 | if (adapter->port[i]) | 3356 | if (adapter->port[i]) |
3320 | ehea_info("%s -> logical port id #%d", | 3357 | netdev_info(adapter->port[i]->netdev, |
3321 | adapter->port[i]->netdev->name, | 3358 | "logical port id #%d\n", *dn_log_port_id); |
3322 | *dn_log_port_id); | ||
3323 | else | 3359 | else |
3324 | ehea_remove_adapter_mr(adapter); | 3360 | ehea_remove_adapter_mr(adapter); |
3325 | 3361 | ||
@@ -3364,21 +3400,20 @@ static ssize_t ehea_probe_port(struct device *dev, | |||
3364 | port = ehea_get_port(adapter, logical_port_id); | 3400 | port = ehea_get_port(adapter, logical_port_id); |
3365 | 3401 | ||
3366 | if (port) { | 3402 | if (port) { |
3367 | ehea_info("adding port with logical port id=%d failed. port " | 3403 | netdev_info(port->netdev, "adding port with logical port id=%d failed: port already configured\n", |
3368 | "already configured as %s.", logical_port_id, | 3404 | logical_port_id); |
3369 | port->netdev->name); | ||
3370 | return -EINVAL; | 3405 | return -EINVAL; |
3371 | } | 3406 | } |
3372 | 3407 | ||
3373 | eth_dn = ehea_get_eth_dn(adapter, logical_port_id); | 3408 | eth_dn = ehea_get_eth_dn(adapter, logical_port_id); |
3374 | 3409 | ||
3375 | if (!eth_dn) { | 3410 | if (!eth_dn) { |
3376 | ehea_info("no logical port with id %d found", logical_port_id); | 3411 | pr_info("no logical port with id %d found\n", logical_port_id); |
3377 | return -EINVAL; | 3412 | return -EINVAL; |
3378 | } | 3413 | } |
3379 | 3414 | ||
3380 | if (ehea_add_adapter_mr(adapter)) { | 3415 | if (ehea_add_adapter_mr(adapter)) { |
3381 | ehea_error("creating MR failed"); | 3416 | pr_err("creating MR failed\n"); |
3382 | return -EIO; | 3417 | return -EIO; |
3383 | } | 3418 | } |
3384 | 3419 | ||
@@ -3393,8 +3428,8 @@ static ssize_t ehea_probe_port(struct device *dev, | |||
3393 | break; | 3428 | break; |
3394 | } | 3429 | } |
3395 | 3430 | ||
3396 | ehea_info("added %s (logical port id=%d)", port->netdev->name, | 3431 | netdev_info(port->netdev, "added: (logical port id=%d)\n", |
3397 | logical_port_id); | 3432 | logical_port_id); |
3398 | } else { | 3433 | } else { |
3399 | ehea_remove_adapter_mr(adapter); | 3434 | ehea_remove_adapter_mr(adapter); |
3400 | return -EIO; | 3435 | return -EIO; |
@@ -3417,8 +3452,8 @@ static ssize_t ehea_remove_port(struct device *dev, | |||
3417 | port = ehea_get_port(adapter, logical_port_id); | 3452 | port = ehea_get_port(adapter, logical_port_id); |
3418 | 3453 | ||
3419 | if (port) { | 3454 | if (port) { |
3420 | ehea_info("removed %s (logical port id=%d)", port->netdev->name, | 3455 | netdev_info(port->netdev, "removed: (logical port id=%d)\n", |
3421 | logical_port_id); | 3456 | logical_port_id); |
3422 | 3457 | ||
3423 | ehea_shutdown_single_port(port); | 3458 | ehea_shutdown_single_port(port); |
3424 | 3459 | ||
@@ -3428,8 +3463,8 @@ static ssize_t ehea_remove_port(struct device *dev, | |||
3428 | break; | 3463 | break; |
3429 | } | 3464 | } |
3430 | } else { | 3465 | } else { |
3431 | ehea_error("removing port with logical port id=%d failed. port " | 3466 | pr_err("removing port with logical port id=%d failed. port not configured.\n", |
3432 | "not configured.", logical_port_id); | 3467 | logical_port_id); |
3433 | return -EINVAL; | 3468 | return -EINVAL; |
3434 | } | 3469 | } |
3435 | 3470 | ||
@@ -3466,7 +3501,7 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, | |||
3466 | int ret; | 3501 | int ret; |
3467 | 3502 | ||
3468 | if (!dev || !dev->dev.of_node) { | 3503 | if (!dev || !dev->dev.of_node) { |
3469 | ehea_error("Invalid ibmebus device probed"); | 3504 | pr_err("Invalid ibmebus device probed\n"); |
3470 | return -EINVAL; | 3505 | return -EINVAL; |
3471 | } | 3506 | } |
3472 | 3507 | ||
@@ -3570,8 +3605,6 @@ static int __devexit ehea_remove(struct platform_device *dev) | |||
3570 | 3605 | ||
3571 | ehea_remove_device_sysfs(dev); | 3606 | ehea_remove_device_sysfs(dev); |
3572 | 3607 | ||
3573 | flush_scheduled_work(); | ||
3574 | |||
3575 | ibmebus_free_irq(adapter->neq->attr.ist1, adapter); | 3608 | ibmebus_free_irq(adapter->neq->attr.ist1, adapter); |
3576 | tasklet_kill(&adapter->neq_tasklet); | 3609 | tasklet_kill(&adapter->neq_tasklet); |
3577 | 3610 | ||
@@ -3614,21 +3647,21 @@ static int ehea_mem_notifier(struct notifier_block *nb, | |||
3614 | 3647 | ||
3615 | switch (action) { | 3648 | switch (action) { |
3616 | case MEM_CANCEL_OFFLINE: | 3649 | case MEM_CANCEL_OFFLINE: |
3617 | ehea_info("memory offlining canceled"); | 3650 | pr_info("memory offlining canceled"); |
3618 | /* Readd canceled memory block */ | 3651 | /* Readd canceled memory block */ |
3619 | case MEM_ONLINE: | 3652 | case MEM_ONLINE: |
3620 | ehea_info("memory is going online"); | 3653 | pr_info("memory is going online"); |
3621 | set_bit(__EHEA_STOP_XFER, &ehea_driver_flags); | 3654 | set_bit(__EHEA_STOP_XFER, &ehea_driver_flags); |
3622 | if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages)) | 3655 | if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages)) |
3623 | goto out_unlock; | 3656 | goto out_unlock; |
3624 | ehea_rereg_mrs(NULL); | 3657 | ehea_rereg_mrs(); |
3625 | break; | 3658 | break; |
3626 | case MEM_GOING_OFFLINE: | 3659 | case MEM_GOING_OFFLINE: |
3627 | ehea_info("memory is going offline"); | 3660 | pr_info("memory is going offline"); |
3628 | set_bit(__EHEA_STOP_XFER, &ehea_driver_flags); | 3661 | set_bit(__EHEA_STOP_XFER, &ehea_driver_flags); |
3629 | if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages)) | 3662 | if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages)) |
3630 | goto out_unlock; | 3663 | goto out_unlock; |
3631 | ehea_rereg_mrs(NULL); | 3664 | ehea_rereg_mrs(); |
3632 | break; | 3665 | break; |
3633 | default: | 3666 | default: |
3634 | break; | 3667 | break; |
@@ -3650,7 +3683,7 @@ static int ehea_reboot_notifier(struct notifier_block *nb, | |||
3650 | unsigned long action, void *unused) | 3683 | unsigned long action, void *unused) |
3651 | { | 3684 | { |
3652 | if (action == SYS_RESTART) { | 3685 | if (action == SYS_RESTART) { |
3653 | ehea_info("Reboot: freeing all eHEA resources"); | 3686 | pr_info("Reboot: freeing all eHEA resources\n"); |
3654 | ibmebus_unregister_driver(&ehea_driver); | 3687 | ibmebus_unregister_driver(&ehea_driver); |
3655 | } | 3688 | } |
3656 | return NOTIFY_DONE; | 3689 | return NOTIFY_DONE; |
@@ -3666,22 +3699,22 @@ static int check_module_parm(void) | |||
3666 | 3699 | ||
3667 | if ((rq1_entries < EHEA_MIN_ENTRIES_QP) || | 3700 | if ((rq1_entries < EHEA_MIN_ENTRIES_QP) || |
3668 | (rq1_entries > EHEA_MAX_ENTRIES_RQ1)) { | 3701 | (rq1_entries > EHEA_MAX_ENTRIES_RQ1)) { |
3669 | ehea_info("Bad parameter: rq1_entries"); | 3702 | pr_info("Bad parameter: rq1_entries\n"); |
3670 | ret = -EINVAL; | 3703 | ret = -EINVAL; |
3671 | } | 3704 | } |
3672 | if ((rq2_entries < EHEA_MIN_ENTRIES_QP) || | 3705 | if ((rq2_entries < EHEA_MIN_ENTRIES_QP) || |
3673 | (rq2_entries > EHEA_MAX_ENTRIES_RQ2)) { | 3706 | (rq2_entries > EHEA_MAX_ENTRIES_RQ2)) { |
3674 | ehea_info("Bad parameter: rq2_entries"); | 3707 | pr_info("Bad parameter: rq2_entries\n"); |
3675 | ret = -EINVAL; | 3708 | ret = -EINVAL; |
3676 | } | 3709 | } |
3677 | if ((rq3_entries < EHEA_MIN_ENTRIES_QP) || | 3710 | if ((rq3_entries < EHEA_MIN_ENTRIES_QP) || |
3678 | (rq3_entries > EHEA_MAX_ENTRIES_RQ3)) { | 3711 | (rq3_entries > EHEA_MAX_ENTRIES_RQ3)) { |
3679 | ehea_info("Bad parameter: rq3_entries"); | 3712 | pr_info("Bad parameter: rq3_entries\n"); |
3680 | ret = -EINVAL; | 3713 | ret = -EINVAL; |
3681 | } | 3714 | } |
3682 | if ((sq_entries < EHEA_MIN_ENTRIES_QP) || | 3715 | if ((sq_entries < EHEA_MIN_ENTRIES_QP) || |
3683 | (sq_entries > EHEA_MAX_ENTRIES_SQ)) { | 3716 | (sq_entries > EHEA_MAX_ENTRIES_SQ)) { |
3684 | ehea_info("Bad parameter: sq_entries"); | 3717 | pr_info("Bad parameter: sq_entries\n"); |
3685 | ret = -EINVAL; | 3718 | ret = -EINVAL; |
3686 | } | 3719 | } |
3687 | 3720 | ||
@@ -3701,11 +3734,8 @@ int __init ehea_module_init(void) | |||
3701 | { | 3734 | { |
3702 | int ret; | 3735 | int ret; |
3703 | 3736 | ||
3704 | printk(KERN_INFO "IBM eHEA ethernet device driver (Release %s)\n", | 3737 | pr_info("IBM eHEA ethernet device driver (Release %s)\n", DRV_VERSION); |
3705 | DRV_VERSION); | ||
3706 | |||
3707 | 3738 | ||
3708 | INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs); | ||
3709 | memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles)); | 3739 | memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles)); |
3710 | memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); | 3740 | memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs)); |
3711 | 3741 | ||
@@ -3722,27 +3752,27 @@ int __init ehea_module_init(void) | |||
3722 | 3752 | ||
3723 | ret = register_reboot_notifier(&ehea_reboot_nb); | 3753 | ret = register_reboot_notifier(&ehea_reboot_nb); |
3724 | if (ret) | 3754 | if (ret) |
3725 | ehea_info("failed registering reboot notifier"); | 3755 | pr_info("failed registering reboot notifier\n"); |
3726 | 3756 | ||
3727 | ret = register_memory_notifier(&ehea_mem_nb); | 3757 | ret = register_memory_notifier(&ehea_mem_nb); |
3728 | if (ret) | 3758 | if (ret) |
3729 | ehea_info("failed registering memory remove notifier"); | 3759 | pr_info("failed registering memory remove notifier\n"); |
3730 | 3760 | ||
3731 | ret = crash_shutdown_register(&ehea_crash_handler); | 3761 | ret = crash_shutdown_register(ehea_crash_handler); |
3732 | if (ret) | 3762 | if (ret) |
3733 | ehea_info("failed registering crash handler"); | 3763 | pr_info("failed registering crash handler\n"); |
3734 | 3764 | ||
3735 | ret = ibmebus_register_driver(&ehea_driver); | 3765 | ret = ibmebus_register_driver(&ehea_driver); |
3736 | if (ret) { | 3766 | if (ret) { |
3737 | ehea_error("failed registering eHEA device driver on ebus"); | 3767 | pr_err("failed registering eHEA device driver on ebus\n"); |
3738 | goto out2; | 3768 | goto out2; |
3739 | } | 3769 | } |
3740 | 3770 | ||
3741 | ret = driver_create_file(&ehea_driver.driver, | 3771 | ret = driver_create_file(&ehea_driver.driver, |
3742 | &driver_attr_capabilities); | 3772 | &driver_attr_capabilities); |
3743 | if (ret) { | 3773 | if (ret) { |
3744 | ehea_error("failed to register capabilities attribute, ret=%d", | 3774 | pr_err("failed to register capabilities attribute, ret=%d\n", |
3745 | ret); | 3775 | ret); |
3746 | goto out3; | 3776 | goto out3; |
3747 | } | 3777 | } |
3748 | 3778 | ||
@@ -3753,7 +3783,7 @@ out3: | |||
3753 | out2: | 3783 | out2: |
3754 | unregister_memory_notifier(&ehea_mem_nb); | 3784 | unregister_memory_notifier(&ehea_mem_nb); |
3755 | unregister_reboot_notifier(&ehea_reboot_nb); | 3785 | unregister_reboot_notifier(&ehea_reboot_nb); |
3756 | crash_shutdown_unregister(&ehea_crash_handler); | 3786 | crash_shutdown_unregister(ehea_crash_handler); |
3757 | out: | 3787 | out: |
3758 | return ret; | 3788 | return ret; |
3759 | } | 3789 | } |
@@ -3762,13 +3792,12 @@ static void __exit ehea_module_exit(void) | |||
3762 | { | 3792 | { |
3763 | int ret; | 3793 | int ret; |
3764 | 3794 | ||
3765 | flush_scheduled_work(); | ||
3766 | driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities); | 3795 | driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities); |
3767 | ibmebus_unregister_driver(&ehea_driver); | 3796 | ibmebus_unregister_driver(&ehea_driver); |
3768 | unregister_reboot_notifier(&ehea_reboot_nb); | 3797 | unregister_reboot_notifier(&ehea_reboot_nb); |
3769 | ret = crash_shutdown_unregister(&ehea_crash_handler); | 3798 | ret = crash_shutdown_unregister(ehea_crash_handler); |
3770 | if (ret) | 3799 | if (ret) |
3771 | ehea_info("failed unregistering crash handler"); | 3800 | pr_info("failed unregistering crash handler\n"); |
3772 | unregister_memory_notifier(&ehea_mem_nb); | 3801 | unregister_memory_notifier(&ehea_mem_nb); |
3773 | kfree(ehea_fw_handles.arr); | 3802 | kfree(ehea_fw_handles.arr); |
3774 | kfree(ehea_bcmc_regs.arr); | 3803 | kfree(ehea_bcmc_regs.arr); |
diff --git a/drivers/net/ehea/ehea_phyp.c b/drivers/net/ehea/ehea_phyp.c index 8fe9dcaa7538..0506967b9044 100644 --- a/drivers/net/ehea/ehea_phyp.c +++ b/drivers/net/ehea/ehea_phyp.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include "ehea_phyp.h" | 31 | #include "ehea_phyp.h" |
30 | 32 | ||
31 | 33 | ||
@@ -67,12 +69,11 @@ static long ehea_plpar_hcall_norets(unsigned long opcode, | |||
67 | } | 69 | } |
68 | 70 | ||
69 | if (ret < H_SUCCESS) | 71 | if (ret < H_SUCCESS) |
70 | ehea_error("opcode=%lx ret=%lx" | 72 | pr_err("opcode=%lx ret=%lx" |
71 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" | 73 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" |
72 | " arg5=%lx arg6=%lx arg7=%lx ", | 74 | " arg5=%lx arg6=%lx arg7=%lx\n", |
73 | opcode, ret, | 75 | opcode, ret, |
74 | arg1, arg2, arg3, arg4, arg5, | 76 | arg1, arg2, arg3, arg4, arg5, arg6, arg7); |
75 | arg6, arg7); | ||
76 | 77 | ||
77 | return ret; | 78 | return ret; |
78 | } | 79 | } |
@@ -114,19 +115,18 @@ static long ehea_plpar_hcall9(unsigned long opcode, | |||
114 | && (((cb_cat == H_PORT_CB4) && ((arg3 == H_PORT_CB4_JUMBO) | 115 | && (((cb_cat == H_PORT_CB4) && ((arg3 == H_PORT_CB4_JUMBO) |
115 | || (arg3 == H_PORT_CB4_SPEED))) || ((cb_cat == H_PORT_CB7) | 116 | || (arg3 == H_PORT_CB4_SPEED))) || ((cb_cat == H_PORT_CB7) |
116 | && (arg3 == H_PORT_CB7_DUCQPN))))) | 117 | && (arg3 == H_PORT_CB7_DUCQPN))))) |
117 | ehea_error("opcode=%lx ret=%lx" | 118 | pr_err("opcode=%lx ret=%lx" |
118 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" | 119 | " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" |
119 | " arg5=%lx arg6=%lx arg7=%lx arg8=%lx" | 120 | " arg5=%lx arg6=%lx arg7=%lx arg8=%lx" |
120 | " arg9=%lx" | 121 | " arg9=%lx" |
121 | " out1=%lx out2=%lx out3=%lx out4=%lx" | 122 | " out1=%lx out2=%lx out3=%lx out4=%lx" |
122 | " out5=%lx out6=%lx out7=%lx out8=%lx" | 123 | " out5=%lx out6=%lx out7=%lx out8=%lx" |
123 | " out9=%lx", | 124 | " out9=%lx\n", |
124 | opcode, ret, | 125 | opcode, ret, |
125 | arg1, arg2, arg3, arg4, arg5, | 126 | arg1, arg2, arg3, arg4, arg5, |
126 | arg6, arg7, arg8, arg9, | 127 | arg6, arg7, arg8, arg9, |
127 | outs[0], outs[1], outs[2], outs[3], | 128 | outs[0], outs[1], outs[2], outs[3], outs[4], |
128 | outs[4], outs[5], outs[6], outs[7], | 129 | outs[5], outs[6], outs[7], outs[8]); |
129 | outs[8]); | ||
130 | return ret; | 130 | return ret; |
131 | } | 131 | } |
132 | 132 | ||
@@ -515,7 +515,7 @@ u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle, | |||
515 | const u64 log_pageaddr, const u64 count) | 515 | const u64 log_pageaddr, const u64 count) |
516 | { | 516 | { |
517 | if ((count > 1) && (log_pageaddr & ~PAGE_MASK)) { | 517 | if ((count > 1) && (log_pageaddr & ~PAGE_MASK)) { |
518 | ehea_error("not on pageboundary"); | 518 | pr_err("not on pageboundary\n"); |
519 | return H_PARAMETER; | 519 | return H_PARAMETER; |
520 | } | 520 | } |
521 | 521 | ||
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index 89128b6373e3..cd44bb8017d9 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/mm.h> | 31 | #include <linux/mm.h> |
30 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
31 | #include "ehea.h" | 33 | #include "ehea.h" |
@@ -45,7 +47,7 @@ static void *hw_qpageit_get_inc(struct hw_queue *queue) | |||
45 | queue->current_q_offset -= queue->pagesize; | 47 | queue->current_q_offset -= queue->pagesize; |
46 | retvalue = NULL; | 48 | retvalue = NULL; |
47 | } else if (((u64) retvalue) & (EHEA_PAGESIZE-1)) { | 49 | } else if (((u64) retvalue) & (EHEA_PAGESIZE-1)) { |
48 | ehea_error("not on pageboundary"); | 50 | pr_err("not on pageboundary\n"); |
49 | retvalue = NULL; | 51 | retvalue = NULL; |
50 | } | 52 | } |
51 | return retvalue; | 53 | return retvalue; |
@@ -58,15 +60,15 @@ static int hw_queue_ctor(struct hw_queue *queue, const u32 nr_of_pages, | |||
58 | int i, k; | 60 | int i, k; |
59 | 61 | ||
60 | if ((pagesize > PAGE_SIZE) || (!pages_per_kpage)) { | 62 | if ((pagesize > PAGE_SIZE) || (!pages_per_kpage)) { |
61 | ehea_error("pagesize conflict! kernel pagesize=%d, " | 63 | pr_err("pagesize conflict! kernel pagesize=%d, ehea pagesize=%d\n", |
62 | "ehea pagesize=%d", (int)PAGE_SIZE, (int)pagesize); | 64 | (int)PAGE_SIZE, (int)pagesize); |
63 | return -EINVAL; | 65 | return -EINVAL; |
64 | } | 66 | } |
65 | 67 | ||
66 | queue->queue_length = nr_of_pages * pagesize; | 68 | queue->queue_length = nr_of_pages * pagesize; |
67 | queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL); | 69 | queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL); |
68 | if (!queue->queue_pages) { | 70 | if (!queue->queue_pages) { |
69 | ehea_error("no mem for queue_pages"); | 71 | pr_err("no mem for queue_pages\n"); |
70 | return -ENOMEM; | 72 | return -ENOMEM; |
71 | } | 73 | } |
72 | 74 | ||
@@ -130,7 +132,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
130 | 132 | ||
131 | cq = kzalloc(sizeof(*cq), GFP_KERNEL); | 133 | cq = kzalloc(sizeof(*cq), GFP_KERNEL); |
132 | if (!cq) { | 134 | if (!cq) { |
133 | ehea_error("no mem for cq"); | 135 | pr_err("no mem for cq\n"); |
134 | goto out_nomem; | 136 | goto out_nomem; |
135 | } | 137 | } |
136 | 138 | ||
@@ -147,7 +149,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
147 | hret = ehea_h_alloc_resource_cq(adapter->handle, &cq->attr, | 149 | hret = ehea_h_alloc_resource_cq(adapter->handle, &cq->attr, |
148 | &cq->fw_handle, &cq->epas); | 150 | &cq->fw_handle, &cq->epas); |
149 | if (hret != H_SUCCESS) { | 151 | if (hret != H_SUCCESS) { |
150 | ehea_error("alloc_resource_cq failed"); | 152 | pr_err("alloc_resource_cq failed\n"); |
151 | goto out_freemem; | 153 | goto out_freemem; |
152 | } | 154 | } |
153 | 155 | ||
@@ -159,7 +161,7 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
159 | for (counter = 0; counter < cq->attr.nr_pages; counter++) { | 161 | for (counter = 0; counter < cq->attr.nr_pages; counter++) { |
160 | vpage = hw_qpageit_get_inc(&cq->hw_queue); | 162 | vpage = hw_qpageit_get_inc(&cq->hw_queue); |
161 | if (!vpage) { | 163 | if (!vpage) { |
162 | ehea_error("hw_qpageit_get_inc failed"); | 164 | pr_err("hw_qpageit_get_inc failed\n"); |
163 | goto out_kill_hwq; | 165 | goto out_kill_hwq; |
164 | } | 166 | } |
165 | 167 | ||
@@ -168,9 +170,8 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
168 | 0, EHEA_CQ_REGISTER_ORIG, | 170 | 0, EHEA_CQ_REGISTER_ORIG, |
169 | cq->fw_handle, rpage, 1); | 171 | cq->fw_handle, rpage, 1); |
170 | if (hret < H_SUCCESS) { | 172 | if (hret < H_SUCCESS) { |
171 | ehea_error("register_rpage_cq failed ehea_cq=%p " | 173 | pr_err("register_rpage_cq failed ehea_cq=%p hret=%llx counter=%i act_pages=%i\n", |
172 | "hret=%llx counter=%i act_pages=%i", | 174 | cq, hret, counter, cq->attr.nr_pages); |
173 | cq, hret, counter, cq->attr.nr_pages); | ||
174 | goto out_kill_hwq; | 175 | goto out_kill_hwq; |
175 | } | 176 | } |
176 | 177 | ||
@@ -178,14 +179,14 @@ struct ehea_cq *ehea_create_cq(struct ehea_adapter *adapter, | |||
178 | vpage = hw_qpageit_get_inc(&cq->hw_queue); | 179 | vpage = hw_qpageit_get_inc(&cq->hw_queue); |
179 | 180 | ||
180 | if ((hret != H_SUCCESS) || (vpage)) { | 181 | if ((hret != H_SUCCESS) || (vpage)) { |
181 | ehea_error("registration of pages not " | 182 | pr_err("registration of pages not complete hret=%llx\n", |
182 | "complete hret=%llx\n", hret); | 183 | hret); |
183 | goto out_kill_hwq; | 184 | goto out_kill_hwq; |
184 | } | 185 | } |
185 | } else { | 186 | } else { |
186 | if (hret != H_PAGE_REGISTERED) { | 187 | if (hret != H_PAGE_REGISTERED) { |
187 | ehea_error("CQ: registration of page failed " | 188 | pr_err("CQ: registration of page failed hret=%llx\n", |
188 | "hret=%llx\n", hret); | 189 | hret); |
189 | goto out_kill_hwq; | 190 | goto out_kill_hwq; |
190 | } | 191 | } |
191 | } | 192 | } |
@@ -241,7 +242,7 @@ int ehea_destroy_cq(struct ehea_cq *cq) | |||
241 | } | 242 | } |
242 | 243 | ||
243 | if (hret != H_SUCCESS) { | 244 | if (hret != H_SUCCESS) { |
244 | ehea_error("destroy CQ failed"); | 245 | pr_err("destroy CQ failed\n"); |
245 | return -EIO; | 246 | return -EIO; |
246 | } | 247 | } |
247 | 248 | ||
@@ -259,7 +260,7 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter, | |||
259 | 260 | ||
260 | eq = kzalloc(sizeof(*eq), GFP_KERNEL); | 261 | eq = kzalloc(sizeof(*eq), GFP_KERNEL); |
261 | if (!eq) { | 262 | if (!eq) { |
262 | ehea_error("no mem for eq"); | 263 | pr_err("no mem for eq\n"); |
263 | return NULL; | 264 | return NULL; |
264 | } | 265 | } |
265 | 266 | ||
@@ -272,21 +273,21 @@ struct ehea_eq *ehea_create_eq(struct ehea_adapter *adapter, | |||
272 | hret = ehea_h_alloc_resource_eq(adapter->handle, | 273 | hret = ehea_h_alloc_resource_eq(adapter->handle, |
273 | &eq->attr, &eq->fw_handle); | 274 | &eq->attr, &eq->fw_handle); |
274 | if (hret != H_SUCCESS) { | 275 | if (hret != H_SUCCESS) { |
275 | ehea_error("alloc_resource_eq failed"); | 276 | pr_err("alloc_resource_eq failed\n"); |
276 | goto out_freemem; | 277 | goto out_freemem; |
277 | } | 278 | } |
278 | 279 | ||
279 | ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages, | 280 | ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages, |
280 | EHEA_PAGESIZE, sizeof(struct ehea_eqe)); | 281 | EHEA_PAGESIZE, sizeof(struct ehea_eqe)); |
281 | if (ret) { | 282 | if (ret) { |
282 | ehea_error("can't allocate eq pages"); | 283 | pr_err("can't allocate eq pages\n"); |
283 | goto out_freeres; | 284 | goto out_freeres; |
284 | } | 285 | } |
285 | 286 | ||
286 | for (i = 0; i < eq->attr.nr_pages; i++) { | 287 | for (i = 0; i < eq->attr.nr_pages; i++) { |
287 | vpage = hw_qpageit_get_inc(&eq->hw_queue); | 288 | vpage = hw_qpageit_get_inc(&eq->hw_queue); |
288 | if (!vpage) { | 289 | if (!vpage) { |
289 | ehea_error("hw_qpageit_get_inc failed"); | 290 | pr_err("hw_qpageit_get_inc failed\n"); |
290 | hret = H_RESOURCE; | 291 | hret = H_RESOURCE; |
291 | goto out_kill_hwq; | 292 | goto out_kill_hwq; |
292 | } | 293 | } |
@@ -370,7 +371,7 @@ int ehea_destroy_eq(struct ehea_eq *eq) | |||
370 | } | 371 | } |
371 | 372 | ||
372 | if (hret != H_SUCCESS) { | 373 | if (hret != H_SUCCESS) { |
373 | ehea_error("destroy EQ failed"); | 374 | pr_err("destroy EQ failed\n"); |
374 | return -EIO; | 375 | return -EIO; |
375 | } | 376 | } |
376 | 377 | ||
@@ -395,7 +396,7 @@ int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue, | |||
395 | for (cnt = 0; cnt < nr_pages; cnt++) { | 396 | for (cnt = 0; cnt < nr_pages; cnt++) { |
396 | vpage = hw_qpageit_get_inc(hw_queue); | 397 | vpage = hw_qpageit_get_inc(hw_queue); |
397 | if (!vpage) { | 398 | if (!vpage) { |
398 | ehea_error("hw_qpageit_get_inc failed"); | 399 | pr_err("hw_qpageit_get_inc failed\n"); |
399 | goto out_kill_hwq; | 400 | goto out_kill_hwq; |
400 | } | 401 | } |
401 | rpage = virt_to_abs(vpage); | 402 | rpage = virt_to_abs(vpage); |
@@ -403,7 +404,7 @@ int ehea_qp_alloc_register(struct ehea_qp *qp, struct hw_queue *hw_queue, | |||
403 | 0, h_call_q_selector, | 404 | 0, h_call_q_selector, |
404 | qp->fw_handle, rpage, 1); | 405 | qp->fw_handle, rpage, 1); |
405 | if (hret < H_SUCCESS) { | 406 | if (hret < H_SUCCESS) { |
406 | ehea_error("register_rpage_qp failed"); | 407 | pr_err("register_rpage_qp failed\n"); |
407 | goto out_kill_hwq; | 408 | goto out_kill_hwq; |
408 | } | 409 | } |
409 | } | 410 | } |
@@ -432,7 +433,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, | |||
432 | 433 | ||
433 | qp = kzalloc(sizeof(*qp), GFP_KERNEL); | 434 | qp = kzalloc(sizeof(*qp), GFP_KERNEL); |
434 | if (!qp) { | 435 | if (!qp) { |
435 | ehea_error("no mem for qp"); | 436 | pr_err("no mem for qp\n"); |
436 | return NULL; | 437 | return NULL; |
437 | } | 438 | } |
438 | 439 | ||
@@ -441,7 +442,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, | |||
441 | hret = ehea_h_alloc_resource_qp(adapter->handle, init_attr, pd, | 442 | hret = ehea_h_alloc_resource_qp(adapter->handle, init_attr, pd, |
442 | &qp->fw_handle, &qp->epas); | 443 | &qp->fw_handle, &qp->epas); |
443 | if (hret != H_SUCCESS) { | 444 | if (hret != H_SUCCESS) { |
444 | ehea_error("ehea_h_alloc_resource_qp failed"); | 445 | pr_err("ehea_h_alloc_resource_qp failed\n"); |
445 | goto out_freemem; | 446 | goto out_freemem; |
446 | } | 447 | } |
447 | 448 | ||
@@ -455,7 +456,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, | |||
455 | init_attr->act_wqe_size_enc_sq, adapter, | 456 | init_attr->act_wqe_size_enc_sq, adapter, |
456 | 0); | 457 | 0); |
457 | if (ret) { | 458 | if (ret) { |
458 | ehea_error("can't register for sq ret=%x", ret); | 459 | pr_err("can't register for sq ret=%x\n", ret); |
459 | goto out_freeres; | 460 | goto out_freeres; |
460 | } | 461 | } |
461 | 462 | ||
@@ -465,7 +466,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, | |||
465 | init_attr->act_wqe_size_enc_rq1, | 466 | init_attr->act_wqe_size_enc_rq1, |
466 | adapter, 1); | 467 | adapter, 1); |
467 | if (ret) { | 468 | if (ret) { |
468 | ehea_error("can't register for rq1 ret=%x", ret); | 469 | pr_err("can't register for rq1 ret=%x\n", ret); |
469 | goto out_kill_hwsq; | 470 | goto out_kill_hwsq; |
470 | } | 471 | } |
471 | 472 | ||
@@ -476,7 +477,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, | |||
476 | init_attr->act_wqe_size_enc_rq2, | 477 | init_attr->act_wqe_size_enc_rq2, |
477 | adapter, 2); | 478 | adapter, 2); |
478 | if (ret) { | 479 | if (ret) { |
479 | ehea_error("can't register for rq2 ret=%x", ret); | 480 | pr_err("can't register for rq2 ret=%x\n", ret); |
480 | goto out_kill_hwr1q; | 481 | goto out_kill_hwr1q; |
481 | } | 482 | } |
482 | } | 483 | } |
@@ -488,7 +489,7 @@ struct ehea_qp *ehea_create_qp(struct ehea_adapter *adapter, | |||
488 | init_attr->act_wqe_size_enc_rq3, | 489 | init_attr->act_wqe_size_enc_rq3, |
489 | adapter, 3); | 490 | adapter, 3); |
490 | if (ret) { | 491 | if (ret) { |
491 | ehea_error("can't register for rq3 ret=%x", ret); | 492 | pr_err("can't register for rq3 ret=%x\n", ret); |
492 | goto out_kill_hwr2q; | 493 | goto out_kill_hwr2q; |
493 | } | 494 | } |
494 | } | 495 | } |
@@ -553,7 +554,7 @@ int ehea_destroy_qp(struct ehea_qp *qp) | |||
553 | } | 554 | } |
554 | 555 | ||
555 | if (hret != H_SUCCESS) { | 556 | if (hret != H_SUCCESS) { |
556 | ehea_error("destroy QP failed"); | 557 | pr_err("destroy QP failed\n"); |
557 | return -EIO; | 558 | return -EIO; |
558 | } | 559 | } |
559 | 560 | ||
@@ -842,7 +843,7 @@ static u64 ehea_reg_mr_section(int top, int dir, int idx, u64 *pt, | |||
842 | (hret != H_PAGE_REGISTERED)) { | 843 | (hret != H_PAGE_REGISTERED)) { |
843 | ehea_h_free_resource(adapter->handle, mr->handle, | 844 | ehea_h_free_resource(adapter->handle, mr->handle, |
844 | FORCE_FREE); | 845 | FORCE_FREE); |
845 | ehea_error("register_rpage_mr failed"); | 846 | pr_err("register_rpage_mr failed\n"); |
846 | return hret; | 847 | return hret; |
847 | } | 848 | } |
848 | } | 849 | } |
@@ -896,7 +897,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr) | |||
896 | 897 | ||
897 | pt = (void *)get_zeroed_page(GFP_KERNEL); | 898 | pt = (void *)get_zeroed_page(GFP_KERNEL); |
898 | if (!pt) { | 899 | if (!pt) { |
899 | ehea_error("no mem"); | 900 | pr_err("no mem\n"); |
900 | ret = -ENOMEM; | 901 | ret = -ENOMEM; |
901 | goto out; | 902 | goto out; |
902 | } | 903 | } |
@@ -906,14 +907,14 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr) | |||
906 | &mr->handle, &mr->lkey); | 907 | &mr->handle, &mr->lkey); |
907 | 908 | ||
908 | if (hret != H_SUCCESS) { | 909 | if (hret != H_SUCCESS) { |
909 | ehea_error("alloc_resource_mr failed"); | 910 | pr_err("alloc_resource_mr failed\n"); |
910 | ret = -EIO; | 911 | ret = -EIO; |
911 | goto out; | 912 | goto out; |
912 | } | 913 | } |
913 | 914 | ||
914 | if (!ehea_bmap) { | 915 | if (!ehea_bmap) { |
915 | ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE); | 916 | ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE); |
916 | ehea_error("no busmap available"); | 917 | pr_err("no busmap available\n"); |
917 | ret = -EIO; | 918 | ret = -EIO; |
918 | goto out; | 919 | goto out; |
919 | } | 920 | } |
@@ -929,7 +930,7 @@ int ehea_reg_kernel_mr(struct ehea_adapter *adapter, struct ehea_mr *mr) | |||
929 | 930 | ||
930 | if (hret != H_SUCCESS) { | 931 | if (hret != H_SUCCESS) { |
931 | ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE); | 932 | ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE); |
932 | ehea_error("registering mr failed"); | 933 | pr_err("registering mr failed\n"); |
933 | ret = -EIO; | 934 | ret = -EIO; |
934 | goto out; | 935 | goto out; |
935 | } | 936 | } |
@@ -952,7 +953,7 @@ int ehea_rem_mr(struct ehea_mr *mr) | |||
952 | hret = ehea_h_free_resource(mr->adapter->handle, mr->handle, | 953 | hret = ehea_h_free_resource(mr->adapter->handle, mr->handle, |
953 | FORCE_FREE); | 954 | FORCE_FREE); |
954 | if (hret != H_SUCCESS) { | 955 | if (hret != H_SUCCESS) { |
955 | ehea_error("destroy MR failed"); | 956 | pr_err("destroy MR failed\n"); |
956 | return -EIO; | 957 | return -EIO; |
957 | } | 958 | } |
958 | 959 | ||
@@ -987,14 +988,14 @@ void print_error_data(u64 *data) | |||
987 | length = EHEA_PAGESIZE; | 988 | length = EHEA_PAGESIZE; |
988 | 989 | ||
989 | if (type == EHEA_AER_RESTYPE_QP) | 990 | if (type == EHEA_AER_RESTYPE_QP) |
990 | ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, " | 991 | pr_err("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, port=%llX\n", |
991 | "port=%llX", resource, data[6], data[12], data[22]); | 992 | resource, data[6], data[12], data[22]); |
992 | else if (type == EHEA_AER_RESTYPE_CQ) | 993 | else if (type == EHEA_AER_RESTYPE_CQ) |
993 | ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource, | 994 | pr_err("CQ (resource=%llX) state: AER=0x%llX\n", |
994 | data[6]); | 995 | resource, data[6]); |
995 | else if (type == EHEA_AER_RESTYPE_EQ) | 996 | else if (type == EHEA_AER_RESTYPE_EQ) |
996 | ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource, | 997 | pr_err("EQ (resource=%llX) state: AER=0x%llX\n", |
997 | data[6]); | 998 | resource, data[6]); |
998 | 999 | ||
999 | ehea_dump(data, length, "error data"); | 1000 | ehea_dump(data, length, "error data"); |
1000 | } | 1001 | } |
@@ -1008,7 +1009,7 @@ u64 ehea_error_data(struct ehea_adapter *adapter, u64 res_handle, | |||
1008 | 1009 | ||
1009 | rblock = (void *)get_zeroed_page(GFP_KERNEL); | 1010 | rblock = (void *)get_zeroed_page(GFP_KERNEL); |
1010 | if (!rblock) { | 1011 | if (!rblock) { |
1011 | ehea_error("Cannot allocate rblock memory."); | 1012 | pr_err("Cannot allocate rblock memory\n"); |
1012 | goto out; | 1013 | goto out; |
1013 | } | 1014 | } |
1014 | 1015 | ||
@@ -1020,9 +1021,9 @@ u64 ehea_error_data(struct ehea_adapter *adapter, u64 res_handle, | |||
1020 | *aerr = rblock[12]; | 1021 | *aerr = rblock[12]; |
1021 | print_error_data(rblock); | 1022 | print_error_data(rblock); |
1022 | } else if (ret == H_R_STATE) { | 1023 | } else if (ret == H_R_STATE) { |
1023 | ehea_error("No error data available: %llX.", res_handle); | 1024 | pr_err("No error data available: %llX\n", res_handle); |
1024 | } else | 1025 | } else |
1025 | ehea_error("Error data could not be fetched: %llX", res_handle); | 1026 | pr_err("Error data could not be fetched: %llX\n", res_handle); |
1026 | 1027 | ||
1027 | free_page((unsigned long)rblock); | 1028 | free_page((unsigned long)rblock); |
1028 | out: | 1029 | out: |
diff --git a/drivers/net/ehea/ehea_qmr.h b/drivers/net/ehea/ehea_qmr.h index 38104734a3be..fddff8ec8cfd 100644 --- a/drivers/net/ehea/ehea_qmr.h +++ b/drivers/net/ehea/ehea_qmr.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #ifndef __EHEA_QMR_H__ | 29 | #ifndef __EHEA_QMR_H__ |
30 | #define __EHEA_QMR_H__ | 30 | #define __EHEA_QMR_H__ |
31 | 31 | ||
32 | #include <linux/prefetch.h> | ||
32 | #include "ehea.h" | 33 | #include "ehea.h" |
33 | #include "ehea_hw.h" | 34 | #include "ehea_hw.h" |
34 | 35 | ||