]> 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)
commit9638724bba415bc2e16eb3ef30b766ad4ab9e84c
treed0db175c200941713b31ea822a4d9679606ffdd7
parent6482dea0cba26929fe5a5c43d48fb64666a9533b
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