IB/mlx5: Report RX checksum capabilities for IPoIB
authorYishai Hadas <yishaih@mellanox.com>
Thu, 8 Jun 2017 13:15:11 +0000 (16:15 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 24 Jul 2017 14:41:01 +0000 (10:41 -0400)
Report RX checksum capabilities when 'ipoib_enhanced_offloads'
capabilities are set and support checksum.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/main.c

index bf74b2ee2f9c55de5245c3c8cd1380efde7e6846..2757d445b0421daed1aeb932c3c9caa4edb42566 100644 (file)
@@ -702,6 +702,10 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
            MLX5_CAP_GEN(dev->mdev, general_notification_event))
                props->raw_packet_caps |= IB_RAW_PACKET_CAP_DELAY_DROP;
 
+       if (MLX5_CAP_GEN(mdev, ipoib_enhanced_offloads) &&
+           MLX5_CAP_IPOIB_ENHANCED(mdev, csum_cap))
+               props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM;
+
        if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) &&
            MLX5_CAP_ETH(dev->mdev, scatter_fcs)) {
                /* Legacy bit to support old userspace libraries */