]> git.baikalelectronics.ru Git - kernel.git/commit
net: ena: aggregate stats increase into a function
authorShay Agroskin <shayagr@amazon.com>
Tue, 8 Dec 2020 18:02:04 +0000 (20:02 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 9 Dec 2020 23:26:40 +0000 (15:26 -0800)
commit8e3eb5526d2a30cbec7b94e76466c5cf45818224
tree02a5c2c0d806ef0423cbaabb4ffb1bdf4bd66171
parentfda272832c68461cfbe1f73914afc324af138976
net: ena: aggregate stats increase into a function

Introduce ena_increase_stat() function to increase statistics by a
certain number.
The function includes the
    - lock aquire (on 32bit machines)
    - stat increase
    - lock release (on 32bit machines)

line sequence that is ubiquitous across the driver.

The function increases a single stat at a time and several stats which
are increased together weren't put into a function to avoid
calling the function several times for each stat which looks bad and
might decrease performance.

Signed-off-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amazon/ena/ena_netdev.c