---------------------------------------------------------------------- r14760: kmacy | 2008-03-25 15:02:47 -0700 eliminate a couple of the simpler tcbinfo lock acquisitions using the new tcp_offload_* wrapper functions ---------------------------------------------------------------------- === 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 14759) +++ local/iwarp_crash_fix/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c (revision 14760) @@ -84,6 +84,8 @@ #include #include +#include + /* * For ULP connections HW may add headers, e.g., for digests, that aren't part * of the messages sent by the host but that are part of the TCP payload and @@ -2631,6 +2633,7 @@ { struct tcpcb *tp = sototcpcb(so); struct toepcb *toep = tp->t_toe; + int needclose = 0; #ifdef T3_TRACE T3_TRACE1(TIDTB(sk), @@ -2638,7 +2641,6 @@ sock_flag(sk, ABORT_RPL_PENDING)); #endif - INP_INFO_WLOCK(&tcbinfo); inp_wlock(tp->t_inpcb); if (toep->tp_flags & TP_ABORT_RPL_PENDING) { @@ -2654,14 +2656,15 @@ if (toep->tp_flags & TP_ABORT_REQ_RCVD) panic("TP_ABORT_REQ_RCVD set"); t3_release_offload_resources(toep); - tp = tcp_close(tp); + needclose = 1; } } } - if (tp) - inp_wunlock(tp->t_inpcb); - INP_INFO_WUNLOCK(&tcbinfo); + inp_wunlock(tp->t_inpcb); + if (needclose) + tcp_offload_close(tp); + m_free(m); } @@ -2898,7 +2901,8 @@ const struct cpl_abort_req_rss *req = cplhdr(m); struct tcpcb *tp = sototcpcb(so); struct toepcb *toep = tp->t_toe; - + int needclose = 0; + inp_wlock(tp->t_inpcb); if ((toep->tp_flags & TP_ABORT_REQ_RCVD) == 0) { toep->tp_flags |= (TP_ABORT_REQ_RCVD|TP_ABORT_SHUTDOWN); @@ -2930,13 +2934,15 @@ goto skip; t3_release_offload_resources(toep); - tp = tcp_close(tp); + needclose = 1; } - if (tp) - inp_wunlock(tp->t_inpcb); + inp_wunlock(tp->t_inpcb); + + if (needclose) + tcp_offload_close(tp); + send_abort_rpl(m, tdev, rst_status); return; - skip: inp_wunlock(tp->t_inpcb); } @@ -2994,9 +3000,7 @@ VALIDATE_SOCK(so); toepcb_hold(toep); - INP_INFO_WLOCK(&tcbinfo); process_abort_req(so, m, TOE_DEV(so)); - INP_INFO_WUNLOCK(&tcbinfo); toepcb_release(toep); return (0); }