net/ena: rework getting number of available descriptors
authorMichal Krawczyk <mk@semihalf.com>
Wed, 8 Apr 2020 08:29:15 +0000 (10:29 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:07 +0000 (13:57 +0200)
commit74456796e0c3524d66e2d2bd73c2e95b7c52ddf2
treeb9d5303ddd21547bb21680f948b2eb701cd8bb98
parent1be097dc96e05a10966db1096feadf956e7f147e
net/ena: rework getting number of available descriptors

ena_com API should be preferred for getting number of used/available
descriptors unless extra calculation needs to be performed.

Some helper variables were added for storing values that are later
reused. Moreover, for limiting the value of sent/received packets to
the number of available descriptors, the RTE_MIN is used instead of
if function, which was doing similar thing but was less descriptive.

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