* [PATCH net-next] net/mlx4_core: Remove unnecessary validation for port number
@ 2014-01-21 8:19 Amir Vadai
2014-01-22 7:14 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Amir Vadai @ 2014-01-21 8:19 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev, Or Gerlitz, Moni Shoua, Matan Barak, Amir Vadai
From: Moni Shoua <monis@mellanox.co.il>
This is a fix to a regression introduced by commit:
"982290a net/mlx4_core: Check port number for validity
before accessing data"
IPoIB could not attach to multicast group and we get this in dmesg:
[144214.145008] ib0: failed to attach to multicast group, ret = -22
[144214.145016] ib0: couldn't attach QP to multicast group ff12:401b:ffff:0000:0000:0000:ffff:ffff
[144214.145019] ib0: multicast join failed for ff12:401b:ffff:0000:0000:0000:ffff:ffff, status -22
The cause to the problem is because port is extracted from gid[5].
Which is only valid for Ethernet.
Removed this validation in mlx4_qp_attach_common(), which is accessed
from both Ethernet and IB flows.
Error flow for bad port value in Ethernet is already exists in that
function.
Signed-off-by: Moni Shoua <monis@mellanox.co.il>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx4/mcg.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index bfe65f7..aefb74f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -943,9 +943,6 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
u8 port = gid[5];
u8 new_entry = 0;
- if (port < 1 || port > dev->caps.num_ports)
- return -EINVAL;
-
mailbox = mlx4_alloc_cmd_mailbox(dev);
if (IS_ERR(mailbox))
return PTR_ERR(mailbox);
--
1.8.3.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net/mlx4_core: Remove unnecessary validation for port number
2014-01-21 8:19 [PATCH net-next] net/mlx4_core: Remove unnecessary validation for port number Amir Vadai
@ 2014-01-22 7:14 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-01-22 7:14 UTC (permalink / raw)
To: amirv; +Cc: netdev, ogerlitz, monis, matanb
From: Amir Vadai <amirv@mellanox.com>
Date: Tue, 21 Jan 2014 10:19:37 +0200
> From: Moni Shoua <monis@mellanox.co.il>
>
> This is a fix to a regression introduced by commit:
> "982290a net/mlx4_core: Check port number for validity
> before accessing data"
>
> IPoIB could not attach to multicast group and we get this in dmesg:
> [144214.145008] ib0: failed to attach to multicast group, ret = -22
> [144214.145016] ib0: couldn't attach QP to multicast group ff12:401b:ffff:0000:0000:0000:ffff:ffff
> [144214.145019] ib0: multicast join failed for ff12:401b:ffff:0000:0000:0000:ffff:ffff, status -22
>
> The cause to the problem is because port is extracted from gid[5].
> Which is only valid for Ethernet.
> Removed this validation in mlx4_qp_attach_common(), which is accessed
> from both Ethernet and IB flows.
> Error flow for bad port value in Ethernet is already exists in that
> function.
>
> Signed-off-by: Moni Shoua <monis@mellanox.co.il>
> Signed-off-by: Matan Barak <matanb@mellanox.com>
> Signed-off-by: Amir Vadai <amirv@mellanox.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-22 7:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-21 8:19 [PATCH net-next] net/mlx4_core: Remove unnecessary validation for port number Amir Vadai
2014-01-22 7:14 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).