[Babel-users] babeld slashes kernel route manipulation performance by 17000%

Daniel Gröber dxld at darkboxed.org
Sat Apr 16 18:29:02 BST 2022


Hi Toke,

so I was debugging not seeing a performance improvement by your patch see
below

On Fri, Apr 15, 2022 at 12:48:05AM +0200, Toke Høiland-Jørgensen wrote:
> diff --git a/kernel_netlink.c b/kernel_netlink.c
> index efe1243c3b07..36aae29124a5 100644
> --- a/kernel_netlink.c
> +++ b/kernel_netlink.c
> @@ -236,7 +236,7 @@ static int nl_setup = 0;
>  static int
>  netlink_socket(struct netlink *nl, uint32_t groups)
>  {
> -    int rc;
> +    int rc, strict;
>      int rcvsize = 512 * 1024;
>  
>      nl->sock = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
> @@ -271,6 +271,9 @@ netlink_socket(struct netlink *nl, uint32_t groups)
>              perror("setsockopt(SO_RCVBUF)");
>          }
>      }
> +    rc = setsockopt(nl->sock, SOL_NETLINK, NETLINK_GET_STRICT_CHK, &strict, sizeof(strict));

You're using `strict` uninitialized here. If I set strict = 1 it works though :D

--Daniel



More information about the Babel-users mailing list