net/ena: fix unneeded doorbell submission
authorJan Medala <jan@semihalf.com>
Fri, 8 Jul 2016 11:11:30 +0000 (13:11 +0200)
committerBruce Richardson <bruce.richardson@intel.com>
Fri, 8 Jul 2016 21:03:59 +0000 (23:03 +0200)
commit5e02e19eb14e2ab191a7e75a2f0b46a3b7c85cca
tree358fe6fe5c0cc3d12034a9b857d9068ddcbbd34d
parent620b173ae0f77c1a5af2592a27b5db8a6ce88bb6
net/ena: fix unneeded doorbell submission

Avoid submitting doorbell when:
* no packets have been submitted to TX
* no free resources have been submitted while RX

Sending doorbell without actual work to be performed by device
violates ENA specification and can lead to unpredictable behavior.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")

Signed-off-by: Alexander Matushevsky <matua@amazon.com>
Signed-off-by: Jan Medala <jan@semihalf.com>
drivers/net/ena/ena_ethdev.c