From b2ee3556a399281cfeed79cd8674eb0fab841820 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Mon, 30 Mar 2009 08:31:05 -0700 Subject: [PATCH] --- yaml --- r: 142945 b: refs/heads/master c: e1d60ec6699f19b760df8261e922ae236ea7bb31 h: refs/heads/master i: 142943: bedf94444bf608c2245c2d3a95fa0a3145731dad v: v3 --- [refs] | 2 +- trunk/Documentation/infiniband/ipoib.txt | 45 ------------------- trunk/drivers/infiniband/hw/mlx4/main.c | 3 +- .../drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 25 +++++------ 4 files changed, 12 insertions(+), 63 deletions(-) diff --git a/[refs] b/[refs] index b49627d81794..6f8395540784 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6a3335b43342b42dd6c69b4bbbde15d622cb49ca +refs/heads/master: e1d60ec6699f19b760df8261e922ae236ea7bb31 diff --git a/trunk/Documentation/infiniband/ipoib.txt b/trunk/Documentation/infiniband/ipoib.txt index 6d40f00b358c..864ff3283780 100644 --- a/trunk/Documentation/infiniband/ipoib.txt +++ b/trunk/Documentation/infiniband/ipoib.txt @@ -24,49 +24,6 @@ Partitions and P_Keys The P_Key for any interface is given by the "pkey" file, and the main interface for a subinterface is in "parent." -Datagram vs Connected modes - - The IPoIB driver supports two modes of operation: datagram and - connected. The mode is set and read through an interface's - /sys/class/net//mode file. - - In datagram mode, the IB UD (Unreliable Datagram) transport is used - and so the interface MTU has is equal to the IB L2 MTU minus the - IPoIB encapsulation header (4 bytes). For example, in a typical IB - fabric with a 2K MTU, the IPoIB MTU will be 2048 - 4 = 2044 bytes. - - In connected mode, the IB RC (Reliable Connected) transport is used. - Connected mode is to takes advantage of the connected nature of the - IB transport and allows an MTU up to the maximal IP packet size of - 64K, which reduces the number of IP packets needed for handling - large UDP datagrams, TCP segments, etc and increases the performance - for large messages. - - In connected mode, the interface's UD QP is still used for multicast - and communication with peers that don't support connected mode. In - this case, RX emulation of ICMP PMTU packets is used to cause the - networking stack to use the smaller UD MTU for these neighbours. - -Stateless offloads - - If the IB HW supports IPoIB stateless offloads, IPoIB advertises - TCP/IP checksum and/or Large Send (LSO) offloading capability to the - network stack. - - Large Receive (LRO) offloading is also implemented and may be turned - on/off using ethtool calls. Currently LRO is supported only for - checksum offload capable devices. - - Stateless offloads are supported only in datagram mode. - -Interrupt moderation - - If the underlying IB device supports CQ event moderation, one can - use ethtool to set interrupt mitigation parameters and thus reduce - the overhead incurred by handling interrupts. The main code path of - IPoIB doesn't use events for TX completion signaling so only RX - moderation is supported. - Debugging Information By compiling the IPoIB driver with CONFIG_INFINIBAND_IPOIB_DEBUG set @@ -98,5 +55,3 @@ References http://ietf.org/rfc/rfc4391.txt IP over InfiniBand (IPoIB) Architecture (RFC 4392) http://ietf.org/rfc/rfc4392.txt - IP over InfiniBand: Connected Mode (RFC 4755) - http://ietf.org/rfc/rfc4755.txt diff --git a/trunk/drivers/infiniband/hw/mlx4/main.c b/trunk/drivers/infiniband/hw/mlx4/main.c index 2ccb9d31771f..ae3d7590346e 100644 --- a/trunk/drivers/infiniband/hw/mlx4/main.c +++ b/trunk/drivers/infiniband/hw/mlx4/main.c @@ -394,8 +394,7 @@ static int mlx4_ib_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) PAGE_SIZE, vma->vm_page_prot)) return -EAGAIN; } else if (vma->vm_pgoff == 1 && dev->dev->caps.bf_reg_size != 0) { - /* FIXME want pgprot_writecombine() for BlueFlame pages */ - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); + vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); if (io_remap_pfn_range(vma, vma->vm_start, to_mucontext(context)->uar.pfn + diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_vlan.c index 4c57f329dd50..5a76a5510350 100644 --- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_vlan.c +++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_vlan.c @@ -70,14 +70,12 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) */ if (ppriv->pkey == pkey) { result = -ENOTUNIQ; - priv = NULL; goto err; } list_for_each_entry(priv, &ppriv->child_intfs, list) { if (priv->pkey == pkey) { result = -ENOTUNIQ; - priv = NULL; goto err; } } @@ -98,7 +96,7 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) result = ipoib_set_dev_features(priv, ppriv->ca); if (result) - goto err; + goto device_init_failed; priv->pkey = pkey; @@ -111,7 +109,7 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) ipoib_warn(ppriv, "failed to initialize subinterface: " "device %s, port %d", ppriv->ca->name, ppriv->port); - goto err; + goto device_init_failed; } result = register_netdevice(priv->dev); @@ -148,19 +146,19 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) register_failed: ipoib_dev_cleanup(priv->dev); +device_init_failed: + free_netdev(priv->dev); + err: mutex_unlock(&ppriv->vlan_mutex); rtnl_unlock(); - if (priv) - free_netdev(priv->dev); - return result; } int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) { struct ipoib_dev_priv *ppriv, *priv, *tpriv; - struct net_device *dev = NULL; + int ret = -ENOENT; if (!capable(CAP_NET_ADMIN)) return -EPERM; @@ -174,17 +172,14 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) unregister_netdevice(priv->dev); ipoib_dev_cleanup(priv->dev); list_del(&priv->list); - dev = priv->dev; + free_netdev(priv->dev); + + ret = 0; break; } } mutex_unlock(&ppriv->vlan_mutex); rtnl_unlock(); - if (dev) { - free_netdev(dev); - return 0; - } - - return -ENODEV; + return ret; }