Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287703
b: refs/heads/master
c: 9f5b6c6
h: refs/heads/master
i:
  287701: 1081724
  287699: 6c6fe65
  287695: 0b8dfb9
v: v3
  • Loading branch information
Eugenia Emantayev authored and David S. Miller committed Feb 15, 2012
1 parent e063508 commit 2f623e4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 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: 2531188b476c83fe29b1d3498a76e329f4b6f16b
refs/heads/master: 9f5b6c632eb3b495d5ae701c43e67da930b1f637
18 changes: 11 additions & 7 deletions trunk/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ struct res_gid {
struct list_head list;
u8 gid[16];
enum mlx4_protocol prot;
enum mlx4_steer_type steer;
};

enum res_qp_states {
Expand Down Expand Up @@ -2480,7 +2481,8 @@ static struct res_gid *find_gid(struct mlx4_dev *dev, int slave,
}

static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
u8 *gid, enum mlx4_protocol prot)
u8 *gid, enum mlx4_protocol prot,
enum mlx4_steer_type steer)
{
struct res_gid *res;
int err;
Expand All @@ -2496,6 +2498,7 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
} else {
memcpy(res->gid, gid, 16);
res->prot = prot;
res->steer = steer;
list_add_tail(&res->list, &rqp->mcg_list);
err = 0;
}
Expand All @@ -2505,14 +2508,15 @@ static int add_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
}

static int rem_mcg_res(struct mlx4_dev *dev, int slave, struct res_qp *rqp,
u8 *gid, enum mlx4_protocol prot)
u8 *gid, enum mlx4_protocol prot,
enum mlx4_steer_type steer)
{
struct res_gid *res;
int err;

spin_lock_irq(&rqp->mcg_spl);
res = find_gid(dev, slave, rqp, gid);
if (!res || res->prot != prot)
if (!res || res->prot != prot || res->steer != steer)
err = -EINVAL;
else {
list_del(&res->list);
Expand Down Expand Up @@ -2548,7 +2552,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,

qp.qpn = qpn;
if (attach) {
err = add_mcg_res(dev, slave, rqp, gid, prot);
err = add_mcg_res(dev, slave, rqp, gid, prot, type);
if (err)
goto ex_put;

Expand All @@ -2557,7 +2561,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
if (err)
goto ex_rem;
} else {
err = rem_mcg_res(dev, slave, rqp, gid, prot);
err = rem_mcg_res(dev, slave, rqp, gid, prot, type);
if (err)
goto ex_put;
err = mlx4_qp_detach_common(dev, &qp, gid, prot, type);
Expand All @@ -2568,7 +2572,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,

ex_rem:
/* ignore error return below, already in error */
err1 = rem_mcg_res(dev, slave, rqp, gid, prot);
err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type);
ex_put:
put_res(dev, slave, qpn, RES_QP);

Expand Down Expand Up @@ -2607,7 +2611,7 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp)
list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) {
qp.qpn = rqp->local_qpn;
err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
MLX4_MC_STEER);
rgid->steer);
list_del(&rgid->list);
kfree(rgid);
}
Expand Down

0 comments on commit 2f623e4

Please sign in to comment.