1. 05 2月, 2022 29 次提交
  2. 04 2月, 2022 11 次提交
    • D
      Merge branch 'ipa-RX-replenish' · c531adaf
      David S. Miller 提交于
      Alex Elder says:
      
      ====================
      net: ipa: improve RX buffer replenishing
      
      This series revises the algorithm used for replenishing receive
      buffers on RX endpoints.  Currently there are two atomic variables
      that track how many receive buffers can be sent to the hardware.
      The new algorithm obviates the need for those, by just assuming we
      always want to provide the hardware with buffers until it can hold
      no more.
      
      The first patch eliminates an atomic variable that's not required.
      The next moves some code into the main replenish function's caller,
      making one of the called function's arguments unnecessary.   The
      next six refactor things a bit more, adding a new helper function
      that allows us to eliminate an additional atomic variable.  And the
      final two implement two more minor improvements.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c531adaf
    • A
      net: ipa: determine replenish doorbell differently · 9654d8c4
      Alex Elder 提交于
      Rather than tracking the number of receive buffer transactions that
      have been submitted without a doorbell, just track the total number
      of transactions that have been issued.  Then ring the doorbell when
      that number modulo the replenish batch size is 0.
      
      The effect is roughly the same, but the new count is slightly more
      interesting, and this approach will someday allow the replenish
      batch size to be tuned at runtime.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9654d8c4
    • A
      net: ipa: replenish after delivering payload · 5d6ac24f
      Alex Elder 提交于
      Replenishing is now solely driven by whether transactions are
      available for a channel, and it doesn't really matter whether
      we replenish before or after we deliver received packets to the
      network stack.
      
      Replenishing before delivering the payload adds a little latency.
      Eliminate that by requesting a replenish after the payload is
      delivered.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d6ac24f
    • A
      net: ipa: kill replenish_backlog · 09b337de
      Alex Elder 提交于
      We no longer use the replenish_backlog atomic variable to decide
      when we've got work to do providing receive buffers to hardware.
      Basically, we try to keep the hardware as full as possible, all the
      time.  We keep supplying buffers until the hardware has no more
      space for them.
      
      As a result, we can get rid of the replenish_backlog field and the
      atomic operations performed on it.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      09b337de
    • A
      net: ipa: introduce gsi_channel_trans_idle() · 5fc7f9ba
      Alex Elder 提交于
      Create a new function that returns true if all transactions for a
      channel are available for use.
      
      Use it in ipa_endpoint_replenish_enable() to see whether to start
      replenishing, and in ipa_endpoint_replenish() to determine whether
      it's necessary after a failure to schedule delayed work to ensure a
      future replenish attempt occurs.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5fc7f9ba
    • A
      net: ipa: don't use replenish_backlog · d0ac30e7
      Alex Elder 提交于
      Rather than determining when to stop replenishing using the
      replenish backlog, just stop when we have exhausted all available
      transactions.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d0ac30e7
    • A
      net: ipa: allocate transaction in replenish loop · 6a606b90
      Alex Elder 提交于
      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: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a606b90
    • A
      net: ipa: decide on doorbell in replenish loop · b9dbabc5
      Alex Elder 提交于
      Decide whether the doorbell should be signaled when committing a
      replenish transaction in the main replenish loop, rather than in
      ipa_endpoint_replenish_one().  This is a step to facilitate the
      next patch.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b9dbabc5
    • A
      net: ipa: increment backlog in replenish caller · 4b22d841
      Alex Elder 提交于
      Three spots call ipa_endpoint_replenish(), and just one of those
      requests that the backlog be incremented after completing the
      replenish operation.
      
      Instead, have the caller increment the backlog, and get rid of the
      add_one argument to ipa_endpoint_replenish().
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4b22d841
    • A
      net: ipa: allocate transaction before pages when replenishing · b4061c13
      Alex Elder 提交于
      A transaction failure only occurs if no more transactions are
      available for an endpoint.  It's a very cheap test.
      
      When replenishing an RX endpoint buffer, there's no point in
      allocating pages if transactions are exhausted.  So don't bother
      doing so unless the transaction allocation succeeds.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b4061c13
    • A
      net: ipa: kill replenish_saved · a9bec7ae
      Alex Elder 提交于
      The replenish_saved field keeps track of the number of times a new
      buffer is added to the backlog when replenishing is disabled.  We
      don't really use it though, so there's no need for us to track it
      separately.  Whether replenishing is enabled or not, we can simply
      increment the backlog.
      
      Get rid of replenish_saved, and initialize and increment the backlog
      where it would have otherwise been used.
      Signed-off-by: NAlex Elder <elder@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a9bec7ae