Skip to content

Commit

Permalink
Merge branches 'cxgb3', 'ehca', 'ipath', 'ipoib', 'misc', 'mlx4', 'mt…
Browse files Browse the repository at this point in the history
…hca' and 'nes' into for-linus
  • Loading branch information
Roland Dreier committed Sep 11, 2009
8 parents ffc40c6 + 6303e74 + 286b63d + 5e47596 + cb58160 + 3b4a8cd + d841064 + cd1d3f7 commit 45c448a
Show file tree
Hide file tree
Showing 50 changed files with 1,096 additions and 510 deletions.
12 changes: 6 additions & 6 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ F: drivers/hwmon/ams/
AMSO1100 RNIC DRIVER
M: Tom Tucker <[email protected]>
M: Steve Wise <[email protected]>
L: [email protected].org
L: [email protected].org
S: Maintained
F: drivers/infiniband/hw/amso1100/

Expand Down Expand Up @@ -1494,7 +1494,7 @@ F: drivers/net/cxgb3/

CXGB3 IWARP RNIC DRIVER (IW_CXGB3)
M: Steve Wise <[email protected]>
L: [email protected].org
L: [email protected].org
W: http://www.openfabrics.org
S: Supported
F: drivers/infiniband/hw/cxgb3/
Expand Down Expand Up @@ -1868,7 +1868,7 @@ F: fs/efs/
EHCA (IBM GX bus InfiniBand adapter) DRIVER
M: Hoang-Nam Nguyen <[email protected]>
M: Christoph Raisch <[email protected]>
L: [email protected].org
L: [email protected].org
S: Supported
F: drivers/infiniband/hw/ehca/

Expand Down Expand Up @@ -2552,7 +2552,7 @@ INFINIBAND SUBSYSTEM
M: Roland Dreier <[email protected]>
M: Sean Hefty <[email protected]>
M: Hal Rosenstock <[email protected]>
L: [email protected].org (moderated for non-subscribers)
L: [email protected].org
W: http://www.openib.org/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git
S: Supported
Expand Down Expand Up @@ -2729,7 +2729,7 @@ F: drivers/net/ipg.c

IPATH DRIVER
M: Ralph Campbell <[email protected]>
L: [email protected].org
L: [email protected].org
T: git git://git.qlogic.com/ipath-linux-2.6
S: Supported
F: drivers/infiniband/hw/ipath/
Expand Down Expand Up @@ -3485,7 +3485,7 @@ F: drivers/scsi/NCR_D700.*
NETEFFECT IWARP RNIC DRIVER (IW_NES)
M: Faisal Latif <[email protected]>
M: Chien Tung <[email protected]>
L: [email protected].org
L: [email protected].org
W: http://www.neteffect.com
S: Supported
F: drivers/infiniband/hw/nes/
Expand Down
1 change: 1 addition & 0 deletions drivers/infiniband/core/iwcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ static void destroy_cm_id(struct iw_cm_id *cm_id)
* In either case, must tell the provider to reject.
*/
cm_id_priv->state = IW_CM_STATE_DESTROYING;
cm_id->device->iwcm->reject(cm_id, NULL, 0);
break;
case IW_CM_STATE_CONN_SENT:
case IW_CM_STATE_DESTROYING:
Expand Down
6 changes: 1 addition & 5 deletions drivers/infiniband/core/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ static struct list_head ib_mad_port_list;
static u32 ib_mad_client_id = 0;

/* Port list lock */
static spinlock_t ib_mad_port_list_lock;

static DEFINE_SPINLOCK(ib_mad_port_list_lock);

/* Forward declarations */
static int method_in_use(struct ib_mad_mgmt_method_table **method,
Expand Down Expand Up @@ -2984,8 +2983,6 @@ static int __init ib_mad_init_module(void)
{
int ret;

spin_lock_init(&ib_mad_port_list_lock);

ib_mad_cache = kmem_cache_create("ib_mad",
sizeof(struct ib_mad_private),
0,
Expand Down Expand Up @@ -3021,4 +3018,3 @@ static void __exit ib_mad_cleanup_module(void)

module_init(ib_mad_init_module);
module_exit(ib_mad_cleanup_module);

10 changes: 9 additions & 1 deletion drivers/infiniband/core/multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ struct mcast_group {
struct ib_sa_query *query;
int query_id;
u16 pkey_index;
u8 leave_state;
int retries;
};

struct mcast_member {
Expand Down Expand Up @@ -350,6 +352,7 @@ static int send_leave(struct mcast_group *group, u8 leave_state)

rec = group->rec;
rec.join_state = leave_state;
group->leave_state = leave_state;

ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
port->port_num, IB_SA_METHOD_DELETE, &rec,
Expand Down Expand Up @@ -542,7 +545,11 @@ static void leave_handler(int status, struct ib_sa_mcmember_rec *rec,
{
struct mcast_group *group = context;

mcast_work_handler(&group->work);
if (status && group->retries > 0 &&
!send_leave(group, group->leave_state))
group->retries--;
else
mcast_work_handler(&group->work);
}

static struct mcast_group *acquire_group(struct mcast_port *port,
Expand All @@ -565,6 +572,7 @@ static struct mcast_group *acquire_group(struct mcast_port *port,
if (!group)
return NULL;

group->retries = 3;
group->port = port;
group->rec.mgid = *mgid;
group->pkey_index = MCAST_INVALID_PKEY_INDEX;
Expand Down
7 changes: 2 additions & 5 deletions drivers/infiniband/core/sa_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ static struct ib_client sa_client = {
.remove = ib_sa_remove_one
};

static spinlock_t idr_lock;
static DEFINE_SPINLOCK(idr_lock);
static DEFINE_IDR(query_idr);

static spinlock_t tid_lock;
static DEFINE_SPINLOCK(tid_lock);
static u32 tid;

#define PATH_REC_FIELD(field) \
Expand Down Expand Up @@ -1077,9 +1077,6 @@ static int __init ib_sa_init(void)
{
int ret;

spin_lock_init(&idr_lock);
spin_lock_init(&tid_lock);

get_random_bytes(&tid, sizeof tid);

ret = ib_register_client(&sa_client);
Expand Down
10 changes: 5 additions & 5 deletions drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ DEFINE_IDR(ib_uverbs_cq_idr);
DEFINE_IDR(ib_uverbs_qp_idr);
DEFINE_IDR(ib_uverbs_srq_idr);

static spinlock_t map_lock;
static DEFINE_SPINLOCK(map_lock);
static struct ib_uverbs_device *dev_table[IB_UVERBS_MAX_DEVICES];
static DECLARE_BITMAP(dev_map, IB_UVERBS_MAX_DEVICES);

Expand Down Expand Up @@ -584,14 +584,16 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,

if (hdr.command < 0 ||
hdr.command >= ARRAY_SIZE(uverbs_cmd_table) ||
!uverbs_cmd_table[hdr.command] ||
!(file->device->ib_dev->uverbs_cmd_mask & (1ull << hdr.command)))
!uverbs_cmd_table[hdr.command])
return -EINVAL;

if (!file->ucontext &&
hdr.command != IB_USER_VERBS_CMD_GET_CONTEXT)
return -EINVAL;

if (!(file->device->ib_dev->uverbs_cmd_mask & (1ull << hdr.command)))
return -ENOSYS;

return uverbs_cmd_table[hdr.command](file, buf + sizeof hdr,
hdr.in_words * 4, hdr.out_words * 4);
}
Expand Down Expand Up @@ -836,8 +838,6 @@ static int __init ib_uverbs_init(void)
{
int ret;

spin_lock_init(&map_lock);

ret = register_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES,
"infiniband_verbs");
if (ret) {
Expand Down
6 changes: 1 addition & 5 deletions drivers/infiniband/hw/amso1100/c2.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ MODULE_DEVICE_TABLE(pci, c2_pci_table);

static void c2_print_macaddr(struct net_device *netdev)
{
pr_debug("%s: MAC %02X:%02X:%02X:%02X:%02X:%02X, "
"IRQ %u\n", netdev->name,
netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5],
netdev->irq);
pr_debug("%s: MAC %pM, IRQ %u\n", netdev->name, netdev->dev_addr, netdev->irq);
}

static void c2_set_rxbufsize(struct c2_port *c2_port)
Expand Down
24 changes: 15 additions & 9 deletions drivers/infiniband/hw/amso1100/c2_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,11 +780,11 @@ int c2_register_device(struct c2_dev *dev)
/* Register pseudo network device */
dev->pseudo_netdev = c2_pseudo_netdev_init(dev);
if (!dev->pseudo_netdev)
goto out3;
goto out;

ret = register_netdev(dev->pseudo_netdev);
if (ret)
goto out2;
goto out_free_netdev;

pr_debug("%s:%u\n", __func__, __LINE__);
strlcpy(dev->ibdev.name, "amso%d", IB_DEVICE_NAME_MAX);
Expand Down Expand Up @@ -851,6 +851,10 @@ int c2_register_device(struct c2_dev *dev)
dev->ibdev.post_recv = c2_post_receive;

dev->ibdev.iwcm = kmalloc(sizeof(*dev->ibdev.iwcm), GFP_KERNEL);
if (dev->ibdev.iwcm == NULL) {
ret = -ENOMEM;
goto out_unregister_netdev;
}
dev->ibdev.iwcm->add_ref = c2_add_ref;
dev->ibdev.iwcm->rem_ref = c2_rem_ref;
dev->ibdev.iwcm->get_qp = c2_get_qp;
Expand All @@ -862,23 +866,25 @@ int c2_register_device(struct c2_dev *dev)

ret = ib_register_device(&dev->ibdev);
if (ret)
goto out1;
goto out_free_iwcm;

for (i = 0; i < ARRAY_SIZE(c2_dev_attributes); ++i) {
ret = device_create_file(&dev->ibdev.dev,
c2_dev_attributes[i]);
if (ret)
goto out0;
goto out_unregister_ibdev;
}
goto out3;
goto out;

out0:
out_unregister_ibdev:
ib_unregister_device(&dev->ibdev);
out1:
out_free_iwcm:
kfree(dev->ibdev.iwcm);
out_unregister_netdev:
unregister_netdev(dev->pseudo_netdev);
out2:
out_free_netdev:
free_netdev(dev->pseudo_netdev);
out3:
out:
pr_debug("%s:%u ret=%d\n", __func__, __LINE__, ret);
return ret;
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/infiniband/hw/cxgb3/iwch.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ static void rnic_init(struct iwch_dev *rnicp)
static void open_rnic_dev(struct t3cdev *tdev)
{
struct iwch_dev *rnicp;
static int vers_printed;

PDBG("%s t3cdev %p\n", __func__, tdev);
if (!vers_printed++)
printk(KERN_INFO MOD "Chelsio T3 RDMA Driver - version %s\n",
printk_once(KERN_INFO MOD "Chelsio T3 RDMA Driver - version %s\n",
DRV_VERSION);
rnicp = (struct iwch_dev *)ib_alloc_device(sizeof(*rnicp));
if (!rnicp) {
Expand Down
8 changes: 4 additions & 4 deletions drivers/infiniband/hw/ehca/ehca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#include "ehca_tools.h"
#include "hcp_if.h"

#define HCAD_VERSION "0028"
#define HCAD_VERSION "0029"

MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Christoph Raisch <[email protected]>");
Expand All @@ -64,7 +64,7 @@ static int ehca_hw_level = 0;
static int ehca_poll_all_eqs = 1;

int ehca_debug_level = 0;
int ehca_nr_ports = 2;
int ehca_nr_ports = -1;
int ehca_use_hp_mr = 0;
int ehca_port_act_time = 30;
int ehca_static_rate = -1;
Expand Down Expand Up @@ -95,8 +95,8 @@ MODULE_PARM_DESC(hw_level,
"Hardware level (0: autosensing (default), "
"0x10..0x14: eHCA, 0x20..0x23: eHCA2)");
MODULE_PARM_DESC(nr_ports,
"number of connected ports (-1: autodetect, 1: port one only, "
"2: two ports (default)");
"number of connected ports (-1: autodetect (default), "
"1: port one only, 2: two ports)");
MODULE_PARM_DESC(use_hp_mr,
"Use high performance MRs (default: no)");
MODULE_PARM_DESC(port_act_time,
Expand Down
6 changes: 5 additions & 1 deletion drivers/infiniband/hw/ehca/ehca_reqs.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,11 @@ static inline int ehca_poll_cq_one(struct ib_cq *cq, struct ib_wc *wc)
wc->slid = cqe->rlid;
wc->dlid_path_bits = cqe->dlid;
wc->src_qp = cqe->remote_qp_number;
wc->wc_flags = cqe->w_completion_flags;
/*
* HW has "Immed data present" and "GRH present" in bits 6 and 5.
* SW defines those in bits 1 and 0, so we can just shift and mask.
*/
wc->wc_flags = (cqe->w_completion_flags >> 5) & 3;
wc->ex.imm_data = cpu_to_be32(cqe->immediate_data);
wc->sl = cqe->service_level;

Expand Down
47 changes: 41 additions & 6 deletions drivers/infiniband/hw/ehca/ehca_sqp.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,30 @@ struct ib_perf {
u8 data[192];
} __attribute__ ((packed));

/* TC/SL/FL packed into 32 bits, as in ClassPortInfo */
struct tcslfl {
u32 tc:8;
u32 sl:4;
u32 fl:20;
} __attribute__ ((packed));

/* IP Version/TC/FL packed into 32 bits, as in GRH */
struct vertcfl {
u32 ver:4;
u32 tc:8;
u32 fl:20;
} __attribute__ ((packed));

static int ehca_process_perf(struct ib_device *ibdev, u8 port_num,
struct ib_wc *in_wc, struct ib_grh *in_grh,
struct ib_mad *in_mad, struct ib_mad *out_mad)
{
struct ib_perf *in_perf = (struct ib_perf *)in_mad;
struct ib_perf *out_perf = (struct ib_perf *)out_mad;
struct ib_class_port_info *poi =
(struct ib_class_port_info *)out_perf->data;
struct tcslfl *tcslfl =
(struct tcslfl *)&poi->redirect_tcslfl;
struct ehca_shca *shca =
container_of(ibdev, struct ehca_shca, ib_device);
struct ehca_sport *sport = &shca->sport[port_num - 1];
Expand All @@ -158,10 +174,29 @@ static int ehca_process_perf(struct ib_device *ibdev, u8 port_num,
poi->base_version = 1;
poi->class_version = 1;
poi->resp_time_value = 18;
poi->redirect_lid = sport->saved_attr.lid;
poi->redirect_qp = sport->pma_qp_nr;

/* copy local routing information from WC where applicable */
tcslfl->sl = in_wc->sl;
poi->redirect_lid =
sport->saved_attr.lid | in_wc->dlid_path_bits;
poi->redirect_qp = sport->pma_qp_nr;
poi->redirect_qkey = IB_QP1_QKEY;
poi->redirect_pkey = IB_DEFAULT_PKEY_FULL;

ehca_query_pkey(ibdev, port_num, in_wc->pkey_index,
&poi->redirect_pkey);

/* if request was globally routed, copy route info */
if (in_grh) {
struct vertcfl *vertcfl =
(struct vertcfl *)&in_grh->version_tclass_flow;
memcpy(poi->redirect_gid, in_grh->dgid.raw,
sizeof(poi->redirect_gid));
tcslfl->tc = vertcfl->tc;
tcslfl->fl = vertcfl->fl;
} else
/* else only fill in default GID */
ehca_query_gid(ibdev, port_num, 0,
(union ib_gid *)&poi->redirect_gid);

ehca_dbg(ibdev, "ehca_pma_lid=%x ehca_pma_qp=%x",
sport->saved_attr.lid, sport->pma_qp_nr);
Expand All @@ -183,8 +218,7 @@ static int ehca_process_perf(struct ib_device *ibdev, u8 port_num,

int ehca_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
struct ib_wc *in_wc, struct ib_grh *in_grh,
struct ib_mad *in_mad,
struct ib_mad *out_mad)
struct ib_mad *in_mad, struct ib_mad *out_mad)
{
int ret;

Expand All @@ -196,7 +230,8 @@ int ehca_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
return IB_MAD_RESULT_SUCCESS;

ehca_dbg(ibdev, "port_num=%x src_qp=%x", port_num, in_wc->src_qp);
ret = ehca_process_perf(ibdev, port_num, in_mad, out_mad);
ret = ehca_process_perf(ibdev, port_num, in_wc, in_grh,
in_mad, out_mad);

return ret;
}
Loading

0 comments on commit 45c448a

Please sign in to comment.