/*
- * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018 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 <%pI6c,%pI6c,%d>, cn %p, cn->c_p %p\n",
- conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" : "IB",
- &conn->c_laddr, &conn->c_faddr,
- conn->c_tos, conn, conn->c_passive);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "RDS/%s: shutdown init <%pI6c,%pI6c,%d>, cn %p, cn->c_p %p\n",
+ conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" :
+ "IB",
+ &conn->c_laddr, &conn->c_faddr,
+ conn->c_tos, conn, conn->c_passive);
/*
* Quiesce the connection mgmt handlers before we start tearing
* things down. We don't hold the mutex for the entire
int i;
int npaths = (conn->c_trans->t_mp_capable ? RDS_MPATH_WORKERS : 1);
- rds_rtd(RDS_RTD_CM, "freeing conn %p <%pI6c,%pI6c,%d>\n",
- conn, &conn->c_laddr, &conn->c_faddr,
- conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM, "freeing conn %p <%pI6c,%pI6c,%d>\n",
+ conn, &conn->c_laddr, &conn->c_faddr,
+ conn->c_tos);
conn->c_destroy_in_prog = 1;
/* Ensure conn will not be scheduled for reconnect */
atomic_set(&cp->cp_state, RDS_CONN_ERROR);
- rds_rtd(RDS_RTD_CM_EXT,
- "RDS/%s: queueing shutdown work, conn %p, <%pI6c,%pI6c,%d>\n",
- conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" : "IB",
- conn, &conn->c_laddr, &conn->c_faddr,
- conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "RDS/%s: queueing shutdown work, conn %p, <%pI6c,%pI6c,%d>\n",
+ conn->c_trans->t_type == RDS_TRANS_TCP ? "TCP" : "IB",
+ 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, <%pI6c,%pI6c,%d>\n",
- conn, &conn->c_laddr, &conn->c_faddr,
- conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "queueing connect work, conn %p, <%pI6c,%pI6c,%d>\n",
+ conn, &conn->c_laddr, &conn->c_faddr,
+ conn->c_tos);
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w, 0);
}
}
/*
- * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018 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 (!to_port) {
/* we tried, but did not get a failover port! */
- rds_rtd(RDS_RTD_ERR,
- "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);
+ rds_rtd_ptr(RDS_RTD_ERR,
+ "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;
}
} else {
complete(&ic->i_last_wqe_complete);
break;
default:
- rds_rtd(RDS_RTD_ERR,
- "Fatal QP Event %u (%s) - connection %pI6c->%pI6c tos %d, reconnecting\n",
- event->event, rds_ib_event_str(event->event),
- &conn->c_laddr, &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_ERR,
+ "Fatal QP Event %u (%s) - connection %pI6c->%pI6c tos %d, reconnecting\n",
+ event->event, rds_ib_event_str(event->event),
+ &conn->c_laddr, &conn->c_faddr, conn->c_tos);
rds_conn_drop(conn, DR_IB_QP_EVENT);
break;
}
daddr6 = &d_mapped_addr;
}
- rds_rtd(RDS_RTD_CM,
- "saddr %pI6c daddr %pI6c RDSv%u.%u lguid 0x%llx fguid 0x%llx tos %d\n",
- saddr6, daddr6,
- RDS_PROTOCOL_MAJOR(version),
- RDS_PROTOCOL_MINOR(version),
- (unsigned long long)be64_to_cpu(lguid),
- (unsigned long long)be64_to_cpu(fguid),
- dp_cmn->ricpc_tos);
+ rds_rtd_ptr(RDS_RTD_CM,
+ "saddr %pI6c daddr %pI6c RDSv%u.%u lguid 0x%llx fguid 0x%llx tos %d\n",
+ saddr6, daddr6,
+ RDS_PROTOCOL_MAJOR(version),
+ RDS_PROTOCOL_MINOR(version),
+ (unsigned long long)be64_to_cpu(lguid),
+ (unsigned long long)be64_to_cpu(fguid),
+ dp_cmn->ricpc_tos);
acl_ret = rds_ib_match_acl(cm_id, saddr6);
if (acl_ret < 0) {
/*
- * Copyright (c) 2009, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018 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
cm_id->route.path_rec[0].qos_class = conn->c_tos;
ret = trans->cm_initiate_connect(cm_id, isv6);
} else {
- rds_rtd(RDS_RTD_CM,
- "ROUTE_RESOLVED: calling rds_conn_drop, conn %p <%pI6c,%pI6c,%d>\n",
- conn, &conn->c_laddr,
- &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM,
+ "ROUTE_RESOLVED: calling rds_conn_drop, conn %p <%pI6c,%pI6c,%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 <%pI6c,%pI6c,%d>\n",
- conn, &conn->c_laddr,
- &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_ERR,
+ "ROUTE_ERROR: conn %p, calling rds_conn_drop <%pI6c,%pI6c,%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 <%pI6c,%pI6c,%d>\n",
- conn, &conn->c_laddr,
- &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_ERR,
+ "ADDR_ERROR: conn %p, calling rds_conn_drop <%pI6c,%pI6c,%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_UNREACHABLE:
case RDMA_CM_EVENT_DEVICE_REMOVAL:
if (conn) {
- rds_rtd(RDS_RTD_ERR,
- "CONN/UNREACHABLE/RMVAL ERR: conn %p, calling rds_conn_drop <%pI6c,%pI6c,%d>\n",
- conn, &conn->c_laddr,
- &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_ERR,
+ "CONN/UNREACHABLE/RMVAL ERR: conn %p, calling rds_conn_drop <%pI6c,%pI6c,%d>\n",
+ conn, &conn->c_laddr,
+ &conn->c_faddr, conn->c_tos);
rds_conn_drop(conn, DR_IB_CONNECT_ERR);
}
break;
conn->c_tos);
rds_ib_conn_destroy_init(conn);
} else {
- rds_rtd(RDS_RTD_ERR,
- "Rejected: *err %d status %d calling rds_conn_drop <%pI6c,%pI6c,%d>\n",
- *err, event->status,
- &conn->c_laddr,
- &conn->c_faddr,
- conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_ERR,
+ "Rejected: *err %d status %d calling rds_conn_drop <%pI6c,%pI6c,%d>\n",
+ *err, event->status,
+ &conn->c_laddr,
+ &conn->c_faddr,
+ conn->c_tos);
rds_conn_drop(conn, DR_IB_REJECTED_EVENT);
}
}
break;
case RDMA_CM_EVENT_ADDR_CHANGE:
- rds_rtd(RDS_RTD_CM_EXT,
- "ADDR_CHANGE event <%pI6c,%pI6c>\n",
- &conn->c_laddr,
- &conn->c_faddr);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "ADDR_CHANGE event <%pI6c,%pI6c>\n",
+ &conn->c_laddr,
+ &conn->c_faddr);
if (conn) {
- rds_rtd(RDS_RTD_CM,
- "ADDR_CHANGE: calling rds_conn_drop <%pI6c,%pI6c,%d>\n",
- &conn->c_laddr, &conn->c_faddr,
- conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM,
+ "ADDR_CHANGE: calling rds_conn_drop <%pI6c,%pI6c,%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,
&conn->c_reconn_w,
break;
case RDMA_CM_EVENT_DISCONNECTED:
- rds_rtd(RDS_RTD_CM,
- "DISCONNECT event - dropping connection %pI6c->%pI6c tos %d\n",
- &conn->c_laddr, &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM,
+ "DISCONNECT event - dropping connection %pI6c->%pI6c tos %d\n",
+ &conn->c_laddr, &conn->c_faddr, conn->c_tos);
rds_conn_drop(conn, DR_IB_DISCONNECTED_EVENT);
break;
RDS_RTD_TCP = 1 << 28, /* 0x10000000 */
};
-#define rds_rtd_printk(format, arg...) \
- trace_printk("%d: " format, __LINE__, ## arg)
-
#define rds_rtd(enabling_bit, format, arg...) \
do { if (likely(!(enabling_bit & kernel_rds_rt_debug_bitmap))) break;\
- rds_rtd_printk(format, ## arg); \
+ trace_printk("%d: " format, __LINE__, ## arg); \
+ } while (0)
+
+#define rds_rtd_ptr(enabling_bit, format, arg...) \
+ do { if (likely(!(enabling_bit & kernel_rds_rt_debug_bitmap))) break; \
+ __trace_printk(_THIS_IP_, "%d: " format, __LINE__, ## arg); \
} while (0)
/* XXX is there one of these somewhere? */
/*
- * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018 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
skb = alloc_skb(sizeof(struct rds_nf_hdr) * 2, gfp);
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, %pI6c -> %pI6c tos %d\n",
- inc, saddr, daddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_ERR,
+ "failure to allocate space for inc %p, %pI6c -> %pI6c 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, %pI6c -> %pI6c tos %d\n",
- conn, inc, saddr, daddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_RCV_EXT,
+ "failed to create skb form, conn %p, inc %p, %pI6c -> %pI6c tos %d\n",
+ conn, inc, saddr, daddr, conn->c_tos);
ret = 1;
}
/* find the proper output socket - it should be the local one on which we originated */
rs = rds_find_bound(&dst->saddr, dst->sport, conn->c_dev_if);
if (!rs) {
- rds_rtd(RDS_RTD_RCV,
- "failed to find output rds_socket dst %pI6c : %u, inc %p, conn %p tos %d\n",
- &dst->daddr, dst->dport, inc, conn,
- conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_RCV,
+ "failed to find output rds_socket dst %pI6c : %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;
}
/* now lets see if we can send it all */
ret = rds_send_internal(conn, rs, inc->i_skb, gfp);
if (len != ret) {
- rds_rtd(RDS_RTD_RCV,
- "failed to send rds_data dst %pI6c : %u, inc %p, conn %p tos %d, len %d != ret %d\n",
- &dst->daddr, dst->dport, inc, conn, conn->c_tos,
- len, ret);
+ rds_rtd_ptr(RDS_RTD_RCV,
+ "failed to send rds_data dst %pI6c : %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;
}
inc_hdr_h_sequence = be64_to_cpu(inc->i_hdr.h_sequence);
if (inc_hdr_h_sequence != cp->cp_next_rx_seq) {
- rds_rtd(RDS_RTD_RCV,
- "conn %p <%pI6c,%pI6c,%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);
+ rds_rtd_ptr(RDS_RTD_RCV,
+ "conn %p <%pI6c,%pI6c,%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);
}
if (inc_hdr_h_sequence < cp->cp_next_rx_seq
/*
- * Copyright (c) 2006, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2018 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
return;
}
- rds_rtd(RDS_RTD_CM_EXT, "conn %p for %pI6c to %pI6c tos %d complete\n",
- conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "conn %p for %pI6c to %pI6c tos %d complete\n",
+ conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos);
cp->cp_reconnect_jiffies = 0;
cp->cp_reconnect_retry = rds_sysctl_reconnect_retry_ms;
struct rds_connection *conn = cp->cp_conn;
bool is_tcp = conn->c_trans->t_type == RDS_TRANS_TCP;
- rds_rtd(RDS_RTD_CM_EXT,
- "conn %p for %pI6c to %pI6c tos %d reconnect jiffies %lu\n",
- conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos,
- cp->cp_reconnect_jiffies);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "conn %p for %pI6c to %pI6c tos %d reconnect jiffies %lu\n",
+ conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos,
+ cp->cp_reconnect_jiffies);
/* let peer with smaller addr initiate reconnect, to avoid duels */
if (is_tcp && rds_addr_cmp(&conn->c_laddr, &conn->c_faddr) >= 0)
}
get_random_bytes(&rand, sizeof(rand));
- rds_rtd(RDS_RTD_CM_EXT,
- "%lu delay %lu ceil conn %p for %pI6c -> %pI6c tos %d\n",
- rand % cp->cp_reconnect_jiffies, cp->cp_reconnect_jiffies,
- conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "%lu delay %lu ceil conn %p for %pI6c -> %pI6c tos %d\n",
+ rand % cp->cp_reconnect_jiffies, cp->cp_reconnect_jiffies,
+ conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos);
queue_delayed_work(cp->cp_wq, &cp->cp_conn_w,
rand % cp->cp_reconnect_jiffies);
cp->cp_drop_source = DR_DEFAULT;
ret = conn->c_trans->conn_path_connect(cp);
- rds_rtd(RDS_RTD_CM_EXT,
- "conn %p for %pI6c to %pI6c tos %d dispatched, ret %d\n",
- conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos, ret);
+ rds_rtd_ptr(RDS_RTD_CM_EXT,
+ "conn %p for %pI6c to %pI6c tos %d dispatched, ret %d\n",
+ conn, &conn->c_laddr, &conn->c_faddr, conn->c_tos,
+ ret);
if (ret) {
if (rds_conn_path_transition(cp,
}
cp->cp_hb_start = now;
} else if (now - cp->cp_hb_start > rds_conn_hb_timeout) {
- rds_rtd(RDS_RTD_CM,
- "RDS/IB: connection <%pI6c,%pI6c,%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_rtd_ptr(RDS_RTD_CM,
+ "RDS/IB: connection <%pI6c,%pI6c,%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;
}
msecs_to_jiffies(100));
} else {
cp->cp_reconnect_retry_count++;
- rds_rtd(RDS_RTD_CM,
- "conn <%pI6c,%pI6c,%d> not up, retry(%d)\n",
- &conn->c_laddr, &conn->c_faddr, conn->c_tos,
- cp->cp_reconnect_retry_count);
+ rds_rtd_ptr(RDS_RTD_CM,
+ "conn <%pI6c,%pI6c,%d> not up, retry(%d)\n",
+ &conn->c_laddr, &conn->c_faddr, conn->c_tos,
+ cp->cp_reconnect_retry_count);
queue_delayed_work(cp->cp_wq, &cp->cp_reconn_w,
msecs_to_jiffies(cp->cp_reconnect_retry));
set_bit(RDS_RECONNECT_TIMEDOUT, &cp->cp_reconn_flags);