From patchwork Mon Apr 18 16:25:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Majd Dibbiny X-Patchwork-Id: 8873851 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 856A59F441 for ; Mon, 18 Apr 2016 16:25:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 984F4201DD for ; Mon, 18 Apr 2016 16:25:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE804201C0 for ; Mon, 18 Apr 2016 16:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751799AbcDRQZz (ORCPT ); Mon, 18 Apr 2016 12:25:55 -0400 Received: from [193.47.165.129] ([193.47.165.129]:53197 "EHLO mellanox.co.il" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751600AbcDRQZz (ORCPT ); Mon, 18 Apr 2016 12:25:55 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from majd@mellanox.com) with ESMTPS (AES256-SHA encrypted); 18 Apr 2016 19:25:23 +0300 Received: from dev-l-vrt-202-005.mtl.labs.mlnx (dev-l-vrt-202-005.mtl.labs.mlnx [10.134.202.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id u3IGPNAm001365; Mon, 18 Apr 2016 19:25:23 +0300 From: Majd Dibbiny To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, leonro@mellanox.com, Bodong Wang , Majd Dibbiny , Matan Barak Subject: [PATCH for-next 2/2] IB/mlx5: Report mlx5 LSO capabilities when querying device Date: Mon, 18 Apr 2016 19:25:17 +0300 Message-Id: <1460996717-18778-3-git-send-email-majd@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1460996717-18778-1-git-send-email-majd@mellanox.com> References: <1460996717-18778-1-git-send-email-majd@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.9 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 From: Bodong Wang mlx5 based hardware supports LSO for Raw Ethernet QPs. LSO (large segment offload) applied here is mainly used for TCP (also known as TSO). Signed-off-by: Bodong Wang Signed-off-by: Majd Dibbiny Signed-off-by: Matan Barak --- drivers/infiniband/hw/mlx5/main.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 5acf346..09502ad 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -454,6 +454,7 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, int max_rq_sg; int max_sq_sg; u64 min_page_size = 1ull << MLX5_CAP_GEN(mdev, log_pg_sz); + u64 max_lso; if (uhw->inlen || uhw->outlen) return -EINVAL; @@ -508,10 +509,18 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, if (MLX5_CAP_GEN(mdev, block_lb_mc)) props->device_cap_flags |= IB_DEVICE_BLOCK_MULTICAST_LOOPBACK; - if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads) && - (MLX5_CAP_ETH(dev->mdev, csum_cap))) + if (MLX5_CAP_GEN(dev->mdev, eth_net_offloads)) { + if (MLX5_CAP_ETH(mdev, csum_cap)) props->device_cap_flags |= IB_DEVICE_RAW_IP_CSUM; + max_lso = MLX5_CAP_ETH(mdev, max_lso_cap); + if (max_lso) { + props->lso_caps.max_lso = 1 << max_lso; + props->lso_caps.supported_qpts |= + 1 << IB_QPT_RAW_ETHERTYPE; + } + } + if (MLX5_CAP_GEN(mdev, ipoib_basic_offloads)) { props->device_cap_flags |= IB_DEVICE_UD_IP_CSUM; props->device_cap_flags |= IB_DEVICE_UD_TSO;