From: Ursula Braun <ubr...@linux.vnet.ibm.com>
Date: Tue, 14 Jul 2015 14:42:33 +0200

> diff --git a/include/linux/tcp.h b/include/linux/tcp.h
> index 48c3696..1b9a698 100644
> --- a/include/linux/tcp.h
> +++ b/include/linux/tcp.h
> @@ -90,15 +90,28 @@ struct tcp_options_received {
>               sack_ok : 4,    /* SACK seen on SYN packet              */
>               snd_wscale : 4, /* Window scaling received from sender  */
>               rcv_wscale : 4; /* Window scaling to send to receiver   */
> +     u8      smc_capability:1; /* SMC capability                     */
>       u8      num_sacks;      /* Number of SACK blocks                */
>       u16     user_mss;       /* mss requested by user in ioctl       */
>       u16     mss_clamp;      /* Maximal mss, negotiated at connection setup 
> */
>  };

This adds new space to this structure, which can be avoided.

sack_ok only actually needs 3 bits, not 4, then you can use the extra
bit for smc_capability.

> diff --git a/include/net/request_sock.h b/include/net/request_sock.h
> index 87935ca..dee47d2 100644
> --- a/include/net/request_sock.h
> +++ b/include/net/request_sock.h
> @@ -55,7 +55,8 @@ struct request_sock {
>       struct sock                     *rsk_listener;
>       u16                             mss;
>       u8                              num_retrans; /* number of retransmits */
> -     u8                              cookie_ts:1; /* syncookie: encode 
> tcpopts in timestamp */
> +     u8                              cookie_ts:1, /* syncookie: encode 
> tcpopts in timestamp */
> +                                     smc_capability:1;
>       u8                              num_timeout:7; /* number of timeouts */
>       /* The following two fields can be easily recomputed I think -AK */
>       u32                             window_clamp; /* window clamp at 
> creation time */

Again, similar situation here.

Please find a way to add your new boolean value without expanding the size of
this structure.  Here is it clear that a single u8 is fully consumed by the
cookie_ts and num_timeout bit fields.

> +#if IS_ENABLED(CONFIG_AFSMC)

I think this ifdef is completely pointless.

What do you think every Linux distribution is going to do for their kernels?
They are going to turn everything on.

So you need to find a way for your new feature to be nearly zero cost,
especially in the fast paths, assuming the code is enabled.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to