Re: [PATCH 1/8] IPoIB: Consolidate rtnl_lock tasks in workqueue

2014-08-15 Thread Wendy Cheng
On Tue, Aug 12, 2014 at 4:38 PM, Doug Ledford dledf...@redhat.com wrote:
 Setting the mtu can safely be moved to the carrier_on_task, which keeps
 us from needing to take the rtnl lock in the join_finish section.


Looks good !

Acked-by: Wendy Cheng wendy.ch...@intel.com

 Signed-off-by: Doug Ledford dledf...@redhat.com
 ---
  drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 8 ++--
  1 file changed, 2 insertions(+), 6 deletions(-)

 diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 
 b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
 index d4e005720d0..a0a42859f12 100644
 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
 +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
 @@ -190,12 +190,6 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast 
 *mcast,
 spin_unlock_irq(priv-lock);
 priv-tx_wr.wr.ud.remote_qkey = priv-qkey;
 set_qkey = 1;
 -
 -   if (!ipoib_cm_admin_enabled(dev)) {
 -   rtnl_lock();
 -   dev_set_mtu(dev, min(priv-mcast_mtu, 
 priv-admin_mtu));
 -   rtnl_unlock();
 -   }
 }

 if (!test_bit(IPOIB_MCAST_FLAG_SENDONLY, mcast-flags)) {
 @@ -371,6 +365,8 @@ void ipoib_mcast_carrier_on_task(struct work_struct *work)
 }

 rtnl_lock();
 +   if (!ipoib_cm_admin_enabled(priv-dev))
 +   dev_set_mtu(priv-dev, min(priv-mcast_mtu, priv-admin_mtu));
 netif_carrier_on(priv-dev);
 rtnl_unlock();
  }
 --
 1.9.3

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


[PATCH 1/8] IPoIB: Consolidate rtnl_lock tasks in workqueue

2014-08-12 Thread Doug Ledford
Setting the mtu can safely be moved to the carrier_on_task, which keeps
us from needing to take the rtnl lock in the join_finish section.

Signed-off-by: Doug Ledford dledf...@redhat.com
---
 drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c 
b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index d4e005720d0..a0a42859f12 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -190,12 +190,6 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast 
*mcast,
spin_unlock_irq(priv-lock);
priv-tx_wr.wr.ud.remote_qkey = priv-qkey;
set_qkey = 1;
-
-   if (!ipoib_cm_admin_enabled(dev)) {
-   rtnl_lock();
-   dev_set_mtu(dev, min(priv-mcast_mtu, priv-admin_mtu));
-   rtnl_unlock();
-   }
}
 
if (!test_bit(IPOIB_MCAST_FLAG_SENDONLY, mcast-flags)) {
@@ -371,6 +365,8 @@ void ipoib_mcast_carrier_on_task(struct work_struct *work)
}
 
rtnl_lock();
+   if (!ipoib_cm_admin_enabled(priv-dev))
+   dev_set_mtu(priv-dev, min(priv-mcast_mtu, priv-admin_mtu));
netif_carrier_on(priv-dev);
rtnl_unlock();
 }
-- 
1.9.3

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