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

Commit 5dab6d3a authored by Hariprasad S's avatar Hariprasad S Committed by Roland Dreier
Browse files

RDMA/cxgb4: Clean up connection on ARP error



Based on origninal work by Steve Wise <swise@opengridcomputing.com>

Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
Signed-off-by: default avatarHariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 233b4301
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -432,8 +432,17 @@ static void arp_failure_discard(void *handle, struct sk_buff *skb)
 */
static void act_open_req_arp_failure(void *handle, struct sk_buff *skb)
{
	struct c4iw_ep *ep = handle;

	printk(KERN_ERR MOD "ARP failure duing connect\n");
	kfree_skb(skb);
	connect_reply_upcall(ep, -EHOSTUNREACH);
	state_set(&ep->com, DEAD);
	remove_handle(ep->com.dev, &ep->com.dev->atid_idr, ep->atid);
	cxgb4_free_atid(ep->com.dev->rdev.lldi.tids, ep->atid);
	dst_release(ep->dst);
	cxgb4_l2t_release(ep->l2t);
	c4iw_put_ep(&ep->com);
}

/*
@@ -658,7 +667,7 @@ static int send_connect(struct c4iw_ep *ep)
		opt2 |= T5_OPT_2_VALID;
		opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE);
	}
	t4_set_arp_err_handler(skb, NULL, act_open_req_arp_failure);
	t4_set_arp_err_handler(skb, ep, act_open_req_arp_failure);

	if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) {
		if (ep->com.remote_addr.ss_family == AF_INET) {