Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b997657 authored by Yuval Shaia's avatar Yuval Shaia Committed by Roland Dreier
Browse files

mlx4_core: Check for DPDP violation only when DPDP is not supported



Move check for DPDP out of the loop to make the code more readable.

Signed-off-by: default avatarYuval Shaia <yuval.shaia@oracle.com>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 9f35e899
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -171,9 +171,9 @@ int mlx4_check_port_params(struct mlx4_dev *dev,
{
{
	int i;
	int i;


	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) {
		for (i = 0; i < dev->caps.num_ports - 1; i++) {
		for (i = 0; i < dev->caps.num_ports - 1; i++) {
			if (port_type[i] != port_type[i + 1]) {
			if (port_type[i] != port_type[i + 1]) {
			if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_DPDP)) {
				mlx4_err(dev, "Only same port types supported on this HCA, aborting\n");
				mlx4_err(dev, "Only same port types supported on this HCA, aborting\n");
				return -EINVAL;
				return -EINVAL;
			}
			}