1. 17 11月, 2021 1 次提交
  2. 29 10月, 2021 12 次提交
  3. 20 9月, 2021 1 次提交
    • M
      bnxt_en: Fix TX timeout when TX ring size is set to the smallest · 5bed8b07
      Michael Chan 提交于
      The smallest TX ring size we support must fit a TX SKB with MAX_SKB_FRAGS
      + 1.  Because the first TX BD for a packet is always a long TX BD, we
      need an extra TX BD to fit this packet.  Define BNXT_MIN_TX_DESC_CNT with
      this value to make this more clear.  The current code uses a minimum
      that is off by 1.  Fix it using this constant.
      
      The tx_wake_thresh to determine when to wake up the TX queue is half the
      ring size but we must have at least BNXT_MIN_TX_DESC_CNT for the next
      packet which may have maximum fragments.  So the comparison of the
      available TX BDs with tx_wake_thresh should be >= instead of > in the
      current code.  Otherwise, at the smallest ring size, we will never wake
      up the TX queue and will cause TX timeout.
      
      Fixes: c0c050c5 ("bnxt_en: New Broadcom ethernet driver.")
      Reviewed-by: NPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadocm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5bed8b07
  4. 01 9月, 2021 1 次提交
  5. 30 8月, 2021 5 次提交
    • E
      bnxt_en: support multiple HWRM commands in flight · 68f684e2
      Edwin Peer 提交于
      Add infrastructure to maintain a pending list of HWRM commands awaiting
      completion and reduce the scope of the hwrm_cmd_lock mutex so that it
      protects only the request mailbox. The mailbox is free to use for one
      or more concurrent commands after receiving deferred response events.
      
      For uniformity and completeness, use the same pending list for
      collecting completions for commands that respond via a completion ring.
      These commands are only used for freeing rings and for IRQ test and
      we only support one such command in flight.
      
      Note deferred responses are also only supported on the main channel.
      The secondary channel (KONG) does not support deferred responses.
      Signed-off-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      68f684e2
    • E
      bnxt_en: remove legacy HWRM interface · b34695a8
      Edwin Peer 提交于
      There are no longer any callers relying on the old API.
      Signed-off-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b34695a8
    • E
      bnxt_en: introduce new firmware message API based on DMA pools · f9ff5782
      Edwin Peer 提交于
      This change constitutes a major step towards supporting multiple
      firmware commands in flight by maintaining a separate response buffer
      for the duration of each request. These firmware commands are also
      known as Hardware Resource Manager (HWRM) commands.  Using separate
      response buffers requires an API change in order for callers to be
      able to free the buffer when done.
      
      It is impossible to keep the existing APIs unchanged.  The existing
      usage for a simple HWRM message request such as the following:
      
              struct input req = {0};
              bnxt_hwrm_cmd_hdr_init(bp, &req, REQ_TYPE, -1, -1);
              rc = hwrm_send_message(bp, &req, sizeof(req), HWRM_CMD_TIMEOUT);
              if (rc)
                      /* error */
      
      changes to:
      
               struct input *req;
               rc = hwrm_req_init(bp, req, REQ_TYPE);
               if (rc)
                       /* error */
               rc = hwrm_req_send(bp, req); /* consumes req */
               if (rc)
                       /* error */
      
      The key changes are:
      
      1. The req is no longer allocated on the stack.
      2. The caller must call hwrm_req_init() to allocate a req buffer and
         check for a valid buffer.
      3. The req buffer is automatically released when hwrm_req_send() returns.
      4. If the caller wants to check the firmware response, the caller must
         call hwrm_req_hold() to take ownership of the response buffer and
         release it afterwards using hwrm_req_drop().  The caller is no longer
         required to explicitly hold the hwrm_cmd_lock mutex to read the
         response.
      5. Because the firmware commands and responses all have different sizes,
         some safeguards are added to the code.
      
      This patch maintains legacy API compatibiltiy, implementing the old
      API in terms of the new.  The follow-on patches will convert all
      callers to use the new APIs.
      
      v2: Fix redefined writeq with parisc .config
          Fix "cast from pointer to integer of different size" warning in
      hwrm_calc_sentinel()
      Signed-off-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9ff5782
    • E
      bnxt_en: move HWRM API implementation into separate file · 3c8c20db
      Edwin Peer 提交于
      Move all firmware messaging functions and definitions to new
      bnxt_hwrm.[ch].  The follow-on patches will make major modifications
      to these APIs.
      Signed-off-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c8c20db
    • E
      bnxt_en: remove DMA mapping for KONG response · 6c172d59
      Edwin Peer 提交于
      The additional response buffer serves no useful purpose. There can
      be only one firmware command in flight due to the hwrm_cmd_lock mutex,
      which is taken for the entire duration of any command completion,
      KONG or otherwise. It is thus safe to share a single DMA buffer.
      
      Removing the code associated with the additional mapping will simplify
      matters in the next patch, which allocates response buffers from DMA
      pools on a per request basis.
      Signed-off-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6c172d59
  6. 28 8月, 2021 2 次提交
  7. 14 8月, 2021 1 次提交
  8. 03 8月, 2021 2 次提交
  9. 29 7月, 2021 2 次提交
  10. 29 6月, 2021 3 次提交
  11. 18 5月, 2021 1 次提交
  12. 26 4月, 2021 4 次提交
  13. 20 4月, 2021 1 次提交
  14. 23 3月, 2021 2 次提交
    • M
      bnxt_en: Enhance retry of the first message to the firmware. · 861aae78
      Michael Chan 提交于
      Two enhancements:
      
      1. Read the health status first before sending the first
      HWRM_VER_GET message to firmware instead of the other way around.
      This guarantees we got the accurate health status before we attempt
      to send the message.
      
      2. We currently only retry sending the first HWRM_VER_GET message to
      the firmware if the firmware is in the process of booting.  If the
      firmware is in error state and is doing core dump for example, the
      driver should also retry if the health register has the RECOVERING
      flag set.  This flag indicates the firmware will undergo recovery
      soon.  Modify the retry logic to retry for this case as well.
      Reviewed-by: NEdwin Peer <edwin.peer@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      861aae78
    • P
      bnxt_en: Improve wait for firmware commands completion · 80a9641f
      Pavan Chebbi 提交于
      In situations where FW has crashed, the bnxt_hwrm_do_send_msg() call
      will have to wait until timeout for each firmware message.  This
      generally takes about half a second for each firmware message.  If we
      try to unload the driver n this state, the unload sequence will take
      a long time to complete.
      
      Improve this by checking the health register if it is available and
      abort the wait for the firmware response if the register shows that
      firmware is not healthy.  The very first message HWRM_VER_GET is
      excluded from this check because that message is used to poll for
      firmware to come out of reset during error recovery.
      Signed-off-by: NPavan Chebbi <pavan.chebbi@broadcom.com>
      Signed-off-by: NMichael Chan <michael.chan@broadcom.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      80a9641f
  15. 15 2月, 2021 2 次提交