linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mlx4: Fix unneeded return error in eth_link_query_port
@ 2010-10-24  7:58 Eli Cohen
  2010-10-24 15:42 ` Roland Dreier
  0 siblings, 1 reply; 29+ messages in thread
From: Eli Cohen @ 2010-10-24  7:58 UTC (permalink / raw)
  To: Roland Dreier; +Cc: RDMA list

eth_link_query_port() returns error if a netdevice was not yet associated with
the IBoE port. This is not required since we already initialize the link as
down.  On the other hand, we need other information that the query provides.
Specifically, this can cause a failure to initilize an IBoE device after this
commit 5eb620c8, which calls ib_query_port().
Fix this by always returning success.

Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/main.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 30cd111..bf3e20c 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -217,7 +217,6 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 {
 	struct mlx4_ib_iboe *iboe = &to_mdev(ibdev)->iboe;
 	struct net_device *ndev;
-	int err = 0;
 	enum ib_mtu tmp;
 
 	props->active_width	= IB_WIDTH_4X;
@@ -237,10 +236,8 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 	props->active_mtu	= IB_MTU_256;
 	spin_lock(&iboe->lock);
 	ndev = iboe->netdevs[port - 1];
-	if (!ndev) {
-		err = -ENOMEM;
+	if (!ndev)
 		goto out;
-	}
 
 	tmp = iboe_get_mtu(ndev->mtu);
 	props->active_mtu = tmp ? min(props->max_mtu, tmp) : IB_MTU_256;
@@ -251,7 +248,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 
 out:
 	spin_unlock(&iboe->lock);
-	return err;
+	return 0;
 }
 
 static int mlx4_ib_query_port(struct ib_device *ibdev, u8 port,
-- 
1.7.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2010-10-26 13:46 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-24  7:58 [PATCH] mlx4: Fix unneeded return error in eth_link_query_port Eli Cohen
2010-10-24 15:42 ` Roland Dreier
     [not found]   ` <adahbgbppgx.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-24 16:00     ` Eli Cohen
2010-10-24 16:22       ` Roland Dreier
     [not found]         ` <adaocajo90s.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-24 18:05           ` Eli Cohen
     [not found]             ` <AANLkTimb++kFYFXCWajBGACpA1OpCXyyeyD-98Ed3uTu-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25  4:12               ` Roland Dreier
     [not found]                 ` <adad3qync5m.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-25  8:18                   ` Eli Cohen
2010-10-25  9:26               ` Or Gerlitz
     [not found]                 ` <4CC54D4E.7050203-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-25  9:33                   ` Or Gerlitz
     [not found]                     ` <4CC54ED7.6030303-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-25 11:37                       ` Eli Cohen
2010-10-25 10:47                   ` can't get IB link with the for-next branch / IBoE patches (was "mlx4: Fix unneeded return error...") Or Gerlitz
     [not found]                     ` <4CC5604D.2080803-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-25 13:36                       ` can't get IB link with the for-next branch / IBoE patches Roland Dreier
     [not found]                         ` <adaaam2jswk.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-25 16:17                           ` Eli Cohen
2010-10-25 16:45                             ` Or Gerlitz
2010-10-25 17:23                             ` Roland Dreier
     [not found]                               ` <adalj5mgp96.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-25 17:35                                 ` Roland Dreier
     [not found]                                   ` <adahbgagopw.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2010-10-26  9:33                                     ` Or Gerlitz
     [not found]                                       ` <4CC6A051.3010703-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-26 12:19                                         ` Or Gerlitz
     [not found]                                           ` <4CC6C75F.8030103-hKgKHo2Ms0FWk0Htik3J/w@public.gmane.org>
2010-10-26 13:10                                             ` Or Gerlitz
2010-10-26 13:46                                             ` Eli Cohen
2010-10-25 10:47                   ` can't get IB link with the for-next branch / IBoE patches (was "mlx4: Fix unneeded return error...") Or Gerlitz
2010-10-25 11:34                   ` [PATCH] mlx4: Fix unneeded return error in eth_link_query_port Eli Cohen
2010-10-25 14:15                     ` Or Gerlitz
     [not found]                       ` <AANLkTi=ZxB4b463OOS6YGxTJSKxjyCj8vy0rNtj0n+uA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 14:36                         ` Eli Cohen
2010-10-25 16:46                           ` Or Gerlitz
     [not found]                             ` <AANLkTimaEcFZMnYE+G3osTWzPkfxuBpRMtrrXF7xUPYv-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 17:13                               ` Eli Cohen
2010-10-25 19:04                                 ` Or Gerlitz
     [not found]                                   ` <AANLkTik_4OzMLMWXud89m_rF47OQ3Wji9R_Bye+0DcTV-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 19:15                                     ` Eli Cohen
     [not found]                                       ` <AANLkTi=yZUoexwVUCfbeGypEWC_8=oZaMu9mBTF+VJgq-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-25 19:38                                         ` Or Gerlitz

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).