Commit 75908376 authored by Alexander Guller's avatar Alexander Guller Committed by David S. Miller

net/mlx4_core: Make sure the max number of QPs per MCG isn't exceeded

In B0 steering mode when adding QPs to the default MCG entry need
to check that maximal number of QPs per MCG entry was not exceeded.
Signed-off-by: default avatarAlexander Guller <alexg@mellanox.com>
Reviewed-by: default avatarAviad Yehezkel <aviadye@mellanox.co.il>
Signed-off-by: default avatarEugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: default avatarAmir Vadai <amirv@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aab2bb0e
...@@ -477,8 +477,14 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port, ...@@ -477,8 +477,14 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
/* now need to add all the promisc qps to default entry */ /* now need to add all the promisc qps to default entry */
memset(mgm, 0, sizeof *mgm); memset(mgm, 0, sizeof *mgm);
members_count = 0; members_count = 0;
list_for_each_entry(dqp, &s_steer->promisc_qps[steer], list) list_for_each_entry(dqp, &s_steer->promisc_qps[steer], list) {
if (members_count == dev->caps.num_qp_per_mgm) {
/* entry is full */
err = -ENOMEM;
goto out_list;
}
mgm->qp[members_count++] = cpu_to_be32(dqp->qpn & MGM_QPN_MASK); mgm->qp[members_count++] = cpu_to_be32(dqp->qpn & MGM_QPN_MASK);
}
mgm->members_count = cpu_to_be32(members_count | MLX4_PROT_ETH << 30); mgm->members_count = cpu_to_be32(members_count | MLX4_PROT_ETH << 30);
err = mlx4_WRITE_PROMISC(dev, port, steer, mailbox); err = mlx4_WRITE_PROMISC(dev, port, steer, mailbox);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment