aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe/tom/t4_connect.c
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2017-01-11 23:48:17 +0000
committerNavdeep Parhar <np@FreeBSD.org>2017-01-11 23:48:17 +0000
commita342904bb5a48c4b9538669774fd6f98fc6b4e0b (patch)
treea68da23d1f3f699ec91db168bc4885000b711af1 /sys/dev/cxgbe/tom/t4_connect.c
parentbd99d5d4d8d0687d75379163a9c2e036df5f797a (diff)
downloadsrc-a342904bb5a48c4b9538669774fd6f98fc6b4e0b.tar.gz
src-a342904bb5a48c4b9538669774fd6f98fc6b4e0b.zip
cxgbe/tom: Add VIMAGE support to the TOE driver.
Active Open: - Save the socket's vnet at the time of the active open (t4_connect) and switch to it when processing the reply (do_act_open_rpl or do_act_establish). Passive Open: - Save the listening socket's vnet in the driver's listen_ctx and switch to it when processing incoming SYNs for the socket. - Reject SYNs that arrive on an ifnet that's not in the same vnet as the listening socket. CLIP (Compressed Local IPv6) table: - Add only those IPv6 addresses to the CLIP that are in a vnet associated with one of the card's ifnets. Misc: - Set vnet from the toepcb when processing TCP state transitions. - The kernel sets the vnet when calling the driver's output routine so t4_push_frames runs in proper vnet context already. One exception is when incoming credits trigger tx within the driver's ithread. Set the vnet explicitly in do_fw4_ack for that case. MFC after: 3 days Sponsored by: Chelsio Communications
Notes
Notes: svn path=/head/; revision=311949
Diffstat (limited to 'sys/dev/cxgbe/tom/t4_connect.c')
-rw-r--r--sys/dev/cxgbe/tom/t4_connect.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c
index f2e4ad456ef4..bd78c7fced61 100644
--- a/sys/dev/cxgbe/tom/t4_connect.c
+++ b/sys/dev/cxgbe/tom/t4_connect.c
@@ -126,6 +126,7 @@ do_act_establish(struct sge_iq *iq, const struct rss_header *rss,
CTR3(KTR_CXGBE, "%s: atid %u, tid %u", __func__, atid, tid);
free_atid(sc, atid);
+ CURVNET_SET(toep->vnet);
INP_WLOCK(inp);
toep->tid = tid;
insert_tid(sc, tid, toep, inp->inp_vflag & INP_IPV6 ? 2 : 1);
@@ -141,6 +142,7 @@ do_act_establish(struct sge_iq *iq, const struct rss_header *rss,
make_established(toep, cpl->snd_isn, cpl->rcv_isn, cpl->tcp_opt);
done:
INP_WUNLOCK(inp);
+ CURVNET_RESTORE();
return (0);
}
@@ -178,6 +180,7 @@ act_open_failure_cleanup(struct adapter *sc, u_int atid, u_int status)
free_atid(sc, atid);
toep->tid = -1;
+ CURVNET_SET(toep->vnet);
if (status != EAGAIN)
INP_INFO_RLOCK(&V_tcbinfo);
INP_WLOCK(inp);
@@ -185,6 +188,7 @@ act_open_failure_cleanup(struct adapter *sc, u_int atid, u_int status)
final_cpl_received(toep); /* unlocks inp */
if (status != EAGAIN)
INP_INFO_RUNLOCK(&V_tcbinfo);
+ CURVNET_RESTORE();
}
/*
@@ -360,6 +364,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
if (wr == NULL)
DONT_OFFLOAD_ACTIVE_OPEN(ENOMEM);
+ toep->vnet = so->so_vnet;
if (sc->tt.ddp && (so->so_options & SO_NO_DDP) == 0)
set_tcpddp_ulp_mode(toep);
else