diff options
| author | Doug Ledford <dledford@redhat.com> | 2014-12-10 11:47:05 -0500 |
|---|---|---|
| committer | Roland Dreier <roland@purestorage.com> | 2014-12-15 21:11:15 -0500 |
| commit | ce347ab90eaabc69a6146d41943981d51e7a9b82 (patch) | |
| tree | 7d8afaf45f93e9f96f93ad1cd8f1ce40da82a566 | |
| parent | bb42a6dd02fb2901a69dbec2358810735b14b186 (diff) | |
IPoIB: No longer use flush as a parameter
Various places in the IPoIB code had a deadlock related to flushing
the ipoib workqueue. Now that we have per device workqueues and a
specific flush workqueue, there is no longer a deadlock issue with
flushing the device specific workqueues and we can do so unilaterally.
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 6 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 19 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 |
3 files changed, 16 insertions, 17 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 28dc927c0e8b..8ba80a6d3a46 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
| @@ -484,10 +484,10 @@ void ipoib_ib_dev_flush_heavy(struct work_struct *work); | |||
| 484 | void ipoib_pkey_event(struct work_struct *work); | 484 | void ipoib_pkey_event(struct work_struct *work); |
| 485 | void ipoib_ib_dev_cleanup(struct net_device *dev); | 485 | void ipoib_ib_dev_cleanup(struct net_device *dev); |
| 486 | 486 | ||
| 487 | int ipoib_ib_dev_open(struct net_device *dev, int flush); | 487 | int ipoib_ib_dev_open(struct net_device *dev); |
| 488 | int ipoib_ib_dev_up(struct net_device *dev); | 488 | int ipoib_ib_dev_up(struct net_device *dev); |
| 489 | int ipoib_ib_dev_down(struct net_device *dev, int flush); | 489 | int ipoib_ib_dev_down(struct net_device *dev); |
| 490 | int ipoib_ib_dev_stop(struct net_device *dev, int flush); | 490 | int ipoib_ib_dev_stop(struct net_device *dev); |
| 491 | void ipoib_pkey_dev_check_presence(struct net_device *dev); | 491 | void ipoib_pkey_dev_check_presence(struct net_device *dev); |
| 492 | 492 | ||
| 493 | int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); | 493 | int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 660967871191..fe65abb5150c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
| @@ -664,7 +664,7 @@ static void ipoib_ib_tx_timer_func(unsigned long ctx) | |||
| 664 | drain_tx_cq((struct net_device *)ctx); | 664 | drain_tx_cq((struct net_device *)ctx); |
| 665 | } | 665 | } |
| 666 | 666 | ||
| 667 | int ipoib_ib_dev_open(struct net_device *dev, int flush) | 667 | int ipoib_ib_dev_open(struct net_device *dev) |
| 668 | { | 668 | { |
| 669 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 669 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
| 670 | int ret; | 670 | int ret; |
| @@ -706,7 +706,7 @@ int ipoib_ib_dev_open(struct net_device *dev, int flush) | |||
| 706 | dev_stop: | 706 | dev_stop: |
| 707 | if (!test_and_set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags)) | 707 | if (!test_and_set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags)) |
| 708 | napi_enable(&priv->napi); | 708 | napi_enable(&priv->napi); |
| 709 | ipoib_ib_dev_stop(dev, flush); | 709 | ipoib_ib_dev_stop(dev); |
| 710 | return -1; | 710 | return -1; |
| 711 | } | 711 | } |
| 712 | 712 | ||
| @@ -738,7 +738,7 @@ int ipoib_ib_dev_up(struct net_device *dev) | |||
| 738 | return ipoib_mcast_start_thread(dev); | 738 | return ipoib_mcast_start_thread(dev); |
| 739 | } | 739 | } |
| 740 | 740 | ||
| 741 | int ipoib_ib_dev_down(struct net_device *dev, int flush) | 741 | int ipoib_ib_dev_down(struct net_device *dev) |
| 742 | { | 742 | { |
| 743 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 743 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
| 744 | 744 | ||
| @@ -807,7 +807,7 @@ void ipoib_drain_cq(struct net_device *dev) | |||
| 807 | local_bh_enable(); | 807 | local_bh_enable(); |
| 808 | } | 808 | } |
| 809 | 809 | ||
| 810 | int ipoib_ib_dev_stop(struct net_device *dev, int flush) | 810 | int ipoib_ib_dev_stop(struct net_device *dev) |
| 811 | { | 811 | { |
| 812 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 812 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
| 813 | struct ib_qp_attr qp_attr; | 813 | struct ib_qp_attr qp_attr; |
| @@ -880,8 +880,7 @@ timeout: | |||
| 880 | /* Wait for all AHs to be reaped */ | 880 | /* Wait for all AHs to be reaped */ |
| 881 | set_bit(IPOIB_STOP_REAPER, &priv->flags); | 881 | set_bit(IPOIB_STOP_REAPER, &priv->flags); |
| 882 | cancel_delayed_work(&priv->ah_reap_task); | 882 | cancel_delayed_work(&priv->ah_reap_task); |
| 883 | if (flush) | 883 | flush_workqueue(priv->wq); |
| 884 | flush_workqueue(priv->wq); | ||
| 885 | 884 | ||
| 886 | begin = jiffies; | 885 | begin = jiffies; |
| 887 | 886 | ||
| @@ -918,7 +917,7 @@ int ipoib_ib_dev_init(struct net_device *dev, struct ib_device *ca, int port) | |||
| 918 | (unsigned long) dev); | 917 | (unsigned long) dev); |
| 919 | 918 | ||
| 920 | if (dev->flags & IFF_UP) { | 919 | if (dev->flags & IFF_UP) { |
| 921 | if (ipoib_ib_dev_open(dev, 1)) { | 920 | if (ipoib_ib_dev_open(dev)) { |
| 922 | ipoib_transport_dev_cleanup(dev); | 921 | ipoib_transport_dev_cleanup(dev); |
| 923 | return -ENODEV; | 922 | return -ENODEV; |
| 924 | } | 923 | } |
| @@ -1040,12 +1039,12 @@ static void __ipoib_ib_dev_flush(struct ipoib_dev_priv *priv, | |||
| 1040 | } | 1039 | } |
| 1041 | 1040 | ||
| 1042 | if (level >= IPOIB_FLUSH_NORMAL) | 1041 | if (level >= IPOIB_FLUSH_NORMAL) |
| 1043 | ipoib_ib_dev_down(dev, 0); | 1042 | ipoib_ib_dev_down(dev); |
| 1044 | 1043 | ||
| 1045 | if (level == IPOIB_FLUSH_HEAVY) { | 1044 | if (level == IPOIB_FLUSH_HEAVY) { |
| 1046 | if (test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags)) | 1045 | if (test_bit(IPOIB_FLAG_INITIALIZED, &priv->flags)) |
| 1047 | ipoib_ib_dev_stop(dev, 0); | 1046 | ipoib_ib_dev_stop(dev); |
| 1048 | if (ipoib_ib_dev_open(dev, 0) != 0) | 1047 | if (ipoib_ib_dev_open(dev) != 0) |
| 1049 | return; | 1048 | return; |
| 1050 | if (netif_queue_stopped(dev)) | 1049 | if (netif_queue_stopped(dev)) |
| 1051 | netif_start_queue(dev); | 1050 | netif_start_queue(dev); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 42e5c278f489..6bad17d4d588 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
| @@ -108,7 +108,7 @@ int ipoib_open(struct net_device *dev) | |||
| 108 | 108 | ||
| 109 | set_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags); | 109 | set_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags); |
| 110 | 110 | ||
| 111 | if (ipoib_ib_dev_open(dev, 1)) { | 111 | if (ipoib_ib_dev_open(dev)) { |
| 112 | if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) | 112 | if (!test_bit(IPOIB_PKEY_ASSIGNED, &priv->flags)) |
| 113 | return 0; | 113 | return 0; |
| 114 | goto err_disable; | 114 | goto err_disable; |
| @@ -139,7 +139,7 @@ int ipoib_open(struct net_device *dev) | |||
| 139 | return 0; | 139 | return 0; |
| 140 | 140 | ||
| 141 | err_stop: | 141 | err_stop: |
| 142 | ipoib_ib_dev_stop(dev, 1); | 142 | ipoib_ib_dev_stop(dev); |
| 143 | 143 | ||
| 144 | err_disable: | 144 | err_disable: |
| 145 | clear_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags); | 145 | clear_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags); |
| @@ -157,8 +157,8 @@ static int ipoib_stop(struct net_device *dev) | |||
| 157 | 157 | ||
| 158 | netif_stop_queue(dev); | 158 | netif_stop_queue(dev); |
| 159 | 159 | ||
| 160 | ipoib_ib_dev_down(dev, 1); | 160 | ipoib_ib_dev_down(dev); |
| 161 | ipoib_ib_dev_stop(dev, 0); | 161 | ipoib_ib_dev_stop(dev); |
| 162 | 162 | ||
| 163 | if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { | 163 | if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { |
| 164 | struct ipoib_dev_priv *cpriv; | 164 | struct ipoib_dev_priv *cpriv; |
