if (conn) {
bool is_tcp = conn->c_trans->t_type == RDS_TRANS_TCP;
- printk(KERN_NOTICE "Resetting RDS/%s connection "
- "<%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- is_tcp ? "tcp" : "IB",
- NIPQUAD(reset.src.s_addr),
- NIPQUAD(reset.dst.s_addr), conn->c_tos);
+ printk(KERN_NOTICE "Resetting RDS/%s connection <%pI4,%pI4,%d>\n",
+ is_tcp ? "tcp" : "IB",
+ &reset.src.s_addr,
+ &reset.dst.s_addr, conn->c_tos);
rds_user_conn_paths_drop(conn, DR_USER_RESET);
}
done:
/*
- * Copyright (c) 2006 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
/* shut it down unless it's down already */
if (!rds_conn_path_transition(cp, RDS_CONN_DOWN, RDS_CONN_DOWN)) {
rds_rtd(RDS_RTD_CM_EXT,
- "RDS/%s: shutdown init <%u.%u.%u.%u,%u.%u.%u.%u,%d>, cn %p, cn->c_p %p\n",
+ "RDS/%s: shutdown init <%pI4,%pI4,%d>, cn %p, cn->c_p %p\n",
conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" : "IB",
- NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ &conn->c_laddr, &conn->c_faddr,
conn->c_tos, conn, conn->c_passive);
/*
* Quiesce the connection mgmt handlers before we start tearing
int i;
int npaths = (conn->c_trans->t_mp_capable ? RDS_MPATH_WORKERS : 1);
- rds_rtd(RDS_RTD_CM, "freeing conn %p <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- conn, NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ rds_rtd(RDS_RTD_CM, "freeing conn %p <%pI4,%pI4,%d>\n",
+ conn, &conn->c_laddr, &conn->c_faddr,
conn->c_tos);
conn->c_destroy_in_prog = 1;
cp->cp_reconnect_err = 0;
cp->cp_reconnect_racing = 0;
if (conn->c_trans->t_type != RDS_TRANS_TCP)
- printk(KERN_INFO "RDS/IB: connection "
- "<%u.%u.%u.%u,%u.%u.%u.%u,%d> "
- "dropped due to '%s'\n",
- NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr),
- conn->c_tos,
- conn_drop_reason_str(cp->cp_drop_source));
+ printk(KERN_INFO "RDS/IB: connection <%pI4,%pI4,%d> dropped due to '%s'\n",
+ &conn->c_laddr,
+ &conn->c_faddr,
+ conn->c_tos,
+ conn_drop_reason_str(cp->cp_drop_source));
} else if ((cp->cp_reconnect_warn) &&
(now - cp->cp_reconnect_start > 60)) {
- printk(KERN_INFO "RDS/%s: re-connect "
- "<%u.%u.%u.%u,%u.%u.%u.%u,%d> stalling "
- "for more than 1 min...(drops=%u err=%d)\n",
- conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" : "IB",
- NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr),
- conn->c_tos,
- cp->cp_reconnect_drops,
- cp->cp_reconnect_err);
+ printk(KERN_INFO "RDS/%s: re-connect <%pI4,%pI4,%d> stalling for more than 1 min...(drops=%u err=%d)\n",
+ conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" : "IB",
+ &conn->c_laddr,
+ &conn->c_faddr,
+ conn->c_tos,
+ cp->cp_reconnect_drops,
+ cp->cp_reconnect_err);
cp->cp_reconnect_warn = 0;
}
cp->cp_reconnect_drops++;
atomic_set(&cp->cp_state, RDS_CONN_ERROR);
rds_rtd(RDS_RTD_CM_EXT,
- "RDS/%s: queueing shutdown work, conn %p, <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
+ "RDS/%s: queueing shutdown work, conn %p, <%pI4,%pI4,%d>\n",
conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" : "IB",
- conn, NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ conn, &conn->c_laddr, &conn->c_faddr,
conn->c_tos);
queue_work(cp->cp_wq, &cp->cp_down_w);
if (rds_conn_path_state(cp) == RDS_CONN_DOWN &&
!test_and_set_bit(RDS_RECONNECT_PENDING, &cp->cp_flags)) {
rds_rtd(RDS_RTD_CM_EXT,
- "queueing connect work, conn %p, <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- conn, NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ "queueing connect work, conn %p, <%pI4,%pI4,%d>\n",
+ conn, &conn->c_laddr, &conn->c_faddr,
conn->c_tos);
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w, 0);
}
static int timeout_until_initial_failovers;
static struct workqueue_struct *rds_ip_wq;
+/* Return a string representation of an IB port state. */
+static const char *rds_ib_port_state2name(int state)
+{
+ switch (state) {
+ case RDS_IB_PORT_INIT:
+ return "INIT";
+ case RDS_IB_PORT_UP:
+ return "UP";
+ case RDS_IB_PORT_DOWN:
+ return "DOWN";
+ default:
+ return "UNKNOWN";
+ }
+}
+
/*
* rds_detected_linklayer_up
*
if (ret) {
printk(KERN_ERR
- "RDS/IP: failed to set IP %u.%u.%u.%u "
- "on %s failed (%d)\n",
- NIPQUAD(ip_config[to_port].ip_addr),
- ip_config[to_port].dev->name, ret);
+ "RDS/IP: failed to set IP %pI4 on %s failed (%d)\n",
+ &ip_config[to_port].ip_addr,
+ ip_config[to_port].dev->name, ret);
goto out;
}
} else if (ret) {
if (ret) {
printk(KERN_NOTICE
- "RDS/IP: failed to move IP %u.%u.%u.%u "
- "from %s to %s\n",
- NIPQUAD(addr), from_dev2, to_dev2);
+ "RDS/IP: failed to move IP %pI4 from %s to %s\n",
+ &addr, from_dev2, to_dev2);
} else {
if (strcmp(from_dev2, to_dev2) == 0) {
/* from_dev2, to_dev2 are identical */
printk(KERN_NOTICE
- "RDS/IP: IP %u.%u.%u.%u resurrected on migrated "
- "interface %s\n",
- NIPQUAD(addr), to_dev2);
+ "RDS/IP: IP %pI4 resurrected on migrated interface %s\n",
+ &addr, to_dev2);
} else {
/* from_dev2, to_dev2 are different! */
printk(KERN_NOTICE
- "RDS/IP: IP %u.%u.%u.%u migrated from %s to %s\n",
- NIPQUAD(addr), from_dev2, to_dev2);
+ "RDS/IP: IP %pI4 migrated from %s to %s\n",
+ &addr, from_dev2, to_dev2);
}
rds_ibdev = ip_config[from_port].rds_ibdev;
ip_config[port].ip_bcast,
ip_config[port].ip_mask);
if (ret) {
- printk(KERN_ERR "RDS/IB: failed to resurrect "
- "IP %u.%u.%u.%u on %s failed (%d)\n",
- NIPQUAD(ip_config[port].ip_addr),
+ printk(KERN_ERR "RDS/IB: failed to resurrect IP %pI4 on %s failed (%d)\n",
+ &ip_config[port].ip_addr,
ip_config[port].dev->name, ret);
goto out;
}
printk(KERN_NOTICE
- "RDS/IB: IP %u.%u.%u.%u resurrected on interface %s\n",
- NIPQUAD(ip_config[port].ip_addr),
+ "RDS/IB: IP %pI4 resurrected on interface %s\n",
+ &ip_config[port].ip_addr,
ip_config[port].dev->name);
for (ii = 0; ii < ip_config[port].alias_cnt; ii++) {
+ struct rds_ib_alias *alias;
+
+ alias = &ip_config[port].aliases[ii];
ret = rds_ib_set_ip(ip_config[port].dev,
- ip_config[port].dev->dev_addr,
- ip_config[port].aliases[ii].if_name,
- ip_config[port].aliases[ii].ip_addr,
- ip_config[port].aliases[ii].ip_bcast,
- ip_config[port].aliases[ii].ip_mask);
+ ip_config[port].dev->dev_addr,
+ alias->if_name,
+ alias->ip_addr,
+ alias->ip_bcast,
+ alias->ip_mask);
if (ret) {
- printk(KERN_ERR "RDS/IB: failed to resurrect "
- "IP %u.%u.%u.%u "
- "on alias %s failed (%d)\n",
- NIPQUAD(ip_config[port].
- aliases[ii].ip_addr),
- ip_config[port].aliases[ii].if_name,
+ printk(KERN_ERR "RDS/IB: failed to resurrect IP %pI4 on alias %s failed (%d)\n",
+ &alias->ip_addr,
+ alias->if_name,
ret);
goto out;
}
printk(KERN_NOTICE
- "RDS/IB: IP %u.%u.%u.%u resurrected"
- " on alias %s on interface %s\n",
- NIPQUAD(ip_config[port].ip_addr),
+ "RDS/IB: IP %pI4 resurrected on alias %s on interface %s\n",
+ &ip_config[port].ip_addr,
ip_config[port].aliases[ii].if_name,
ip_config[port].dev->name);
}
if (!to_port) {
/* we tried, but did not get a failover port! */
rds_rtd(RDS_RTD_ERR,
- "RDS/IB: IP %u.%u.%u.%u failed to migrate from %s: no matching dest port avail!\n",
- NIPQUAD(ip_config[from_port].ip_addr),
+ "RDS/IB: IP %pI4 failed to migrate from %s: no matching dest port avail!\n",
+ &ip_config[from_port].ip_addr,
ip_config[from_port].if_name);
return;
}
"port state transition to " :
"port state transition NONE - "
"port retained in state ")),
- (ip_config[port].port_state == RDS_IB_PORT_UP ? "UP" :
- (ip_config[port].port_state == RDS_IB_PORT_DOWN ?
- "DOWN" : "INIT")),
+ rds_ib_port_state2name(ip_config[port].port_state),
ip_config[port].port_layerflags);
if (this_port_transition == RDSIBP_TRANSITION_NOOP) {
* port by its IP address!
*/
if (ip_config[ii].ip_active_port == ii) {
- printk(KERN_NOTICE "RDS/IB: IP %u.%u.%u.%u "
- "deactivated on interface %s "
- "(no suitable failover target available)\n",
- NIPQUAD(ip_config[ii].ip_addr),
+ printk(KERN_NOTICE "RDS/IB: IP %pI4 deactivated on interface %s (no suitable failover target available)\n",
+ &ip_config[ii].ip_addr,
ip_config[ii].dev->name);
ret = rds_ib_set_ip(NULL, NULL,
}
for (i = 1; i <= ip_port_cnt; i++) {
- printk(KERN_INFO "RDS/IB: %s/port_%d/%s: "
- "IP %d.%d.%d.%d/%d.%d.%d.%d/%d.%d.%d.%d "
- "state %s\n",
- ((ip_config[i].rds_ibdev) ?
- ((ip_config[i].rds_ibdev->dev) ?
- ip_config[i].rds_ibdev->dev->name :
- "No IB device") :
- "No RDS device"),
- ip_config[i].port_num,
- ip_config[i].if_name,
- NIPQUAD(ip_config[i].ip_addr),
- NIPQUAD(ip_config[i].ip_bcast),
- NIPQUAD(ip_config[i].ip_mask),
- (ip_config[i].port_state ==
- RDS_IB_PORT_UP ? "UP" :
- (ip_config[i].port_state ==
- RDS_IB_PORT_DOWN ? "DOWN" : "INIT")));
+ char *dev_name;
+
+ if (ip_config[i].rds_ibdev)
+ if (ip_config[i].rds_ibdev->dev)
+ dev_name = ip_config[i].rds_ibdev->dev->name;
+ else
+ dev_name = "No IB device";
+ else
+ dev_name = "No RDS device";
+ printk(KERN_INFO "RDS/IB: %s/port_%d/%s: IP %pI4/%pI4/%pI4 state %s\n",
+ dev_name,
+ ip_config[i].port_num,
+ ip_config[i].if_name,
+ &ip_config[i].ip_addr,
+ &ip_config[i].ip_bcast,
+ &ip_config[i].ip_mask,
+ rds_ib_port_state2name(ip_config[i].port_state));
for (j = 0; j < ip_config[i].alias_cnt; j++) {
- printk(KERN_INFO "Alias %s "
- "IP %d.%d.%d.%d/%d.%d.%d.%d/%d.%d.%d.%d\n",
- ip_config[i].aliases[j].if_name,
- NIPQUAD(ip_config[i].
- aliases[j].ip_addr),
- NIPQUAD(ip_config[i].
- aliases[j].ip_bcast),
- NIPQUAD(ip_config[i].
- aliases[j].ip_mask));
+ printk(KERN_INFO "Alias %s IP %pI4/%pI4/%pI4\n",
+ ip_config[i].aliases[j].if_name,
+ &ip_config[i].aliases[j].ip_addr,
+ &ip_config[i].aliases[j].ip_bcast,
+ &ip_config[i].aliases[j].ip_mask);
}
}
}
(port_transition == RDSIBP_TRANSITION_DOWN ?
"port state transition to " :
"port state transition NONE - port retained in state ")),
- (ip_config[port].port_state == RDS_IB_PORT_UP ? "UP" :
- (ip_config[port].port_state == RDS_IB_PORT_DOWN ?
- "DOWN" : "INIT")),
+ rds_ib_port_state2name(ip_config[port].port_state),
ip_config[port].port_layerflags);
if (port_transition == RDSIBP_TRANSITION_NOOP) {
/*
- * Copyright (c) 2006 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
if (conn->c_version < RDS_PROTOCOL_VERSION) {
if (conn->c_version != RDS_PROTOCOL_COMPAT_VERSION) {
- printk(KERN_NOTICE "RDS/IB: Connection to"
- " %u.%u.%u.%u version %u.%u failed,"
- " no longer supported\n",
- NIPQUAD(conn->c_faddr),
- RDS_PROTOCOL_MAJOR(conn->c_version),
- RDS_PROTOCOL_MINOR(conn->c_version));
+ printk(KERN_NOTICE "RDS/IB: Connection to %pI4 version %u.%u failed, no longer supported\n",
+ &conn->c_faddr,
+ RDS_PROTOCOL_MAJOR(conn->c_version),
+ RDS_PROTOCOL_MINOR(conn->c_version));
rds_ib_conn_destroy_init(conn);
return;
}
while ((nr = ib_poll_cq(cq, RDS_WC_MAX, wcs)) > 0) {
for (i = 0; i < nr; i++) {
if ((++ic->i_rx_poll_cq % RDS_IB_RX_LIMIT) == 0) {
- rdsdebug("connection <%u.%u.%u.%u,%u.%u.%u.%u,%d>"
- " RX poll_cq processed %d\n",
- NIPQUAD(ic->conn->c_laddr),
- NIPQUAD(ic->conn->c_faddr),
+ rdsdebug("connection <%pI4,%pI4,%d> RX poll_cq processed %d\n",
+ &ic->conn->c_laddr,
+ &ic->conn->c_faddr,
ic->conn->c_tos,
ic->i_rx_poll_cq);
}
ret = rds_ib_match_acl(ic->i_cm_id, conn->c_faddr);
if (ret < 0) {
- pr_err("RDS: IB: active conn=%p, <%u.%u.%u.%u,%u.%u.%u.%u,%d> destroyed due ACL violation\n",
- conn, NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
- conn->c_tos);
+ pr_err("RDS: IB: active conn=%p, <%pI4,%pI4,%d> destroyed due ACL violation\n",
+ conn, &conn->c_laddr, &conn->c_faddr,
+ conn->c_tos);
rds_ib_conn_destroy_init(conn);
return 0;
}
}
rds_rtd(RDS_RTD_CM_EXT,
- "RDS/IB: conn init <%u.%u.%u.%u,%u.%u.%u.%u,%d> cm_id %p\n",
- NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ "RDS/IB: conn init <%pI4,%pI4,%d> cm_id %p\n",
+ &conn->c_laddr, &conn->c_faddr,
conn->c_tos, ic->i_cm_id);
src.sin_family = AF_INET;
/*
- * Copyright (c) 2006 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
send, &send->s_wr, ret, failed_wr);
BUG_ON(failed_wr != &send->s_wr);
if (ret) {
- printk(KERN_WARNING "RDS/IB: atomic ib_post_send to %u.%u.%u.%u "
- "returned %d\n", NIPQUAD(conn->c_faddr), ret);
+ printk(KERN_WARNING "RDS/IB: atomic ib_post_send to %pI4 returned %d\n",
+ &conn->c_faddr, ret);
rds_ib_ring_unalloc(&ic->i_send_ring, work_alloc);
rds_ib_sub_signaled(ic, nr_sig);
goto out;
if (conn) {
struct rds_ib_connection *ibic;
- printk(KERN_CRIT "rds dropping connection after rdma_resolve_route failure"
- "connection %u.%u.%u.%u->%u.%u.%u.%u\n", NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr));
+ printk(KERN_CRIT "rds dropping connection after rdma_resolve_route failure connection %pI4->%pI4\n",
+ &conn->c_laddr, &conn->c_faddr);
ibic = conn->c_transport_data;
if (ibic && ibic->i_cm_id == cm_id)
ibic->i_cm_id = NULL;
ret = trans->cm_initiate_connect(cm_id);
} else {
rds_rtd(RDS_RTD_CM,
- "ROUTE_RESOLVED: calling rds_conn_drop, conn %p <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- conn, NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr), conn->c_tos);
+ "ROUTE_RESOLVED: calling rds_conn_drop, conn %p <%pI4,%pI4,%d>\n",
+ conn, &conn->c_laddr,
+ &conn->c_faddr, conn->c_tos);
rds_conn_drop(conn, DR_IB_RDMA_CM_ID_MISMATCH);
}
}
if (conn) {
rds_rtd(RDS_RTD_ERR,
- "ROUTE_ERROR: conn %p, calling rds_conn_drop <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- conn, NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr), conn->c_tos);
+ "ROUTE_ERROR: conn %p, calling rds_conn_drop <%pI4,%pI4,%d>\n",
+ conn, &conn->c_laddr,
+ &conn->c_faddr, conn->c_tos);
rds_conn_drop(conn, DR_IB_ROUTE_ERR);
}
break;
case RDMA_CM_EVENT_ADDR_ERROR:
if (conn) {
rds_rtd(RDS_RTD_ERR,
- "ADDR_ERROR: conn %p, calling rds_conn_drop <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- conn, NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr), conn->c_tos);
+ "ADDR_ERROR: conn %p, calling rds_conn_drop <%pI4,%pI4,%d>\n",
+ conn, &conn->c_laddr,
+ &conn->c_faddr, conn->c_tos);
rds_conn_drop(conn, DR_IB_ADDR_ERR);
}
break;
case RDMA_CM_EVENT_DEVICE_REMOVAL:
if (conn) {
rds_rtd(RDS_RTD_ERR,
- "CONN/UNREACHABLE/RMVAL ERR: conn %p, calling rds_conn_drop <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- conn, NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr), conn->c_tos);
+ "CONN/UNREACHABLE/RMVAL ERR: conn %p, calling rds_conn_drop <%pI4,%pI4,%d>\n",
+ conn, &conn->c_laddr,
+ &conn->c_faddr, conn->c_tos);
rds_conn_drop(conn, DR_IB_CONNECT_ERR);
}
break;
if (event->status == RDS_REJ_CONSUMER_DEFINED &&
(*err) == 0) {
/* Rejection from RDSV3.1 */
- pr_warn("Rejected: CSR_DEF err 0, calling rds_conn_drop <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr), conn->c_tos);
+ pr_warn("Rejected: CSR_DEF err 0, calling rds_conn_drop <%pI4,%pI4,%d>\n",
+ &conn->c_laddr,
+ &conn->c_faddr, conn->c_tos);
if (!conn->c_tos)
conn->c_proposed_version =
RDS_PROTOCOL_COMPAT_VERSION;
} else if (event->status == RDS_REJ_CONSUMER_DEFINED &&
(*err) == RDS_ACL_FAILURE) {
/* Rejection due to ACL violation */
- pr_err("RDS: IB: conn=%p, <%u.%u.%u.%u,%u.%u.%u.%u,%d> destroyed due to ACL violation\n",
- conn, NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr),
- conn->c_tos);
+ pr_err("RDS: IB: conn=%p, <%pI4,%pI4,%d> destroyed due to ACL violation\n",
+ conn, &conn->c_laddr,
+ &conn->c_faddr,
+ conn->c_tos);
rds_ib_conn_destroy_init(conn);
} else {
rds_rtd(RDS_RTD_ERR,
- "Rejected: *err %d status %d calling rds_conn_drop <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
+ "Rejected: *err %d status %d calling rds_conn_drop <%pI4,%pI4,%d>\n",
*err, event->status,
- NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr),
+ &conn->c_laddr,
+ &conn->c_faddr,
conn->c_tos);
rds_conn_drop(conn, DR_IB_REJECTED_EVENT);
}
case RDMA_CM_EVENT_ADDR_CHANGE:
rds_rtd(RDS_RTD_CM_EXT,
- "ADDR_CHANGE event <%u.%u.%u.%u,%u.%u.%u.%u>\n",
- NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr));
+ "ADDR_CHANGE event <%pI4,%pI4>\n",
+ &conn->c_laddr,
+ &conn->c_faddr);
if (conn) {
rds_rtd(RDS_RTD_CM,
- "ADDR_CHANGE: calling rds_conn_drop <%u.%u.%u.%u,%u.%u.%u.%u,%d>\n",
- NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ "ADDR_CHANGE: calling rds_conn_drop <%pI4,%pI4,%d>\n",
+ &conn->c_laddr, &conn->c_faddr,
conn->c_tos);
if (!rds_conn_self_loopback_passive(conn)) {
queue_delayed_work(conn->c_path[0].cp_wq,
/*
- * Copyright (c) 2006 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
int ret;
struct rds_conn_path *cp;
- rdsdebug(KERN_ALERT "incoming: conn %p, inc %p, %u.%u.%u.%u : %d -> %u.%u.%u.%u : %d\n",
- conn, inc, NIPQUAD(saddr), inc->i_hdr.h_sport, NIPQUAD(daddr), inc->i_hdr.h_dport);
+ rdsdebug(KERN_ALERT "incoming: conn %p, inc %p, %pI4:%d -> %pI4:%d\n",
+ conn, inc, &saddr, inc->i_hdr.h_sport, &daddr,
+ inc->i_hdr.h_dport);
/* initialize some globals */
rs = NULL;
if (NULL == skb) {
/* if we have allocation problems, then we just need to depart */
rds_rtd(RDS_RTD_ERR,
- "failure to allocate space for inc %p, %u.%u.%u.%u -> %u.%d.%u.%u tos %d\n",
- inc, NIPQUAD(saddr), NIPQUAD(daddr), conn->c_tos);
+ "failure to allocate space for inc %p, %pI4 -> %pI4 tos %d\n",
+ inc, &saddr, &daddr, conn->c_tos);
rds_recv_local(cp, saddr, daddr, inc, gfp, rs);
/* drop the reference if we had taken one */
if (NULL != rs)
/* if we had a failure to convert, then just assuming to continue as local */
else {
rds_rtd(RDS_RTD_RCV_EXT,
- "failed to create skb form, conn %p, inc %p, %u.%u.%u.%u -> %u.%u.%u.%u tos %d\n",
- conn, inc, NIPQUAD(saddr), NIPQUAD(daddr), conn->c_tos);
+ "failed to create skb form, conn %p, inc %p, %pI4 -> %pI4 tos %d\n",
+ conn, inc, &saddr, &daddr, conn->c_tos);
ret = 1;
}
/* we don't really expect an error state from this call that isn't the done above */
else {
/* we don't really know how to handle this yet - just ignore for now */
- printk(KERN_ERR "unacceptible state for skb ret %d, conn %p, inc %p, "
- "%u.%u.%u.%u -> %u.%u.%u.%u\n",
- ret, conn, inc, NIPQUAD(saddr), NIPQUAD(daddr));
+ printk(KERN_ERR "unacceptible state for skb ret %d, conn %p, inc %p, %pI4 -> %pI4\n",
+ ret, conn, inc, &saddr, &daddr);
}
}
EXPORT_SYMBOL_GPL(rds_recv_incoming);
struct rds_incoming *inc, gfp_t gfp)
{
/* drop the existing incoming message */
- rdsdebug("dropping request on conn %p, inc %p, %u.%u.%u.%u -> %u.%u.%u.%u",
- conn, inc, NIPQUAD(saddr), NIPQUAD(daddr));
+ rdsdebug("dropping request on conn %p, inc %p, %pI4 -> %pI4",
+ conn, inc, &saddr, &daddr);
}
static void
/* cannot find a matching connection so drop the request */
if (NULL == nconn) {
- printk(KERN_ALERT "cannot find matching conn for inc %p, %u.%u.%u.%u -> %u.%u.%u.%u\n",
- inc, NIPQUAD(dst->saddr), NIPQUAD(dst->daddr));
+ printk(KERN_ALERT "cannot find matching conn for inc %p, %pI4 -> %pI4\n",
+ inc, &dst->saddr, &dst->daddr);
- rdsdebug("cannot find matching conn for inc %p, %u.%u.%u.%u -> %u.%u.%u.%u",
- inc, NIPQUAD(dst->saddr), NIPQUAD(dst->daddr));
+ rdsdebug("cannot find matching conn for inc %p, %pI4 -> %pI4",
+ inc, &dst->saddr, &dst->daddr);
rds_recv_drop(conn, dst->saddr, dst->daddr, inc, gfp);
}
/* this is a request for our local node, but potentially a different source
rs = rds_find_bound(dst->saddr, dst->sport);
if (!rs) {
rds_rtd(RDS_RTD_RCV,
- "failed to find output rds_socket dst %u.%u.%u.%u : %u, inc %p, conn %p tos %d\n",
- NIPQUAD(dst->daddr), dst->dport, inc, conn,
+ "failed to find output rds_socket dst %pI4 : %u, inc %p, conn %p tos %d\n",
+ &dst->daddr, dst->dport, inc, conn,
conn->c_tos);
rds_stats_inc(s_recv_drop_no_sock);
goto out;
ret = rds_send_internal(conn, rs, inc->i_skb, gfp);
if (len != ret) {
rds_rtd(RDS_RTD_RCV,
- "failed to send rds_data dst %u.%u.%u.%u : %u, inc %p, conn %p tos %d, len %d != ret %d\n",
- NIPQUAD(dst->daddr), dst->dport, inc, conn, conn->c_tos,
+ "failed to send rds_data dst %pI4 : %u, inc %p, conn %p tos %d, len %d != ret %d\n",
+ &dst->daddr, dst->dport, inc, conn, conn->c_tos,
len, ret);
goto out;
}
if (inc_hdr_h_sequence != cp->cp_next_rx_seq) {
rds_rtd(RDS_RTD_RCV,
- "conn %p <%u.%u.%u.%u,%u.%u.%u.%u,%d> expect seq# %llu, recved seq# %llu, retrans bit %d\n",
- conn, NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ "conn %p <%pI4,%pI4,%d> expect seq# %llu, recved seq# %llu, retrans bit %d\n",
+ conn, &conn->c_laddr, &conn->c_faddr,
conn->c_tos, cp->cp_next_rx_seq, inc_hdr_h_sequence,
inc->i_hdr.h_flags & RDS_FLAG_RETRANSMITTED);
}
/*
- * Copyright (c) 2006 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
queue_delayed_work(conn->c_path[0].cp_wq,
&conn->c_path[0].cp_send_w, 1);
- rdsdebug("message sent for rs %p, conn %p, len %d, %u.%u.%u.%u : %u -> %u.%u.%u.%u : %u\n",
- rs, conn, skb->len, NIPQUAD(dst->saddr), dst->sport, NIPQUAD(dst->daddr), dst->dport);
+ rdsdebug("message sent for rs %p, conn %p, len %d, %pI4:%u->%pI4:%u\n",
+ rs, conn, skb->len, &dst->saddr, dst->sport, &dst->daddr,
+ dst->dport);
ret = skb->len;
out:
unsigned int rds_tcp_stats_info_copy(struct rds_info_iterator *iter,
unsigned int avail);
-#ifndef NIPQUAD
-#define NIPQUAD(addr) \
- ((unsigned char *)&(addr))[0], \
- ((unsigned char *)&(addr))[1], \
- ((unsigned char *)&(addr))[2], \
- ((unsigned char *)&(addr))[3]
-#endif
-
-#ifndef NIPQUAD_FMT
-#define NIPQUAD_FMT "%u.%u.%u.%u"
-#endif
-
#endif
/*
- * Copyright (c) 2006 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
cp->cp_hb_start = now;
} else if (now - cp->cp_hb_start > rds_conn_hb_timeout) {
rds_rtd(RDS_RTD_CM,
- "RDS/IB: connection <%u.%u.%u.%u,%u.%u.%u.%u,%d> timed out (0x%lx,0x%lx)..discon and recon\n",
- NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr),
+ "RDS/IB: connection <%pI4,%pI4,%d> timed out (0x%lx,0x%lx)..discon and recon\n",
+ &conn->c_laddr, &conn->c_faddr,
conn->c_tos, cp->cp_hb_start, now);
rds_conn_path_drop(cp, DR_HB_TIMEOUT);
return;
rds_sysctl_shutdown_trace_start_time) &&
(now - cp->cp_reconnect_start <
rds_sysctl_shutdown_trace_end_time))
- pr_info("RDS/%s: connection <%u.%u.%u.%u,%u.%u.%u.%u,%d> "
- "shutdown init due to '%s'\n",
- (is_tcp ? "TCP" : "IB"),
- NIPQUAD(conn->c_laddr),
- NIPQUAD(conn->c_faddr),
- conn->c_tos,
- conn_drop_reason_str(cp->cp_drop_source));
+ pr_info("RDS/%s: connection <%pI4,%pI4,%d> shutdown init due to '%s'\n",
+ (is_tcp ? "TCP" : "IB"),
+ &conn->c_laddr,
+ &conn->c_faddr,
+ conn->c_tos,
+ conn_drop_reason_str(cp->cp_drop_source));
rds_conn_shutdown(cp);
}