diff options
| author | Roland Dreier <roland@purestorage.com> | 2015-01-30 18:38:46 -0500 |
|---|---|---|
| committer | Roland Dreier <roland@purestorage.com> | 2015-01-30 18:38:46 -0500 |
| commit | 4e0ab200fa4594d16bb7fc697ec4d9edfb5a43f0 (patch) | |
| tree | ee5fea6eb4d86d237269259733840db95c44e7b4 /drivers/infiniband/ulp/ipoib | |
| parent | a84544a4feb2cf5cafdf3cce3269da0c3b4fcc45 (diff) | |
Revert "IPoIB: Make ipoib_mcast_stop_thread flush the workqueue"
This reverts commit bb42a6dd02fb2901a69dbec2358810735b14b186.
The series of IPoIB bug fixes that went into 3.19-rc1 introduce
regressions, and after trying to sort things out, we decided to revert
to 3.18's IPoIB driver and get things right for 3.20.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib')
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 2 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 4 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 21 |
3 files changed, 15 insertions, 12 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 28dc927c0e8b..45fd10a72ec1 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
| @@ -499,7 +499,7 @@ void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb); | |||
| 499 | 499 | ||
| 500 | void ipoib_mcast_restart_task(struct work_struct *work); | 500 | void ipoib_mcast_restart_task(struct work_struct *work); |
| 501 | int ipoib_mcast_start_thread(struct net_device *dev); | 501 | int ipoib_mcast_start_thread(struct net_device *dev); |
| 502 | int ipoib_mcast_stop_thread(struct net_device *dev); | 502 | int ipoib_mcast_stop_thread(struct net_device *dev, int flush); |
| 503 | 503 | ||
| 504 | void ipoib_mcast_dev_down(struct net_device *dev); | 504 | void ipoib_mcast_dev_down(struct net_device *dev); |
| 505 | void ipoib_mcast_dev_flush(struct net_device *dev); | 505 | void ipoib_mcast_dev_flush(struct net_device *dev); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 660967871191..bfd17d41b5f2 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
| @@ -747,7 +747,7 @@ int ipoib_ib_dev_down(struct net_device *dev, int flush) | |||
| 747 | clear_bit(IPOIB_FLAG_OPER_UP, &priv->flags); | 747 | clear_bit(IPOIB_FLAG_OPER_UP, &priv->flags); |
| 748 | netif_carrier_off(dev); | 748 | netif_carrier_off(dev); |
| 749 | 749 | ||
| 750 | ipoib_mcast_stop_thread(dev); | 750 | ipoib_mcast_stop_thread(dev, flush); |
| 751 | ipoib_mcast_dev_flush(dev); | 751 | ipoib_mcast_dev_flush(dev); |
| 752 | 752 | ||
| 753 | ipoib_flush_paths(dev); | 753 | ipoib_flush_paths(dev); |
| @@ -1097,7 +1097,7 @@ void ipoib_ib_dev_cleanup(struct net_device *dev) | |||
| 1097 | */ | 1097 | */ |
| 1098 | ipoib_flush_paths(dev); | 1098 | ipoib_flush_paths(dev); |
| 1099 | 1099 | ||
| 1100 | ipoib_mcast_stop_thread(dev); | 1100 | ipoib_mcast_stop_thread(dev, 1); |
| 1101 | ipoib_mcast_dev_flush(dev); | 1101 | ipoib_mcast_dev_flush(dev); |
| 1102 | 1102 | ||
| 1103 | ipoib_transport_dev_cleanup(dev); | 1103 | ipoib_transport_dev_cleanup(dev); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index bc50dd0d0e4d..845f910eb214 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
| @@ -648,7 +648,7 @@ int ipoib_mcast_start_thread(struct net_device *dev) | |||
| 648 | return 0; | 648 | return 0; |
| 649 | } | 649 | } |
| 650 | 650 | ||
| 651 | int ipoib_mcast_stop_thread(struct net_device *dev) | 651 | int ipoib_mcast_stop_thread(struct net_device *dev, int flush) |
| 652 | { | 652 | { |
| 653 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 653 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
| 654 | 654 | ||
| @@ -659,7 +659,8 @@ int ipoib_mcast_stop_thread(struct net_device *dev) | |||
| 659 | cancel_delayed_work(&priv->mcast_task); | 659 | cancel_delayed_work(&priv->mcast_task); |
| 660 | mutex_unlock(&mcast_mutex); | 660 | mutex_unlock(&mcast_mutex); |
| 661 | 661 | ||
| 662 | flush_workqueue(priv->wq); | 662 | if (flush) |
| 663 | flush_workqueue(priv->wq); | ||
| 663 | 664 | ||
| 664 | return 0; | 665 | return 0; |
| 665 | } | 666 | } |
| @@ -837,6 +838,8 @@ void ipoib_mcast_restart_task(struct work_struct *work) | |||
| 837 | 838 | ||
| 838 | ipoib_dbg_mcast(priv, "restarting multicast task\n"); | 839 | ipoib_dbg_mcast(priv, "restarting multicast task\n"); |
| 839 | 840 | ||
| 841 | ipoib_mcast_stop_thread(dev, 0); | ||
| 842 | |||
| 840 | local_irq_save(flags); | 843 | local_irq_save(flags); |
| 841 | netif_addr_lock(dev); | 844 | netif_addr_lock(dev); |
| 842 | spin_lock(&priv->lock); | 845 | spin_lock(&priv->lock); |
| @@ -933,10 +936,13 @@ void ipoib_mcast_restart_task(struct work_struct *work) | |||
| 933 | * We have to cancel outside of the spinlock, but we have to | 936 | * We have to cancel outside of the spinlock, but we have to |
| 934 | * take the rtnl lock or else we race with the removal of | 937 | * take the rtnl lock or else we race with the removal of |
| 935 | * entries from the remove list in mcast_dev_flush as part | 938 | * entries from the remove list in mcast_dev_flush as part |
| 936 | * of ipoib_stop(). We detect the drop of the ADMIN_UP flag | 939 | * of ipoib_stop() which will call mcast_stop_thread with |
| 937 | * to signal that we have hit this particular race, and we | 940 | * flush == 1 while holding the rtnl lock, and the |
| 938 | * return since we know we don't need to do anything else | 941 | * flush_workqueue won't complete until this restart_mcast_task |
| 939 | * anyway. | 942 | * completes. So do like the carrier on task and attempt to |
| 943 | * take the rtnl lock, but if we can't before the ADMIN_UP flag | ||
| 944 | * goes away, then just return and know that the remove list will | ||
| 945 | * get flushed later by mcast_stop_thread. | ||
| 940 | */ | 946 | */ |
| 941 | while (!rtnl_trylock()) { | 947 | while (!rtnl_trylock()) { |
| 942 | if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) | 948 | if (!test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)) |
| @@ -948,9 +954,6 @@ void ipoib_mcast_restart_task(struct work_struct *work) | |||
| 948 | ipoib_mcast_leave(mcast->dev, mcast); | 954 | ipoib_mcast_leave(mcast->dev, mcast); |
| 949 | ipoib_mcast_free(mcast); | 955 | ipoib_mcast_free(mcast); |
| 950 | } | 956 | } |
| 951 | /* | ||
| 952 | * Restart our join task if needed | ||
| 953 | */ | ||
| 954 | ipoib_mcast_start_thread(dev); | 957 | ipoib_mcast_start_thread(dev); |
| 955 | rtnl_unlock(); | 958 | rtnl_unlock(); |
| 956 | } | 959 | } |
