Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9a42886 authored by Joe Perches's avatar Joe Perches Committed by Doug Ledford
Browse files

cxgb4: Convert PDBG to pr_debug



Use a more typical logging style.

Miscellanea:

o Obsolete the c4iw_debug module parameter
o Coalesce formats
o Realign arguments

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 700456bd
Loading
Loading
Loading
Loading
+156 −147
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ MODULE_PARM_DESC(enable_tcp_window_scaling,

int c4iw_debug;
module_param(c4iw_debug, int, 0644);
MODULE_PARM_DESC(c4iw_debug, "Enable debug logging (default=0)");
MODULE_PARM_DESC(c4iw_debug, "obsolete");

static int peer2peer = 1;
module_param(peer2peer, int, 0644);
@@ -180,7 +180,7 @@ static void ref_qp(struct c4iw_ep *ep)

static void start_ep_timer(struct c4iw_ep *ep)
{
	PDBG("%s ep %p\n", __func__, ep);
	pr_debug("%s ep %p\n", __func__, ep);
	if (timer_pending(&ep->timer)) {
		pr_err("%s timer already started! ep %p\n",
		       __func__, ep);
@@ -196,7 +196,7 @@ static void start_ep_timer(struct c4iw_ep *ep)

static int stop_ep_timer(struct c4iw_ep *ep)
{
	PDBG("%s ep %p stopping\n", __func__, ep);
	pr_debug("%s ep %p stopping\n", __func__, ep);
	del_timer_sync(&ep->timer);
	if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) {
		c4iw_put_ep(&ep->com);
@@ -212,7 +212,7 @@ static int c4iw_l2t_send(struct c4iw_rdev *rdev, struct sk_buff *skb,

	if (c4iw_fatal_error(rdev)) {
		kfree_skb(skb);
		PDBG("%s - device in error state - dropping\n", __func__);
		pr_debug("%s - device in error state - dropping\n", __func__);
		return -EIO;
	}
	error = cxgb4_l2t_send(rdev->lldi.ports[0], skb, l2e);
@@ -229,7 +229,7 @@ int c4iw_ofld_send(struct c4iw_rdev *rdev, struct sk_buff *skb)

	if (c4iw_fatal_error(rdev)) {
		kfree_skb(skb);
		PDBG("%s - device in error state - dropping\n", __func__);
		pr_debug("%s - device in error state - dropping\n", __func__);
		return -EIO;
	}
	error = cxgb4_ofld_send(rdev->lldi.ports[0], skb);
@@ -263,9 +263,9 @@ static void set_emss(struct c4iw_ep *ep, u16 opt)
	if (ep->emss < 128)
		ep->emss = 128;
	if (ep->emss & 7)
		PDBG("Warning: misaligned mtu idx %u mss %u emss=%u\n",
		pr_debug("Warning: misaligned mtu idx %u mss %u emss=%u\n",
			 TCPOPT_MSS_G(opt), ep->mss, ep->emss);
	PDBG("%s mss_idx %u mss %u emss=%u\n", __func__, TCPOPT_MSS_G(opt),
	pr_debug("%s mss_idx %u mss %u emss=%u\n", __func__, TCPOPT_MSS_G(opt),
		 ep->mss, ep->emss);
}

@@ -287,7 +287,7 @@ static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state new)
static void state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state new)
{
	mutex_lock(&epc->mutex);
	PDBG("%s - %s -> %s\n", __func__, states[epc->state], states[new]);
	pr_debug("%s - %s -> %s\n", __func__, states[epc->state], states[new]);
	__state_set(epc, new);
	mutex_unlock(&epc->mutex);
	return;
@@ -322,7 +322,7 @@ static void *alloc_ep(int size, gfp_t gfp)
		mutex_init(&epc->mutex);
		c4iw_init_wr_wait(&epc->wr_wait);
	}
	PDBG("%s alloc ep %p\n", __func__, epc);
	pr_debug("%s alloc ep %p\n", __func__, epc);
	return epc;
}

@@ -384,7 +384,7 @@ void _c4iw_free_ep(struct kref *kref)
	struct c4iw_ep *ep;

	ep = container_of(kref, struct c4iw_ep, com.kref);
	PDBG("%s ep %p state %s\n", __func__, ep, states[ep->com.state]);
	pr_debug("%s ep %p state %s\n", __func__, ep, states[ep->com.state]);
	if (test_bit(QP_REFERENCED, &ep->com.flags))
		deref_qp(ep);
	if (test_bit(RELEASE_RESOURCES, &ep->com.flags)) {
@@ -567,7 +567,7 @@ static void abort_arp_failure(void *handle, struct sk_buff *skb)
	struct c4iw_rdev *rdev = &ep->com.dev->rdev;
	struct cpl_abort_req *req = cplhdr(skb);

	PDBG("%s rdev %p\n", __func__, rdev);
	pr_debug("%s rdev %p\n", __func__, rdev);
	req->cmd = CPL_ABORT_NO_RST;
	ret = c4iw_ofld_send(rdev, skb);
	if (ret) {
@@ -642,7 +642,7 @@ static int send_halfclose(struct c4iw_ep *ep)
	struct sk_buff *skb = skb_dequeue(&ep->com.ep_skb_list);
	u32 wrlen = roundup(sizeof(struct cpl_close_con_req), 16);

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	if (WARN_ON(!skb))
		return -ENOMEM;

@@ -657,7 +657,7 @@ static int send_abort(struct c4iw_ep *ep)
	u32 wrlen = roundup(sizeof(struct cpl_abort_req), 16);
	struct sk_buff *req_skb = skb_dequeue(&ep->com.ep_skb_list);

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	if (WARN_ON(!req_skb))
		return -ENOMEM;

@@ -720,7 +720,7 @@ static int send_connect(struct c4iw_ep *ep)
			roundup(sizev4, 16) :
			roundup(sizev6, 16);

	PDBG("%s ep %p atid %u\n", __func__, ep, ep->atid);
	pr_debug("%s ep %p atid %u\n", __func__, ep, ep->atid);

	skb = get_skb(NULL, wrlen, GFP_KERNEL);
	if (!skb) {
@@ -821,7 +821,7 @@ static int send_connect(struct c4iw_ep *ep)
				t5req->params =
					  cpu_to_be64(FILTER_TUPLE_V(params));
				t5req->rsvd = cpu_to_be32(isn);
				PDBG("%s snd_isn %u\n", __func__, t5req->rsvd);
			pr_debug("%s snd_isn %u\n", __func__, t5req->rsvd);
				t5req->opt2 = cpu_to_be32(opt2);
			} else {
				t6req->params =
@@ -876,7 +876,7 @@ static int send_connect(struct c4iw_ep *ep)
				t5req6->params =
					    cpu_to_be64(FILTER_TUPLE_V(params));
				t5req6->rsvd = cpu_to_be32(isn);
				PDBG("%s snd_isn %u\n", __func__, t5req6->rsvd);
			pr_debug("%s snd_isn %u\n", __func__, t5req6->rsvd);
				t5req6->opt2 = cpu_to_be32(opt2);
			} else {
				t6req6->params =
@@ -906,7 +906,8 @@ static int send_mpa_req(struct c4iw_ep *ep, struct sk_buff *skb,
	struct mpa_message *mpa;
	struct mpa_v2_conn_params mpa_v2_params;

	PDBG("%s ep %p tid %u pd_len %d\n", __func__, ep, ep->hwtid, ep->plen);
	pr_debug("%s ep %p tid %u pd_len %d\n",
		 __func__, ep, ep->hwtid, ep->plen);

	BUG_ON(skb_cloned(skb));

@@ -960,7 +961,7 @@ static int send_mpa_req(struct c4iw_ep *ep, struct sk_buff *skb,
	if (mpa_rev_to_use == 2) {
		mpa->private_data_size = htons(ntohs(mpa->private_data_size) +
					       sizeof (struct mpa_v2_conn_params));
		PDBG("%s initiator ird %u ord %u\n", __func__, ep->ird,
		pr_debug("%s initiator ird %u ord %u\n", __func__, ep->ird,
			 ep->ord);
		mpa_v2_params.ird = htons((u16)ep->ird);
		mpa_v2_params.ord = htons((u16)ep->ord);
@@ -1013,7 +1014,8 @@ static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen)
	struct sk_buff *skb;
	struct mpa_v2_conn_params mpa_v2_params;

	PDBG("%s ep %p tid %u pd_len %d\n", __func__, ep, ep->hwtid, ep->plen);
	pr_debug("%s ep %p tid %u pd_len %d\n",
		 __func__, ep, ep->hwtid, ep->plen);

	mpalen = sizeof(*mpa) + plen;
	if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn)
@@ -1093,7 +1095,8 @@ static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen)
	struct sk_buff *skb;
	struct mpa_v2_conn_params mpa_v2_params;

	PDBG("%s ep %p tid %u pd_len %d\n", __func__, ep, ep->hwtid, ep->plen);
	pr_debug("%s ep %p tid %u pd_len %d\n",
		 __func__, ep, ep->hwtid, ep->plen);

	mpalen = sizeof(*mpa) + plen;
	if (ep->mpa_attr.version == 2 && ep->mpa_attr.enhanced_rdma_conn)
@@ -1184,7 +1187,7 @@ static int act_establish(struct c4iw_dev *dev, struct sk_buff *skb)

	ep = lookup_atid(t, atid);

	PDBG("%s ep %p tid %u snd_isn %u rcv_isn %u\n", __func__, ep, tid,
	pr_debug("%s ep %p tid %u snd_isn %u rcv_isn %u\n", __func__, ep, tid,
		 be32_to_cpu(req->snd_isn), be32_to_cpu(req->rcv_isn));

	mutex_lock(&ep->com.mutex);
@@ -1228,12 +1231,12 @@ static void close_complete_upcall(struct c4iw_ep *ep, int status)
{
	struct iw_cm_event event;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	memset(&event, 0, sizeof(event));
	event.event = IW_CM_EVENT_CLOSE;
	event.status = status;
	if (ep->com.cm_id) {
		PDBG("close complete delivered ep %p cm_id %p tid %u\n",
		pr_debug("close complete delivered ep %p cm_id %p tid %u\n",
			 ep, ep->com.cm_id, ep->hwtid);
		ep->com.cm_id->event_handler(ep->com.cm_id, &event);
		deref_cm_id(&ep->com);
@@ -1245,11 +1248,11 @@ static void peer_close_upcall(struct c4iw_ep *ep)
{
	struct iw_cm_event event;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	memset(&event, 0, sizeof(event));
	event.event = IW_CM_EVENT_DISCONNECT;
	if (ep->com.cm_id) {
		PDBG("peer close delivered ep %p cm_id %p tid %u\n",
		pr_debug("peer close delivered ep %p cm_id %p tid %u\n",
			 ep, ep->com.cm_id, ep->hwtid);
		ep->com.cm_id->event_handler(ep->com.cm_id, &event);
		set_bit(DISCONN_UPCALL, &ep->com.history);
@@ -1260,12 +1263,12 @@ static void peer_abort_upcall(struct c4iw_ep *ep)
{
	struct iw_cm_event event;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	memset(&event, 0, sizeof(event));
	event.event = IW_CM_EVENT_CLOSE;
	event.status = -ECONNRESET;
	if (ep->com.cm_id) {
		PDBG("abort delivered ep %p cm_id %p tid %u\n", ep,
		pr_debug("abort delivered ep %p cm_id %p tid %u\n", ep,
			 ep->com.cm_id, ep->hwtid);
		ep->com.cm_id->event_handler(ep->com.cm_id, &event);
		deref_cm_id(&ep->com);
@@ -1277,7 +1280,8 @@ static void connect_reply_upcall(struct c4iw_ep *ep, int status)
{
	struct iw_cm_event event;

	PDBG("%s ep %p tid %u status %d\n", __func__, ep, ep->hwtid, status);
	pr_debug("%s ep %p tid %u status %d\n",
		 __func__, ep, ep->hwtid, status);
	memset(&event, 0, sizeof(event));
	event.event = IW_CM_EVENT_CONNECT_REPLY;
	event.status = status;
@@ -1306,7 +1310,7 @@ static void connect_reply_upcall(struct c4iw_ep *ep, int status)
		}
	}

	PDBG("%s ep %p tid %u status %d\n", __func__, ep,
	pr_debug("%s ep %p tid %u status %d\n", __func__, ep,
		 ep->hwtid, status);
	set_bit(CONN_RPL_UPCALL, &ep->com.history);
	ep->com.cm_id->event_handler(ep->com.cm_id, &event);
@@ -1320,7 +1324,7 @@ static int connect_request_upcall(struct c4iw_ep *ep)
	struct iw_cm_event event;
	int ret;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	memset(&event, 0, sizeof(event));
	event.event = IW_CM_EVENT_CONNECT_REQUEST;
	memcpy(&event.local_addr, &ep->com.local_addr,
@@ -1357,13 +1361,13 @@ static void established_upcall(struct c4iw_ep *ep)
{
	struct iw_cm_event event;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	memset(&event, 0, sizeof(event));
	event.event = IW_CM_EVENT_ESTABLISHED;
	event.ird = ep->ord;
	event.ord = ep->ird;
	if (ep->com.cm_id) {
		PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
		pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
		ep->com.cm_id->event_handler(ep->com.cm_id, &event);
		set_bit(ESTAB_UPCALL, &ep->com.history);
	}
@@ -1375,7 +1379,8 @@ static int update_rx_credits(struct c4iw_ep *ep, u32 credits)
	u32 wrlen = roundup(sizeof(struct cpl_rx_data_ack), 16);
	u32 credit_dack;

	PDBG("%s ep %p tid %u credits %u\n", __func__, ep, ep->hwtid, credits);
	pr_debug("%s ep %p tid %u credits %u\n",
		 __func__, ep, ep->hwtid, credits);
	skb = get_skb(NULL, wrlen, GFP_KERNEL);
	if (!skb) {
		pr_err("update_rx_credits - cannot alloc skb!\n");
@@ -1426,7 +1431,7 @@ static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb)
	int err;
	int disconnect = 0;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);

	/*
	 * If we get more than the supported amount of private data
@@ -1524,8 +1529,9 @@ static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb)
				MPA_V2_IRD_ORD_MASK;
			resp_ord = ntohs(mpa_v2_params->ord) &
				MPA_V2_IRD_ORD_MASK;
			PDBG("%s responder ird %u ord %u ep ird %u ord %u\n",
			     __func__, resp_ird, resp_ord, ep->ird, ep->ord);
			pr_debug("%s responder ird %u ord %u ep ird %u ord %u\n",
				 __func__,
				 resp_ird, resp_ord, ep->ird, ep->ord);

			/*
			 * This is a double-check. Ideally, below checks are
@@ -1569,9 +1575,8 @@ static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb)
		if (peer2peer)
			ep->mpa_attr.p2p_type = p2p_type;

	PDBG("%s - crc_enabled=%d, recv_marker_enabled=%d, "
	     "xmit_marker_enabled=%d, version=%d p2p_type=%d local-p2p_type = "
	     "%d\n", __func__, ep->mpa_attr.crc_enabled,
	pr_debug("%s - crc_enabled=%d, recv_marker_enabled=%d, xmit_marker_enabled=%d, version=%d p2p_type=%d local-p2p_type = %d\n",
		 __func__, ep->mpa_attr.crc_enabled,
		 ep->mpa_attr.recv_marker_enabled,
		 ep->mpa_attr.xmit_marker_enabled, ep->mpa_attr.version,
		 ep->mpa_attr.p2p_type, p2p_type);
@@ -1667,7 +1672,7 @@ static int process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
	struct mpa_v2_conn_params *mpa_v2_params;
	u16 plen;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);

	/*
	 * If we get more than the supported amount of private data
@@ -1676,7 +1681,7 @@ static int process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
	if (ep->mpa_pkt_len + skb->len > sizeof(ep->mpa_pkt))
		goto err_stop_timer;

	PDBG("%s enter (%s line %u)\n", __func__, __FILE__, __LINE__);
	pr_debug("%s enter (%s line %u)\n", __func__, __FILE__, __LINE__);

	/*
	 * Copy the new data into our accumulation buffer.
@@ -1692,7 +1697,7 @@ static int process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
	if (ep->mpa_pkt_len < sizeof(*mpa))
		return 0;

	PDBG("%s enter (%s line %u)\n", __func__, __FILE__, __LINE__);
	pr_debug("%s enter (%s line %u)\n", __func__, __FILE__, __LINE__);
	mpa = (struct mpa_message *) ep->mpa_pkt;

	/*
@@ -1755,8 +1760,8 @@ static int process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
				MPA_V2_IRD_ORD_MASK;
			ep->ord = min_t(u32, ep->ord,
					cur_max_read_depth(ep->com.dev));
			PDBG("%s initiator ird %u ord %u\n", __func__, ep->ird,
			     ep->ord);
			pr_debug("%s initiator ird %u ord %u\n",
				 __func__, ep->ird, ep->ord);
			if (ntohs(mpa_v2_params->ird) & MPA_V2_PEER2PEER_MODEL)
				if (peer2peer) {
					if (ntohs(mpa_v2_params->ord) &
@@ -1773,8 +1778,8 @@ static int process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb)
		if (peer2peer)
			ep->mpa_attr.p2p_type = p2p_type;

	PDBG("%s - crc_enabled=%d, recv_marker_enabled=%d, "
	     "xmit_marker_enabled=%d, version=%d p2p_type=%d\n", __func__,
	pr_debug("%s - crc_enabled=%d, recv_marker_enabled=%d, xmit_marker_enabled=%d, version=%d p2p_type=%d\n",
		 __func__,
		 ep->mpa_attr.crc_enabled, ep->mpa_attr.recv_marker_enabled,
		 ep->mpa_attr.xmit_marker_enabled, ep->mpa_attr.version,
		 ep->mpa_attr.p2p_type);
@@ -1813,7 +1818,7 @@ static int rx_data(struct c4iw_dev *dev, struct sk_buff *skb)
	ep = get_ep_from_tid(dev, tid);
	if (!ep)
		return 0;
	PDBG("%s ep %p tid %u dlen %u\n", __func__, ep, ep->hwtid, dlen);
	pr_debug("%s ep %p tid %u dlen %u\n", __func__, ep, ep->hwtid, dlen);
	skb_pull(skb, sizeof(*hdr));
	skb_trim(skb, dlen);
	mutex_lock(&ep->com.mutex);
@@ -1867,7 +1872,7 @@ static int abort_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
		pr_warn("Abort rpl to freed endpoint\n");
		return 0;
	}
	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	mutex_lock(&ep->com.mutex);
	switch (ep->com.state) {
	case ABORTING:
@@ -1992,7 +1997,8 @@ static void set_tcp_window(struct c4iw_ep *ep, struct port_info *pi)
{
	ep->snd_win = snd_win;
	ep->rcv_win = rcv_win;
	PDBG("%s snd_win %d rcv_win %d\n", __func__, ep->snd_win, ep->rcv_win);
	pr_debug("%s snd_win %d rcv_win %d\n",
		 __func__, ep->snd_win, ep->rcv_win);
}

#define ACT_OPEN_RETRY_COUNT 2
@@ -2097,7 +2103,7 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
	int iptype;
	__u8 *ra;

	PDBG("%s qp %p cm_id %p\n", __func__, ep->com.qp, ep->com.cm_id);
	pr_debug("%s qp %p cm_id %p\n", __func__, ep->com.qp, ep->com.cm_id);
	init_timer(&ep->timer);
	c4iw_init_wr_wait(&ep->com.wr_wait);

@@ -2160,7 +2166,7 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
		goto fail4;
	}

	PDBG("%s txq_idx %u tx_chan %u smac_idx %u rss_qid %u l2t_idx %u\n",
	pr_debug("%s txq_idx %u tx_chan %u smac_idx %u rss_qid %u l2t_idx %u\n",
		 __func__, ep->txq_idx, ep->tx_chan, ep->smac_idx, ep->rss_qid,
		 ep->l2t->idx);

@@ -2212,11 +2218,11 @@ static int act_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
	la6 = (struct sockaddr_in6 *)&ep->com.local_addr;
	ra6 = (struct sockaddr_in6 *)&ep->com.remote_addr;

	PDBG("%s ep %p atid %u status %u errno %d\n", __func__, ep, atid,
	pr_debug("%s ep %p atid %u status %u errno %d\n", __func__, ep, atid,
		 status, status2errno(status));

	if (cxgb_is_neg_adv(status)) {
		PDBG("%s Connection problems for atid %u status %u (%s)\n",
		pr_debug("%s Connection problems for atid %u status %u (%s)\n",
			 __func__, atid, status, neg_adv_str(status));
		ep->stats.connect_neg_adv++;
		mutex_lock(&dev->rdev.stats.lock);
@@ -2312,10 +2318,10 @@ static int pass_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
	struct c4iw_listen_ep *ep = get_ep_from_stid(dev, stid);

	if (!ep) {
		PDBG("%s stid %d lookup failure!\n", __func__, stid);
		pr_debug("%s stid %d lookup failure!\n", __func__, stid);
		goto out;
	}
	PDBG("%s ep %p status %d error %d\n", __func__, ep,
	pr_debug("%s ep %p status %d error %d\n", __func__, ep,
		 rpl->status, status2errno(rpl->status));
	c4iw_wake_up(&ep->com.wr_wait, status2errno(rpl->status));
	c4iw_put_ep(&ep->com);
@@ -2329,7 +2335,7 @@ static int close_listsrv_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
	unsigned int stid = GET_TID(rpl);
	struct c4iw_listen_ep *ep = get_ep_from_stid(dev, stid);

	PDBG("%s ep %p\n", __func__, ep);
	pr_debug("%s ep %p\n", __func__, ep);
	c4iw_wake_up(&ep->com.wr_wait, status2errno(rpl->status));
	c4iw_put_ep(&ep->com);
	return 0;
@@ -2347,7 +2353,7 @@ static int accept_cr(struct c4iw_ep *ep, struct sk_buff *skb,
	int win;
	enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	BUG_ON(skb_cloned(skb));

	skb_get(skb);
@@ -2418,7 +2424,7 @@ static int accept_cr(struct c4iw_ep *ep, struct sk_buff *skb,
		if (peer2peer)
			isn += 4;
		rpl5->iss = cpu_to_be32(isn);
		PDBG("%s iss %u\n", __func__, be32_to_cpu(rpl5->iss));
		pr_debug("%s iss %u\n", __func__, be32_to_cpu(rpl5->iss));
	}

	rpl->opt0 = cpu_to_be64(opt0);
@@ -2431,7 +2437,7 @@ static int accept_cr(struct c4iw_ep *ep, struct sk_buff *skb,

static void reject_cr(struct c4iw_dev *dev, u32 hwtid, struct sk_buff *skb)
{
	PDBG("%s c4iw_dev %p tid %u\n", __func__, dev, hwtid);
	pr_debug("%s c4iw_dev %p tid %u\n", __func__, dev, hwtid);
	BUG_ON(skb_cloned(skb));
	skb_trim(skb, sizeof(struct cpl_tid_release));
	release_tid(&dev->rdev, hwtid, skb);
@@ -2457,12 +2463,13 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)

	parent_ep = (struct c4iw_ep *)get_ep_from_stid(dev, stid);
	if (!parent_ep) {
		PDBG("%s connect request on invalid stid %d\n", __func__, stid);
		pr_debug("%s connect request on invalid stid %d\n",
			 __func__, stid);
		goto reject;
	}

	if (state_read(&parent_ep->com) != LISTEN) {
		PDBG("%s - listening ep not in LISTEN\n", __func__);
		pr_debug("%s - listening ep not in LISTEN\n", __func__);
		goto reject;
	}

@@ -2471,7 +2478,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)

	/* Find output route */
	if (iptype == 4)  {
		PDBG("%s parent ep %p hwtid %u laddr %pI4 raddr %pI4 lport %d rport %d peer_mss %d\n"
		pr_debug("%s parent ep %p hwtid %u laddr %pI4 raddr %pI4 lport %d rport %d peer_mss %d\n"
			 , __func__, parent_ep, hwtid,
			 local_ip, peer_ip, ntohs(local_port),
			 ntohs(peer_port), peer_mss);
@@ -2479,7 +2486,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
				      *(__be32 *)local_ip, *(__be32 *)peer_ip,
				      local_port, peer_port, tos);
	} else {
		PDBG("%s parent ep %p hwtid %u laddr %pI6 raddr %pI6 lport %d rport %d peer_mss %d\n"
		pr_debug("%s parent ep %p hwtid %u laddr %pI6 raddr %pI6 lport %d rport %d peer_mss %d\n"
			 , __func__, parent_ep, hwtid,
			 local_ip, peer_ip, ntohs(local_port),
			 ntohs(peer_port), peer_mss);
@@ -2565,7 +2572,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
	child_ep->dst = dst;
	child_ep->hwtid = hwtid;

	PDBG("%s tx_chan %u smac_idx %u rss_qid %u\n", __func__,
	pr_debug("%s tx_chan %u smac_idx %u rss_qid %u\n", __func__,
		 child_ep->tx_chan, child_ep->smac_idx, child_ep->rss_qid);

	init_timer(&child_ep->timer);
@@ -2601,11 +2608,11 @@ static int pass_establish(struct c4iw_dev *dev, struct sk_buff *skb)
	int ret;

	ep = get_ep_from_tid(dev, tid);
	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	ep->snd_seq = be32_to_cpu(req->snd_isn);
	ep->rcv_seq = be32_to_cpu(req->rcv_isn);

	PDBG("%s ep %p hwtid %u tcp_opt 0x%02x\n", __func__, ep, tid,
	pr_debug("%s ep %p hwtid %u tcp_opt 0x%02x\n", __func__, ep, tid,
		 ntohs(req->tcp_opt));

	set_emss(ep, ntohs(req->tcp_opt));
@@ -2638,7 +2645,7 @@ static int peer_close(struct c4iw_dev *dev, struct sk_buff *skb)
	if (!ep)
		return 0;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	dst_confirm(ep->dst);

	set_bit(PEER_CLOSE, &ep->com.history);
@@ -2660,12 +2667,12 @@ static int peer_close(struct c4iw_dev *dev, struct sk_buff *skb)
		 * in rdma connection migration (see c4iw_accept_cr()).
		 */
		__state_set(&ep->com, CLOSING);
		PDBG("waking up ep %p tid %u\n", ep, ep->hwtid);
		pr_debug("waking up ep %p tid %u\n", ep, ep->hwtid);
		c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
		break;
	case MPA_REP_SENT:
		__state_set(&ep->com, CLOSING);
		PDBG("waking up ep %p tid %u\n", ep, ep->hwtid);
		pr_debug("waking up ep %p tid %u\n", ep, ep->hwtid);
		c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
		break;
	case FPDU_MODE:
@@ -2729,7 +2736,7 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
		return 0;

	if (cxgb_is_neg_adv(req->status)) {
		PDBG("%s Negative advice on abort- tid %u status %d (%s)\n",
		pr_debug("%s Negative advice on abort- tid %u status %d (%s)\n",
			 __func__, ep->hwtid, req->status,
			 neg_adv_str(req->status));
		ep->stats.abort_neg_adv++;
@@ -2738,7 +2745,7 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
		mutex_unlock(&dev->rdev.stats.lock);
		goto deref_ep;
	}
	PDBG("%s ep %p tid %u state %u\n", __func__, ep, ep->hwtid,
	pr_debug("%s ep %p tid %u state %u\n", __func__, ep, ep->hwtid,
		 ep->com.state);
	set_bit(PEER_ABORT, &ep->com.history);

@@ -2771,8 +2778,8 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
			 * do some housekeeping so as to re-initiate the
			 * connection
			 */
			PDBG("%s: mpa_rev=%d. Retrying with mpav1\n", __func__,
			     mpa_rev);
			pr_debug("%s: mpa_rev=%d. Retrying with mpav1\n",
				 __func__, mpa_rev);
			ep->retry_with_mpa_v1 = 1;
		}
		break;
@@ -2798,7 +2805,7 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)
	case ABORTING:
		break;
	case DEAD:
		PDBG("%s PEER_ABORT IN DEAD STATE!!!!\n", __func__);
		pr_debug("%s PEER_ABORT IN DEAD STATE!!!!\n", __func__);
		mutex_unlock(&ep->com.mutex);
		goto deref_ep;
	default:
@@ -2862,7 +2869,7 @@ static int close_con_rpl(struct c4iw_dev *dev, struct sk_buff *skb)
	if (!ep)
		return 0;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	BUG_ON(!ep);

	/* The cm_id may be null if we failed to connect */
@@ -2938,17 +2945,18 @@ static int fw4_ack(struct c4iw_dev *dev, struct sk_buff *skb)
	ep = get_ep_from_tid(dev, tid);
	if (!ep)
		return 0;
	PDBG("%s ep %p tid %u credits %u\n", __func__, ep, ep->hwtid, credits);
	pr_debug("%s ep %p tid %u credits %u\n",
		 __func__, ep, ep->hwtid, credits);
	if (credits == 0) {
		PDBG("%s 0 credit ack ep %p tid %u state %u\n",
		pr_debug("%s 0 credit ack ep %p tid %u state %u\n",
			 __func__, ep, ep->hwtid, state_read(&ep->com));
		goto out;
	}

	dst_confirm(ep->dst);
	if (ep->mpa_skb) {
		PDBG("%s last streaming msg ack ep %p tid %u state %u "
		     "initiator %u freeing skb\n", __func__, ep, ep->hwtid,
		pr_debug("%s last streaming msg ack ep %p tid %u state %u initiator %u freeing skb\n",
			 __func__, ep, ep->hwtid,
			 state_read(&ep->com), ep->mpa_attr.initiator ? 1 : 0);
		mutex_lock(&ep->com.mutex);
		kfree_skb(ep->mpa_skb);
@@ -2967,7 +2975,7 @@ int c4iw_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len)
	int abort;
	struct c4iw_ep *ep = to_ep(cm_id);

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);

	mutex_lock(&ep->com.mutex);
	if (ep->com.state != MPA_REQ_RCVD) {
@@ -2998,7 +3006,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
	struct c4iw_qp *qp = get_qhp(h, conn_param->qpn);
	int abort = 0;

	PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid);
	pr_debug("%s ep %p tid %u\n", __func__, ep, ep->hwtid);

	mutex_lock(&ep->com.mutex);
	if (ep->com.state != MPA_REQ_RCVD) {
@@ -3051,7 +3059,7 @@ int c4iw_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
			ep->ird = 1;
	}

	PDBG("%s %d ird %d ord %d\n", __func__, __LINE__, ep->ird, ep->ord);
	pr_debug("%s %d ird %d ord %d\n", __func__, __LINE__, ep->ird, ep->ord);

	ep->com.cm_id = cm_id;
	ref_cm_id(&ep->com);
@@ -3207,12 +3215,12 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
	ep->com.dev = dev;
	ep->com.qp = get_qhp(dev, conn_param->qpn);
	if (!ep->com.qp) {
		PDBG("%s qpn 0x%x not found!\n", __func__, conn_param->qpn);
		pr_debug("%s qpn 0x%x not found!\n", __func__, conn_param->qpn);
		err = -EINVAL;
		goto fail2;
	}
	ref_qp(ep);
	PDBG("%s qpn 0x%x qp %p cm_id %p\n", __func__, conn_param->qpn,
	pr_debug("%s qpn 0x%x qp %p cm_id %p\n", __func__, conn_param->qpn,
		 ep->com.qp, cm_id);

	/*
@@ -3250,7 +3258,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
		}

		/* find a route */
		PDBG("%s saddr %pI4 sport 0x%x raddr %pI4 rport 0x%x\n",
		pr_debug("%s saddr %pI4 sport 0x%x raddr %pI4 rport 0x%x\n",
			 __func__, &laddr->sin_addr, ntohs(laddr->sin_port),
			 ra, ntohs(raddr->sin_port));
		ep->dst = cxgb_find_route(&dev->rdev.lldi, get_real_dev,
@@ -3272,7 +3280,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
		}

		/* find a route */
		PDBG("%s saddr %pI6 sport 0x%x raddr %pI6 rport 0x%x\n",
		pr_debug("%s saddr %pI6 sport 0x%x raddr %pI6 rport 0x%x\n",
			 __func__, laddr6->sin6_addr.s6_addr,
			 ntohs(laddr6->sin6_port),
			 raddr6->sin6_addr.s6_addr, ntohs(raddr6->sin6_port));
@@ -3296,7 +3304,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
		goto fail4;
	}

	PDBG("%s txq_idx %u tx_chan %u smac_idx %u rss_qid %u l2t_idx %u\n",
	pr_debug("%s txq_idx %u tx_chan %u smac_idx %u rss_qid %u l2t_idx %u\n",
		 __func__, ep->txq_idx, ep->tx_chan, ep->smac_idx, ep->rss_qid,
		 ep->l2t->idx);

@@ -3411,7 +3419,7 @@ int c4iw_create_listen(struct iw_cm_id *cm_id, int backlog)
		goto fail1;
	}
	skb_queue_head_init(&ep->com.ep_skb_list);
	PDBG("%s ep %p\n", __func__, ep);
	pr_debug("%s ep %p\n", __func__, ep);
	ep->com.cm_id = cm_id;
	ref_cm_id(&ep->com);
	ep->com.dev = dev;
@@ -3465,7 +3473,7 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id)
	int err;
	struct c4iw_listen_ep *ep = to_listen_ep(cm_id);

	PDBG("%s ep %p\n", __func__, ep);
	pr_debug("%s ep %p\n", __func__, ep);

	might_sleep();
	state_set(&ep->com, DEAD);
@@ -3506,7 +3514,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp)

	mutex_lock(&ep->com.mutex);

	PDBG("%s ep %p state %s, abrupt %d\n", __func__, ep,
	pr_debug("%s ep %p state %s, abrupt %d\n", __func__, ep,
		 states[ep->com.state], abrupt);

	/*
@@ -3560,7 +3568,7 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp)
	case MORIBUND:
	case ABORTING:
	case DEAD:
		PDBG("%s ignoring disconnect ep %p state %u\n",
		pr_debug("%s ignoring disconnect ep %p state %u\n",
			 __func__, ep, ep->com.state);
		break;
	default:
@@ -3665,7 +3673,7 @@ static void passive_ofld_conn_reply(struct c4iw_dev *dev, struct sk_buff *skb,
	rpl_skb = (struct sk_buff *)(unsigned long)req->cookie;
	BUG_ON(!rpl_skb);
	if (req->retval) {
		PDBG("%s passive open failure %d\n", __func__, req->retval);
		pr_debug("%s passive open failure %d\n", __func__, req->retval);
		mutex_lock(&dev->rdev.stats.lock);
		dev->rdev.stats.pas_ofld_conn_fails++;
		mutex_unlock(&dev->rdev.stats.lock);
@@ -3881,7 +3889,8 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)

	lep = (struct c4iw_ep *)get_ep_from_stid(dev, stid);
	if (!lep) {
		PDBG("%s connect request on invalid stid %d\n", __func__, stid);
		pr_debug("%s connect request on invalid stid %d\n",
			 __func__, stid);
		goto reject;
	}

@@ -3918,7 +3927,7 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb)
	skb_set_transport_header(skb, (void *)tcph - (void *)rss);
	skb_get(skb);

	PDBG("%s lip 0x%x lport %u pip 0x%x pport %u tos %d\n", __func__,
	pr_debug("%s lip 0x%x lport %u pip 0x%x pport %u tos %d\n", __func__,
		 ntohl(iph->daddr), ntohs(tcph->dest), ntohl(iph->saddr),
		 ntohs(tcph->source), iph->tos);

@@ -4017,7 +4026,7 @@ static void process_timeout(struct c4iw_ep *ep)
	int abort = 1;

	mutex_lock(&ep->com.mutex);
	PDBG("%s ep %p tid %u state %d\n", __func__, ep, ep->hwtid,
	pr_debug("%s ep %p tid %u state %d\n", __func__, ep, ep->hwtid,
		 ep->com.state);
	set_bit(TIMEDOUT, &ep->com.history);
	switch (ep->com.state) {
@@ -4161,13 +4170,13 @@ static int fw6_msg(struct c4iw_dev *dev, struct sk_buff *skb)
	struct c4iw_wr_wait *wr_waitp;
	int ret;

	PDBG("%s type %u\n", __func__, rpl->type);
	pr_debug("%s type %u\n", __func__, rpl->type);

	switch (rpl->type) {
	case FW6_TYPE_WR_RPL:
		ret = (int)((be64_to_cpu(rpl->data[0]) >> 8) & 0xff);
		wr_waitp = (struct c4iw_wr_wait *)(__force unsigned long) rpl->data[1];
		PDBG("%s wr_waitp %p ret %u\n", __func__, wr_waitp, ret);
		pr_debug("%s wr_waitp %p ret %u\n", __func__, wr_waitp, ret);
		if (wr_waitp)
			c4iw_wake_up(wr_waitp, ret ? -ret : 0);
		kfree_skb(skb);
@@ -4199,12 +4208,12 @@ static int peer_abort_intr(struct c4iw_dev *dev, struct sk_buff *skb)
		return 0;
	}
	if (cxgb_is_neg_adv(req->status)) {
		PDBG("%s Negative advice on abort- tid %u status %d (%s)\n",
		pr_debug("%s Negative advice on abort- tid %u status %d (%s)\n",
			 __func__, ep->hwtid, req->status,
			 neg_adv_str(req->status));
		goto out;
	}
	PDBG("%s ep %p tid %u state %u\n", __func__, ep, ep->hwtid,
	pr_debug("%s ep %p tid %u state %u\n", __func__, ep, ep->hwtid,
		 ep->com.state);

	c4iw_wake_up(&ep->com.wr_wait, -ECONNRESET);
+36 −35

File changed.

Preview size limit exceeded, changes collapsed.

+27 −31

File changed.

Preview size limit exceeded, changes collapsed.

+14 −15
Original line number Diff line number Diff line
@@ -47,8 +47,7 @@ static void print_tpte(struct c4iw_dev *dev, u32 stag)
			"%s cxgb4_read_tpte err %d\n", __func__, ret);
		return;
	}
	PDBG("stag idx 0x%x valid %d key 0x%x state %d pdid %d "
	       "perm 0x%x ps %d len 0x%llx va 0x%llx\n",
	pr_debug("stag idx 0x%x valid %d key 0x%x state %d pdid %d perm 0x%x ps %d len 0x%llx va 0x%llx\n",
		 stag & 0xffffff00,
		 FW_RI_TPTE_VALID_G(ntohl(tpte.valid_to_pdid)),
		 FW_RI_TPTE_STAGKEY_G(ntohl(tpte.valid_to_pdid)),
@@ -71,7 +70,7 @@ static void dump_err_cqe(struct c4iw_dev *dev, struct t4_cqe *err_cqe)
		CQE_STATUS(err_cqe), CQE_TYPE(err_cqe), ntohl(err_cqe->len),
		CQE_WRID_HI(err_cqe), CQE_WRID_LOW(err_cqe));

	PDBG("%016llx %016llx %016llx %016llx\n",
	pr_debug("%016llx %016llx %016llx %016llx\n",
		 be64_to_cpu(p[0]), be64_to_cpu(p[1]), be64_to_cpu(p[2]),
		 be64_to_cpu(p[3]));

@@ -235,7 +234,7 @@ int c4iw_ev_handler(struct c4iw_dev *dev, u32 qid)
		if (atomic_dec_and_test(&chp->refcnt))
			wake_up(&chp->wait);
	} else {
		PDBG("%s unknown cqid 0x%x\n", __func__, qid);
		pr_debug("%s unknown cqid 0x%x\n", __func__, qid);
		spin_unlock_irqrestore(&dev->lock, flag);
	}
	return 0;
+20 −24

File changed.

Preview size limit exceeded, changes collapsed.

Loading