From: Josef Bacik <jba...@fb.com>
Date: Thu, 22 Dec 2016 16:26:38 -0500

> @@ -74,12 +74,16 @@ struct inet_ehash_bucket {
>   * users logged onto your box, isn't it nice to know that new data
>   * ports are created in O(1) time?  I thought so. ;-)        -DaveM
>   */
> +#define FASTREUSEPORT_ANY    1
> +#define FASTREUSEPORT_STRICT 2
> +
>  struct inet_bind_bucket {
>       possible_net_t          ib_net;
>       unsigned short          port;
>       signed char             fastreuse;
>       signed char             fastreuseport;
>       kuid_t                  fastuid;
> +     struct sock_common      fastsock;
>       int                     num_owners;
>       struct hlist_node       node;
>       struct hlist_head       owners;

I understand why you did this fastsock thing, it's the easiest way out.

But it is so wasteful, but in space and time.  You have to store an entire fake
socket here, but there is not need for anything other than the recv saddr
member(s).

And you have to copy the whole thing to store the state, which again
is almost entirely unnecessary.

You really just need to store only the required state, and abstract the
AF specific bits properly.

Reply via email to