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)
commit89dd735e8c1e58b9b0d39535c7c32261773cb495
tree02a5c2c0d806ef0423cbaabb4ffb1bdf4bd66171
parent1e5847395eebfc98e89558c9f5d0058b949ddc1d
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