net/ena: use macros for ring index operations
authorMichal Krawczyk <mk@semihalf.com>
Wed, 8 Apr 2020 08:29:17 +0000 (10:29 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:07 +0000 (13:57 +0200)
commitc0006061fbe8df61a1caed0d578a0b416ab2166a
tree15035312ce94a00a86489d62307f1905a04042b4
parent7755060798de9c0146df8809926030ed47fc9086
net/ena: use macros for ring index operations

To improve code readability, abstraction was added for operating on IO
rings indexes.

Driver was defining local variable for ring mask in each function that
needed to operate on the ring indexes. Now it is being stored in the
ring as this value won't change unless size of the ring will change and
macros for advancing indexes using the mask has been added.

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Igor Chauskin <igorch@amazon.com>
Reviewed-by: Guy Tzalik <gtzalik@amazon.com>
drivers/net/ena/ena_ethdev.c
drivers/net/ena/ena_ethdev.h