* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
int x;
unsigned char *deb = adr;
for (x = 0; x < len; x += 16) {
- pr_info("%s adr=%p ofs=%04x %016llx %016llx\n",
- msg, deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
+ printk(DRV_NAME " %s adr=%p ofs=%04x %016llx %016llx\n", msg,
+ deb, x, *((u64 *)&deb[0]), *((u64 *)&deb[8]));
deb += 16;
}
}
cb2 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb2) {
- netdev_err(dev, "no mem for cb2\n");
+ ehea_error("no mem for cb2");
goto out;
}
port->logical_port_id,
H_PORT_CB2, H_PORT_CB2_ALL, cb2);
if (hret != H_SUCCESS) {
- netdev_err(dev, "query_ehea_port failed\n");
+ ehea_error("query_ehea_port failed");
goto out_herr;
}
if (!skb) {
q_skba->os_skbs = fill_wqes - i;
if (q_skba->os_skbs == q_skba->len - 2) {
- netdev_info(pr->port->netdev,
- "rq%i ran dry - no mem for skb\n",
- rq_nr);
+ ehea_info("%s: rq%i ran dry - no mem for skb",
+ pr->port->netdev->name, rq_nr);
ret = -ENOMEM;
}
break;
if (cqe->status & EHEA_CQE_STAT_FAT_ERR_MASK) {
if (netif_msg_rx_err(pr->port)) {
- pr_err("Critical receive error for QP %d. Resetting port.\n",
- pr->qp->init_attr.qp_nr);
+ ehea_error("Critical receive error for QP %d. "
+ "Resetting port.", pr->qp->init_attr.qp_nr);
ehea_dump(cqe, sizeof(*cqe), "CQE");
}
ehea_schedule_port_reset(pr->port);
skb_arr_rq1_len,
wqe_index);
if (unlikely(!skb)) {
- netif_err(port, rx_err, dev,
- "LL rq1: skb=NULL\n");
+ if (netif_msg_rx_err(port))
+ ehea_error("LL rq1: skb=NULL");
skb = netdev_alloc_skb(dev,
EHEA_L_PKT_SIZE);
skb = get_skb_by_index(skb_arr_rq2,
skb_arr_rq2_len, cqe);
if (unlikely(!skb)) {
- netif_err(port, rx_err, dev,
- "rq2: skb=NULL\n");
+ if (netif_msg_rx_err(port))
+ ehea_error("rq2: skb=NULL");
break;
}
ehea_fill_skb(dev, skb, cqe);
skb = get_skb_by_index(skb_arr_rq3,
skb_arr_rq3_len, cqe);
if (unlikely(!skb)) {
- netif_err(port, rx_err, dev,
- "rq3: skb=NULL\n");
+ if (netif_msg_rx_err(port))
+ ehea_error("rq3: skb=NULL");
break;
}
ehea_fill_skb(dev, skb, cqe);
msecs_to_jiffies(100));
if (!ret) {
- pr_err("HW/SW queues out of sync\n");
+ ehea_error("HW/SW queues out of sync");
ehea_schedule_port_reset(pr->port);
return;
}
}
if (cqe->status & EHEA_CQE_STAT_ERR_MASK) {
- pr_err("Bad send completion status=0x%04X\n",
- cqe->status);
+ ehea_error("Bad send completion status=0x%04X",
+ cqe->status);
if (netif_msg_tx_err(pr->port))
ehea_dump(cqe, sizeof(*cqe), "Send CQE");
if (cqe->status & EHEA_CQE_STAT_RESET_MASK) {
- pr_err("Resetting port\n");
+ ehea_error("Resetting port");
ehea_schedule_port_reset(pr->port);
break;
}
while (eqe) {
qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry);
- pr_err("QP aff_err: entry=0x%llx, token=0x%x\n",
- eqe->entry, qp_token);
+ ehea_error("QP aff_err: entry=0x%llx, token=0x%x",
+ eqe->entry, qp_token);
qp = port->port_res[qp_token].qp;
}
if (reset_port) {
- pr_err("Resetting port\n");
+ ehea_error("Resetting port");
ehea_schedule_port_reset(port);
}
/* may be called via ehea_neq_tasklet() */
cb0 = (void *)get_zeroed_page(GFP_ATOMIC);
if (!cb0) {
- pr_err("no mem for cb0\n");
+ ehea_error("no mem for cb0");
ret = -ENOMEM;
goto out;
}
cb4 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb4) {
- pr_err("no mem for cb4\n");
+ ehea_error("no mem for cb4");
ret = -ENOMEM;
goto out;
}
break;
}
} else {
- pr_err("Failed sensing port speed\n");
+ ehea_error("Failed sensing port speed");
ret = -EIO;
}
} else {
if (hret == H_AUTHORITY) {
- pr_info("Hypervisor denied setting port speed\n");
+ ehea_info("Hypervisor denied setting port speed");
ret = -EPERM;
} else {
ret = -EIO;
- pr_err("Failed setting port speed\n");
+ ehea_error("Failed setting port speed");
}
}
if (!prop_carrier_state || (port->phy_link == EHEA_PHY_LINK_UP))
u8 ec;
u8 portnum;
struct ehea_port *port;
- struct net_device *dev;
ec = EHEA_BMASK_GET(NEQE_EVENT_CODE, eqe);
portnum = EHEA_BMASK_GET(NEQE_PORTNUM, eqe);
port = ehea_get_port(adapter, portnum);
- dev = port->netdev;
switch (ec) {
case EHEA_EC_PORTSTATE_CHG: /* port state change */
if (!port) {
- netdev_err(dev, "unknown portnum %x\n", portnum);
+ ehea_error("unknown portnum %x", portnum);
break;
}
if (EHEA_BMASK_GET(NEQE_PORT_UP, eqe)) {
- if (!netif_carrier_ok(dev)) {
+ if (!netif_carrier_ok(port->netdev)) {
ret = ehea_sense_port_attr(port);
if (ret) {
- netdev_err(dev, "failed resensing port attributes\n");
+ ehea_error("failed resensing port "
+ "attributes");
break;
}
- netif_info(port, link, dev,
- "Logical port up: %dMbps %s Duplex\n",
- port->port_speed,
- port->full_duplex == 1 ?
- "Full" : "Half");
+ if (netif_msg_link(port))
+ ehea_info("%s: Logical port up: %dMbps "
+ "%s Duplex",
+ port->netdev->name,
+ port->port_speed,
+ port->full_duplex ==
+ 1 ? "Full" : "Half");
- netif_carrier_on(dev);
- netif_wake_queue(dev);
+ netif_carrier_on(port->netdev);
+ netif_wake_queue(port->netdev);
}
} else
- if (netif_carrier_ok(dev)) {
- netif_info(port, link, dev,
- "Logical port down\n");
- netif_carrier_off(dev);
- netif_stop_queue(dev);
+ if (netif_carrier_ok(port->netdev)) {
+ if (netif_msg_link(port))
+ ehea_info("%s: Logical port down",
+ port->netdev->name);
+ netif_carrier_off(port->netdev);
+ netif_stop_queue(port->netdev);
}
if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PORT_UP, eqe)) {
port->phy_link = EHEA_PHY_LINK_UP;
- netif_info(port, link, dev,
- "Physical port up\n");
+ if (netif_msg_link(port))
+ ehea_info("%s: Physical port up",
+ port->netdev->name);
if (prop_carrier_state)
- netif_carrier_on(dev);
+ netif_carrier_on(port->netdev);
} else {
port->phy_link = EHEA_PHY_LINK_DOWN;
- netif_info(port, link, dev,
- "Physical port down\n");
+ if (netif_msg_link(port))
+ ehea_info("%s: Physical port down",
+ port->netdev->name);
if (prop_carrier_state)
- netif_carrier_off(dev);
+ netif_carrier_off(port->netdev);
}
if (EHEA_BMASK_GET(NEQE_EXTSWITCH_PRIMARY, eqe))
- netdev_info(dev,
- "External switch port is primary port\n");
+ ehea_info("External switch port is primary port");
else
- netdev_info(dev,
- "External switch port is backup port\n");
+ ehea_info("External switch port is backup port");
break;
case EHEA_EC_ADAPTER_MALFUNC:
- netdev_err(dev, "Adapter malfunction\n");
+ ehea_error("Adapter malfunction");
break;
case EHEA_EC_PORT_MALFUNC:
- netdev_info(dev, "Port malfunction\n");
- netif_carrier_off(dev);
- netif_stop_queue(dev);
+ ehea_info("Port malfunction: Device: %s", port->netdev->name);
+ netif_carrier_off(port->netdev);
+ netif_stop_queue(port->netdev);
break;
default:
- netdev_err(dev, "unknown event code %x, eqe=0x%llX\n", ec, eqe);
+ ehea_error("unknown event code %x, eqe=0x%llX", ec, eqe);
break;
}
}
u64 event_mask;
eqe = ehea_poll_eq(adapter->neq);
- pr_debug("eqe=%p\n", eqe);
+ ehea_debug("eqe=%p", eqe);
while (eqe) {
- pr_debug("*eqe=%lx\n", eqe->entry);
+ ehea_debug("*eqe=%lx", eqe->entry);
ehea_parse_eqe(adapter, eqe->entry);
eqe = ehea_poll_eq(adapter->neq);
- pr_debug("next eqe=%p\n", eqe);
+ ehea_debug("next eqe=%p", eqe);
}
event_mask = EHEA_BMASK_SET(NELR_PORTSTATE_CHG, 1)
ehea_qp_aff_irq_handler,
IRQF_DISABLED, port->int_aff_name, port);
if (ret) {
- netdev_err(dev, "failed registering irq for qp_aff_irq_handler:ist=%X\n",
- port->qp_eq->attr.ist1);
+ ehea_error("failed registering irq for qp_aff_irq_handler:"
+ "ist=%X", port->qp_eq->attr.ist1);
goto out_free_qpeq;
}
- netif_info(port, ifup, dev,
- "irq_handle 0x%X for function qp_aff_irq_handler registered\n",
- port->qp_eq->attr.ist1);
+ if (netif_msg_ifup(port))
+ ehea_info("irq_handle 0x%X for function qp_aff_irq_handler "
+ "registered", port->qp_eq->attr.ist1);
for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
IRQF_DISABLED, pr->int_send_name,
pr);
if (ret) {
- netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n",
- i, pr->eq->attr.ist1);
+ ehea_error("failed registering irq for ehea_queue "
+ "port_res_nr:%d, ist=%X", i,
+ pr->eq->attr.ist1);
goto out_free_req;
}
- netif_info(port, ifup, dev,
- "irq_handle 0x%X for function ehea_queue_int %d registered\n",
- pr->eq->attr.ist1, i);
+ if (netif_msg_ifup(port))
+ ehea_info("irq_handle 0x%X for function ehea_queue_int "
+ "%d registered", pr->eq->attr.ist1, i);
}
out:
return ret;
for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
pr = &port->port_res[i];
ibmebus_free_irq(pr->eq->attr.ist1, pr);
- netif_info(port, intr, dev,
- "free send irq for res %d with handle 0x%X\n",
- i, pr->eq->attr.ist1);
+ if (netif_msg_intr(port))
+ ehea_info("free send irq for res %d with handle 0x%X",
+ i, pr->eq->attr.ist1);
}
/* associated events */
ibmebus_free_irq(port->qp_eq->attr.ist1, port);
- netif_info(port, intr, dev,
- "associated event interrupt for handle 0x%X freed\n",
- port->qp_eq->attr.ist1);
+ if (netif_msg_intr(port))
+ ehea_info("associated event interrupt for handle 0x%X freed",
+ port->qp_eq->attr.ist1);
}
static int ehea_configure_port(struct ehea_port *port)
out_free:
ehea_rem_mr(&pr->send_mr);
out:
- pr_err("Generating SMRS failed\n");
+ ehea_error("Generating SMRS failed\n");
return -EIO;
}
pr->eq = ehea_create_eq(adapter, eq_type, EHEA_MAX_ENTRIES_EQ, 0);
if (!pr->eq) {
- pr_err("create_eq failed (eq)\n");
+ ehea_error("create_eq failed (eq)");
goto out_free;
}
pr->eq->fw_handle,
port->logical_port_id);
if (!pr->recv_cq) {
- pr_err("create_cq failed (cq_recv)\n");
+ ehea_error("create_cq failed (cq_recv)");
goto out_free;
}
pr->eq->fw_handle,
port->logical_port_id);
if (!pr->send_cq) {
- pr_err("create_cq failed (cq_send)\n");
+ ehea_error("create_cq failed (cq_send)");
goto out_free;
}
if (netif_msg_ifup(port))
- pr_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d\n",
- pr->send_cq->attr.act_nr_of_cqes,
- pr->recv_cq->attr.act_nr_of_cqes);
+ ehea_info("Send CQ: act_nr_cqes=%d, Recv CQ: act_nr_cqes=%d",
+ pr->send_cq->attr.act_nr_of_cqes,
+ pr->recv_cq->attr.act_nr_of_cqes);
init_attr = kzalloc(sizeof(*init_attr), GFP_KERNEL);
if (!init_attr) {
ret = -ENOMEM;
- pr_err("no mem for ehea_qp_init_attr\n");
+ ehea_error("no mem for ehea_qp_init_attr");
goto out_free;
}
pr->qp = ehea_create_qp(adapter, adapter->pd, init_attr);
if (!pr->qp) {
- pr_err("create_qp failed\n");
+ ehea_error("create_qp failed");
ret = -EIO;
goto out_free;
}
if (netif_msg_ifup(port))
- 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",
- init_attr->qp_nr,
- init_attr->act_nr_send_wqes,
- init_attr->act_nr_rwqes_rq1,
- init_attr->act_nr_rwqes_rq2,
- init_attr->act_nr_rwqes_rq3);
+ ehea_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", init_attr->qp_nr,
+ init_attr->act_nr_send_wqes,
+ init_attr->act_nr_rwqes_rq1,
+ init_attr->act_nr_rwqes_rq2,
+ init_attr->act_nr_rwqes_rq3);
pr->sq_skba_size = init_attr->act_nr_send_wqes + 1;
swqe->descriptors++;
}
} else
- pr_err("cannot handle fragmented headers\n");
+ ehea_error("cannot handle fragmented headers");
}
static void write_swqe2_nonTSO(struct sk_buff *skb,
port->logical_port_id,
reg_type, port->mac_addr, 0, hcallid);
if (hret != H_SUCCESS) {
- pr_err("%sregistering bc address failed (tagged)\n",
- hcallid == H_REG_BCMC ? "" : "de");
+ ehea_error("%sregistering bc address failed (tagged)",
+ hcallid == H_REG_BCMC ? "" : "de");
ret = -EIO;
goto out_herr;
}
port->logical_port_id,
reg_type, port->mac_addr, 0, hcallid);
if (hret != H_SUCCESS) {
- pr_err("%sregistering bc address failed (vlan)\n",
- hcallid == H_REG_BCMC ? "" : "de");
+ ehea_error("%sregistering bc address failed (vlan)",
+ hcallid == H_REG_BCMC ? "" : "de");
ret = -EIO;
}
out_herr:
cb0 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb0) {
- pr_err("no mem for cb0\n");
+ ehea_error("no mem for cb0");
ret = -ENOMEM;
goto out;
}
static void ehea_promiscuous_error(u64 hret, int enable)
{
if (hret == H_AUTHORITY)
- pr_info("Hypervisor denied %sabling promiscuous mode\n",
- enable == 1 ? "en" : "dis");
+ ehea_info("Hypervisor denied %sabling promiscuous mode",
+ enable == 1 ? "en" : "dis");
else
- pr_err("failed %sabling promiscuous mode\n",
- enable == 1 ? "en" : "dis");
+ ehea_error("failed %sabling promiscuous mode",
+ enable == 1 ? "en" : "dis");
}
static void ehea_promiscuous(struct net_device *dev, int enable)
cb7 = (void *)get_zeroed_page(GFP_ATOMIC);
if (!cb7) {
- pr_err("no mem for cb7\n");
+ ehea_error("no mem for cb7");
goto out;
}
hret = ehea_multicast_reg_helper(port, mc_entry->macaddr,
H_DEREG_BCMC);
if (hret) {
- pr_err("failed deregistering mcast MAC\n");
+ ehea_error("failed deregistering mcast MAC");
ret = -EIO;
}
if (!hret)
port->allmulti = 1;
else
- netdev_err(dev,
- "failed enabling IFF_ALLMULTI\n");
+ ehea_error("failed enabling IFF_ALLMULTI");
}
} else
if (!enable) {
if (!hret)
port->allmulti = 0;
else
- netdev_err(dev,
- "failed disabling IFF_ALLMULTI\n");
+ ehea_error("failed disabling IFF_ALLMULTI");
}
}
ehea_mcl_entry = kzalloc(sizeof(*ehea_mcl_entry), GFP_ATOMIC);
if (!ehea_mcl_entry) {
- pr_err("no mem for mcl_entry\n");
+ ehea_error("no mem for mcl_entry");
return;
}
if (!hret)
list_add(&ehea_mcl_entry->list, &port->mc_list->list);
else {
- pr_err("failed registering mcast MAC\n");
+ ehea_error("failed registering mcast MAC");
kfree(ehea_mcl_entry);
}
}
}
if (netdev_mc_count(dev) > port->adapter->max_mc_mac) {
- pr_info("Mcast registration limit reached (0x%llx). Use ALLMULTI!\n",
- port->adapter->max_mc_mac);
+ ehea_info("Mcast registration limit reached (0x%llx). "
+ "Use ALLMULTI!",
+ port->adapter->max_mc_mac);
goto out;
}
}
pr->swqe_id_counter += 1;
- netif_info(port, tx_queued, dev,
- "post swqe on QP %d\n", pr->qp->init_attr.qp_nr);
- if (netif_msg_tx_queued(port))
+ if (netif_msg_tx_queued(port)) {
+ ehea_info("post swqe on QP %d", pr->qp->init_attr.qp_nr);
ehea_dump(swqe, 512, "swqe");
+ }
if (unlikely(test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))) {
netif_stop_queue(dev);
cb1 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb1) {
- pr_err("no mem for cb1\n");
+ ehea_error("no mem for cb1");
goto out;
}
hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS)
- pr_err("modify_ehea_port failed\n");
+ ehea_error("modify_ehea_port failed");
free_page((unsigned long)cb1);
out:
cb1 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb1) {
- pr_err("no mem for cb1\n");
+ ehea_error("no mem for cb1");
goto out;
}
hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_port failed\n");
+ ehea_error("query_ehea_port failed");
goto out;
}
hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS)
- pr_err("modify_ehea_port failed\n");
+ ehea_error("modify_ehea_port failed");
out:
free_page((unsigned long)cb1);
return;
cb1 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb1) {
- pr_err("no mem for cb1\n");
+ ehea_error("no mem for cb1");
goto out;
}
hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_port failed\n");
+ ehea_error("query_ehea_port failed");
goto out;
}
hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id,
H_PORT_CB1, H_PORT_CB1_ALL, cb1);
if (hret != H_SUCCESS)
- pr_err("modify_ehea_port failed\n");
+ ehea_error("modify_ehea_port failed");
out:
free_page((unsigned long)cb1);
}
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_qp failed (1)\n");
+ ehea_error("query_ehea_qp failed (1)");
goto out;
}
EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
&dummy64, &dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- pr_err("modify_ehea_qp failed (1)\n");
+ ehea_error("modify_ehea_qp failed (1)");
goto out;
}
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_qp failed (2)\n");
+ ehea_error("query_ehea_qp failed (2)");
goto out;
}
EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
&dummy64, &dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- pr_err("modify_ehea_qp failed (2)\n");
+ ehea_error("modify_ehea_qp failed (2)");
goto out;
}
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_qp failed (3)\n");
+ ehea_error("query_ehea_qp failed (3)");
goto out;
}
EHEA_BMASK_SET(H_QPCB0_QP_CTL_REG, 1), cb0,
&dummy64, &dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- pr_err("modify_ehea_qp failed (3)\n");
+ ehea_error("modify_ehea_qp failed (3)");
goto out;
}
hret = ehea_h_query_ehea_qp(adapter->handle, 0, qp->fw_handle,
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF), cb0);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_qp failed (4)\n");
+ ehea_error("query_ehea_qp failed (4)");
goto out;
}
EHEA_MAX_ENTRIES_EQ, 1);
if (!port->qp_eq) {
ret = -EINVAL;
- pr_err("ehea_create_eq failed (qp_eq)\n");
+ ehea_error("ehea_create_eq failed (qp_eq)");
goto out_kill_eq;
}
ret = ehea_port_res_setup(port, port->num_def_qps,
port->num_add_tx_qps);
if (ret) {
- netdev_err(dev, "port_res_failed\n");
+ ehea_error("port_res_failed");
goto out;
}
/* Set default QP for this port */
ret = ehea_configure_port(port);
if (ret) {
- netdev_err(dev, "ehea_configure_port failed. ret:%d\n", ret);
+ ehea_error("ehea_configure_port failed. ret:%d", ret);
goto out_clean_pr;
}
ret = ehea_reg_interrupts(dev);
if (ret) {
- netdev_err(dev, "reg_interrupts failed. ret:%d\n", ret);
+ ehea_error("reg_interrupts failed. ret:%d", ret);
goto out_clean_pr;
}
for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++) {
ret = ehea_activate_qp(port->adapter, port->port_res[i].qp);
if (ret) {
- netdev_err(dev, "activate_qp failed\n");
+ ehea_error("activate_qp failed");
goto out_free_irqs;
}
}
for (i = 0; i < port->num_def_qps; i++) {
ret = ehea_fill_port_res(&port->port_res[i]);
if (ret) {
- netdev_err(dev, "out_free_irqs\n");
+ ehea_error("out_free_irqs");
goto out_free_irqs;
}
}
ehea_clean_all_portres(port);
out:
if (ret)
- netdev_info(dev, "Failed starting. ret=%i\n", ret);
+ ehea_info("Failed starting %s. ret=%i", dev->name, ret);
ehea_update_bcmc_registrations();
ehea_update_firmware_handles();
mutex_lock(&port->port_lock);
- netif_info(port, ifup, dev, "enabling port\n");
+ if (netif_msg_ifup(port))
+ ehea_info("enabling port %s", dev->name);
ret = ehea_up(dev);
if (!ret) {
ret = ehea_clean_all_portres(port);
if (ret)
- netdev_info(dev, "Failed freeing resources. ret=%i\n", ret);
+ ehea_info("Failed freeing resources for %s. ret=%i",
+ dev->name, ret);
ehea_update_firmware_handles();
int ret;
struct ehea_port *port = netdev_priv(dev);
- netif_info(port, ifdown, dev, "disabling port\n");
+ if (netif_msg_ifdown(port))
+ ehea_info("disabling port %s", dev->name);
set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags);
cancel_work_sync(&port->reset_task);
msecs_to_jiffies(100));
if (!ret) {
- pr_err("WARNING: sq not flushed completely\n");
+ ehea_error("WARNING: sq not flushed completely");
break;
}
}
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_qp failed (1)\n");
+ ehea_error("query_ehea_qp failed (1)");
goto out;
}
1), cb0, &dummy64,
&dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- pr_err("modify_ehea_qp failed (1)\n");
+ ehea_error("modify_ehea_qp failed (1)");
goto out;
}
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- pr_err("query_ehea_qp failed (2)\n");
+ ehea_error("query_ehea_qp failed (2)");
goto out;
}
/* deregister shared memory regions */
dret = ehea_rem_smrs(pr);
if (dret) {
- pr_err("unreg shared memory region failed\n");
+ ehea_error("unreg shared memory region failed");
goto out;
}
}
ret = ehea_gen_smrs(pr);
if (ret) {
- netdev_err(dev, "creation of shared memory regions failed\n");
+ ehea_error("creation of shared memory regions failed");
goto out;
}
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- netdev_err(dev, "query_ehea_qp failed (1)\n");
+ ehea_error("query_ehea_qp failed (1)");
goto out;
}
1), cb0, &dummy64,
&dummy64, &dummy16, &dummy16);
if (hret != H_SUCCESS) {
- netdev_err(dev, "modify_ehea_qp failed (1)\n");
+ ehea_error("modify_ehea_qp failed (1)");
goto out;
}
EHEA_BMASK_SET(H_QPCB0_ALL, 0xFFFF),
cb0);
if (hret != H_SUCCESS) {
- netdev_err(dev, "query_ehea_qp failed (2)\n");
+ ehea_error("query_ehea_qp failed (2)");
goto out;
}
ehea_set_multicast_list(dev);
- netif_info(port, timer, dev, "reset successful\n");
+ if (netif_msg_timer(port))
+ ehea_info("Device %s resetted successfully", dev->name);
port_napi_enable(port);
int ret, i;
struct ehea_adapter *adapter;
- pr_info("LPAR memory changed - re-initializing driver\n");
+ ehea_info("LPAR memory changed - re-initializing driver");
list_for_each_entry(adapter, &adapter_list, list)
if (adapter->active_ports) {
/* Unregister old memory region */
ret = ehea_rem_mr(&adapter->mr);
if (ret) {
- pr_err("unregister MR failed - driver inoperable!\n");
+ ehea_error("unregister MR failed - driver"
+ " inoperable!");
goto out;
}
}
/* Register new memory region */
ret = ehea_reg_kernel_mr(adapter, &adapter->mr);
if (ret) {
- pr_err("register MR failed - driver inoperable!\n");
+ ehea_error("register MR failed - driver"
+ " inoperable!");
goto out;
}
}
}
}
- pr_info("re-initializing driver complete\n");
+ ehea_info("re-initializing driver complete");
out:
return;
}
/* (Try to) enable *jumbo frames */
cb4 = (void *)get_zeroed_page(GFP_KERNEL);
if (!cb4) {
- pr_err("no mem for cb4\n");
+ ehea_error("no mem for cb4");
ret = -ENOMEM;
goto out;
} else {
ret = of_device_register(&port->ofdev);
if (ret) {
- pr_err("failed to register device. ret=%d\n", ret);
+ ehea_error("failed to register device. ret=%d", ret);
goto out;
}
ret = device_create_file(&port->ofdev.dev, &dev_attr_log_port_id);
if (ret) {
- pr_err("failed to register attributes, ret=%d\n", ret);
+ ehea_error("failed to register attributes, ret=%d", ret);
goto out_unreg_of_dev;
}
dev = alloc_etherdev(sizeof(struct ehea_port));
if (!dev) {
- pr_err("no mem for net_device\n");
+ ehea_error("no mem for net_device");
ret = -ENOMEM;
goto out_err;
}
ret = register_netdev(dev);
if (ret) {
- pr_err("register_netdev failed. ret=%d\n", ret);
+ ehea_error("register_netdev failed. ret=%d", ret);
goto out_unreg_port;
}
ret = ehea_get_jumboframe_status(port, &jumbo);
if (ret)
- netdev_err(dev, "failed determining jumbo frame status\n");
+ ehea_error("failed determining jumbo frame status for %s",
+ port->netdev->name);
- netdev_info(dev, "Jumbo frames are %sabled\n",
- jumbo == 1 ? "en" : "dis");
+ ehea_info("%s: Jumbo frames are %sabled", dev->name,
+ jumbo == 1 ? "en" : "dis");
adapter->active_ports++;
free_netdev(dev);
out_err:
- pr_err("setting up logical port with id=%d failed, ret=%d\n",
- logical_port_id, ret);
+ ehea_error("setting up logical port with id=%d failed, ret=%d",
+ logical_port_id, ret);
return NULL;
}
dn_log_port_id = of_get_property(eth_dn, "ibm,hea-port-no",
NULL);
if (!dn_log_port_id) {
- pr_err("bad device node: eth_dn name=%s\n",
- eth_dn->full_name);
+ ehea_error("bad device node: eth_dn name=%s",
+ eth_dn->full_name);
continue;
}
if (ehea_add_adapter_mr(adapter)) {
- pr_err("creating MR failed\n");
+ ehea_error("creating MR failed");
of_node_put(eth_dn);
return -EIO;
}
*dn_log_port_id,
eth_dn);
if (adapter->port[i])
- netdev_info(adapter->port[i]->netdev,
- "logical port id #%d\n", *dn_log_port_id);
+ ehea_info("%s -> logical port id #%d",
+ adapter->port[i]->netdev->name,
+ *dn_log_port_id);
else
ehea_remove_adapter_mr(adapter);
port = ehea_get_port(adapter, logical_port_id);
if (port) {
- netdev_info(port->netdev, "adding port with logical port id=%d failed: port already configured\n",
- logical_port_id);
+ ehea_info("adding port with logical port id=%d failed. port "
+ "already configured as %s.", logical_port_id,
+ port->netdev->name);
return -EINVAL;
}
eth_dn = ehea_get_eth_dn(adapter, logical_port_id);
if (!eth_dn) {
- pr_info("no logical port with id %d found\n", logical_port_id);
+ ehea_info("no logical port with id %d found", logical_port_id);
return -EINVAL;
}
if (ehea_add_adapter_mr(adapter)) {
- pr_err("creating MR failed\n");
+ ehea_error("creating MR failed");
return -EIO;
}
break;
}
- netdev_info(port->netdev, "added: (logical port id=%d)\n",
- logical_port_id);
+ ehea_info("added %s (logical port id=%d)", port->netdev->name,
+ logical_port_id);
} else {
ehea_remove_adapter_mr(adapter);
return -EIO;
port = ehea_get_port(adapter, logical_port_id);
if (port) {
- netdev_info(port->netdev, "removed: (logical port id=%d)\n",
- logical_port_id);
+ ehea_info("removed %s (logical port id=%d)", port->netdev->name,
+ logical_port_id);
ehea_shutdown_single_port(port);
break;
}
} else {
- pr_err("removing port with logical port id=%d failed. port not configured.\n",
- logical_port_id);
+ ehea_error("removing port with logical port id=%d failed. port "
+ "not configured.", logical_port_id);
return -EINVAL;
}
int ret;
if (!dev || !dev->dev.of_node) {
- pr_err("Invalid ibmebus device probed\n");
+ ehea_error("Invalid ibmebus device probed");
return -EINVAL;
}
switch (action) {
case MEM_CANCEL_OFFLINE:
- pr_info("memory offlining canceled\n");
+ ehea_info("memory offlining canceled");
/* Readd canceled memory block */
case MEM_ONLINE:
- pr_info("memory is going online\n");
+ ehea_info("memory is going online");
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages))
goto out_unlock;
ehea_rereg_mrs(NULL);
break;
case MEM_GOING_OFFLINE:
- pr_info("memory is going offline\n");
+ ehea_info("memory is going offline");
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages))
goto out_unlock;
unsigned long action, void *unused)
{
if (action == SYS_RESTART) {
- pr_info("Reboot: freeing all eHEA resources\n");
+ ehea_info("Reboot: freeing all eHEA resources");
ibmebus_unregister_driver(&ehea_driver);
}
return NOTIFY_DONE;
if ((rq1_entries < EHEA_MIN_ENTRIES_QP) ||
(rq1_entries > EHEA_MAX_ENTRIES_RQ1)) {
- pr_info("Bad parameter: rq1_entries\n");
+ ehea_info("Bad parameter: rq1_entries");
ret = -EINVAL;
}
if ((rq2_entries < EHEA_MIN_ENTRIES_QP) ||
(rq2_entries > EHEA_MAX_ENTRIES_RQ2)) {
- pr_info("Bad parameter: rq2_entries\n");
+ ehea_info("Bad parameter: rq2_entries");
ret = -EINVAL;
}
if ((rq3_entries < EHEA_MIN_ENTRIES_QP) ||
(rq3_entries > EHEA_MAX_ENTRIES_RQ3)) {
- pr_info("Bad parameter: rq3_entries\n");
+ ehea_info("Bad parameter: rq3_entries");
ret = -EINVAL;
}
if ((sq_entries < EHEA_MIN_ENTRIES_QP) ||
(sq_entries > EHEA_MAX_ENTRIES_SQ)) {
- pr_info("Bad parameter: sq_entries\n");
+ ehea_info("Bad parameter: sq_entries");
ret = -EINVAL;
}
{
int ret;
- pr_info("IBM eHEA ethernet device driver (Release %s)\n", DRV_VERSION);
+ printk(KERN_INFO "IBM eHEA ethernet device driver (Release %s)\n",
+ DRV_VERSION);
INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs);
ret = register_reboot_notifier(&ehea_reboot_nb);
if (ret)
- pr_info("failed registering reboot notifier\n");
+ ehea_info("failed registering reboot notifier");
ret = register_memory_notifier(&ehea_mem_nb);
if (ret)
- pr_info("failed registering memory remove notifier\n");
+ ehea_info("failed registering memory remove notifier");
ret = crash_shutdown_register(ehea_crash_handler);
if (ret)
- pr_info("failed registering crash handler\n");
+ ehea_info("failed registering crash handler");
ret = ibmebus_register_driver(&ehea_driver);
if (ret) {
- pr_err("failed registering eHEA device driver on ebus\n");
+ ehea_error("failed registering eHEA device driver on ebus");
goto out2;
}
ret = driver_create_file(&ehea_driver.driver,
&driver_attr_capabilities);
if (ret) {
- pr_err("failed to register capabilities attribute, ret=%d\n",
- ret);
+ ehea_error("failed to register capabilities attribute, ret=%d",
+ ret);
goto out3;
}
unregister_reboot_notifier(&ehea_reboot_nb);
ret = crash_shutdown_unregister(ehea_crash_handler);
if (ret)
- pr_info("failed unregistering crash handler\n");
+ ehea_info("failed unregistering crash handler");
unregister_memory_notifier(&ehea_mem_nb);
kfree(ehea_fw_handles.arr);
kfree(ehea_bcmc_regs.arr);
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
#include <linux/mm.h>
#include <linux/slab.h>
#include "ehea.h"
queue->current_q_offset -= queue->pagesize;
retvalue = NULL;
} else if (((u64) retvalue) & (EHEA_PAGESIZE-1)) {
- pr_err("not on pageboundary\n");
+ ehea_error("not on pageboundary");
retvalue = NULL;
}
return retvalue;
int i, k;
if ((pagesize > PAGE_SIZE) || (!pages_per_kpage)) {
- pr_err("pagesize conflict! kernel pagesize=%d, ehea pagesize=%d\n",
- (int)PAGE_SIZE, (int)pagesize);
+ ehea_error("pagesize conflict! kernel pagesize=%d, "
+ "ehea pagesize=%d", (int)PAGE_SIZE, (int)pagesize);
return -EINVAL;
}
queue->queue_length = nr_of_pages * pagesize;
queue->queue_pages = kmalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
if (!queue->queue_pages) {
- pr_err("no mem for queue_pages\n");
+ ehea_error("no mem for queue_pages");
return -ENOMEM;
}
cq = kzalloc(sizeof(*cq), GFP_KERNEL);
if (!cq) {
- pr_err("no mem for cq\n");
+ ehea_error("no mem for cq");
goto out_nomem;
}
hret = ehea_h_alloc_resource_cq(adapter->handle, &cq->attr,
&cq->fw_handle, &cq->epas);
if (hret != H_SUCCESS) {
- pr_err("alloc_resource_cq failed\n");
+ ehea_error("alloc_resource_cq failed");
goto out_freemem;
}
for (counter = 0; counter < cq->attr.nr_pages; counter++) {
vpage = hw_qpageit_get_inc(&cq->hw_queue);
if (!vpage) {
- pr_err("hw_qpageit_get_inc failed\n");
+ ehea_error("hw_qpageit_get_inc failed");
goto out_kill_hwq;
}
0, EHEA_CQ_REGISTER_ORIG,
cq->fw_handle, rpage, 1);
if (hret < H_SUCCESS) {
- pr_err("register_rpage_cq failed ehea_cq=%p hret=%llx counter=%i act_pages=%i\n",
- cq, hret, counter, cq->attr.nr_pages);
+ ehea_error("register_rpage_cq failed ehea_cq=%p "
+ "hret=%llx counter=%i act_pages=%i",
+ cq, hret, counter, cq->attr.nr_pages);
goto out_kill_hwq;
}
vpage = hw_qpageit_get_inc(&cq->hw_queue);
if ((hret != H_SUCCESS) || (vpage)) {
- pr_err("registration of pages not complete hret=%llx\n",
- hret);
+ ehea_error("registration of pages not "
+ "complete hret=%llx\n", hret);
goto out_kill_hwq;
}
} else {
if (hret != H_PAGE_REGISTERED) {
- pr_err("CQ: registration of page failed hret=%llx\n",
- hret);
+ ehea_error("CQ: registration of page failed "
+ "hret=%llx\n", hret);
goto out_kill_hwq;
}
}
}
if (hret != H_SUCCESS) {
- pr_err("destroy CQ failed\n");
+ ehea_error("destroy CQ failed");
return -EIO;
}
eq = kzalloc(sizeof(*eq), GFP_KERNEL);
if (!eq) {
- pr_err("no mem for eq\n");
+ ehea_error("no mem for eq");
return NULL;
}
hret = ehea_h_alloc_resource_eq(adapter->handle,
&eq->attr, &eq->fw_handle);
if (hret != H_SUCCESS) {
- pr_err("alloc_resource_eq failed\n");
+ ehea_error("alloc_resource_eq failed");
goto out_freemem;
}
ret = hw_queue_ctor(&eq->hw_queue, eq->attr.nr_pages,
EHEA_PAGESIZE, sizeof(struct ehea_eqe));
if (ret) {
- pr_err("can't allocate eq pages\n");
+ ehea_error("can't allocate eq pages");
goto out_freeres;
}
for (i = 0; i < eq->attr.nr_pages; i++) {
vpage = hw_qpageit_get_inc(&eq->hw_queue);
if (!vpage) {
- pr_err("hw_qpageit_get_inc failed\n");
+ ehea_error("hw_qpageit_get_inc failed");
hret = H_RESOURCE;
goto out_kill_hwq;
}
}
if (hret != H_SUCCESS) {
- pr_err("destroy EQ failed\n");
+ ehea_error("destroy EQ failed");
return -EIO;
}
for (cnt = 0; cnt < nr_pages; cnt++) {
vpage = hw_qpageit_get_inc(hw_queue);
if (!vpage) {
- pr_err("hw_qpageit_get_inc failed\n");
+ ehea_error("hw_qpageit_get_inc failed");
goto out_kill_hwq;
}
rpage = virt_to_abs(vpage);
0, h_call_q_selector,
qp->fw_handle, rpage, 1);
if (hret < H_SUCCESS) {
- pr_err("register_rpage_qp failed\n");
+ ehea_error("register_rpage_qp failed");
goto out_kill_hwq;
}
}
qp = kzalloc(sizeof(*qp), GFP_KERNEL);
if (!qp) {
- pr_err("no mem for qp\n");
+ ehea_error("no mem for qp");
return NULL;
}
hret = ehea_h_alloc_resource_qp(adapter->handle, init_attr, pd,
&qp->fw_handle, &qp->epas);
if (hret != H_SUCCESS) {
- pr_err("ehea_h_alloc_resource_qp failed\n");
+ ehea_error("ehea_h_alloc_resource_qp failed");
goto out_freemem;
}
init_attr->act_wqe_size_enc_sq, adapter,
0);
if (ret) {
- pr_err("can't register for sq ret=%x\n", ret);
+ ehea_error("can't register for sq ret=%x", ret);
goto out_freeres;
}
init_attr->act_wqe_size_enc_rq1,
adapter, 1);
if (ret) {
- pr_err("can't register for rq1 ret=%x\n", ret);
+ ehea_error("can't register for rq1 ret=%x", ret);
goto out_kill_hwsq;
}
init_attr->act_wqe_size_enc_rq2,
adapter, 2);
if (ret) {
- pr_err("can't register for rq2 ret=%x\n", ret);
+ ehea_error("can't register for rq2 ret=%x", ret);
goto out_kill_hwr1q;
}
}
init_attr->act_wqe_size_enc_rq3,
adapter, 3);
if (ret) {
- pr_err("can't register for rq3 ret=%x\n", ret);
+ ehea_error("can't register for rq3 ret=%x", ret);
goto out_kill_hwr2q;
}
}
}
if (hret != H_SUCCESS) {
- pr_err("destroy QP failed\n");
+ ehea_error("destroy QP failed");
return -EIO;
}
(hret != H_PAGE_REGISTERED)) {
ehea_h_free_resource(adapter->handle, mr->handle,
FORCE_FREE);
- pr_err("register_rpage_mr failed\n");
+ ehea_error("register_rpage_mr failed");
return hret;
}
}
pt = (void *)get_zeroed_page(GFP_KERNEL);
if (!pt) {
- pr_err("no mem\n");
+ ehea_error("no mem");
ret = -ENOMEM;
goto out;
}
&mr->handle, &mr->lkey);
if (hret != H_SUCCESS) {
- pr_err("alloc_resource_mr failed\n");
+ ehea_error("alloc_resource_mr failed");
ret = -EIO;
goto out;
}
if (!ehea_bmap) {
ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
- pr_err("no busmap available\n");
+ ehea_error("no busmap available");
ret = -EIO;
goto out;
}
if (hret != H_SUCCESS) {
ehea_h_free_resource(adapter->handle, mr->handle, FORCE_FREE);
- pr_err("registering mr failed\n");
+ ehea_error("registering mr failed");
ret = -EIO;
goto out;
}
hret = ehea_h_free_resource(mr->adapter->handle, mr->handle,
FORCE_FREE);
if (hret != H_SUCCESS) {
- pr_err("destroy MR failed\n");
+ ehea_error("destroy MR failed");
return -EIO;
}
length = EHEA_PAGESIZE;
if (type == EHEA_AER_RESTYPE_QP)
- pr_err("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, port=%llX\n",
- resource, data[6], data[12], data[22]);
+ ehea_error("QP (resource=%llX) state: AER=0x%llX, AERR=0x%llX, "
+ "port=%llX", resource, data[6], data[12], data[22]);
else if (type == EHEA_AER_RESTYPE_CQ)
- pr_err("CQ (resource=%llX) state: AER=0x%llX\n",
- resource, data[6]);
+ ehea_error("CQ (resource=%llX) state: AER=0x%llX", resource,
+ data[6]);
else if (type == EHEA_AER_RESTYPE_EQ)
- pr_err("EQ (resource=%llX) state: AER=0x%llX\n",
- resource, data[6]);
+ ehea_error("EQ (resource=%llX) state: AER=0x%llX", resource,
+ data[6]);
ehea_dump(data, length, "error data");
}
rblock = (void *)get_zeroed_page(GFP_KERNEL);
if (!rblock) {
- pr_err("Cannot allocate rblock memory\n");
+ ehea_error("Cannot allocate rblock memory.");
goto out;
}
*aerr = rblock[12];
print_error_data(rblock);
} else if (ret == H_R_STATE) {
- pr_err("No error data available: %llX\n", res_handle);
+ ehea_error("No error data available: %llX.", res_handle);
} else
- pr_err("Error data could not be fetched: %llX\n", res_handle);
+ ehea_error("Error data could not be fetched: %llX", res_handle);
free_page((unsigned long)rblock);
out: