Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133639
b: refs/heads/master
c: 270b8b8
h: refs/heads/master
i:
  133637: 2f55b53
  133635: 4283de9
  133631: cd187a4
v: v3
  • Loading branch information
Moni Shoua authored and Roland Dreier committed Jan 28, 2009
1 parent 7d3b119 commit 822c34b
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 314 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: a6a47771b113be8e694aedd80f66ea94d05bd8df
refs/heads/master: 270b8b85134c299799dddec624ceeb5671330131
27 changes: 7 additions & 20 deletions trunk/drivers/infiniband/hw/mlx4/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@ static void update_sm_ah(struct mlx4_ib_dev *dev, u8 port_num, u16 lid, u8 sl)
* Snoop SM MADs for port info and P_Key table sets, so we can
* synthesize LID change and P_Key change events.
*/
static void smp_snoop(struct ib_device *ibdev, u8 port_num, struct ib_mad *mad,
u16 prev_lid)
static void smp_snoop(struct ib_device *ibdev, u8 port_num, struct ib_mad *mad)
{
struct ib_event event;

Expand All @@ -158,7 +157,6 @@ static void smp_snoop(struct ib_device *ibdev, u8 port_num, struct ib_mad *mad,
if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO) {
struct ib_port_info *pinfo =
(struct ib_port_info *) ((struct ib_smp *) mad)->data;
u16 lid = be16_to_cpu(pinfo->lid);

update_sm_ah(to_mdev(ibdev), port_num,
be16_to_cpu(pinfo->sm_lid),
Expand All @@ -167,15 +165,12 @@ static void smp_snoop(struct ib_device *ibdev, u8 port_num, struct ib_mad *mad,
event.device = ibdev;
event.element.port_num = port_num;

if (pinfo->clientrereg_resv_subnetto & 0x80) {
if (pinfo->clientrereg_resv_subnetto & 0x80)
event.event = IB_EVENT_CLIENT_REREGISTER;
ib_dispatch_event(&event);
}

if (prev_lid != lid) {
else
event.event = IB_EVENT_LID_CHANGE;
ib_dispatch_event(&event);
}

ib_dispatch_event(&event);
}

if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PKEY_TABLE) {
Expand Down Expand Up @@ -233,9 +228,8 @@ int mlx4_ib_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)
{
u16 slid, prev_lid = 0;
u16 slid;
int err;
struct ib_port_attr pattr;

slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);

Expand Down Expand Up @@ -269,13 +263,6 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
} else
return IB_MAD_RESULT_SUCCESS;

if ((in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
in_mad->mad_hdr.method == IB_MGMT_METHOD_SET &&
in_mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO &&
!ib_query_port(ibdev, port_num, &pattr))
prev_lid = pattr.lid;

err = mlx4_MAD_IFC(to_mdev(ibdev),
mad_flags & IB_MAD_IGNORE_MKEY,
mad_flags & IB_MAD_IGNORE_BKEY,
Expand All @@ -284,7 +271,7 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
return IB_MAD_RESULT_FAILURE;

if (!out_mad->mad_hdr.status) {
smp_snoop(ibdev, port_num, in_mad, prev_lid);
smp_snoop(ibdev, port_num, in_mad);
node_desc_override(ibdev, out_mad);
}

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,12 +699,11 @@ static void mlx4_ib_remove(struct mlx4_dev *dev, void *ibdev_ptr)
struct mlx4_ib_dev *ibdev = ibdev_ptr;
int p;

mlx4_ib_mad_cleanup(ibdev);
ib_unregister_device(&ibdev->ib_dev);

for (p = 1; p <= ibdev->num_ports; ++p)
mlx4_CLOSE_PORT(dev, p);

mlx4_ib_mad_cleanup(ibdev);
ib_unregister_device(&ibdev->ib_dev);
iounmap(ibdev->uar_map);
mlx4_uar_free(dev, &ibdev->priv_uar);
mlx4_pd_free(dev, ibdev->priv_pdn);
Expand Down
25 changes: 19 additions & 6 deletions trunk/drivers/infiniband/hw/mthca/mthca_mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ static void update_sm_ah(struct mthca_dev *dev,
*/
static void smp_snoop(struct ib_device *ibdev,
u8 port_num,
struct ib_mad *mad)
struct ib_mad *mad,
u16 prev_lid)
{
struct ib_event event;

Expand All @@ -114,6 +115,7 @@ static void smp_snoop(struct ib_device *ibdev,
if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO) {
struct ib_port_info *pinfo =
(struct ib_port_info *) ((struct ib_smp *) mad)->data;
u16 lid = be16_to_cpu(pinfo->lid);

mthca_update_rate(to_mdev(ibdev), port_num);
update_sm_ah(to_mdev(ibdev), port_num,
Expand All @@ -123,12 +125,15 @@ static void smp_snoop(struct ib_device *ibdev,
event.device = ibdev;
event.element.port_num = port_num;

if (pinfo->clientrereg_resv_subnetto & 0x80)
if (pinfo->clientrereg_resv_subnetto & 0x80) {
event.event = IB_EVENT_CLIENT_REREGISTER;
else
event.event = IB_EVENT_LID_CHANGE;
ib_dispatch_event(&event);
}

ib_dispatch_event(&event);
if (prev_lid != lid) {
event.event = IB_EVENT_LID_CHANGE;
ib_dispatch_event(&event);
}
}

if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PKEY_TABLE) {
Expand Down Expand Up @@ -196,6 +201,8 @@ int mthca_process_mad(struct ib_device *ibdev,
int err;
u8 status;
u16 slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
u16 prev_lid = 0;
struct ib_port_attr pattr;

/* Forward locally generated traps to the SM */
if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP &&
Expand Down Expand Up @@ -233,6 +240,12 @@ int mthca_process_mad(struct ib_device *ibdev,
return IB_MAD_RESULT_SUCCESS;
} else
return IB_MAD_RESULT_SUCCESS;
if ((in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
in_mad->mad_hdr.method == IB_MGMT_METHOD_SET &&
in_mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO &&
!ib_query_port(ibdev, port_num, &pattr))
prev_lid = pattr.lid;

err = mthca_MAD_IFC(to_mdev(ibdev),
mad_flags & IB_MAD_IGNORE_MKEY,
Expand All @@ -252,7 +265,7 @@ int mthca_process_mad(struct ib_device *ibdev,
}

if (!out_mad->mad_hdr.status) {
smp_snoop(ibdev, port_num, in_mad);
smp_snoop(ibdev, port_num, in_mad, prev_lid);
node_desc_override(ibdev, out_mad);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/mlx4/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
obj-$(CONFIG_MLX4_CORE) += mlx4_core.o

mlx4_core-y := alloc.o catas.o cmd.o cq.o eq.o fw.o icm.o intf.o main.o mcg.o \
mr.o pd.o port.o profile.o qp.o reset.o sense.o srq.o
mr.o pd.o port.o profile.o qp.o reset.o srq.o

obj-$(CONFIG_MLX4_EN) += mlx4_en.o

Expand Down
16 changes: 14 additions & 2 deletions trunk/drivers/net/mlx4/catas.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum {
static DEFINE_SPINLOCK(catas_lock);

static LIST_HEAD(catas_list);
static struct workqueue_struct *catas_wq;
static struct work_struct catas_work;

static int internal_err_reset = 1;
Expand Down Expand Up @@ -76,7 +77,7 @@ static void poll_catas(unsigned long dev_ptr)
list_add(&priv->catas_err.list, &catas_list);
spin_unlock(&catas_lock);

queue_work(mlx4_wq, &catas_work);
queue_work(catas_wq, &catas_work);
}
} else
mod_timer(&priv->catas_err.timer,
Expand Down Expand Up @@ -145,7 +146,18 @@ void mlx4_stop_catas_poll(struct mlx4_dev *dev)
spin_unlock_irq(&catas_lock);
}

void __init mlx4_catas_init(void)
int __init mlx4_catas_init(void)
{
INIT_WORK(&catas_work, catas_reset);

catas_wq = create_singlethread_workqueue("mlx4_err");
if (!catas_wq)
return -ENOMEM;

return 0;
}

void mlx4_catas_cleanup(void)
{
destroy_workqueue(catas_wq);
}
16 changes: 5 additions & 11 deletions trunk/drivers/net/mlx4/eq.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
int cqn;
int eqes_found = 0;
int set_ci = 0;
int port;

while ((eqe = next_eqe_sw(eq))) {
/*
Expand Down Expand Up @@ -204,16 +203,11 @@ static int mlx4_eq_int(struct mlx4_dev *dev, struct mlx4_eq *eq)
break;

case MLX4_EVENT_TYPE_PORT_CHANGE:
port = be32_to_cpu(eqe->event.port_change.port) >> 28;
if (eqe->subtype == MLX4_PORT_CHANGE_SUBTYPE_DOWN) {
mlx4_dispatch_event(dev, MLX4_DEV_EVENT_PORT_DOWN,
port);
mlx4_priv(dev)->sense.do_sense_port[port] = 1;
} else {
mlx4_dispatch_event(dev, MLX4_DEV_EVENT_PORT_UP,
port);
mlx4_priv(dev)->sense.do_sense_port[port] = 0;
}
mlx4_dispatch_event(dev,
eqe->subtype == MLX4_PORT_CHANGE_SUBTYPE_ACTIVE ?
MLX4_DEV_EVENT_PORT_UP :
MLX4_DEV_EVENT_PORT_DOWN,
be32_to_cpu(eqe->event.port_change.port) >> 28);
break;

case MLX4_EVENT_TYPE_CQ_ERROR:
Expand Down
Loading

0 comments on commit 822c34b

Please sign in to comment.