Skip to content

Commit

Permalink
Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/roland/infiniband

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband:
  IB/mthca: Always fill MTTs from CPU
  IB/mthca: Merge MR and FMR space on 64-bit systems
  IB/mthca: Fix access to MTT and MPT tables on non-cache-coherent CPUs
  IB/mthca: Give reserved MTTs a separate cache line
  IB/mthca: Fix reserved MTTs calculation on mem-free HCAs
  RDMA/cxgb3: Add driver for Chelsio T3 RNIC
  IB: Remove redundant "_wq" from workqueue names
  RDMA/cma: Increment port number after close to avoid re-use
  IB/ehca: Fix memleak on module unloading
  IB/mthca: Work around gcc bug on sparc64
  IPoIB: Connected mode experimental support
  IB/core: Use ARRAY_SIZE macro for mandatory_table
  IB/mthca: Use correct structure size in call to memset()
  • Loading branch information
Linus Torvalds committed Feb 14, 2007
2 parents 9468482 + b2875d4 commit 93bbad8
Show file tree
Hide file tree
Showing 46 changed files with 11,279 additions and 114 deletions.
1 change: 1 addition & 0 deletions drivers/infiniband/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ source "drivers/infiniband/hw/mthca/Kconfig"
source "drivers/infiniband/hw/ipath/Kconfig"
source "drivers/infiniband/hw/ehca/Kconfig"
source "drivers/infiniband/hw/amso1100/Kconfig"
source "drivers/infiniband/hw/cxgb3/Kconfig"

source "drivers/infiniband/ulp/ipoib/Kconfig"

Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ obj-$(CONFIG_INFINIBAND_MTHCA) += hw/mthca/
obj-$(CONFIG_INFINIBAND_IPATH) += hw/ipath/
obj-$(CONFIG_INFINIBAND_EHCA) += hw/ehca/
obj-$(CONFIG_INFINIBAND_AMSO1100) += hw/amso1100/
obj-$(CONFIG_INFINIBAND_CXGB3) += hw/cxgb3/
obj-$(CONFIG_INFINIBAND_IPOIB) += ulp/ipoib/
obj-$(CONFIG_INFINIBAND_SRP) += ulp/srp/
obj-$(CONFIG_INFINIBAND_ISER) += ulp/iser/
2 changes: 1 addition & 1 deletion drivers/infiniband/core/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ static struct notifier_block nb = {

static int addr_init(void)
{
addr_wq = create_singlethread_workqueue("ib_addr_wq");
addr_wq = create_singlethread_workqueue("ib_addr");
if (!addr_wq)
return -ENOMEM;

Expand Down
68 changes: 57 additions & 11 deletions drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static struct workqueue_struct *cma_wq;
static DEFINE_IDR(sdp_ps);
static DEFINE_IDR(tcp_ps);
static DEFINE_IDR(udp_ps);
static int next_port;

struct cma_device {
struct list_head list;
Expand Down Expand Up @@ -1722,33 +1723,74 @@ static int cma_alloc_port(struct idr *ps, struct rdma_id_private *id_priv,
unsigned short snum)
{
struct rdma_bind_list *bind_list;
int port, start, ret;
int port, ret;

bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
if (!bind_list)
return -ENOMEM;

start = snum ? snum : sysctl_local_port_range[0];
do {
ret = idr_get_new_above(ps, bind_list, snum, &port);
} while ((ret == -EAGAIN) && idr_pre_get(ps, GFP_KERNEL));

if (ret)
goto err1;

if (port != snum) {
ret = -EADDRNOTAVAIL;
goto err2;
}

bind_list->ps = ps;
bind_list->port = (unsigned short) port;
cma_bind_port(bind_list, id_priv);
return 0;
err2:
idr_remove(ps, port);
err1:
kfree(bind_list);
return ret;
}

static int cma_alloc_any_port(struct idr *ps, struct rdma_id_private *id_priv)
{
struct rdma_bind_list *bind_list;
int port, ret;

bind_list = kzalloc(sizeof *bind_list, GFP_KERNEL);
if (!bind_list)
return -ENOMEM;

retry:
do {
ret = idr_get_new_above(ps, bind_list, start, &port);
ret = idr_get_new_above(ps, bind_list, next_port, &port);
} while ((ret == -EAGAIN) && idr_pre_get(ps, GFP_KERNEL));

if (ret)
goto err;
goto err1;

if ((snum && port != snum) ||
(!snum && port > sysctl_local_port_range[1])) {
idr_remove(ps, port);
if (port > sysctl_local_port_range[1]) {
if (next_port != sysctl_local_port_range[0]) {
idr_remove(ps, port);
next_port = sysctl_local_port_range[0];
goto retry;
}
ret = -EADDRNOTAVAIL;
goto err;
goto err2;
}

if (port == sysctl_local_port_range[1])
next_port = sysctl_local_port_range[0];
else
next_port = port + 1;

bind_list->ps = ps;
bind_list->port = (unsigned short) port;
cma_bind_port(bind_list, id_priv);
return 0;
err:
err2:
idr_remove(ps, port);
err1:
kfree(bind_list);
return ret;
}
Expand Down Expand Up @@ -1811,7 +1853,7 @@ static int cma_get_port(struct rdma_id_private *id_priv)

mutex_lock(&lock);
if (cma_any_port(&id_priv->id.route.addr.src_addr))
ret = cma_alloc_port(ps, id_priv, 0);
ret = cma_alloc_any_port(ps, id_priv);
else
ret = cma_use_port(ps, id_priv);
mutex_unlock(&lock);
Expand Down Expand Up @@ -2448,7 +2490,11 @@ static int cma_init(void)
{
int ret;

cma_wq = create_singlethread_workqueue("rdma_cm_wq");
get_random_bytes(&next_port, sizeof next_port);
next_port = (next_port % (sysctl_local_port_range[1] -
sysctl_local_port_range[0])) +
sysctl_local_port_range[0];
cma_wq = create_singlethread_workqueue("rdma_cm");
if (!cma_wq)
return -ENOMEM;

Expand Down
3 changes: 2 additions & 1 deletion drivers/infiniband/core/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <linux/module.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/mutex.h>
Expand Down Expand Up @@ -93,7 +94,7 @@ static int ib_device_check_mandatory(struct ib_device *device)
};
int i;

for (i = 0; i < sizeof mandatory_table / sizeof mandatory_table[0]; ++i) {
for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) {
if (!*(void **) ((void *) device + mandatory_table[i].offset)) {
printk(KERN_WARNING "Device %s is missing mandatory function %s\n",
device->name, mandatory_table[i].name);
Expand Down
27 changes: 27 additions & 0 deletions drivers/infiniband/hw/cxgb3/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
config INFINIBAND_CXGB3
tristate "Chelsio RDMA Driver"
depends on CHELSIO_T3 && INFINIBAND && INET
select GENERIC_ALLOCATOR
---help---
This is an iWARP/RDMA driver for the Chelsio T3 1GbE and
10GbE adapters.

For general information about Chelsio and our products, visit
our website at <http://www.chelsio.com>.

For customer support, please visit our customer support page at
<http://www.chelsio.com/support.htm>.

Please send feedback to <[email protected]>.

To compile this driver as a module, choose M here: the module
will be called iw_cxgb3.

config INFINIBAND_CXGB3_DEBUG
bool "Verbose debugging output"
depends on INFINIBAND_CXGB3
default n
---help---
This option causes the Chelsio RDMA driver to produce copious
amounts of debug messages. Select this if you are developing
the driver or trying to diagnose a problem.
12 changes: 12 additions & 0 deletions drivers/infiniband/hw/cxgb3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \
-I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core

obj-$(CONFIG_INFINIBAND_CXGB3) += iw_cxgb3.o

iw_cxgb3-y := iwch_cm.o iwch_ev.o iwch_cq.o iwch_qp.o iwch_mem.o \
iwch_provider.o iwch.o cxio_hal.o cxio_resource.o

ifdef CONFIG_INFINIBAND_CXGB3_DEBUG
EXTRA_CFLAGS += -DDEBUG
iw_cxgb3-y += cxio_dbg.o
endif
Loading

0 comments on commit 93bbad8

Please sign in to comment.