Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217752
b: refs/heads/master
c: 183ae74
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Sep 28, 2010
1 parent 12f12f4 commit a8143e4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 39 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0d68b8693bd16bfbbc93b89f1d9f3351723307c
refs/heads/master: 183ae74bda75b1cfda632b42cdc916853e2dded4
30 changes: 6 additions & 24 deletions trunk/drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
props->max_srq = dev->dev->caps.num_srqs - dev->dev->caps.reserved_srqs;
props->max_srq_wr = dev->dev->caps.max_srq_wqes - 1;
props->max_srq_sge = dev->dev->caps.max_srq_sge;
props->max_fast_reg_page_list_len = MLX4_MAX_FAST_REG_PAGES;
props->max_fast_reg_page_list_len = PAGE_SIZE / sizeof (u64);
props->local_ca_ack_delay = dev->dev->caps.local_ca_ack_delay;
props->atomic_cap = dev->dev->caps.flags & MLX4_DEV_CAP_FLAG_ATOMIC ?
IB_ATOMIC_HCA : IB_ATOMIC_NONE;
Expand Down Expand Up @@ -272,32 +272,14 @@ static int mlx4_ib_query_pkey(struct ib_device *ibdev, u8 port, u16 index,
static int mlx4_ib_modify_device(struct ib_device *ibdev, int mask,
struct ib_device_modify *props)
{
struct mlx4_cmd_mailbox *mailbox;

if (mask & ~IB_DEVICE_MODIFY_NODE_DESC)
return -EOPNOTSUPP;

if (!(mask & IB_DEVICE_MODIFY_NODE_DESC))
return 0;

spin_lock(&to_mdev(ibdev)->sm_lock);
memcpy(ibdev->node_desc, props->node_desc, 64);
spin_unlock(&to_mdev(ibdev)->sm_lock);

/*
* If possible, pass node desc to FW, so it can generate
* a 144 trap. If cmd fails, just ignore.
*/
mailbox = mlx4_alloc_cmd_mailbox(to_mdev(ibdev)->dev);
if (IS_ERR(mailbox))
return 0;

memset(mailbox->buf, 0, 256);
memcpy(mailbox->buf, props->node_desc, 64);
mlx4_cmd(to_mdev(ibdev)->dev, mailbox->dma, 1, 0,
MLX4_CMD_SET_NODE, MLX4_CMD_TIME_CLASS_A);

mlx4_free_cmd_mailbox(to_mdev(ibdev)->dev, mailbox);
if (mask & IB_DEVICE_MODIFY_NODE_DESC) {
spin_lock(&to_mdev(ibdev)->sm_lock);
memcpy(ibdev->node_desc, props->node_desc, 64);
spin_unlock(&to_mdev(ibdev)->sm_lock);
}

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mlx4/mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device
struct mlx4_ib_fast_reg_page_list *mfrpl;
int size = page_list_len * sizeof (u64);

if (page_list_len > MLX4_MAX_FAST_REG_PAGES)
if (size > PAGE_SIZE)
return ERR_PTR(-EINVAL);

mfrpl = kmalloc(sizeof *mfrpl, GFP_KERNEL);
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/infiniband/hw/nes/nes_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,9 +476,9 @@ static struct ib_fast_reg_page_list *nes_alloc_fast_reg_page_list(
}
nes_debug(NES_DBG_MR, "nes_alloc_fast_reg_pbl: nes_frpl = %p, "
"ibfrpl = %p, ibfrpl.page_list = %p, pbl.kva = %p, "
"pbl.paddr= %p\n", pnesfrpl, &pnesfrpl->ibfrpl,
"pbl.paddr = %llx\n", pnesfrpl, &pnesfrpl->ibfrpl,
pnesfrpl->ibfrpl.page_list, pnesfrpl->nes_wqe_pbl.kva,
(void *)pnesfrpl->nes_wqe_pbl.paddr);
(unsigned long long) pnesfrpl->nes_wqe_pbl.paddr);

return pifrpl;
}
Expand Down Expand Up @@ -3483,13 +3483,13 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
for (i = 0; i < ib_wr->wr.fast_reg.page_list_len; i++)
dst_page_list[i] = cpu_to_le64(src_page_list[i]);

nes_debug(NES_DBG_IW_TX, "SQ_FMR: iova_start: %p, "
"length: %d, rkey: %0x, pgl_paddr: %p, "
nes_debug(NES_DBG_IW_TX, "SQ_FMR: iova_start: %llx, "
"length: %d, rkey: %0x, pgl_paddr: %llx, "
"page_list_len: %u, wqe_misc: %x\n",
(void *)ib_wr->wr.fast_reg.iova_start,
(unsigned long long) ib_wr->wr.fast_reg.iova_start,
ib_wr->wr.fast_reg.length,
ib_wr->wr.fast_reg.rkey,
(void *)pnesfrpl->nes_wqe_pbl.paddr,
(unsigned long long) pnesfrpl->nes_wqe_pbl.paddr,
ib_wr->wr.fast_reg.page_list_len,
wqe_misc);
break;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ MODULE_PARM_DESC(use_prio, "Enable steering by VLAN priority on ETH ports "

static int log_mtts_per_seg = ilog2(MLX4_MTT_ENTRY_PER_SEG);
module_param_named(log_mtts_per_seg, log_mtts_per_seg, int, 0444);
MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment (1-7)");
MODULE_PARM_DESC(log_mtts_per_seg, "Log2 number of MTT entries per segment (1-5)");

int mlx4_check_port_params(struct mlx4_dev *dev,
enum mlx4_port_type *port_type)
Expand Down Expand Up @@ -1304,7 +1304,7 @@ static int __init mlx4_verify_params(void)
return -1;
}

if ((log_mtts_per_seg < 1) || (log_mtts_per_seg > 7)) {
if ((log_mtts_per_seg < 1) || (log_mtts_per_seg > 5)) {
pr_warning("mlx4_core: bad log_mtts_per_seg: %d\n", log_mtts_per_seg);
return -1;
}
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/mlx4/cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ enum {
MLX4_CMD_QUERY_PORT = 0x43,
MLX4_CMD_SENSE_PORT = 0x4d,
MLX4_CMD_SET_PORT = 0xc,
MLX4_CMD_SET_NODE = 0x5a,
MLX4_CMD_ACCESS_DDR = 0x2e,
MLX4_CMD_MAP_ICM = 0xffa,
MLX4_CMD_UNMAP_ICM = 0xff9,
Expand Down
4 changes: 0 additions & 4 deletions trunk/include/linux/mlx4/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,6 @@ enum {
MLX4_NUM_FEXCH = 64 * 1024,
};

enum {
MLX4_MAX_FAST_REG_PAGES = 511,
};

static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor)
{
return (major << 32) | (minor << 16) | subminor;
Expand Down

0 comments on commit a8143e4

Please sign in to comment.