From patchwork Wed Aug 5 15:34:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Vadai X-Patchwork-Id: 6951231 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8CA76C05AC for ; Wed, 5 Aug 2015 15:35:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B1AF320412 for ; Wed, 5 Aug 2015 15:35:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9B812035B for ; Wed, 5 Aug 2015 15:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbbHEPfo (ORCPT ); Wed, 5 Aug 2015 11:35:44 -0400 Received: from [193.47.165.129] ([193.47.165.129]:60329 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752998AbbHEPfo (ORCPT ); Wed, 5 Aug 2015 11:35:44 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from amirv@mellanox.com) with ESMTPS (AES256-SHA encrypted); 5 Aug 2015 18:35:09 +0300 Received: from swl095.mtl.labs.mlnx (swl095.mtl.labs.mlnx [10.7.17.95]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t75FZ9dK032619; Wed, 5 Aug 2015 18:35:09 +0300 From: Amir Vadai To: Doug Ledford Cc: linux-rdma@vger.kernel.org, Yevgeny Petrilin , Or Gerlitz , Tal Alon , Moshe Lazer , Bodong Wang , Eric Dube , Amir Vadai Subject: [PATCH for-next 2/2] IB/mlx4_ib: Add support for RX/TX checksum offload capabilities report Date: Wed, 5 Aug 2015 18:34:27 +0300 Message-Id: <1438788867-18332-3-git-send-email-amirv@mellanox.com> X-Mailer: git-send-email 2.4.3.413.ga5fe668 In-Reply-To: <1438788867-18332-1-git-send-email-amirv@mellanox.com> References: <1438788867-18332-1-git-send-email-amirv@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the new capability flags for RX/TX checksum offload. Signed-off-by: Amir Vadai --- drivers/infiniband/hw/mlx4/main.c | 6 ++++++ 1 file changed, 6 insertions(+) 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;