1. 14 2月, 2020 1 次提交
  2. 12 2月, 2020 3 次提交
  3. 01 2月, 2020 2 次提交
    • J
      mm, tree-wide: rename put_user_page*() to unpin_user_page*() · f1f6a7dd
      John Hubbard 提交于
      In order to provide a clearer, more symmetric API for pinning and
      unpinning DMA pages.  This way, pin_user_pages*() calls match up with
      unpin_user_pages*() calls, and the API is a lot closer to being
      self-explanatory.
      
      Link: http://lkml.kernel.org/r/20200107224558.2362728-23-jhubbard@nvidia.comSigned-off-by: NJohn Hubbard <jhubbard@nvidia.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Cc: Björn Töpel <bjorn.topel@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
      Cc: Ira Weiny <ira.weiny@intel.com>
      Cc: Jason Gunthorpe <jgg@mellanox.com>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Leon Romanovsky <leonro@mellanox.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f1f6a7dd
    • J
      IB/{core,hw,umem}: set FOLL_PIN via pin_user_pages*(), fix up ODP · dfa0a4ff
      John Hubbard 提交于
      Convert infiniband to use the new pin_user_pages*() calls.
      
      Also, revert earlier changes to Infiniband ODP that had it using
      put_user_page().  ODP is "Case 3" in
      Documentation/core-api/pin_user_pages.rst, which is to say, normal
      get_user_pages() and put_page() is the API to use there.
      
      The new pin_user_pages*() calls replace corresponding get_user_pages*()
      calls, and set the FOLL_PIN flag.  The FOLL_PIN flag requires that the
      caller must return the pages via put_user_page*() calls, but infiniband
      was already doing that as part of an earlier commit.
      
      Link: http://lkml.kernel.org/r/20200107224558.2362728-14-jhubbard@nvidia.comSigned-off-by: NJohn Hubbard <jhubbard@nvidia.com>
      Reviewed-by: NJason Gunthorpe <jgg@mellanox.com>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Cc: Björn Töpel <bjorn.topel@intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
      Cc: Ira Weiny <ira.weiny@intel.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Kirill A. Shutemov <kirill@shutemov.name>
      Cc: Leon Romanovsky <leonro@mellanox.com>
      Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
      Cc: Mike Rapoport <rppt@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      dfa0a4ff
  4. 31 1月, 2020 1 次提交
    • J
      RDMA/core: Make the entire API tree static · 8889f6fa
      Jason Gunthorpe 提交于
      Compilation of mlx5 driver without CONFIG_INFINIBAND_USER_ACCESS generates
      the following error.
      
      on x86_64:
      
       ld: drivers/infiniband/hw/mlx5/main.o: in function `mlx5_ib_handler_MLX5_IB_METHOD_VAR_OBJ_ALLOC':
       main.c:(.text+0x186d): undefined reference to `ib_uverbs_get_ucontext_file'
       ld: drivers/infiniband/hw/mlx5/main.o:(.rodata+0x2480): undefined reference to `uverbs_idr_class'
       ld: drivers/infiniband/hw/mlx5/main.o:(.rodata+0x24d8): undefined reference to `uverbs_destroy_def_handler'
      
      This is happening because some parts of the UAPI description are not
      static. This is a hold over from earlier code that relied on struct
      pointers to refer to object types, now object types are referenced by
      number. Remove the unused globals and add statics to the remaining UAPI
      description elements.
      
      Remove the redundent #ifdefs around mlx5_ib_*defs and obsolete
      mlx5_ib_get_devx_tree().
      
      The compiler now trims alot more unused code, including the above
      problematic definitions when !CONFIG_INFINIBAND_USER_ACCESS.
      
      Fixes: 7be76bef ("IB/mlx5: Introduce VAR object and its alloc/destroy methods")
      Reported-by: NRandy Dunlap <rdunlap@infradead.org>
      Acked-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      8889f6fa
  5. 30 1月, 2020 1 次提交
  6. 28 1月, 2020 1 次提交
    • H
      IB/mlx4: Fix leak in id_map_find_del · ea660ad7
      Håkon Bugge 提交于
      Using CX-3 virtual functions, either from a bare-metal machine or
      pass-through from a VM, MAD packets are proxied through the PF driver.
      
      Since the VF drivers have separate name spaces for MAD Transaction Ids
      (TIDs), the PF driver has to re-map the TIDs and keep the book keeping in
      a cache.
      
      Following the RDMA Connection Manager (CM) protocol, it is clear when an
      entry has to evicted from the cache. When a DREP is sent from
      mlx4_ib_multiplex_cm_handler(), id_map_find_del() is called. Similar when
      a REJ is received by the mlx4_ib_demux_cm_handler(), id_map_find_del() is
      called.
      
      This function wipes out the TID in use from the IDR or XArray and removes
      the id_map_entry from the table.
      
      In short, it does everything except the topping of the cake, which is to
      remove the entry from the list and free it. In other words, for the REJ
      case enumerated above, one id_map_entry will be leaked.
      
      For the other case above, a DREQ has been received first. The reception of
      the DREQ will trigger queuing of a delayed work to delete the
      id_map_entry, for the case where the VM doesn't send back a DREP.
      
      In the normal case, the VM _will_ send back a DREP, and id_map_find_del()
      will be called.
      
      But this scenario introduces a secondary leak. First, when the DREQ is
      received, a delayed work is queued. The VM will then return a DREP, which
      will call id_map_find_del(). As stated above, this will free the TID used
      from the XArray or IDR. Now, there is window where that particular TID can
      be re-allocated, lets say by an outgoing REQ. This TID will later be wiped
      out by the delayed work, when the function id_map_ent_timeout() is
      called. But the id_map_entry allocated by the outgoing REQ will not be
      de-allocated, and we have a leak.
      
      Both leaks are fixed by removing the id_map_find_del() function and only
      using schedule_delayed(). Of course, a check in schedule_delayed() to see
      if the work already has been queued, has been added.
      
      Another benefit of always using the delayed version for deleting entries,
      is that we do get a TimeWait effect; a TID no longer in use, will occupy
      the XArray or IDR for CM_CLEANUP_CACHE_TIMEOUT time, without any ability
      of being re-used for that time period.
      
      Fixes: 3cf69cc8 ("IB/mlx4: Add CM paravirtualization")
      Link: https://lore.kernel.org/r/20200123155521.1212288-1-haakon.bugge@oracle.comSigned-off-by: NHåkon Bugge <haakon.bugge@oracle.com>
      Signed-off-by: NManjunath Patil <manjunath.b.patil@oracle.com>
      Reviewed-by: NRama Nichanamatlu <rama.nichanamatlu@oracle.com>
      Reviewed-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      ea660ad7
  7. 26 1月, 2020 2 次提交
    • N
      IB/hfi1: Fix logical condition in msix_request_irq · 79ba4f93
      Nathan Chancellor 提交于
      Clang warns:
      
      drivers/infiniband/hw/hfi1/msix.c:136:22: warning: overlapping
      comparisons always evaluate to false [-Wtautological-overlap-compare]
              if (type < IRQ_SDMA && type >= IRQ_OTHER)
                  ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      1 warning generated.
      
      It is impossible for something to be less than 0 (IRQ_SDMA) and greater
      than or equal to 3 (IRQ_OTHER) at the same time. A logical OR should
      have been used to keep the same logic as before.
      
      Link: https://lore.kernel.org/r/20200116222658.5285-1-natechancellor@gmail.com
      Link: https://github.com/ClangBuiltLinux/linux/issues/841
      Fixes: 13d2a838 ("IB/hfi1: Decouple IRQ name from type")
      Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Acked-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      79ba4f93
    • D
      IB/mlx5: Return the administrative GUID if exists · 4bbd4923
      Danit Goldberg 提交于
      A user can change the operational GUID (a.k.a affective GUID) through
      link/infiniband. Therefore it is preferred to return the currently set
      GUID if it exists instead of the operational.
      
      This way the PF can query which VF GUID will be set in the next bind.  In
      order to align with MAC address, zero is returned if administrative GUID
      is not set.
      
      For example, before setting administrative GUID:
       $ ip link show
       ib0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 4092 qdisc mq state UP mode DEFAULT group default qlen 256
       link/infiniband 00:00:00:08:fe:80:00:00:00:00:00:00:52:54:00:c0:fe:12:34:55 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
       vf 0     link/infiniband 00:00:00:08:fe:80:00:00:00:00:00:00:52:54:00:c0:fe:12:34:55 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff,
       spoof checking off, NODE_GUID 00:00:00:00:00:00:00:00, PORT_GUID 00:00:00:00:00:00:00:00, link-state auto, trust off, query_rss off
      
      Then:
      
       $ ip link set ib0 vf 0 node_guid 11:00:af:21:cb:05:11:00
       $ ip link set ib0 vf 0 port_guid 22:11:af:21:cb:05:11:00
      
      After setting administrative GUID:
       $ ip link show
       ib0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 4092 qdisc mq state UP mode DEFAULT group default qlen 256
       link/infiniband 00:00:00:08:fe:80:00:00:00:00:00:00:52:54:00:c0:fe:12:34:55 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff
       vf 0     link/infiniband 00:00:00:08:fe:80:00:00:00:00:00:00:52:54:00:c0:fe:12:34:55 brd 00:ff:ff:ff:ff:12:40:1b:ff:ff:00:00:00:00:00:00:ff:ff:ff:ff,
       spoof checking off, NODE_GUID 11:00:af:21:cb:05:11:00, PORT_GUID 22:11:af:21:cb:05:11:00, link-state auto, trust off, query_rss off
      
      Fixes: 9c0015ef ("IB/mlx5: Implement callbacks for getting VFs GUID attributes")
      Link: https://lore.kernel.org/r/20200116120048.12744-1-leon@kernel.orgSigned-off-by: NDanit Goldberg <danitg@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      4bbd4923
  8. 17 1月, 2020 5 次提交
  9. 16 1月, 2020 13 次提交
  10. 14 1月, 2020 3 次提交
  11. 13 1月, 2020 3 次提交
  12. 10 1月, 2020 5 次提交