From e13a0a527a82a9d4a76fd516acc591a2944ed4d1 Mon Sep 17 00:00:00 2001 From: lstewart Date: Sun, 12 Jul 2009 09:14:28 +0000 Subject: [PATCH] Pad the following TCP related structs to allow MFCs of upcoming features/fixes back to the 8 branch: tcp_var.h - struct sackhint - struct tcpcb - struct tcpstat The patch breaks the ABI. Bump __FreeBSD_version to 800102 accordingly. User space tools that rely on the size of any of these structs (e.g. sockstat) need to be recompiled. Reviewed by: rpaulo, sam, andre, rwatson Approved by: re & mentor (gnn) --- UPDATING | 7 +++++++ sys/netinet/tcp_var.h | 11 ++++++++++- sys/sys/param.h | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/UPDATING b/UPDATING index facb330320ac..99fd25bfd22b 100644 --- a/UPDATING +++ b/UPDATING @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8.x IS SLOW: to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20090712: + Padding has been added to struct tcpcb, sackhint and tcpstat in + to facilitate future MFCs and bug fixes whilst + maintainig the ABI. However, this change breaks the ABI, so bump + __FreeBSD_version to 800102. User space tools that rely on the size of + any of these structs (e.g. sockstat) need to be recompiled. + 20090630: The NFS_LEGACYRPC option has been removed along with the old kernel RPC implementation that this option selected. Kernel diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 3d5a2ac9e8f5..d0183585f57d 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -72,6 +72,9 @@ struct sackhole { struct sackhint { struct sackhole *nexthole; int sack_bytes_rexmit; + + int ispare; /* explicit pad for 64bit alignment */ + uint64_t _pad[2]; /* 1 sacked_bytes, 1 TBD */ }; struct tcptemp { @@ -99,6 +102,7 @@ do { \ */ struct tcpcb { struct tsegqe_head t_segq; /* segment reassembly queue */ + void *t_pspare[2]; /* new reassembly queue */ int t_segqlen; /* segment reassembly queue length */ int t_dupacks; /* consecutive dup acks recd */ @@ -190,10 +194,13 @@ struct tcpcb { int t_rttlow; /* smallest observerved RTT */ u_int32_t rfbuf_ts; /* recv buffer autoscaling timestamp */ int rfbuf_cnt; /* recv buffer autoscaling byte count */ - void *t_pspare[3]; /* toe usrreqs / toepcb * / congestion algo / 1 general use */ struct toe_usrreqs *t_tu; /* offload operations vector */ void *t_toe; /* TOE pcb pointer */ int t_bytes_acked; /* # bytes acked during current RTT */ + + int t_ispare; /* explicit pad for 64bit alignment */ + void *t_pspare2[6]; /* 2 CC / 4 TBD */ + uint64_t _pad[12]; /* 7 UTO, 5 TBD (1-2 CC/RTT?) */ }; /* @@ -460,6 +467,8 @@ struct tcpstat { u_long tcps_ecn_ect1; /* ECN Capable Transport */ u_long tcps_ecn_shs; /* ECN successful handshakes */ u_long tcps_ecn_rcwnd; /* # times ECN reduced the cwnd */ + + u_long _pad[12]; /* 6 UTO, 6 TBD */ }; #ifdef _KERNEL diff --git a/sys/sys/param.h b/sys/sys/param.h index 465d0941f3a7..890a5c9ff743 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 800101 /* Master, propagated to newvers */ +#define __FreeBSD_version 800102 /* Master, propagated to newvers */ #ifndef LOCORE #include