lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 23 Sep 2015 10:33:07 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Ahern <dsa@...ulusnetworks.com>
Cc:	netdev@...r.kernel.org
Subject: Re: [PATCH net-next 0/9 v2] net: Refactor ip_route_input_slow

On Wed, 2015-09-23 at 10:08 -0600, David Ahern wrote:
> On 9/23/15 9:30 AM, Eric Dumazet wrote:
> >
> > You also remove a lot of goto, but do not place likely() or unlikely()
> > clauses that would help compiler to emit the same optimal code.
> 
> I do not see where I have changed the likely/unlikely aspect of the 
> logic. Can you point to an example in the patches?
> 

Sure, I did for PATCH net-next 7/9

Copied here :

> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 0fdcb0539795..c23bb0965966 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1790,15 +1790,19 @@ static int ip_route_input_slow(struct sk_buff
*skb, __be32 daddr, __be32 saddr,
>       if (ipv4_is_lbcast(daddr) || (saddr == 0 && daddr == 0))
>               goto brd_input;
>  
> -     if (ipv4_is_zeronet(daddr))
> -             goto martian_destination;
> +     if (ipv4_is_zeronet(daddr)) {
> +             ip_handle_martian_dest(dev, in_dev, daddr, saddr);
> +             goto out;
> +     }
>  

As requested, here is an example of code for which compiler might
compile in a non efficient way, ie inserting code at the wrong place,
increasing icache pressure.

Removing a goto is removing an implicit unlikely.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ