diff mbox

[for-next,2/2] IB/mlx4_ib: Add support for RX/TX checksum offload capabilities report

Message ID 1438788867-18332-3-git-send-email-amirv@mellanox.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Amir Vadai Aug. 5, 2015, 3:34 p.m. UTC
Use the new capability flags for RX/TX checksum offload.

Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/infiniband/hw/mlx4/main.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 1437ed5..2af7554 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -442,6 +442,12 @@  static int mlx4_ib_query_device(struct ib_device *ibdev,
 		props->device_cap_flags |= IB_DEVICE_MANAGED_FLOW_STEERING;
 	}
 
+	if ((dev->dev->caps.rx_checksum_flags_port[1] > 0) ||
+	    (dev->dev->caps.rx_checksum_flags_port[2] > 0))
+		props->csum_caps |= IB_CSUM_RX_TCP_UDP | IB_CSUM_RX_IP_HDR;
+
+	props->csum_caps |= IB_CSUM_TX_TCP_UDP | IB_CSUM_TX_IP_HDR;
+
 	props->vendor_id	   = be32_to_cpup((__be32 *) (out_mad->data + 36)) &
 		0xffffff;
 	props->vendor_part_id	   = dev->dev->persist->pdev->device;