diff options
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib.h | 4 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_cm.c | 31 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 31 |
3 files changed, 33 insertions, 33 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h index 196eb52f0035..07ca6fd5546b 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib.h +++ b/drivers/infiniband/ulp/ipoib/ipoib.h | |||
| @@ -535,14 +535,14 @@ void ipoib_drain_cq(struct net_device *dev); | |||
| 535 | void ipoib_set_ethtool_ops(struct net_device *dev); | 535 | void ipoib_set_ethtool_ops(struct net_device *dev); |
| 536 | int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca); | 536 | int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca); |
| 537 | 537 | ||
| 538 | #ifdef CONFIG_INFINIBAND_IPOIB_CM | ||
| 539 | |||
| 540 | #define IPOIB_FLAGS_RC 0x80 | 538 | #define IPOIB_FLAGS_RC 0x80 |
| 541 | #define IPOIB_FLAGS_UC 0x40 | 539 | #define IPOIB_FLAGS_UC 0x40 |
| 542 | 540 | ||
| 543 | /* We don't support UC connections at the moment */ | 541 | /* We don't support UC connections at the moment */ |
| 544 | #define IPOIB_CM_SUPPORTED(ha) (ha[0] & (IPOIB_FLAGS_RC)) | 542 | #define IPOIB_CM_SUPPORTED(ha) (ha[0] & (IPOIB_FLAGS_RC)) |
| 545 | 543 | ||
| 544 | #ifdef CONFIG_INFINIBAND_IPOIB_CM | ||
| 545 | |||
| 546 | extern int ipoib_max_conn_qp; | 546 | extern int ipoib_max_conn_qp; |
| 547 | 547 | ||
| 548 | static inline int ipoib_cm_admin_enabled(struct net_device *dev) | 548 | static inline int ipoib_cm_admin_enabled(struct net_device *dev) |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 175581cf478c..72ae63f0072d 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c | |||
| @@ -1448,37 +1448,6 @@ static ssize_t show_mode(struct device *d, struct device_attribute *attr, | |||
| 1448 | return sprintf(buf, "datagram\n"); | 1448 | return sprintf(buf, "datagram\n"); |
| 1449 | } | 1449 | } |
| 1450 | 1450 | ||
| 1451 | int ipoib_set_mode(struct net_device *dev, const char *buf) | ||
| 1452 | { | ||
| 1453 | struct ipoib_dev_priv *priv = netdev_priv(dev); | ||
| 1454 | |||
| 1455 | /* flush paths if we switch modes so that connections are restarted */ | ||
| 1456 | if (IPOIB_CM_SUPPORTED(dev->dev_addr) && !strcmp(buf, "connected\n")) { | ||
| 1457 | set_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); | ||
| 1458 | ipoib_warn(priv, "enabling connected mode " | ||
| 1459 | "will cause multicast packet drops\n"); | ||
| 1460 | netdev_update_features(dev); | ||
| 1461 | rtnl_unlock(); | ||
| 1462 | priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM; | ||
| 1463 | |||
| 1464 | ipoib_flush_paths(dev); | ||
| 1465 | rtnl_lock(); | ||
| 1466 | return 0; | ||
| 1467 | } | ||
| 1468 | |||
| 1469 | if (!strcmp(buf, "datagram\n")) { | ||
| 1470 | clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); | ||
| 1471 | netdev_update_features(dev); | ||
| 1472 | dev_set_mtu(dev, min(priv->mcast_mtu, dev->mtu)); | ||
| 1473 | rtnl_unlock(); | ||
| 1474 | ipoib_flush_paths(dev); | ||
| 1475 | rtnl_lock(); | ||
| 1476 | return 0; | ||
| 1477 | } | ||
| 1478 | |||
| 1479 | return -EINVAL; | ||
| 1480 | } | ||
| 1481 | |||
| 1482 | static ssize_t set_mode(struct device *d, struct device_attribute *attr, | 1451 | static ssize_t set_mode(struct device *d, struct device_attribute *attr, |
| 1483 | const char *buf, size_t count) | 1452 | const char *buf, size_t count) |
| 1484 | { | 1453 | { |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index d576c7aad89d..6fdc9e78da0d 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
| @@ -215,6 +215,37 @@ static int ipoib_change_mtu(struct net_device *dev, int new_mtu) | |||
| 215 | return 0; | 215 | return 0; |
| 216 | } | 216 | } |
| 217 | 217 | ||
| 218 | int ipoib_set_mode(struct net_device *dev, const char *buf) | ||
| 219 | { | ||
| 220 | struct ipoib_dev_priv *priv = netdev_priv(dev); | ||
| 221 | |||
| 222 | /* flush paths if we switch modes so that connections are restarted */ | ||
| 223 | if (IPOIB_CM_SUPPORTED(dev->dev_addr) && !strcmp(buf, "connected\n")) { | ||
| 224 | set_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); | ||
| 225 | ipoib_warn(priv, "enabling connected mode " | ||
| 226 | "will cause multicast packet drops\n"); | ||
| 227 | netdev_update_features(dev); | ||
| 228 | rtnl_unlock(); | ||
| 229 | priv->tx_wr.send_flags &= ~IB_SEND_IP_CSUM; | ||
| 230 | |||
| 231 | ipoib_flush_paths(dev); | ||
| 232 | rtnl_lock(); | ||
| 233 | return 0; | ||
| 234 | } | ||
| 235 | |||
| 236 | if (!strcmp(buf, "datagram\n")) { | ||
| 237 | clear_bit(IPOIB_FLAG_ADMIN_CM, &priv->flags); | ||
| 238 | netdev_update_features(dev); | ||
| 239 | dev_set_mtu(dev, min(priv->mcast_mtu, dev->mtu)); | ||
| 240 | rtnl_unlock(); | ||
| 241 | ipoib_flush_paths(dev); | ||
| 242 | rtnl_lock(); | ||
| 243 | return 0; | ||
| 244 | } | ||
| 245 | |||
| 246 | return -EINVAL; | ||
| 247 | } | ||
| 248 | |||
| 218 | static struct ipoib_path *__path_find(struct net_device *dev, void *gid) | 249 | static struct ipoib_path *__path_find(struct net_device *dev, void *gid) |
| 219 | { | 250 | { |
| 220 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 251 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
