]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: allocate transaction in replenish loop
authorAlex Elder <elder@linaro.org>
Thu, 3 Feb 2022 17:09:22 +0000 (11:09 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Feb 2022 10:16:08 +0000 (10:16 +0000)
commit7db6548cd0dad423538ae75f57f8ca3895cbaf54
treed0db175c200941713b31ea822a4d9679606ffdd7
parent9c2b877fdebb937ca45f19776f96a5df81f9e491
net: ipa: allocate transaction in replenish loop

When replenishing, have ipa_endpoint_replenish() allocate a
transaction, and pass that to ipa_endpoint_replenish_one() to fill.
Then, if that produces no error, commit the transaction within the
replenish loop as well.  In this way we can distinguish between
transaction failures and buffer allocation/mapping failures.

Failure to allocate a transaction simply means the hardware already
has as many receive buffers as it can hold.  In that case we can
break out of the replenish loop because there's nothing more to do.

If we fail to allocate or map pages for the receive buffer, just
try again later.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/ipa_endpoint.c