25 Mar, 2009

1 commit


05 Mar, 2009

1 commit

  • Some attribute show functions test ibdev_is_alive() to make sure that
    it's OK to access device state. However, the sysfs attributes will
    not be registered until the device is fully initialized, and they'll
    be unregistered before anything is torn down, so ibdev_is_alive()
    doesn't do anything useful. Remove it.

    Signed-off-by: Roland Dreier

    Roland Dreier
     

04 Mar, 2009

2 commits

  • Our testing uncovered a race condition in ib_sa_event():

    spin_lock_irqsave(&port->ah_lock, flags);
    if (port->sm_ah)
    kref_put(&port->sm_ah->ref, free_sm_ah);
    port->sm_ah = NULL;
    spin_unlock_irqrestore(&port->ah_lock, flags);

    schedule_work(&sa_dev->port[event->element.port_num -
    sa_dev->start_port].update_task);

    If two events occur back-to-back (e.g., client-reregister and LID
    change), both may pass the spinlock-protected code above before the
    scheduled work updates the port->sm_ah handle. Then if the scheduled
    work ends up running twice, the second operation will then find a
    non-NULL port->sm_ah, and will simply overwrite it in update_sm_ah --
    resulting in an AH leak.

    Signed-off-by: Jack Morgenstein
    Signed-off-by: Roland Dreier

    Jack Morgenstein
     
  • If ib_post_send_mad() returns 0, the API guarantees that there will be
    a callback to send_buf->mad_agent->send_handler() so that the sender
    can call ib_free_send_mad(). Otherwise, the ib_mad_send_buf will be
    leaked and the mad_agent reference count will never go to zero and the
    IB device module cannot be unloaded. The above can happen without
    this patch if process_mad() returns (IB_MAD_RESULT_SUCCESS |
    IB_MAD_RESULT_CONSUMED).

    If process_mad() returns IB_MAD_RESULT_SUCCESS and there is no agent
    registered to receive the mad being sent, handle_outgoing_dr_smp()
    returns zero which causes a MAD packet which is at the end of the
    directed route to be incorrectly sent on the wire but doesn't cause a
    hang since the HCA generates a send completion.

    Signed-off-by: Ralph Campbell
    Signed-off-by: Roland Dreier

    Ralph Campbell
     

28 Feb, 2009

2 commits

  • There is a potential race in ib_register_mad_agent() where the struct
    ib_mad_agent_private is not fully initialized before it is added to
    the list of agents per IB port. This means the ib_mad_agent_private
    could be seen before the refcount, spin locks, and linked lists are
    initialized. The fix is to initialize the structure earlier.

    Signed-off-by: Ralph Campbell
    Signed-off-by: Roland Dreier

    Ralph Campbell
     
  • handle_outgoing_dr_smp() can queue a struct ib_mad_local_private
    *local on the mad_agent_priv->local_work work queue with
    local->mad_priv == NULL if device->process_mad() returns
    IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY and
    (!ib_response_mad(&mad_priv->mad.mad) ||
    !mad_agent_priv->agent.recv_handler).

    In this case, local_completions() will be called with local->mad_priv
    == NULL. The code does check for this case and skips calling
    recv_mad_agent->agent.recv_handler() but recv == 0 so
    kmem_cache_free() is called with a NULL pointer.

    Also, since recv isn't reinitialized each time through the loop, it
    can cause a memory leak if recv should have been zero.

    Signed-off-by: Ralph Campbell

    Ralph Campbell
     

26 Feb, 2009

1 commit

  • Move the ib_device_unregister_sysfs() call from ib_dealloc_device() to
    ib_unregister_device(). The old code allows device unregister to
    proceed even if some sysfs files are open, which leaves a window where
    userspace can open a file before a device is removed but then end up
    reading the file after the device is removed, which leads to various
    kernel crashes either because the device data structure is freed or
    because the low-level driver code is gone after module removal.

    By not returning from ib_unregister_device() until after all sysfs
    entries are removed, we make sure that data structures and/or module
    code is not freed until after all sysfs access is done.

    Reported-by: Jack Morgenstein
    Signed-off-by: Roland Dreier

    Roland Dreier
     

18 Jan, 2009

1 commit

  • The base versions handle constant folding just fine, use them
    directly. The replacements are OK in the include/ files as they are
    not exported to userspace so we don't need the __ prefixed versions.

    This patch does not affect code generation at all.

    Signed-off-by: Harvey Harrison
    Signed-off-by: Roland Dreier

    Harvey Harrison
     

07 Jan, 2009

1 commit


30 Dec, 2008

1 commit

  • Commit 38617c64 ("RDMA/addr: Add support for translating IPv6
    addresses") broke the build when CONFIG_IPV6=n, because the ib_addr
    module unconditionally attempted to call ipv6_chk_addr() and other
    IPv6 functions that are not defined when IPv6 is disabled. Fix this
    by only building IPv6 support if CONFIG_IPV6 is turned on, and
    add a Kconfig dependency to prevent the ib_addr code from being built
    in when IPv6 is built modular.

    Signed-off-by: Roland Dreier

    Roland Dreier
     

29 Dec, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1429 commits)
    net: Allow dependancies of FDDI & Tokenring to be modular.
    igb: Fix build warning when DCA is disabled.
    net: Fix warning fallout from recent NAPI interface changes.
    gro: Fix potential use after free
    sfc: If AN is enabled, always read speed/duplex from the AN advertising bits
    sfc: When disabling the NIC, close the device rather than unregistering it
    sfc: SFT9001: Add cable diagnostics
    sfc: Add support for multiple PHY self-tests
    sfc: Merge top-level functions for self-tests
    sfc: Clean up PHY mode management in loopback self-test
    sfc: Fix unreliable link detection in some loopback modes
    sfc: Generate unique names for per-NIC workqueues
    802.3ad: use standard ethhdr instead of ad_header
    802.3ad: generalize out mac address initializer
    802.3ad: initialize ports LACPDU from const initializer
    802.3ad: remove typedef around ad_system
    802.3ad: turn ports is_individual into a bool
    802.3ad: turn ports is_enabled into a bool
    802.3ad: make ntt bool
    ixgbe: Fix set_ringparam in ixgbe to use the same memory pools.
    ...

    Fixed trivial IPv4/6 address printing conflicts in fs/cifs/connect.c due
    to the conversion to %pI (in this networking merge) and the addition of
    doing IPv6 addresses (from the earlier merge of CIFS).

    Linus Torvalds
     

25 Dec, 2008

2 commits

  • Handle AF_INET6 cases where required, and use struct sockaddr_storage
    wherever an IPv6 address might be stored.

    Signed-off-by: Aleksey Senin
    Signed-off-by: Roland Dreier

    Aleksey Senin
     
  • Add support for translating AF_INET6 addresses to the IB address
    translation service. This requires using struct sockaddr_storage
    instead of struct sockaddr wherever an IPv6 address might be stored,
    and adding cases to handle IPv6 in addition to IPv4 to the various
    translation functions.

    Signed-off-by: Aleksey Senin
    Signed-off-by: Roland Dreier

    Aleksey Senin
     

07 Nov, 2008

1 commit


02 Nov, 2008

1 commit

  • As it is, all instances of ->release() for files that have ->fasync()
    need to remember to evict file from fasync lists; forgetting that
    creates a hole and we actually have a bunch that *does* forget.

    So let's keep our lives simple - let __fput() check FASYNC in
    file->f_flags and call ->fasync() there if it's been set. And lose that
    crap in ->release() instances - leaving it there is still valid, but we
    don't have to bother anymore.

    Signed-off-by: Al Viro
    Signed-off-by: Linus Torvalds

    Al Viro
     

30 Oct, 2008

1 commit


29 Oct, 2008

1 commit


23 Oct, 2008

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    IB/ehca: Reject dynamic memory add/remove when ehca adapter is present
    IB/ehca: Fix reported max number of QPs and CQs in systems with >1 adapter
    IPoIB: Set netdev offload features properly for child (VLAN) interfaces
    IPoIB: Clean up ethtool support
    mlx4_core: Add Ethernet PCI device IDs
    mlx4_en: Add driver for Mellanox ConnectX 10GbE NIC
    mlx4_core: Multiple port type support
    mlx4_core: Ethernet MAC/VLAN management
    mlx4_core: Get ethernet MTU and default address from firmware
    mlx4_core: Support multiple pre-reserved QP regions
    Update NetEffect maintainer emails to Intel emails
    RDMA/cxgb3: Remove cmid reference on tid allocation failures
    IB/mad: Use krealloc() to resize snoop table
    IPoIB: Always initialize poll_timer to avoid crash on unload
    IB/ehca: Don't allow creating UC QP with SRQ
    mlx4_core: Add QP range reservation support
    RDMA/ucma: Test ucma_alloc_multicast() return against NULL, not with IS_ERR()

    Linus Torvalds
     
  • Roland Dreier
     

20 Oct, 2008

1 commit

  • Tejun's commit 7b595756ec1f49e0049a9e01a1298d53a7faaa15 made sysfs
    attribute->owner unnecessary. But the field was left in the structure to
    ease the merge. It's been over a year since that change and it is now
    time to start killing attribute->owner along with its users - one arch at
    a time!

    This patch is attempt #1 to get rid of attribute->owner only for
    CONFIG_X86_64 or CONFIG_X86_32 . We will deal with other arches later on
    as and when possible - avr32 will be the next since that is something I
    can test. Compile (make allyesconfig / make allmodconfig / custom config)
    and boot tested.

    akpm: the idea is that we put the declaration of sttribute.owner inside
    `#ifndef CONFIG_X86'. But that proved to be too ambitious for now because
    new usages kept on turning up in subsystem trees.

    [akpm: remove the ifdef for now]
    Signed-off-by: Parag Warudkar
    Cc: Greg KH
    Cc: Ingo Molnar
    Cc: Tejun Heo
    Cc: Len Brown
    Cc: Jens Axboe
    Cc: Jean Delvare
    Cc: Roland Dreier
    Cc: David Brownell
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Parag Warudkar
     

17 Oct, 2008

1 commit


15 Oct, 2008

1 commit

  • Use krealloc() instead of kmalloc() followed by memcpy() when resizing
    the MAD module's snoop table.

    Also put parentheses around the new table size to avoid calculating
    the wrong size to allocate, which fixes a bug pointed out by Haven
    Hash .

    Signed-off-by: Roland Dreier

    Roland Dreier
     

11 Oct, 2008

1 commit

  • In case of error, the function ucma_alloc_multicast() returns a NULL
    pointer, but never returns an ERR pointer. So after a call to this
    function, an IS_ERR test should be replaced by a NULL test.

    The semantic match that finds this problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @match bad_is_err_test@
    expression x, E;
    @@

    x = ucma_alloc_multicast(...)
    ... when != x = E
    IS_ERR(x)
    //

    Signed-off-by: Julien Brunel
    Signed-off-by: Julia Lawall
    Signed-off-by: Roland Dreier

    Julien Brunel
     

10 Oct, 2008

1 commit


01 Oct, 2008

1 commit

  • commit 110cf374 ("infiniband: make cm_device use a struct device and
    not a kobject.") introduced a memory leak, since it deleted
    cm_release_dev_obj(), which was where cm_dev was freed. Fix this by
    freeing the leaked structure after calling device_unregister().

    Signed-off-by: Sean Hefty
    Signed-off-by: Roland Dreier

    Hefty, Sean
     

21 Sep, 2008

1 commit

  • This fixes the problem of incoming BMA responses being dropped due to
    a bad "is response" check. Fix the test to use the ib_response_mad()
    predicate, which correctly handles BMA MADs.

    This fixes .

    Signed-off-by: Michael Brooks
    Acked-by: Sean Hefty
    Signed-off-by: Roland Dreier

    Michael Brooks
     

08 Aug, 2008

2 commits


05 Aug, 2008

1 commit

  • There are a few places where the RDMA CM code handles IPv6 by doing

    struct sockaddr addr;
    u8 pad[sizeof(struct sockaddr_in6) -
    sizeof(struct sockaddr)];

    This is fragile and ugly; handle this in a better way with just

    struct sockaddr_storage addr;

    [ Also roll in patch from Aleksey Senin to
    switch to struct sockaddr_storage and get rid of padding arrays in
    struct rdma_addr. ]

    Signed-off-by: Roland Dreier

    Roland Dreier
     

25 Jul, 2008

3 commits

  • Remove explicit cycle_kernel_lock() call and document why the code is safe.

    Signed-off-by: Roland Dreier

    Roland Dreier
     
  • Remove explicit lock_kernel() calls and document why the code is safe.

    Signed-off-by: Roland Dreier

    Roland Dreier
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    MAINTAINERS: Remove Glenn Streiff from NetEffect entry
    mlx4_core: Improve error message when not enough UAR pages are available
    IB/mlx4: Add support for memory management extensions and local DMA L_Key
    IB/mthca: Keep free count for MTT buddy allocator
    mlx4_core: Keep free count for MTT buddy allocator
    mlx4_code: Add missing FW status return code
    IB/mlx4: Rename struct mlx4_lso_seg to mlx4_wqe_lso_seg
    mlx4_core: Add module parameter to enable QoS support
    RDMA/iwcm: Remove IB_ACCESS_LOCAL_WRITE from remote QP attributes
    IPoIB: Include err code in trace message for ib_sa_path_rec_get() failures
    IB/sa_query: Check if sm_ah is NULL in ib_sa_remove_one()
    IB/ehca: Release mutex in error path of alloc_small_queue_page()
    IB/ehca: Use default value for Local CA ACK Delay if FW returns 0
    IB/ehca: Filter PATH_MIG events if QP was never armed
    IB/iser: Add support for RDMA_CM_EVENT_ADDR_CHANGE event
    RDMA/cma: Add RDMA_CM_EVENT_TIMEWAIT_EXIT event
    RDMA/cma: Add RDMA_CM_EVENT_ADDR_CHANGE event

    Linus Torvalds
     

24 Jul, 2008

1 commit


23 Jul, 2008

4 commits

  • Remove IB_ACCESS_LOCAL_WRITE from qp.qp_access_flags because this
    attribute is only used to set remote permissions.

    Signed-off-by: Dotan Barak
    Signed-off-by: Roland Dreier

    Dotan Barak
     
  • If update_sm_ah() fails, it leaves the port's sm_ah as NULL. Then if
    the device or module is removed, ib_sa_remove_one() will dereference a
    NULL pointer when it calls kref_put(). Fix this by testing if sm_ah
    is NULL before dropping the reference.

    Signed-off-by: Ralph Campbell
    Signed-off-by: Roland Dreier

    Ralph Campbell
     
  • Consumers that want to re-use their QPs in new connections need to
    know when the QP has exited the timewait state. Report the timewait
    event through the rdma_cm.

    Signed-off-by: Amir Vadai
    Acked-by: Sean Hefty
    Signed-off-by: Roland Dreier

    Amir Vadai
     
  • Add an RDMA_CM_EVENT_ADDR_CHANGE event can be used by rdma-cm
    consumers that wish to have their RDMA sessions always use the same
    links (eg ) as the IP stack does. In the current code, this
    does not happen when bonding is used and fail-over happened but the IB
    link used by an already existing session is operating fine.

    Use the netevent notification for sensing that a change has happened
    in the IP stack, then scan the rdma-cm ID list to see if there is an
    ID that is "misaligned" with respect to the IP stack, and deliver
    RDMA_CM_EVENT_ADDR_CHANGE for this ID. The consumer can act on the
    event or just ignore it.

    Signed-off-by: Or Gerlitz
    Signed-off-by: Roland Dreier

    Or Gerlitz
     

22 Jul, 2008

2 commits

  • This object really should be a struct device, or at least contain a
    pointer to a struct device, as it is trying to create a separate device
    tree outside of the main device tree. This patch fixes this problem.

    It is needed for the class core rework that is being done in the driver
    core.

    Cc: Kay Sievers
    Cc: Roland Dreier
    Cc: Sean Hefty
    Cc: Hal Rosenstock
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     
  • This pointer really is a struct ib_device, not a struct device, so name
    it properly to help prevent confusion.

    This makes the followon patch in this series much smaller and easier to
    understand as well.

    Cc: Kay Sievers
    Cc: Roland Dreier
    Cc: Hal Rosenstock
    Acked-by: Sean Hefty
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

15 Jul, 2008

1 commit

  • The RDMA CM has some logic in place to make sure that callbacks on a
    given CM ID are delivered to the consumer in a serialized manner.
    Specifically it has code to protect against a device removal racing
    with a running callback function.

    This patch simplifies this logic by using a mutex per ID instead of a
    wait queue and atomic variable. This means that cma_disable_remove()
    now is more properly named to cma_disable_callback(), and
    cma_enable_remove() can now be removed because it just would become a
    trivial wrapper around mutex_unlock().

    Signed-off-by: Or Gerlitz
    Signed-off-by: Roland Dreier

    Or Gerlitz