1. 26 7月, 2012 1 次提交
    • K
      mlx4: Add support for EEH error recovery · 57dbf29a
      Kleber Sacilotto de Souza 提交于
      Currently the mlx4 drivers don't have the necessary callbacks to
      implement EEH errors detection and recovery, so the PCI layer uses the
      probe and remove callbacks to try to recover the device after an error on
      the bus. However, these callbacks have race conditions with the internal
      catastrophic error recovery functions, which will also detect the error
      and this can cause the system to crash if both EEH and catas functions
      try to reset the device.
      
      This patch adds the necessary error recovery callbacks and makes sure
      that the internal catastrophic error functions will not try to reset the
      device in such scenarios. It also adds some calls to
      pci_channel_offline() to suppress reads/writes on the bus when the slot
      cannot accept I/O operations so we prevent unnecessary accesses to the
      bus and speed up the device removal.
      Signed-off-by: NKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
      Acked-by: NShlomo Pongratz <shlomop@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      57dbf29a
  2. 08 7月, 2012 1 次提交
  3. 01 6月, 2012 1 次提交
  4. 16 5月, 2012 2 次提交
  5. 20 3月, 2012 1 次提交
  6. 07 2月, 2012 1 次提交
  7. 05 2月, 2012 1 次提交
  8. 23 1月, 2012 1 次提交
  9. 20 12月, 2011 1 次提交
  10. 14 12月, 2011 6 次提交
    • J
      mlx4_core: Modify driver initialization flow to accommodate SRIOV for Ethernet · ab9c17a0
      Jack Morgenstein 提交于
      1. Added module parameters sr_iov and probe_vf for controlling enablement of
         SRIOV mode.
      2. Increased default max num-qps, num-mpts and log_num_macs to accomodate
         SRIOV mode
      3. Added port_type_array as a module parameter to allow driver startup with
         ports configured as desired.
         In SRIOV mode, only ETH is supported, and this array is ignored; otherwise,
         for the case where the FW supports both port types (ETH and IB), the
         port_type_array parameter is used.
         By default, the port_type_array is set to configure both ports as IB.
      4. When running in sriov mode, the master needs to initialize the ICM eq table
         to hold the eq's for itself and also for all the slaves.
      5. mlx4_set_port_mask() now invoked from mlx4_init_hca, instead of in mlx4_dev_cap.
      6. Introduced sriov VF (slave) device startup/teardown logic (mainly procedures
         mlx4_init_slave, mlx4_slave_exit, mlx4_slave_cap, mlx4_slave_exit and flow
         modifications in __mlx4_init_one, mlx4_init_hca, and mlx4_setup_hca).
         VFs obtain their startup information from the PF (master) device via the
         comm channel.
      7. In SRIOV mode (both PF and VF), MSI_X must be enabled, or the driver
         aborts loading the device.
      8. Do not allow setting port type via sysfs when running in SRIOV mode.
      9. mlx4_get_ownership:  Currently, only one PF is supported by the driver.
         If the HCA is burned with FW which enables more than one PF, only one
         of the PFs is allowed to run.  The first one up grabs a FW ownership
         semaphone -- all other PFs will find that semaphore taken, and the
         driver will not allow them to run.
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NYevgeny Petrilin <yevgenyp@mellanox.co.il>
      Signed-off-by: NLiran Liss <liranl@mellanox.co.il>
      Signed-off-by: NMarcel Apfelbaum <marcela@mellanox.co.il>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab9c17a0
    • E
      mlx4: Ethernet port management modifications · ffe455ad
      Eugenia Emantayev 提交于
      The physical port is now common to the PF and VFs.
      The port resources and configuration is managed by the PF, VFs can
      only influence the MTU of the port, it is set as max among all functions,
      Each function allocates RX buffers of required size to meet it's MTU enforcement.
      Port management code was moved to mlx4_core, as the mlx4_en module is
      virtualization unaware
      
      Move handling qp functionality to mlx4_get_eth_qp/mlx4_put_eth_qp
      including reserve/release range and add/release unicast steering.
      Let mlx4_register/unregister_mac deal only with MAC (un)registration.
      Signed-off-by: NEugenia Emantayev <eugenia@mellanox.co.il>
      Signed-off-by: NYevgeny Petrilin <yevgenyp@mellanox.co.il>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ffe455ad
    • E
      mlx4: Traffic steering management support for SRIOV · 0ec2c0f8
      Eugenia Emantayev 提交于
      Let multicast/unicast attaching flow go through resource tracker.
      The PF is the one responsible for managing all the steering entries.
      Define and use module parameter that determines the number of qps
      per multicast group.
      Minor changes in function calls according to changed prototype.
      Signed-off-by: NEugenia Emantayev <eugenia@mellanox.co.il>
      Signed-off-by: NYevgeny Petrilin <yevgenyp@mellanox.co.il>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0ec2c0f8
    • E
      mlx4_core: resource tracking for HCA resources used by guests · c82e9aa0
      Eli Cohen 提交于
      The resource tracker is used to track usage of HCA resources by the different
      guests.
      
      Virtual functions (VFs) are attached to guest operating systems but
      resources are allocated from the same pool and are assigned to VFs. It is
      essential that hostile/buggy guests not be able to affect the operation of
      other VFs, possibly attached to other guest OSs since ConnectX firmware is not
      tolerant to misuse of resources.
      
      The resource tracker module associates each resource with a VF and maintains
      state information for the allocated object. It also defines allowed state
      transitions and enforces them.
      
      Relationships between resources are also referred to. For example, CQs are
      pointed to by QPs, so it is forbidden to destroy a CQ if a QP refers to it.
      
      ICM memory is always accessible through the primary function and hence it is
      allocated by the owner of the primary function.
      
      When a guest dies, an FLR is generated for all the VFs it owns and all the
      resources it used are freed.
      
      The tracked resource types are: QPs, CQs, SRQs, MPTs, MTTs, MACs, RES_EQs,
      and XRCDNs.
      Signed-off-by: NEli Cohen <eli@mellanox.co.il>
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c82e9aa0
    • Y
      net/mlx4_core: Implement the master-slave communication channel · e8f081aa
      Yevgeny Petrilin 提交于
      When SRIOV is enabled, pf and vfs communicate via shared comm channel.
      The vf gets its side of the comm channel via a VF BAR.
      Each VF (slave) creates its vHCR (virtual HCA Command Register),
      Its DMA address is passed to the PF (master) using Communication Channel Register.
      The same Register is used to notify the master of commands posted by the
      slaves and for the master to pass events to the slaves, such as command completions
      and asynchronous events.
      
      The vHCR format is identical to the HCR format, except for the 'go' and 't' bits,
      which are reserved in the vHCR. Posting commands to the vHCR is identical to
      the way it is done with the HCR, albeit that the function/PF token fields are
      used instead of the HCR go bit.
      Specifically:
      - When the function prepares a new command in the vHCR, it issues the Post_vHCR_cmd
        communication channel command and toggles the value of the function token;
        when PF token has an equal value, the command has been accepted and a new command may be posted.
      - When the PF detects a Post_vHCR_cmd command, it concludes that a new command is available in the vHCR;
        after processing the command, the PF toggles the PF token to match the function token.
      
      When the 'e' bit is not set, the completion of a Post_vHCR_cmd command also indicates
      the completion the vHCR command. If, however, the 'e' bit is set, the completion of a
      Post_vHCR_cmd command only indicates that the vHCR command has been accepted for execution by the PF.
      
      Function commands are processed by the PF as follows:
      -DMA (using the ACCESS_MEM command) the vHCR image into a shadow buffer.
      -Validate that the opcode is non-privileged, and that the opcode- and input-modifiers are legal.
      -DMA the in-box (if required) into a shadow buffer.
      -Validate the command:
      	o Resource ranges (e.g., QP ranges).
      	o Partition key.
      	o Ranges of referenced resources (e.g., CQs within QP contexts).
      -If the 'e' bit is set
      	o complete the Post_vHCR_cmd command
      -Execute the command on the HCR.
      -DMA the results to the vHCR out-box (if required).
      -If the 'e' bit is set
      	o Indicate command completion by generating a completion event using the GEN_EQE command
      -Otherwise
      	o DMA the command status to the vHCR
      	o Complete the Post_vHCR_cmd command
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NYevgeny Petrillin <yevgenyp@mellanox.com>
      Signed-off-by: NLiran Liss <liranl@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e8f081aa
    • J
      mlx4_core: Add "native" argument to mlx4_cmd and its callers (where needed) · f9baff50
      Jack Morgenstein 提交于
      For SRIOV, some Hypervisor commands can be executed directly (native = 1).
      Others should go through the command wrapper flow (for tracking resource
      usage, for example, or for changing some HCA configurations that slaves
      need to be notified of).
      
      This patch sets the groundwork for this capability -- adding the correct
      value of "native" in each case.
      
      Note that if SRIOV is not activated, this parameter has no effect.
      Signed-off-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f9baff50
  11. 01 11月, 2011 1 次提交
  12. 11 8月, 2011 1 次提交
  13. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  14. 07 7月, 2009 1 次提交
    • Y
      mlx4_core: Handle multi-physical function devices · cc4ac2e7
      Yevgeny Petrilin 提交于
      MT26468 (PCI ID 0x6764) devices can expose multiple physical
      functions.  The current driver only handles the primary physical
      function.  For other functions, the QUERY_FW firmware command will
      fail with the CMD_STAT_MULTI_FUNC_REQ error code.  Don't try to drive
      such devices, but print a message saying the driver is skipping those
      devices rather than just "QUERY_FW command failed."
      Signed-off-by: NYevgeny Petrilin <yevgenyp@mellanox.co.il>
      
      [ Rather than keeping unsupported devices bound to the driver, simply
        print a more informative error message and exit - Roland ]
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      cc4ac2e7
  15. 26 7月, 2008 1 次提交
  16. 23 7月, 2008 1 次提交
  17. 17 4月, 2008 1 次提交
  18. 10 10月, 2007 2 次提交
    • R
      mlx4_core: Use mmiowb() to avoid firmware commands getting jumbled up · 2e61c646
      Roland Dreier 提交于
      Firmware commands are sent to the HCA by writing multiple words to a
      command register block.  Access to this block of registers is
      serialized with a mutex.  However, on large SGI systems writes to the
      register block may be reordered within the system interconnect and
      reach the HCA in a different order than they were issued (even with
      the mutex).  Fix this by adding an mmiowb() before dropping the mutex.
      
      This bug was observed with real workloads with the similar FW command
      code in the mthca driver, and adding the mmiowb() as in commit
      66547550 ("IB/mthca: Use mmiowb() to avoid firmware commands getting
      jumbled up") was confirmed to fix the problems, so we should add the
      same fix to mlx4.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      2e61c646
    • D
      mlx4_core: Use enum value GO_BIT_TIMEOUT_MSECS · 36ce10d3
      Dotan Barak 提交于
      Rename GO_BIT_TIMEOUT to GO_BIT_TIMEOUT_MSECS for clarity, and
      actually use it as the go bit timeout (instead of having the define
      but then ignoring it and using a hard-coded 10 * HZ for the actual
      timeout).
      Signed-off-by: NDotan Barak <dotanb@dev.mellanox.co.il>
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      36ce10d3
  19. 21 7月, 2007 1 次提交
    • R
      mlx4_core: Change command token on timeout · 0981582d
      Roland Dreier 提交于
          
      The FW command token is currently only updated on a command completion
      event. This means that on command timeout, the same token will be
      reused for new command, which results in a mess if the timed out
      command *does* eventually complete.
      
      This is the same change as the patch for mthca from Michael
      S. Tsirkin <mst@dev.mellanox.co.il> that was just merged.  It seems
      sensible to avoid gratuitous differences in FW command processing
      between mthca and mlx4.
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      0981582d
  20. 09 5月, 2007 1 次提交
    • R
      IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters · 225c7b1f
      Roland Dreier 提交于
      Add an InfiniBand driver for Mellanox ConnectX adapters.  Because
      these adapters can also be used as ethernet NICs and Fibre Channel 
      HBAs, the driver is split into two modules: 
       
        mlx4_core: Handles low-level things like device initialization and 
          processing firmware commands.  Also controls resource allocation 
          so that the InfiniBand, ethernet and FC functions can share a 
          device without stepping on each other. 
       
        mlx4_ib: Handles InfiniBand-specific things; plugs into the 
          InfiniBand midlayer. 
      Signed-off-by: NRoland Dreier <rolandd@cisco.com>
      225c7b1f