Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F164959294
D29503.id86632.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29503.id86632.diff
View Options
diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c
--- a/sys/dev/cxgbe/tom/t4_cpl_io.c
+++ b/sys/dev/cxgbe/tom/t4_cpl_io.c
@@ -1260,6 +1260,7 @@
break;
case TCPS_FIN_WAIT_2:
+ restore_so_proto(so, inp->inp_vflag & INP_IPV6);
tcp_twstart(tp);
INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */
NET_EPOCH_EXIT(et);
@@ -1320,6 +1321,7 @@
switch (tp->t_state) {
case TCPS_CLOSING: /* see TCPS_FIN_WAIT_2 in do_peer_close too */
+ restore_so_proto(so, inp->inp_vflag & INP_IPV6);
tcp_twstart(tp);
release:
INP_UNLOCK_ASSERT(inp); /* safe, we have a ref on the inp */
diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h
--- a/sys/dev/cxgbe/tom/t4_tom.h
+++ b/sys/dev/cxgbe/tom/t4_tom.h
@@ -352,6 +352,7 @@
struct toepcb *hold_toepcb(struct toepcb *);
void free_toepcb(struct toepcb *);
void offload_socket(struct socket *, struct toepcb *);
+void restore_so_proto(struct socket *, bool);
void undo_offload_socket(struct socket *);
void final_cpl_received(struct toepcb *);
void insert_tid(struct adapter *, int, void *, int);
diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c
--- a/sys/dev/cxgbe/tom/t4_tom.c
+++ b/sys/dev/cxgbe/tom/t4_tom.c
@@ -79,9 +79,11 @@
#include "tom/t4_tom.h"
#include "tom/t4_tls.h"
+static struct protosw *tcp_protosw;
static struct protosw toe_protosw;
static struct pr_usrreqs toe_usrreqs;
+static struct protosw *tcp6_protosw;
static struct protosw toe6_protosw;
static struct pr_usrreqs toe6_usrreqs;
@@ -263,6 +265,15 @@
mtx_unlock(&td->toep_list_lock);
}
+void
+restore_so_proto(struct socket *so, bool v6)
+{
+ if (v6)
+ so->so_proto = tcp6_protosw;
+ else
+ so->so_proto = tcp_protosw;
+}
+
/* This is _not_ the normal way to "unoffload" a socket. */
void
undo_offload_socket(struct socket *so)
@@ -282,6 +293,7 @@
sb = &so->so_rcv;
SOCKBUF_LOCK(sb);
sb->sb_flags &= ~SB_NOCOALESCE;
+ restore_so_proto(so, inp->inp_vflag & INP_IPV6);
SOCKBUF_UNLOCK(sb);
tp->tod = NULL;
@@ -1837,8 +1849,6 @@
static int
t4_tom_mod_load(void)
{
- struct protosw *tcp_protosw, *tcp6_protosw;
-
/* CPL handlers */
t4_register_cpl_handler(CPL_GET_TCB_RPL, do_get_tcb_rpl);
t4_register_shared_cpl_handler(CPL_L2T_WRITE_RPL, do_l2t_write_rpl2,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 6, 3:14 AM (7 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36009416
Default Alt Text
D29503.id86632.diff (2 KB)
Attached To
Mode
D29503: cxgbe/t4_tom: restore socket's protosw before entering TIME_WAIT.
Attached
Detach File
Event Timeline
Log In to Comment