On Wed, 2005-03-16 at 23:15, Vivek Kashyap wrote:
> Signed-off-by: Vivek Kashyap <[EMAIL PROTECTED]>
>
>
> --- a/include/linux/tcp.h 2005-01-21 17:48:00.000000000 -0800
> +++ b/include/linux/tcp.h 2005-02-22 11:55:42.000000000 -0800
> @@ -127,6 +127,7 @@ enum {
> #define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
> #define TCP_INFO 11 /* Information about this connection. */
> #define TCP_QUICKACK 12 /* Block/reenable quick acks */
> +#define TCP_ACCEPTQ_SHARE 13 /* Set/get accept queue share */
>
> #define TCPI_OPT_TIMESTAMPS 1
> #define TCPI_OPT_SACK 2
> @@ -190,6 +191,18 @@ struct tcp_info
> __u32 tcpi_total_retrans;
> };
>
> +#define NUM_ACCEPT_QUEUES (1 << CONFIG_ACCEPT_QUEUES)
> +#define NUM_ACCEPT_QUEUES_BITS (NUM_ACCEPT_QUEUES-1)
> +#define ACCEPTQ_PERCENTILE 10 /* ratio in 1/10 increments */
> +
> +struct tcp_acceptq_info {
> + unsigned char acceptq_shares;
> + unsigned long acceptq_wait_time;
> + unsigned int acceptq_qcount;
> + unsigned int acceptq_count;
> +};
> +
> +
How about changing acceptq_shares to an int? The two alternative
acceptq interfaces (/rcfs and setsockopt) would then have a consistent
type used for shares.
The unsigned char will usually have padding between it and
acceptq_wait_time -- so using a char does not decrease the size of the
structure. The only advantage I can see is using a char is it saves
kernel stack space in tcp.c:setsockopt() -- but this appears to be
negligible (24 bytes by default, 3 * NUM_ACCEPT_QUEUES in general).
On a related note, since this structure gets passed between kernel and
userspace via get/setsockopt() I think 32/64-bit system call data
translation may be required for this structure (my recollection of when
it's required is a bit rusty unfortunately..). If the layout is
different for x86_64/em64t/IA64 architectures, is not
performance-sensitive, and you're not otherwise attached to the field
ordering, you might be able to avoid such problems by reordering the
fields.
Cheers,
-Matt Helsley
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech