OSDN Git Service

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)
commit6a606b90153b821915daade0b8f253d01d443d75
treed0db175c200941713b31ea822a4d9679606ffdd7
parentb9dbabc5ca84087862cc3ea21bb718d2ef99fa2f
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