Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231773
b: refs/heads/master
c: eb4a7cb
h: refs/heads/master
i:
  231771: 81814d4
v: v3
  • Loading branch information
John L. Burr authored and Roland Dreier committed Jan 12, 2011
1 parent b52d2cd commit 36dabb8
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 42 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: da995a8aee044bc5d0847e19e351cd48a2cb8bcc
refs/heads/master: eb4a7cbf27082bea34764bab3bc85595683f967b
12 changes: 5 additions & 7 deletions trunk/drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,8 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
struct mlx4_ib_dev *mdev = to_mdev(ibqp->device);
struct mlx4_ib_qp *mqp = to_mqp(ibqp);

err = mlx4_multicast_attach(mdev->dev, &mqp->mqp, gid->raw,
!!(mqp->flags & MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK),
MLX4_PROTOCOL_IB);
err = mlx4_multicast_attach(mdev->dev, &mqp->mqp, gid->raw, !!(mqp->flags &
MLX4_IB_QP_BLOCK_MULTICAST_LOOPBACK));
if (err)
return err;

Expand All @@ -636,7 +635,7 @@ static int mlx4_ib_mcg_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
return 0;

err_add:
mlx4_multicast_detach(mdev->dev, &mqp->mqp, gid->raw, MLX4_PROTOCOL_IB);
mlx4_multicast_detach(mdev->dev, &mqp->mqp, gid->raw);
return err;
}

Expand Down Expand Up @@ -666,7 +665,7 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
struct mlx4_ib_gid_entry *ge;

err = mlx4_multicast_detach(mdev->dev,
&mqp->mqp, gid->raw, MLX4_PROTOCOL_IB);
&mqp->mqp, gid->raw);
if (err)
return err;

Expand Down Expand Up @@ -1006,8 +1005,7 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
if (mlx4_uar_alloc(dev, &ibdev->priv_uar))
goto err_pd;

ibdev->uar_map = ioremap((phys_addr_t) ibdev->priv_uar.pfn << PAGE_SHIFT,
PAGE_SIZE);
ibdev->uar_map = ioremap(ibdev->priv_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
if (!ibdev->uar_map)
goto err_uar;
MLX4_INIT_DOORBELL_LOCK(&ibdev->uar_lock);
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/infiniband/hw/mthca/mthca_catas.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static void poll_catas(unsigned long dev_ptr)

void mthca_start_catas_poll(struct mthca_dev *dev)
{
unsigned long addr;
phys_addr_t addr;

init_timer(&dev->catas_err.timer);
dev->catas_err.map = NULL;
Expand All @@ -158,7 +158,8 @@ void mthca_start_catas_poll(struct mthca_dev *dev)
dev->catas_err.map = ioremap(addr, dev->catas_err.size * 4);
if (!dev->catas_err.map) {
mthca_warn(dev, "couldn't map catastrophic error region "
"at 0x%lx/0x%x\n", addr, dev->catas_err.size * 4);
"at 0x%llx/0x%x\n", (unsigned long long) addr,
dev->catas_err.size * 4);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ int mthca_RUN_FW(struct mthca_dev *dev, u8 *status)

static void mthca_setup_cmd_doorbells(struct mthca_dev *dev, u64 base)
{
unsigned long addr;
phys_addr_t addr;
u16 max_off = 0;
int i;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static int mthca_map_reg(struct mthca_dev *dev,
unsigned long offset, unsigned long size,
void __iomem **map)
{
unsigned long base = pci_resource_start(dev->pdev, 0);
phys_addr_t base = pci_resource_start(dev->pdev, 0);

*map = ioremap(base + offset, size);
if (!*map)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ static int mthca_setup_hca(struct mthca_dev *dev)
goto err_uar_table_free;
}

dev->kar = ioremap(dev->driver_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
dev->kar = ioremap((phys_addr_t) dev->driver_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
if (!dev->kar) {
mthca_err(dev, "Couldn't map kernel access region, "
"aborting.\n");
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr)

int mthca_init_mr_table(struct mthca_dev *dev)
{
unsigned long addr;
phys_addr_t addr;
int mpts, mtts, err, i;

err = mthca_alloc_init(&dev->mr_table.mpt_alloc,
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/mlx4/catas.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static void catas_reset(struct work_struct *work)
void mlx4_start_catas_poll(struct mlx4_dev *dev)
{
struct mlx4_priv *priv = mlx4_priv(dev);
phys_addr_t addr;
unsigned long addr;

INIT_LIST_HEAD(&priv->catas_err.list);
init_timer(&priv->catas_err.timer);
Expand All @@ -124,8 +124,8 @@ void mlx4_start_catas_poll(struct mlx4_dev *dev)

priv->catas_err.map = ioremap(addr, priv->fw.catas_size * 4);
if (!priv->catas_err.map) {
mlx4_warn(dev, "Failed to map internal error buffer at 0x%llx\n",
(unsigned long long) addr);
mlx4_warn(dev, "Failed to map internal error buffer at 0x%lx\n",
addr);
return;
}

Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/net/mlx4/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
if (mlx4_uar_alloc(dev, &mdev->priv_uar))
goto err_pd;

mdev->uar_map = ioremap((phys_addr_t) mdev->priv_uar.pfn << PAGE_SHIFT,
PAGE_SIZE);
mdev->uar_map = ioremap(mdev->priv_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
if (!mdev->uar_map)
goto err_uar;
spin_lock_init(&mdev->uar_lock);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
goto err_uar_table_free;
}

priv->kar = ioremap((phys_addr_t) priv->driver_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
priv->kar = ioremap(priv->driver_uar.pfn << PAGE_SHIFT, PAGE_SIZE);
if (!priv->kar) {
mlx4_err(dev, "Couldn't map kernel access region, "
"aborting.\n");
Expand Down
23 changes: 10 additions & 13 deletions trunk/drivers/net/mlx4/mcg.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ static int mlx4_MGID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
* entry in hash chain and *mgm holds end of hash chain.
*/
static int find_mgm(struct mlx4_dev *dev,
u8 *gid, enum mlx4_protocol protocol,
struct mlx4_cmd_mailbox *mgm_mailbox,
u8 *gid, struct mlx4_cmd_mailbox *mgm_mailbox,
u16 *hash, int *prev, int *index)
{
struct mlx4_cmd_mailbox *mailbox;
Expand Down Expand Up @@ -135,8 +134,7 @@ static int find_mgm(struct mlx4_dev *dev,
return err;
}

if (!memcmp(mgm->gid, gid, 16) &&
be32_to_cpu(mgm->members_count) >> 30 == protocol)
if (!memcmp(mgm->gid, gid, 16))
return err;

*prev = *index;
Expand All @@ -148,7 +146,7 @@ static int find_mgm(struct mlx4_dev *dev,
}

int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
int block_mcast_loopback, enum mlx4_protocol protocol)
int block_mcast_loopback)
{
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_cmd_mailbox *mailbox;
Expand All @@ -167,7 +165,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],

mutex_lock(&priv->mcg_table.mutex);

err = find_mgm(dev, gid, protocol, mailbox, &hash, &prev, &index);
err = find_mgm(dev, gid, mailbox, &hash, &prev, &index);
if (err)
goto out;

Expand All @@ -189,7 +187,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
memcpy(mgm->gid, gid, 16);
}

members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
members_count = be32_to_cpu(mgm->members_count);
if (members_count == MLX4_QP_PER_MGM) {
mlx4_err(dev, "MGM at index %x is full.\n", index);
err = -ENOMEM;
Expand All @@ -209,7 +207,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
else
mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK);

mgm->members_count = cpu_to_be32(members_count | (u32) protocol << 30);
mgm->members_count = cpu_to_be32(members_count);

err = mlx4_WRITE_MCG(dev, index, mailbox);
if (err)
Expand Down Expand Up @@ -244,8 +242,7 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
}
EXPORT_SYMBOL_GPL(mlx4_multicast_attach);

int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
enum mlx4_protocol protocol)
int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
{
struct mlx4_priv *priv = mlx4_priv(dev);
struct mlx4_cmd_mailbox *mailbox;
Expand All @@ -263,7 +260,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],

mutex_lock(&priv->mcg_table.mutex);

err = find_mgm(dev, gid, protocol, mailbox, &hash, &prev, &index);
err = find_mgm(dev, gid, mailbox, &hash, &prev, &index);
if (err)
goto out;

Expand All @@ -273,7 +270,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
goto out;
}

members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
members_count = be32_to_cpu(mgm->members_count);
for (loc = -1, i = 0; i < members_count; ++i)
if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qp->qpn)
loc = i;
Expand All @@ -285,7 +282,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
}


mgm->members_count = cpu_to_be32(--members_count | (u32) protocol << 30);
mgm->members_count = cpu_to_be32(--members_count);
mgm->qp[loc] = mgm->qp[i - 1];
mgm->qp[i - 1] = 0;

Expand Down
10 changes: 2 additions & 8 deletions trunk/include/linux/mlx4/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ enum {
MLX4_STAT_RATE_OFFSET = 5
};

enum mlx4_protocol {
MLX4_PROTOCOL_IB,
MLX4_PROTOCOL_EN,
};

enum {
MLX4_MTT_FLAG_PRESENT = 1
};
Expand Down Expand Up @@ -505,9 +500,8 @@ int mlx4_INIT_PORT(struct mlx4_dev *dev, int port);
int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port);

int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
int block_mcast_loopback, enum mlx4_protocol protocol);
int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
enum mlx4_protocol protocol);
int block_mcast_loopback);
int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16]);

int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index);
void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index);
Expand Down
6 changes: 5 additions & 1 deletion trunk/include/linux/mlx4/driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#define MLX4_DRIVER_H

#include <linux/device.h>
#include <linux/mlx4/device.h>

struct mlx4_dev;

Expand All @@ -45,6 +44,11 @@ enum mlx4_dev_event {
MLX4_DEV_EVENT_PORT_REINIT,
};

enum mlx4_protocol {
MLX4_PROTOCOL_IB,
MLX4_PROTOCOL_EN,
};

struct mlx4_interface {
void * (*add) (struct mlx4_dev *dev);
void (*remove)(struct mlx4_dev *dev, void *context);
Expand Down

0 comments on commit 36dabb8

Please sign in to comment.