summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_offload.h13
-rw-r--r--sys/netinet/tcp_syncache.c21
-rw-r--r--sys/netinet/tcp_syncache.h6
-rw-r--r--sys/netinet/tcp_var.h6
4 files changed, 37 insertions, 9 deletions
diff --git a/sys/netinet/tcp_offload.h b/sys/netinet/tcp_offload.h
index d05ef46..48f35ff 100644
--- a/sys/netinet/tcp_offload.h
+++ b/sys/netinet/tcp_offload.h
@@ -184,6 +184,19 @@ struct toe_usrreqs {
void (*tu_syncache_event)(int event, void *toep);
};
+/*
+ * Proxy for struct tcpopt between TOE drivers and TCP functions.
+ */
+struct toeopt {
+ u_int64_t to_flags; /* see tcpopt in tcp_var.h */
+ u_int16_t to_mss; /* maximum segment size */
+ u_int8_t to_wscale; /* window scaling */
+
+ u_int8_t _pad1; /* explicit pad for 64bit alignment */
+ u_int32_t _pad2; /* explicit pad for 64bit alignment */
+ u_int64_t _pad3[4]; /* TBD */
+};
+
#define TOE_SC_ENTRY_PRESENT 1 /* 4-tuple already present */
#define TOE_SC_DROP 2 /* connection was timed out */
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c
index dc05f46..440115d 100644
--- a/sys/netinet/tcp_syncache.c
+++ b/sys/netinet/tcp_syncache.c
@@ -943,14 +943,20 @@ failed:
}
int
-tcp_offload_syncache_expand(struct in_conninfo *inc, struct tcpopt *to,
+tcp_offload_syncache_expand(struct in_conninfo *inc, struct toeopt *toeo,
struct tcphdr *th, struct socket **lsop, struct mbuf *m)
{
INIT_VNET_INET(curvnet);
+ struct tcpopt to;
int rc;
+
+ bzero(&to, sizeof(struct tcpopt));
+ to.to_mss = toeo->to_mss;
+ to.to_wscale = toeo->to_wscale;
+ to.to_flags = toeo->to_flags;
INP_INFO_WLOCK(&V_tcbinfo);
- rc = syncache_expand(inc, to, th, lsop, m);
+ rc = syncache_expand(inc, &to, th, lsop, m);
INP_INFO_WUNLOCK(&V_tcbinfo);
return (rc);
@@ -1437,15 +1443,22 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
}
void
-tcp_offload_syncache_add(struct in_conninfo *inc, struct tcpopt *to,
+tcp_offload_syncache_add(struct in_conninfo *inc, struct toeopt *toeo,
struct tcphdr *th, struct inpcb *inp, struct socket **lsop,
struct toe_usrreqs *tu, void *toepcb)
{
INIT_VNET_INET(curvnet);
+ struct tcpopt to;
+
+ bzero(&to, sizeof(struct tcpopt));
+ to.to_mss = toeo->to_mss;
+ to.to_wscale = toeo->to_wscale;
+ to.to_flags = toeo->to_flags;
INP_INFO_WLOCK(&V_tcbinfo);
INP_WLOCK(inp);
- _syncache_add(inc, to, th, inp, lsop, NULL, tu, toepcb);
+
+ _syncache_add(inc, &to, th, inp, lsop, NULL, tu, toepcb);
}
/*
diff --git a/sys/netinet/tcp_syncache.h b/sys/netinet/tcp_syncache.h
index 5ed0c9e..93c7aaa 100644
--- a/sys/netinet/tcp_syncache.h
+++ b/sys/netinet/tcp_syncache.h
@@ -34,6 +34,8 @@
#define _NETINET_TCP_SYNCACHE_H_
#ifdef _KERNEL
+struct toeopt;
+
void syncache_init(void);
#ifdef VIMAGE
void syncache_destroy(void);
@@ -41,11 +43,11 @@ void syncache_destroy(void);
void syncache_unreach(struct in_conninfo *, struct tcphdr *);
int syncache_expand(struct in_conninfo *, struct tcpopt *,
struct tcphdr *, struct socket **, struct mbuf *);
-int tcp_offload_syncache_expand(struct in_conninfo *inc, struct tcpopt *to,
+int tcp_offload_syncache_expand(struct in_conninfo *inc, struct toeopt *toeo,
struct tcphdr *th, struct socket **lsop, struct mbuf *m);
void syncache_add(struct in_conninfo *, struct tcpopt *,
struct tcphdr *, struct inpcb *, struct socket **, struct mbuf *);
-void tcp_offload_syncache_add(struct in_conninfo *, struct tcpopt *,
+void tcp_offload_syncache_add(struct in_conninfo *, struct toeopt *,
struct tcphdr *, struct inpcb *, struct socket **,
struct toe_usrreqs *tu, void *toepcb);
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index d018358..e802220 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -267,7 +267,7 @@ struct tcpcb {
* options in tcp_addoptions.
*/
struct tcpopt {
- u_long to_flags; /* which options are present */
+ u_int64_t to_flags; /* which options are present */
#define TOF_MSS 0x0001 /* maximum segment size */
#define TOF_SCALE 0x0002 /* window scaling */
#define TOF_SACKPERM 0x0004 /* SACK permitted */
@@ -277,11 +277,11 @@ struct tcpopt {
#define TOF_MAXOPT 0x0100
u_int32_t to_tsval; /* new timestamp */
u_int32_t to_tsecr; /* reflected timestamp */
+ u_char *to_sacks; /* pointer to the first SACK blocks */
+ u_char *to_signature; /* pointer to the TCP-MD5 signature */
u_int16_t to_mss; /* maximum segment size */
u_int8_t to_wscale; /* window scaling */
u_int8_t to_nsacks; /* number of SACK blocks */
- u_char *to_sacks; /* pointer to the first SACK blocks */
- u_char *to_signature; /* pointer to the TCP-MD5 signature */
};
/*
OpenPOWER on IntegriCloud