diff options
| author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2005-06-19 01:46:52 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2005-06-19 01:46:52 -0400 |
| commit | 2e6599cb899ba4b133f42cbf9d2b1883d2dc583a (patch) | |
| tree | b5d4fcca4d2a515fc3d3d20cefaaeebd8dbf661f /include/linux/ip.h | |
| parent | 1944972d3bb651474a5021c9da8d0166ae19f1eb (diff) | |
[NET] Generalise TCP's struct open_request minisock infrastructure
Kept this first changeset minimal, without changing existing names to
ease peer review.
Basicaly tcp_openreq_alloc now receives the or_calltable, that in turn
has two new members:
->slab, that replaces tcp_openreq_cachep
->obj_size, to inform the size of the openreq descendant for
a specific protocol
The protocol specific fields in struct open_request were moved to a
class hierarchy, with the things that are common to all connection
oriented PF_INET protocols in struct inet_request_sock, the TCP ones
in tcp_request_sock, that is an inet_request_sock, that is an
open_request.
I.e. this uses the same approach used for the struct sock class
hierarchy, with sk_prot indicating if the protocol wants to use the
open_request infrastructure by filling in sk_prot->rsk_prot with an
or_calltable.
Results? Performance is improved and TCP v4 now uses only 64 bytes per
open request minisock, down from 96 without this patch :-)
Next changeset will rename some of the structs, fields and functions
mentioned above, struct or_calltable is way unclear, better name it
struct request_sock_ops, s/struct open_request/struct request_sock/g,
etc.
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ip.h')
| -rw-r--r-- | include/linux/ip.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/ip.h b/include/linux/ip.h index 8438c68591..d5b7c90720 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
| @@ -81,6 +81,7 @@ | |||
| 81 | #ifdef __KERNEL__ | 81 | #ifdef __KERNEL__ |
| 82 | #include <linux/config.h> | 82 | #include <linux/config.h> |
| 83 | #include <linux/types.h> | 83 | #include <linux/types.h> |
| 84 | #include <net/request_sock.h> | ||
| 84 | #include <net/sock.h> | 85 | #include <net/sock.h> |
| 85 | #include <linux/igmp.h> | 86 | #include <linux/igmp.h> |
| 86 | #include <net/flow.h> | 87 | #include <net/flow.h> |
| @@ -107,6 +108,26 @@ struct ip_options { | |||
| 107 | 108 | ||
| 108 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) | 109 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) |
| 109 | 110 | ||
| 111 | struct inet_request_sock { | ||
| 112 | struct open_request req; | ||
| 113 | u32 loc_addr; | ||
| 114 | u32 rmt_addr; | ||
| 115 | u16 rmt_port; | ||
| 116 | u16 snd_wscale : 4, | ||
| 117 | rcv_wscale : 4, | ||
| 118 | tstamp_ok : 1, | ||
| 119 | sack_ok : 1, | ||
| 120 | wscale_ok : 1, | ||
| 121 | ecn_ok : 1, | ||
| 122 | acked : 1; | ||
| 123 | struct ip_options *opt; | ||
| 124 | }; | ||
| 125 | |||
| 126 | static inline struct inet_request_sock *inet_rsk(const struct open_request *sk) | ||
| 127 | { | ||
| 128 | return (struct inet_request_sock *)sk; | ||
| 129 | } | ||
| 130 | |||
| 110 | struct ipv6_pinfo; | 131 | struct ipv6_pinfo; |
| 111 | 132 | ||
| 112 | struct inet_sock { | 133 | struct inet_sock { |
