[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALzJLG_q9gNwrS0yCemoCgkKi38FBkGEkMKTCg9Mij8oLyxgvw@mail.gmail.com>
Date: Sun, 5 Feb 2017 13:22:08 +0200
From: Saeed Mahameed <saeedm@....mellanox.co.il>
To: David Laight <David.Laight@...lab.com>
Cc: Saeed Mahameed <saeedm@...lanox.com>,
"David S. Miller" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [net-next 5/8] net/mlx5e: Calc vlan_tag_present only once on xmit
On Wed, Feb 1, 2017 at 1:20 PM, David Laight <David.Laight@...lab.com> wrote:
> From: Saeed Mahameed
>> Sent: 31 January 2017 20:59
>> Cache skb_vlan_tag_present(skb) and pass it wherever needed in xmit
>> routines.
> ...
>
> Does this actually generate better code?
Only in case skb pointer is kept in memory (we will save up to 3
skb->vlan_tci dereferences in that case).
> It is quite likely that your 'vlan_present' variable ends up being on stack.
> Whereas the 'skb' is likely to be in a register.
can i assume this to be likely true on all archs ?
> In which case the two loads are likely to be must the same and your
> change has added a write to the stack.
>
> David
>
>
Powered by blists - more mailing lists