---------------------------------------------------------------------- r14761: kmacy | 2008-03-25 15:31:37 -0700 hide tcbinfo lock acquisitions in syncache wrapper functions ---------------------------------------------------------------------- === local/iwarp_crash_fix/sys/netinet/tcp_syncache.c ================================================================== --- local/iwarp_crash_fix/sys/netinet/tcp_syncache.c (revision 14760) +++ local/iwarp_crash_fix/sys/netinet/tcp_syncache.c (revision 14761) @@ -953,6 +953,19 @@ return (0); } +int +syncache_offload_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th, + struct socket **lsop, struct mbuf *m) +{ + int rc; + + INP_INFO_WLOCK(&tcbinfo); + rc = syncache_expand(inc, to, th, lsop, m); + INP_INFO_WLOCK(&tcbinfo); + + return (rc); +} + /* * Given a LISTEN socket and an inbound SYN request, add * this to the syn cache, and send back a segment: @@ -1423,6 +1436,9 @@ struct tcphdr *th, struct inpcb *inp, struct socket **lsop, struct toe_usrreqs *tu, void *toepcb) { + + INP_INFO_WLOCK(&tcbinfo); + INP_LOCK(inp); _syncache_add(inc, to, th, inp, lsop, NULL, tu, toepcb); } === local/iwarp_crash_fix/sys/netinet/tcp_syncache.h ================================================================== --- local/iwarp_crash_fix/sys/netinet/tcp_syncache.h (revision 14760) +++ local/iwarp_crash_fix/sys/netinet/tcp_syncache.h (revision 14761) @@ -38,6 +38,8 @@ void syncache_unreach(struct in_conninfo *, struct tcphdr *); int syncache_expand(struct in_conninfo *, struct tcpopt *, struct tcphdr *, struct socket **, struct mbuf *); +int syncache_offload_expand(struct in_conninfo *, struct tcpopt *, + struct tcphdr *, struct socket **, struct mbuf *); void syncache_add(struct in_conninfo *, struct tcpopt *, struct tcphdr *, struct inpcb *, struct socket **, struct mbuf *); void syncache_offload_add(struct in_conninfo *, struct tcpopt *, === local/iwarp_crash_fix/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ================================================================== --- local/iwarp_crash_fix/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c (revision 14760) +++ local/iwarp_crash_fix/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c (revision 14761) @@ -3178,8 +3178,6 @@ to.to_mss = mss; to.to_wscale = wsf; to.to_flags = (mss ? TOF_MSS : 0) | (wsf ? TOF_SCALE : 0) | (ts ? TOF_TS : 0) | (sack ? TOF_SACKPERM : 0); - INP_INFO_WLOCK(&tcbinfo); - inp_wlock(inp); syncache_offload_add(&inc, &to, &th, inp, &lso, &cxgb_toe_usrreqs, toep); } @@ -3543,7 +3541,6 @@ LIST_REMOVE(toep, synq_entry); SOCK_UNLOCK(so); - INP_INFO_WLOCK(&tcbinfo); if (!syncache_expand_establish_req(req, &so, toep)) { /* * No entry @@ -3557,11 +3554,6 @@ UNIMPLEMENTED(); } - /* - * XXX workaround for lack of syncache drop - */ - toepcb_release(toep); - tp = sototcpcb(so); inp_wlock(tp->t_inpcb); @@ -3587,7 +3579,11 @@ */ make_established(so, ntohl(req->snd_isn), ntohs(req->tcp_opt)); - INP_INFO_WUNLOCK(&tcbinfo); + + /* + * XXX workaround for lack of syncache drop + */ + toepcb_release(toep); inp_wunlock(tp->t_inpcb); CTR1(KTR_TOM, "do_pass_establish tid=%u", toep->tp_tid);