Skip to content
Snippets Groups Projects
  1. Jun 18, 2018
    • Bharat Potnuri's avatar
      RDMA/core: Save kernel caller name when creating CQ using ib_create_cq() · 7350cdd0
      Bharat Potnuri authored
      
      Few kernel applications like SCST-iSER create CQ using ib_create_cq(),
      where accessing CQ structures using rdma restrack tool leads to below NULL
      pointer dereference. This patch saves caller kernel module name similar to
      ib_alloc_cq().
      
      BUG: unable to handle kernel NULL pointer dereference at           (null)
      IP: [<ffffffff8132ca70>] skip_spaces+0x30/0x30
      PGD 738bac067 PUD 8533f0067 PMD 0
      Oops: 0000 [#1] SMP
      R10: ffff88017fc03300 R11: 0000000000000246 R12: 0000000000000000
      R13: ffff88082fa5a668 R14: ffff88017475a000 R15: 0000000000000000
      FS:  00002b32726582c0(0000) GS:ffff88087fc40000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000000 CR3: 00000008491a1000 CR4: 00000000003607e0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      Call Trace:
       [<ffffffffc05af69c>] ? fill_res_name_pid+0x7c/0x90 [ib_core]
       [<ffffffffc05af79f>] fill_res_cq_entry+0xef/0x170 [ib_core]
       [<ffffffffc05af4c4>] res_get_common_dumpit+0x3c4/0x480 [ib_core]
       [<ffffffffc05af5d3>] nldev_res_get_cq_dumpit+0x13/0x20 [ib_core]
       [<ffffffff815bc1e7>] netlink_dump+0x117/0x2e0
       [<ffffffff815bcb8b>] __netlink_dump_start+0x1ab/0x230
       [<ffffffffc059fead>] ibnl_rcv_msg+0x11d/0x1f0 [ib_core]
       [<ffffffffc05af5c0>] ? nldev_res_get_mr_dumpit+0x20/0x20 [ib_core]
       [<ffffffffc059fd90>] ? rdma_nl_multicast+0x30/0x30 [ib_core]
       [<ffffffff815bea49>] netlink_rcv_skb+0xa9/0xc0
       [<ffffffffc05a0018>] ibnl_rcv+0x98/0xb0 [ib_core]
       [<ffffffff815be132>] netlink_unicast+0xf2/0x1b0
       [<ffffffff815be50f>] netlink_sendmsg+0x31f/0x6a0
       [<ffffffff8156b580>] sock_sendmsg+0xb0/0xf0
       [<ffffffff816ace9e>] ? _raw_spin_unlock_bh+0x1e/0x20
       [<ffffffff8156f998>] ? release_sock+0x118/0x170
       [<ffffffff8156b731>] SYSC_sendto+0x121/0x1c0
       [<ffffffff81568340>] ? sock_alloc_file+0xa0/0x140
       [<ffffffff81221265>] ? __fd_install+0x25/0x60
       [<ffffffff8156c2ce>] SyS_sendto+0xe/0x10
       [<ffffffff816b6c2a>] system_call_fastpath+0x16/0x1b
      RIP  [<ffffffff8132ca70>] skip_spaces+0x30/0x30
      RSP <ffff88072be97760>
      CR2: 0000000000000000
      
      Cc: <stable@vger.kernel.org>
      Fixes: f66c8ba4 ("RDMA/core: Save kernel caller name when creating PD and CQ objects")
      Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: default avatarPotnuri Bharat Teja <bharat@chelsio.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      7350cdd0
  2. Jun 12, 2018
  3. Jun 05, 2018
  4. Jun 04, 2018
  5. Jun 02, 2018
  6. May 28, 2018
  7. May 24, 2018
  8. May 23, 2018
  9. May 22, 2018
  10. May 17, 2018
  11. May 15, 2018
    • Lidong Chen's avatar
      IB/umem: Use the correct mm during ib_umem_release · 8e907ed4
      Lidong Chen authored
      
      User-space may invoke ibv_reg_mr and ibv_dereg_mr in different threads.
      
      If ibv_dereg_mr is called after the thread which invoked ibv_reg_mr has
      exited, get_pid_task will return NULL and ib_umem_release will not
      decrease mm->pinned_vm.
      
      Instead of using threads to locate the mm, use the overall tgid from the
      ib_ucontext struct instead. This matches the behavior of ODP and
      disassociate in handling the mm of the process that called ibv_reg_mr.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 87773dd5 ("IB: ib_umem_release() should decrement mm->pinned_vm from ib_umem_get")
      Signed-off-by: default avatarLidong Chen <lidongchen@tencent.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      8e907ed4
  12. May 09, 2018
  13. May 03, 2018
    • Steve Wise's avatar
      RDMA/nldev: helper functions to add driver attributes · 73937e8a
      Steve Wise authored
      
      These help rdma drivers to fill out the driver entries.
      
      Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      73937e8a
    • Steve Wise's avatar
      RDMA/nldev: add driver-specific resource tracking · da5c8507
      Steve Wise authored
      
      Each driver can register a "fill entry" function with the restrack core.
      This function will be called when filling out a resource, allowing the
      driver to add driver-specific details.  The details consist of a
      nltable of nested attributes, that are in the form of <key, [print-type],
      value> tuples.  Both key and value attributes are mandatory.  The key
      nlattr must be a string, and the value nlattr can be one of the driver
      attributes that are generic, but typed, allowing the attributes to be
      validated.  Currently the driver nlattr types include string, s32,
      u32, s64, and u64.  The print-type nlattr allows a driver to specify
      an alternative display format for user tools displaying the attribute.
      For example, a u32 attribute will default to "%u", but a print-type
      attribute can be included for it to be displayed in hex.  This allows
      the user tool to print the number in the format desired by the driver
      driver.
      
      More attrs can be defined as they become needed by drivers.
      
      Signed-off-by: default avatarSteve Wise <swise@opengridcomputing.com>
      Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      da5c8507
  14. Apr 18, 2018
    • Jason Gunthorpe's avatar
      RDMA/rdma_cm: Delete rdma_addr_client · ee6548d1
      Jason Gunthorpe authored
      
      The only thing it does is block module unload while work is posted from
      rdma_resolve_ip().
      
      However, this is not the right place to do this. The users of
      rdma_resolve_ip() must ensure their own module does not unload until
      rdma_resolve_ip() calls the callback, or until rdma_addr_cancel() is
      called.
      
      Similarly callers to rdma_addr_find_l2_eth_by_grh() must ensure their
      module does not unload while they are calling code.
      
      The only two users are already safe, so there is no need for this.
      
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      ee6548d1
  15. Apr 05, 2018
  16. Apr 04, 2018
    • Matan Barak's avatar
      IB/uverbs: Introduce ESP steering match filter · 56ab0b38
      Matan Barak authored
      
      Adding a new ESP steering match filter that could match against
      spi and seq used in IPSec protocol.
      
      Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      56ab0b38
    • Matan Barak's avatar
      IB/uverbs: Add modify ESP flow_action · 7d12f8d5
      Matan Barak authored
      
      flow_actions of ESP type could be modified during runtime. This could be
      common for example when ESN should be changed. Adding a new
      UVERBS_FLOW_ACTION_ESP_MODIFY method for changing ESP parameters of an
      existing ESP flow_action.
      The new method uses the UVERBS_FLOW_ACTION_ESP_CREATE attributes, but
      adds a new IB_FLOW_ACTION_ESP_FLAGS_MOD_ESP_ATTRS which means ESP_ATTRS
      should be changed.
      In addition, we add a new FLOW_ACTION_ESP_REPLAY_NONE replay type that
      could be used when one wants to disable a replay protection over a
      specific flow_action.
      
      Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      7d12f8d5
    • Boris Pismenny's avatar
      IB/uverbs: Introduce egress flow steering · 21e82d3e
      Boris Pismenny authored
      
      The egress flag indicates that this flow steering rule is for egress
      traffic. The scope of an egress rule is port-wide, meaning all packets
      originated from that port, which match the steering rule specification
      will be effected by this steering rule's action.
      
      Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarBoris Pismenny <borisp@mellanox.com>
      Reviewed-by: default avatarMatan Barak <matanb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      21e82d3e
    • Matan Barak's avatar
      IB/uverbs: Add action_handle flow steering specification · 9b828441
      Matan Barak authored
      
      Binding a flow_action to flow steering rule requires using a new
      specification. Therefore, adding such an IB_FLOW_SPEC_ACTION_HANDLE flow
      specification.
      
      Flow steering rules could use flow_action(s) and as of that we need to
      avoid deleting flow_action(s) as long as they're being used.
      Moreover, when the attached rules are deleted, action_handle reference
      count should be decremented. Introducing a new mechanism of flow
      resources to keep track on the attached action_handle(s). Later on, this
      mechanism should be extended to other attached flow steering resources
      like flow counters.
      
      Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      9b828441
    • Matan Barak's avatar
      IB/uverbs: Add flow_action create and destroy verbs · 2eb9beae
      Matan Barak authored
      
      A verbs application may receive and transmits packets using a data
      path pipeline. Sometimes, the first stage in the receive pipeline or
      the last stage in the transmit pipeline involves transforming a
      packet, either in order to make it easier for later stages to process
      it or to prepare it for transmission over the wire. Such transformation
      could be stripping/encapsulating the packet (i.e. vxlan),
      decrypting/encrypting it (i.e. ipsec), altering headers, doing some
      complex FPGA changes, etc.
      
      Some hardware could do such transformations without software data path
      intervention at all. The flow steering API supports steering a
      packet (either to a QP or dropping it) and some simple packet
      immutable actions (i.e. tagging a packet). Complex actions, that may
      change the packet, could bloat the flow steering API extensively.
      Sometimes the same action should be applied to several flows.
      In this case, it's easier to bind several flows to the same action and
      modify it than change all matching flows.
      
      Introducing a new flow_action object that abstracts any packet
      transformation (out of a standard and well defined set of actions).
      This flow_action object could be tied to a flow steering rule via a
      new specification.
      
      Currently, we support esp flow_action, which encrypts or decrypts a
      packet according to the given parameters. However, we present a
      flexible schema that could be used to other transformation actions tied
      to flow rules.
      
      Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      2eb9beae
    • Matan Barak's avatar
      IB/uverbs: Add enum attribute type to ioctl() interface · 494c5580
      Matan Barak authored
      
      Methods sometimes need to get one attribute out of a group of
      pre-defined attributes. This is an enum-like behavior. Since
      this is a common requirement, we add a new ENUM attribute to the
      generic uverbs ioctl() layer. This attribute is embedded in methods,
      like any other attributes we currently have. ENUM attributes point to
      an array of standard UVERBS_ATTR_PTR_IN. The user-space encodes the
      enum's attribute id in the id field and the internal PTR_IN attr id in
      the enum_data.elem_id field. This ENUM attribute could be shared by
      several attributes and it can get UVERBS_ATTR_SPEC_F_MANDATORY flag,
      stating this attribute must be supported by the kernel, like any other
      attribute.
      
      Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarMatan Barak <matanb@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      494c5580
    • Parav Pandit's avatar
      RDMA: Use ib_gid_attr during GID modification · 414448d2
      Parav Pandit authored
      
      Now that ib_gid_attr contains device, port and index, simplify the
      provider APIs add_gid() and del_gid() to use device, port and index
      fields from the ib_gid_attr attributes structure.
      
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      414448d2
    • Parav Pandit's avatar
      IB/core: Refactor GID modify code for RoCE · 598ff6ba
      Parav Pandit authored
      
      Code is refactored to prepare separate functions for RoCE which can do more
      complex operations related to reference counting, while still
      maintainining code readability. This includes
      (a) Simplification to not perform netdevice checks and modifications
      for IB link layer.
      (b) Do not add RoCE GID entry which has NULL netdevice; instead return
      an error.
      (c) If GID addition fails at provider level add_gid(), do not add the
      entry in the cache and keep the entry marked as INVALID.
      (d) Simplify and reuse the ib_cache_gid_add()/del() routines so that they
      can be used even for modifying default GIDs. This avoid some code
      duplication in modifying default GIDs.
      (e) find_gid() routine refers to the data entry flags to qualify a GID
      as valid or invalid GID rather than depending on attributes and zeroness
      of the GID content.
      (f) gid_table_reserve_default() sets the GID default attribute at
      beginning while setting up the GID table. There is no need to use
      default_gid flag in low level functions such as write_gid(), add_gid(),
      del_gid(), as they never need to update the DEFAULT property of the GID
      entry while during GID table update.
      
      As as result of this refactor, reserved GID 0:0:0:0:0:0:0:0 is no longer
      searchable as described below.
      
      A unicast GID entry of 0:0:0:0:0:0:0:0 is Reserved GID as per the IB
      spec version 1.3 section 4.1.1, point (6) whose snippet is below.
      
      "The unicast GID address 0:0:0:0:0:0:0:0 is reserved - referred to as
      the Reserved GID. It shall never be assigned to any endport. It shall
      not be used as a destination address or in a global routing header
      (GRH)."
      
      GID table cache now only stores valid GID entries. Before this patch,
      Reserved GID 0:0:0:0:0:0:0:0 was searchable in the GID table using
      ib_find_cached_gid_by_port() and other similar find routines.
      
      Zero GID is no longer searchable as it shall not to be present in GRH or
      path recored entry as described in IB spec version 1.3 section 4.1.1,
      point (6), section 12.7.10 and section 12.7.20.
      
      ib_cache_update() is simplified to check link layer once, use unified
      locking scheme for all link layers, removed temporary gid table
      allocation/free logic.
      
      Additionally,
      (a) Expand ib_gid_attr to store port and index so that GID query
      routines can get port and index information from the attribute structure.
      (b) Expand ib_gid_attr to store device as well so that in future code when
      GID reference counting is done, device is used to reach back to the GID
      table entry.
      
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      598ff6ba
    • Parav Pandit's avatar
      RDMA/core: Update query_gid documentation for HCA drivers · 72e1ff0f
      Parav Pandit authored
      
      query_gid() should return right GID value for iWarp and IB link layers.
      It is a no-op for RoCE link layer.  Update the documentation to reflect
      this.
      
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      72e1ff0f
  17. Mar 29, 2018
  18. Mar 28, 2018
  19. Mar 27, 2018
  20. Mar 26, 2018
    • Kirill Tkhai's avatar
      net: Drop NETDEV_UNREGISTER_FINAL · 070f2d7e
      Kirill Tkhai authored
      
      Last user is gone after bdf5bd7f "rds: tcp: remove
      register_netdevice_notifier infrastructure.", so we can
      remove this netdevice command. This allows to delete
      rtnl_lock() in netdev_run_todo(), which is hot path for
      net namespace unregistration.
      
      dev_change_net_namespace() and netdev_wait_allrefs()
      have rcu_barrier() before NETDEV_UNREGISTER_FINAL call,
      and the source commits say they were introduced to
      delemit the call with NETDEV_UNREGISTER, but this patch
      leaves them on the places, since they require additional
      analysis, whether we need in them for something else.
      
      Signed-off-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      070f2d7e
Loading