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/net/sock.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/net/sock.h')
-rw-r--r-- | include/net/sock.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index a9ef3a6a13f3..6919276af8af 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -484,6 +484,8 @@ extern void sk_stream_kill_queues(struct sock *sk); | |||
484 | 484 | ||
485 | extern int sk_wait_data(struct sock *sk, long *timeo); | 485 | extern int sk_wait_data(struct sock *sk, long *timeo); |
486 | 486 | ||
487 | struct or_calltable; | ||
488 | |||
487 | /* Networking protocol blocks we attach to sockets. | 489 | /* Networking protocol blocks we attach to sockets. |
488 | * socket layer -> transport layer interface | 490 | * socket layer -> transport layer interface |
489 | * transport -> network interface is defined by struct inet_proto | 491 | * transport -> network interface is defined by struct inet_proto |
@@ -547,6 +549,8 @@ struct proto { | |||
547 | kmem_cache_t *slab; | 549 | kmem_cache_t *slab; |
548 | unsigned int obj_size; | 550 | unsigned int obj_size; |
549 | 551 | ||
552 | struct or_calltable *rsk_prot; | ||
553 | |||
550 | struct module *owner; | 554 | struct module *owner; |
551 | 555 | ||
552 | char name[32]; | 556 | char name[32]; |