Deleted Added
full compact
t4_cpl_io.c (242671) t4_cpl_io.c (243680)
1/*-
2 * Copyright (c) 2012 Chelsio Communications, Inc.
3 * All rights reserved.
4 * Written by: Navdeep Parhar <np@FreeBSD.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 Chelsio Communications, Inc.
3 * All rights reserved.
4 * Written by: Navdeep Parhar <np@FreeBSD.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_cpl_io.c 242671 2012-11-06 20:22:39Z np $");
29__FBSDID("$FreeBSD: head/sys/dev/cxgbe/tom/t4_cpl_io.c 243680 2012-11-29 19:10:04Z np $");
30
31#include "opt_inet.h"
32
33#ifdef TCP_OFFLOAD
34#include <sys/param.h>
35#include <sys/types.h>
36#include <sys/kernel.h>
37#include <sys/ktr.h>

--- 743 unchanged lines hidden (view full) ---

781 struct sockbuf *sb;
782#ifdef INVARIANTS
783 unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl)));
784#endif
785
786 KASSERT(opcode == CPL_PEER_CLOSE,
787 ("%s: unexpected opcode 0x%x", __func__, opcode));
788 KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__));
30
31#include "opt_inet.h"
32
33#ifdef TCP_OFFLOAD
34#include <sys/param.h>
35#include <sys/types.h>
36#include <sys/kernel.h>
37#include <sys/ktr.h>

--- 743 unchanged lines hidden (view full) ---

781 struct sockbuf *sb;
782#ifdef INVARIANTS
783 unsigned int opcode = G_CPL_OPCODE(be32toh(OPCODE_TID(cpl)));
784#endif
785
786 KASSERT(opcode == CPL_PEER_CLOSE,
787 ("%s: unexpected opcode 0x%x", __func__, opcode));
788 KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__));
789
790 if (__predict_false(toep->flags & TPF_SYNQE)) {
791#ifdef INVARIANTS
792 struct synq_entry *synqe = (void *)toep;
793
794 INP_WLOCK(synqe->lctx->inp);
795 if (synqe->flags & TPF_SYNQE_HAS_L2TE) {
796 KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN,
797 ("%s: listen socket closed but tid %u not aborted.",
798 __func__, tid));
799 } else {
800 /*
801 * do_pass_accept_req is still running and will
802 * eventually take care of this tid.
803 */
804 }
805 INP_WUNLOCK(synqe->lctx->inp);
806#endif
807 CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid,
808 toep, toep->flags);
809 return (0);
810 }
811
789 KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__));
790
791 INP_INFO_WLOCK(&V_tcbinfo);
792 INP_WLOCK(inp);
793 tp = intotcpcb(inp);
794
795 CTR5(KTR_CXGBE, "%s: tid %u (%s), toep_flags 0x%x, inp %p", __func__,
796 tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, inp);

--- 290 unchanged lines hidden (view full) ---

1087 struct toepcb *toep = lookup_tid(sc, tid);
1088 struct inpcb *inp = toep->inp;
1089 struct tcpcb *tp;
1090 struct socket *so;
1091 struct sockbuf *sb;
1092 int len;
1093
1094 if (__predict_false(toep->flags & TPF_SYNQE)) {
812 KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__));
813
814 INP_INFO_WLOCK(&V_tcbinfo);
815 INP_WLOCK(inp);
816 tp = intotcpcb(inp);
817
818 CTR5(KTR_CXGBE, "%s: tid %u (%s), toep_flags 0x%x, inp %p", __func__,
819 tid, tp ? tcpstates[tp->t_state] : "no tp", toep->flags, inp);

--- 290 unchanged lines hidden (view full) ---

1110 struct toepcb *toep = lookup_tid(sc, tid);
1111 struct inpcb *inp = toep->inp;
1112 struct tcpcb *tp;
1113 struct socket *so;
1114 struct sockbuf *sb;
1115 int len;
1116
1117 if (__predict_false(toep->flags & TPF_SYNQE)) {
1095 /*
1096 * do_pass_establish failed and must be attempting to abort the
1097 * synqe's tid. Meanwhile, the T4 has sent us data for such a
1098 * connection.
1099 */
1100 KASSERT(toep->flags & TPF_ABORT_SHUTDOWN,
1101 ("%s: synqe and tid isn't being aborted.", __func__));
1118#ifdef INVARIANTS
1119 struct synq_entry *synqe = (void *)toep;
1120
1121 INP_WLOCK(synqe->lctx->inp);
1122 if (synqe->flags & TPF_SYNQE_HAS_L2TE) {
1123 KASSERT(synqe->flags & TPF_ABORT_SHUTDOWN,
1124 ("%s: listen socket closed but tid %u not aborted.",
1125 __func__, tid));
1126 } else {
1127 /*
1128 * do_pass_accept_req is still running and will
1129 * eventually take care of this tid.
1130 */
1131 }
1132 INP_WUNLOCK(synqe->lctx->inp);
1133#endif
1134 CTR4(KTR_CXGBE, "%s: tid %u, synqe %p (0x%x)", __func__, tid,
1135 toep, toep->flags);
1102 m_freem(m);
1103 return (0);
1104 }
1105
1106 KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__));
1107
1108 /* strip off CPL header */
1109 m_adj(m, sizeof(*cpl));

--- 316 unchanged lines hidden ---
1136 m_freem(m);
1137 return (0);
1138 }
1139
1140 KASSERT(toep->tid == tid, ("%s: toep tid mismatch", __func__));
1141
1142 /* strip off CPL header */
1143 m_adj(m, sizeof(*cpl));

--- 316 unchanged lines hidden ---