1. 21 1月, 2017 1 次提交
    • A
      qed: avoid possible stack overflow in qed_ll2_acquire_connection · 0629a330
      Arnd Bergmann 提交于
      struct qed_ll2_info is rather large, so putting it on the stack
      can cause an overflow, as this warning tries to tell us:
      
      drivers/net/ethernet/qlogic/qed/qed_ll2.c: In function 'qed_ll2_start':
      drivers/net/ethernet/qlogic/qed/qed_ll2.c:2159:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      
      qed_ll2_start_ooo() already uses a dynamic allocation for the structure
      to work around that problem, and we could do the same in qed_ll2_start()
      as well as qed_roce_ll2_start(), but since the structure is only
      used to pass a couple of initialization values here, it seems nicer
      to replace it with a different structure.
      
      Lacking any idea for better naming, I'm adding 'struct qed_ll2_conn',
      which now contains all the initialization data, and this now simply
      gets copied into struct qed_ll2_info rather than assigning all members
      one by one.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0629a330
  2. 18 1月, 2017 1 次提交
  3. 02 1月, 2017 7 次提交
  4. 18 12月, 2016 1 次提交
  5. 14 12月, 2016 1 次提交
  6. 06 12月, 2016 1 次提交
  7. 03 12月, 2016 2 次提交
  8. 01 12月, 2016 2 次提交
    • M
      qed*: Handle-based L2-queues. · 3da7a37a
      Mintz, Yuval 提交于
      The driver needs to maintain several FW/HW-indices for each one of
      its queues. Currently, that mapping is done by the QED where it uses
      an rx/tx array of so-called hw-cids, populating them whenever a new
      queue is opened and clearing them upon destruction of said queues.
      
      This maintenance is far from ideal - there's no real reason why
      QED needs to maintain such a data-structure. It becomes even worse
      when considering the fact that the PF's queues and its child VFs' queues
      are all mapped into the same data-structure.
      As a by-product, the set of parameters an interface needs to supply for
      queue APIs is non-trivial, and some of the variables in the API
      structures have different meaning depending on their exact place
      in the configuration flow.
      
      This patch re-organizes the way L2 queues are configured and maintained.
      In short:
        - Required parameters for queue init are now well-defined.
        - Qed would allocate a queue-cid based on parameters.
          Upon initialization success, it would return a handle to caller.
        - Queue-handle would be maintained by entity requesting queue-init,
          not necessarily qed.
        - All further queue-APIs [update, destroy] would use the opaque
          handle as reference for the queue instead of various indices.
      
      The possible owners of such handles:
        - PF queues [qede] - complete handles based on provided configuration.
        - VF queues [qede] - fw-context-less handles, containing only relative
          information; Only the PF-side would need the absolute indices
          for configuration, so they're omitted here.
        - VF queues [qed, PF-side] - complete handles based on VF initialization.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3da7a37a
    • M
      qed: Optimize qed_chain datapath usage · 6d937acf
      Mintz, Yuval 提交于
      The chain structure and functions are widely used by the qed* modules,
      both for configuration and datapath.
      E.g., qede's Tx has one such chain and its Rx has two.
      
      Currently, the strucutre's fields which are required for datapath
      related functions [produce/consume] are intertwined with fields which
      are required only for configuration purposes [init/destroy/etc.].
      
      This patch re-arranges the chain structure so that all the fields which
      are required for datapath usage could reside in a single cacheline instead
      of the two which are required today.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6d937acf
  9. 11 11月, 2016 2 次提交
  10. 10 11月, 2016 1 次提交
    • M
      qed: Prevent stack corruption on MFW interaction · bb480242
      Mintz, Yuval 提交于
      Driver uses a union for copying data to & from management firmware
      when interacting with it.
      Problem is that the function always copies sizeof(union) while commit
      2edbff8d ("qed: Learn resources from management firmware") is casting
      a union elements which is of smaller size [24-byte instead of 88-bytes].
      
      Also, the union contains some inappropriate elements which increase its
      size [should have been 32-bytes]. While this shouldn't corrupt other
      PF messages to the MFW [as management firmware enforces permissions so
      that each PF is allowed to write only to its own mailbox] we fix this
      here as well.
      
      Fixes: 2edbff8d ("qed: Learn resources from management firmware")
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bb480242
  11. 01 11月, 2016 7 次提交
  12. 23 10月, 2016 2 次提交
  13. 19 10月, 2016 2 次提交
  14. 14 10月, 2016 8 次提交
  15. 13 10月, 2016 2 次提交