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] [day] [month] [year] [list]
Message-ID: <61d558ac-8aa3-8dd4-cd18-e9bdd42650a7@intel.com>
Date:   Wed, 18 Jan 2023 13:01:18 -0800
From:   Jacob Keller <jacob.e.keller@...el.com>
To:     Jesper Dangaard Brouer <jbrouer@...hat.com>,
        <netdev@...r.kernel.org>
CC:     <brouer@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
        "David S. Miller" <davem@...emloft.net>, <edumazet@...gle.com>,
        <pabeni@...hat.com>
Subject: Re: [PATCH net-next] net: avoid irqsave in skb_defer_free_flush



On 1/18/2023 11:19 AM, Jesper Dangaard Brouer wrote:
> 
> On 17/01/2023 20.29, Jacob Keller wrote:
>>
>> On 1/17/2023 4:29 AM, Jesper Dangaard Brouer wrote:
>>> The spin_lock irqsave/restore API variant in skb_defer_free_flush can
>>> be replaced with the faster spin_lock irq variant, which doesn't need
>>> to read and restore the CPU flags.
>>>
>>> Using the unconditional irq "disable/enable" API variant is safe,
>>> because the skb_defer_free_flush() function is only called during
>>> NAPI-RX processing in net_rx_action(), where it is known the IRQs
>>> are enabled.
>>>
>>
>> Did you mean disabled here? If IRQs are enabled that would mean the
>> interrupt could be triggered and we would need to irqsave, no?
> 
> I do mean 'enabled' in the text here.
> 
> As you can see in net_rx_action() we are allowed to perform code like:
> 
> 	local_irq_disable();
> 	list_splice_init(&sd->poll_list, &list);
> 	local_irq_enable();
> 
> Disabling local IRQ without saving 'flags' and unconditionally enabling
> local IRQs again.  Thus, in skb_defer_free_flush() we can do the same,
> without saving 'flags'.  Hope it makes it more clear.
> 

Ahh, that makes sense.

In that case, no further nits and:

Reviewed-by: Jacob Keller <jacob.e.keller@...el.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ