1. 22 3月, 2017 8 次提交
  2. 15 3月, 2017 1 次提交
  3. 27 2月, 2017 1 次提交
    • M
      qed: Fix race with multiple VFs · fd3c615a
      Mintz, Yuval 提交于
      A PF syncronizes all IOV activity relating to its VFs
      by using a single workqueue handling the work.
      The workqueue would reach a bitmask of pending VF events
      and act upon each in turn.
      
      Problem is that the indication of a VF message [which sets
      the 'vf event' bit for that VF] arrives and is set in
      the slowpath attention context, which isn't syncronized with
      the processing of the events.
      When multiple VFs are present, it's possible that PF would
      lose the indication of one of the VF's pending evens, leading
      that VF to later timeout.
      
      Instead of adding locks/barriers, simply move from a bitmask
      into a per-VF indication inside that VF entry in the PF database.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fd3c615a
  4. 21 2月, 2017 1 次提交
    • M
      qed: Reflect PF link when initializing VF · 33b2fbd0
      Mintz, Yuval 提交于
      VF learns of the current link state via its bulletin board,
      which might reflect either the physical link state or some
      user-configured logical state.
      Whenever the physical link changes or whnever such a configuration
      is explicitly made by user the PF driver would update the bulletin
      that the VF reads. But if neither has happened - i.e., PF still
      hasn't got a physical link up and no additional configuration was
      done the VF wouldn't have a valid link information available.
      
      Simply reflect the physical link state whenever the VF is
      initialized. The user could then affect it however he wants.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      33b2fbd0
  5. 18 1月, 2017 1 次提交
  6. 02 1月, 2017 3 次提交
  7. 01 12月, 2016 1 次提交
    • 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
  8. 01 11月, 2016 1 次提交
    • M
      qed: Use VF-queue feature · 5a1f965a
      Mintz, Yuval 提交于
      Driver sets several restrictions about the number of supported VFs
      according to available HW/FW resources.
      This creates a problem as there are constellations which can't be
      supported [as limitation don't accurately describe the resources],
      as well as holes where enabling IOV would fail due to supposed
      lack of resources.
      
      This introduces a new interal feature - vf-queues, which would
      be used to lift some of the restriction and accurately enumerate
      the queues that can be used by a given PF's VFs.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a1f965a
  9. 14 10月, 2016 1 次提交
    • Y
      qed: Handle malicious VFs events · 7eff82b0
      Yuval Mintz 提交于
      Malicious VFs might be caught in several different methods:
        - Misusing their bar permission and being blocked by hardware.
        - Misusing their fastpath logic and being blocked by firmware.
        - Misusing their interaction with their PF via hw-channel,
          and being blocked by PF driver.
      
      On the first two items, firmware would indicate to driver that
      the VF is to be considered malicious, but would sometime still
      allow the VF to communicate with the PF [depending on the exact
      nature of the malicious activity done by the VF].
      The current existing logic on the PF side lacks handling of such events,
      and might allow the PF to perform some incorrect configuration on behalf
      of a VF that was previously indicated as malicious.
      
      The new scheme is simple -
      Once the PF determines a VF is malicious it would:
       a. Ignore any further requests on behalf of the VF-driver.
       b. Prevent any configurations initiated by the hyperuser for
          the malicious VF, as firmware isn't willing to serve such.
      
      The malicious indication would be cleared upon the VF flr,
      after which it would become usable once again.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@caviumnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7eff82b0
  10. 04 10月, 2016 1 次提交
  11. 10 9月, 2016 1 次提交
    • B
      qed: mark symbols static where possible · ba56947a
      Baoyou Xie 提交于
      We get a few warnings when building kernel with W=1:
      drivers/net/ethernet/qlogic/qed/qed_l2.c:112:5: warning: no previous prototype for 'qed_sp_vport_start' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_sriov.c:110:6: warning: no previous prototype for 'qed_iov_is_valid_vfid' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_sriov.c:188:5: warning: no previous prototype for 'qed_iov_post_vf_bulletin' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_sriov.c:578:6: warning: no previous prototype for 'qed_iov_set_vfs_to_disable' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_sriov.c:1135:28: warning: no previous prototype for 'qed_iov_get_public_vf_info' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_sriov.c:1148:6: warning: no previous prototype for 'qed_iov_clean_vf' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_sriov.c:2444:5: warning: no previous prototype for 'qed_iov_chk_ucast' [-Wmissing-prototypes]
      drivers/net/ethernet/qlogic/qed/qed_sriov.c:2762:5: warning: no previous prototype for 'qed_iov_vf_flr_cleanup' [-Wmissing-prototypes]
      ....
      
      In fact, these functions are only used in the file in which they are
      declared and don't need a declaration, but can be made static.
      so this patch marks these functions with 'static'.
      Signed-off-by: NBaoyou Xie <baoyou.xie@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba56947a
  12. 07 9月, 2016 1 次提交
    • J
      qed: Remove OOM messages · 2591c280
      Joe Perches 提交于
      These messages are unnecessary as OOM allocation failures already do
      a dump_stack() giving more or less the same information.
      
      $ size drivers/net/ethernet/qlogic/qed/built-in.o* (defconfig x86-64)
         text	   data	    bss	    dec	    hex	filename
       127817	  27969	  32800	 188586	  2e0aa	drivers/net/ethernet/qlogic/qed/built-in.o.new
       132474	  27969	  32800	 193243	  2f2db	drivers/net/ethernet/qlogic/qed/built-in.o.old
      
      Miscellanea:
      
      o Change allocs to the generally preferred forms where possible.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2591c280
  13. 23 8月, 2016 2 次提交
  14. 20 8月, 2016 1 次提交
    • Y
      qed: utilize FW 8.10.10.0 · 05fafbfb
      Yuval Mintz 提交于
      This new firmware for the qed* adpaters fixes several issues:
       - Better blocking of malicious VFs.
       - After FLR, Tx-switching [internal routing] of packets might
         be incorrect.
       - Deletion of unicast MAC filters would sometime have side-effect
         of corrupting the MAC filters configred for a device.
      It also contains fixes for future qed* drivers that *hopefully* would be
      sent for review in the near future.
      
      In addition, it would allow driver some new functionality, including:
       - Allowing PF/VF driver compaitibility with old drivers [running
         pre-8.10.5.0 firmware].
       - Better debug facilities.
      
      This would also bump the qed* driver versions to 8.10.9.20.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      05fafbfb
  15. 16 8月, 2016 1 次提交
  16. 31 7月, 2016 1 次提交
  17. 08 6月, 2016 6 次提交
    • Y
      qed: PF to reply to unknown messages · 54fdd80f
      Yuval Mintz 提交于
      If a future VF would send the PF an unknown message, the PF today would
      not send a reply. This would have 2 bad effects:
        a. VF would have to timeout on the request.
        b. If VF were to send an additional message to PF, firmware would mark
           it as malicious.
      
      Instead, if there's some valid reply-address on the message - let the PF
      answer and tell the VF it doesn't know the message.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      54fdd80f
    • Y
      qed: PF enforce MAC limitation of VFs · 8246d0b4
      Yuval Mintz 提交于
      The only limitation relating to MACs the PF enforce today on its VFs
      is in case it has a forced-unicast MAC address for them, in which case
      they can't configure other unicast addresses.
      Specifically, the PF isn't enforcing the number of MAC addresse a VF can
      configure regardless of the nubmer of such filters agreed upon by PF and
      VF during the acquisition process.
      
      PF's shadow-config is now extended to also contain information about its
      VFs' unicast addresses configuration, allowing such enforcement.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8246d0b4
    • Y
      qed: Move doorbell calculation from VF to PF · 5040acf5
      Yuval Mintz 提交于
      Today, the VF is aware of its queues context-ids, and calculates the
      doorbell address when opening its queues on its own.
      The configuration of doorbells in HW can sometime in the future be changed
      by the PF [hw has several configurable features that might affect doorbell
      addresses, e.g., dpm support], this would break compatibility with older
      VFs as their calculated doorbell addresses would be incorrect for such a
      configuration.
      
      In order to avoid such a backward compatibility failure, let the PF make
      the calculation of the doorbell offset based on the context-id, and pass
      that to the VF.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5040acf5
    • Y
      qed: Make PF more robust against malicious VF · 41086467
      Yuval Mintz 提交于
      There are several requests the VF can make toward the PF which the driver
      would pass to firmware without checking the validity first - specifically,
      opening queues and updating vports. Such configurations might cause the
      firmware to assert.
      
      This adds validation of the legality of said configurations on the PF side
      before passing it onward via ramrod to firmware.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41086467
    • Y
      qed: PF-VF resource negotiation · 1cf2b1a9
      Yuval Mintz 提交于
      One of the goals of the vf's first message to the PF [acquire]
      is to learn about the number of resources available to it [macs, vlans,
      etc.]. This is done via negotiation - the VF requires a set of resources,
      which the PF either approves or disaproves and sends a smaller set of
      resources as alternative. In this later case, the VF is then expected to
      either abort the probe or re-send the acquire message with less
      required resources.
      
      While this infrastructure exists since the initial submision of qed
      SRIOV support, it's in fact completely inoperational - PF isn't really
      looking into the resources the VF has asked for and is never going to
      reply to the VF that it lacks resources.
      
      This patch addresses this flow, fixing it and allowing the PF and VF
      to actually agree on a set of resources.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1cf2b1a9
    • Y
      qed: Relax VF firmware requirements · 1fe614d1
      Yuval Mintz 提交于
      Current driver require an exact match between VF and PF storm firmware;
      Any difference would fail the VF acquire message, causing the VF probe
      to be aborted.
      
      While there's still dependencies between the two, the recent FW submission
      has relaxed the match requirement - instead of an exact match, there's now
      a 'fastpath' HSI major/minor scheme, where VFs and PFs that match in their
      major number can co-exist even if their minor is different.
      
      In order to accomadate this change some changes in the vf-start init flow
      had to be made, as the VF start ramrod now has to be sent only after PF
      learns which fastpath HSI its VF is requiring.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1fe614d1
  18. 03 6月, 2016 1 次提交
    • Y
      qed: Utilize FW 8.10.3.0 · 351a4ded
      Yuval Mintz 提交于
      The New QED firmware contains several fixes, including:
        - Wrong classification of packets in 4-port devices.
        - Anti-spoof interoperability with encapsulated packets.
        - Tx-switching of encapsulated packets.
      It also slightly improves Tx performance of the device.
      
      In addition, this firmware contains the necessary logic for
      supporting iscsi & rdma, for which we plan on pushing protocol
      drivers in the imminent future.
      Signed-off-by: NYuval Mintz <Yuval.Mintz@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      351a4ded
  19. 17 5月, 2016 4 次提交
  20. 12 5月, 2016 3 次提交