summaryrefslogtreecommitdiff
path: root/drivers/infiniband/ulp/ipoib/ipoib_main.c
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2008-04-16 21:09:27 -0700
committerRoland Dreier <rolandd@cisco.com>2008-04-16 21:09:27 -0700
commit40ca1988e03c001747d0b4cc1b25cf38297c9f9e (patch)
tree5eb1d1e32b41409bd722df9c80deb326a227b09f /drivers/infiniband/ulp/ipoib/ipoib_main.c
parentc93570f23a98c633570397aedc6d1808f5d5846a (diff)
IPoIB: Add LSO support
For HCAs that support TCP segmentation offload (IB_DEVICE_UD_TSO), set NETIF_F_TSO and use HW LSO to offload TCP segmentation. Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_main.c')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index d87f53190a15..35a3643fb566 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -1134,14 +1134,15 @@ static struct net_device *ipoib_add_port(const char *format,
kfree(device_attr);
goto device_init_failed;
}
+ priv->hca_caps = device_attr->device_cap_flags;
- if (device_attr->device_cap_flags & IB_DEVICE_UD_IP_CSUM) {
+ kfree(device_attr);
+
+ if (priv->hca_caps & IB_DEVICE_UD_IP_CSUM) {
set_bit(IPOIB_FLAG_CSUM, &priv->flags);
priv->dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
}
- kfree(device_attr);
-
/*
* Set the full membership bit, so that we join the right
* broadcast group, etc.
@@ -1176,6 +1177,9 @@ static struct net_device *ipoib_add_port(const char *format,
goto event_failed;
}
+ if (priv->dev->features & NETIF_F_SG && priv->hca_caps & IB_DEVICE_UD_TSO)
+ priv->dev->features |= NETIF_F_TSO;
+
result = register_netdev(priv->dev);
if (result) {
printk(KERN_WARNING "%s: couldn't register ipoib port %d; error %d\n",