projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx4_en: Use vlan id instead of vlan index for unregistration
[cascardo/linux.git]
/
drivers
/
net
/
ethernet
/
mellanox
/
mlx4
/
resource_tracker.c
diff --git
a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index
dd68763
..
993a2ef
100644
(file)
--- a/
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@
-1443,7
+1443,7
@@
static void rem_slave_macs(struct mlx4_dev *dev, int slave)
}
static int mac_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
}
static int mac_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
- u64 in_param, u64 *out_param)
+ u64 in_param, u64 *out_param
, int in_port
)
{
int err = -EINVAL;
int port;
{
int err = -EINVAL;
int port;
@@
-1452,7
+1452,7
@@
static int mac_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
if (op != RES_OP_RESERVE_AND_MAP)
return err;
if (op != RES_OP_RESERVE_AND_MAP)
return err;
- port =
get_param_l(out_param)
;
+ port =
!in_port ? get_param_l(out_param) : in_port
;
mac = in_param;
err = __mlx4_register_mac(dev, port, mac);
mac = in_param;
err = __mlx4_register_mac(dev, port, mac);
@@
-1470,7
+1470,7
@@
static int mac_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
}
static int vlan_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
}
static int vlan_alloc_res(struct mlx4_dev *dev, int slave, int op, int cmd,
- u64 in_param, u64 *out_param)
+ u64 in_param, u64 *out_param
, int port
)
{
return 0;
}
{
return 0;
}
@@
-1528,7
+1528,7
@@
int mlx4_ALLOC_RES_wrapper(struct mlx4_dev *dev, int slave,
int err;
int alop = vhcr->op_modifier;
int err;
int alop = vhcr->op_modifier;
- switch (vhcr->in_modifier) {
+ switch (vhcr->in_modifier
& 0xFF
) {
case RES_QP:
err = qp_alloc_res(dev, slave, vhcr->op_modifier, alop,
vhcr->in_param, &vhcr->out_param);
case RES_QP:
err = qp_alloc_res(dev, slave, vhcr->op_modifier, alop,
vhcr->in_param, &vhcr->out_param);
@@
-1556,12
+1556,14
@@
int mlx4_ALLOC_RES_wrapper(struct mlx4_dev *dev, int slave,
case RES_MAC:
err = mac_alloc_res(dev, slave, vhcr->op_modifier, alop,
case RES_MAC:
err = mac_alloc_res(dev, slave, vhcr->op_modifier, alop,
- vhcr->in_param, &vhcr->out_param);
+ vhcr->in_param, &vhcr->out_param,
+ (vhcr->in_modifier >> 8) & 0xFF);
break;
case RES_VLAN:
err = vlan_alloc_res(dev, slave, vhcr->op_modifier, alop,
break;
case RES_VLAN:
err = vlan_alloc_res(dev, slave, vhcr->op_modifier, alop,
- vhcr->in_param, &vhcr->out_param);
+ vhcr->in_param, &vhcr->out_param,
+ (vhcr->in_modifier >> 8) & 0xFF);
break;
case RES_COUNTER:
break;
case RES_COUNTER:
@@
-1730,14
+1732,14
@@
static int srq_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
}
static int mac_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
}
static int mac_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
- u64 in_param, u64 *out_param)
+ u64 in_param, u64 *out_param
, int in_port
)
{
int port;
int err = 0;
switch (op) {
case RES_OP_RESERVE_AND_MAP:
{
int port;
int err = 0;
switch (op) {
case RES_OP_RESERVE_AND_MAP:
- port =
get_param_l(out_param)
;
+ port =
!in_port ? get_param_l(out_param) : in_port
;
mac_del_from_slave(dev, slave, in_param, port);
__mlx4_unregister_mac(dev, port, in_param);
break;
mac_del_from_slave(dev, slave, in_param, port);
__mlx4_unregister_mac(dev, port, in_param);
break;
@@
-1751,7
+1753,7
@@
static int mac_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
}
static int vlan_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
}
static int vlan_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
- u64 in_param, u64 *out_param)
+ u64 in_param, u64 *out_param
, int port
)
{
return 0;
}
{
return 0;
}
@@
-1803,7
+1805,7
@@
int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave,
int err = -EINVAL;
int alop = vhcr->op_modifier;
int err = -EINVAL;
int alop = vhcr->op_modifier;
- switch (vhcr->in_modifier) {
+ switch (vhcr->in_modifier
& 0xFF
) {
case RES_QP:
err = qp_free_res(dev, slave, vhcr->op_modifier, alop,
vhcr->in_param);
case RES_QP:
err = qp_free_res(dev, slave, vhcr->op_modifier, alop,
vhcr->in_param);
@@
-1831,12
+1833,14
@@
int mlx4_FREE_RES_wrapper(struct mlx4_dev *dev, int slave,
case RES_MAC:
err = mac_free_res(dev, slave, vhcr->op_modifier, alop,
case RES_MAC:
err = mac_free_res(dev, slave, vhcr->op_modifier, alop,
- vhcr->in_param, &vhcr->out_param);
+ vhcr->in_param, &vhcr->out_param,
+ (vhcr->in_modifier >> 8) & 0xFF);
break;
case RES_VLAN:
err = vlan_free_res(dev, slave, vhcr->op_modifier, alop,
break;
case RES_VLAN:
err = vlan_free_res(dev, slave, vhcr->op_modifier, alop,
- vhcr->in_param, &vhcr->out_param);
+ vhcr->in_param, &vhcr->out_param,
+ (vhcr->in_modifier >> 8) & 0xFF);
break;
case RES_COUNTER:
break;
case RES_COUNTER:
@@
-4081,7
+4085,7
@@
void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work)
if (work->flags & MLX4_VF_IMMED_VLAN_FLAG_VLAN && !errors &&
NO_INDX != work->orig_vlan_ix)
__mlx4_unregister_vlan(&work->priv->dev, work->port,
if (work->flags & MLX4_VF_IMMED_VLAN_FLAG_VLAN && !errors &&
NO_INDX != work->orig_vlan_ix)
__mlx4_unregister_vlan(&work->priv->dev, work->port,
- work->orig_vlan_i
x
);
+ work->orig_vlan_i
d
);
out:
kfree(work);
return;
out:
kfree(work);
return;