From patchwork Tue Mar 20 21:18:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10297945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2FBD56039A for ; Tue, 20 Mar 2018 21:19:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 215A72969A for ; Tue, 20 Mar 2018 21:19:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 160332969F; Tue, 20 Mar 2018 21:19:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EA4A2969A for ; Tue, 20 Mar 2018 21:19:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751459AbeCTVTI (ORCPT ); Tue, 20 Mar 2018 17:19:08 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35181 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751334AbeCTVTE (ORCPT ); Tue, 20 Mar 2018 17:19:04 -0400 Received: by mail-wm0-f66.google.com with SMTP id r82so6245060wme.0 for ; Tue, 20 Mar 2018 14:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tbVhkuTyGPzI4sIv2fvPsLAvYpAddv4G7AnHk7VFo24=; b=dWzsbPAd59bzgj1HKz51csgnVNYUZz8o/x5j672S6LmhlDVIhhY01H4LbxpKD1TPFe ixdKkBDStEtDpYxbz7AVeONqao7WZDCxg98sFuAE5nxP2vyB+/sZ//dEX2w8KlSqXWXu lNdXzuIDilHrJ31TkdsGiXDPLwOSXYcdicXK2diJIl6IlZon7Da5m8H4WkUu0g2yMCi0 nwsoR9KExQcrkeF4skJuwiUyjE+lyOfml2tULK0dPIqDYcMaagbghpmnO448NupiU1GV yOXD5DUiaOcr1OrSgoByt7cER8nOj/MiOIbvQK7QA+F7IVMXQNaRjtqroKPH/f3SwRuf OTyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tbVhkuTyGPzI4sIv2fvPsLAvYpAddv4G7AnHk7VFo24=; b=BF8+3oG2SBHXDZy/HtDK/ezz+Ceb61I98m6eWOOZRB4ER2K1iHYQaVFLCJl0rHdg1a dTvWdF6pGnwVxvc7zhmowL1LfeuP+aLJOc0bkiYKORGbWDlNxMaH2lh8U/vFaO+/qCs6 xjzKMJkbRO4A8FfR6/m3CR2w4+0qsLFj2n2SPl2CXGRpYCgAefWUiVxqazOij9EYEdEA 0cAnmlB6qskY/m8F49WwtZvB8D+LIxif2O2udaxafI8sS3TU1U7SykE+wPOf1JxaOlsi EziAWssOZ3k7sGeVRLRlPgUhd2QQqRR0HoKqN3GX2uUBFOs5FHL7+Bg1iL9CXD9Qf5Ct je6Q== X-Gm-Message-State: AElRT7HGnic8NkHBrjUIXIQ8i1jNiuHRrrlGwswtHhw7orMxnGh6hjRV EVB3X+7xkpPdZgtDFuQFBpZeHXtAnAc= X-Google-Smtp-Source: AG47ELvO97FdLUv9jP5c+//fHv/uSQ24kd+YyHDe1me/3OUUMt0mqoKWfumMgJ0mfL8zVaHwg+5nBw== X-Received: by 10.28.23.143 with SMTP id 137mr865183wmx.153.1521580742287; Tue, 20 Mar 2018 14:19:02 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id t196sm1709085wme.35.2018.03.20.14.18.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 14:18:59 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyOen-0002ew-7Y; Tue, 20 Mar 2018 15:18:57 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Yishai Hadas Subject: [PATCH rdma-core 07/20] mlx5: Do not use internal ABI structures in place of kernel ABI Date: Tue, 20 Mar 2018 15:18:37 -0600 Message-Id: <20180320211850.10090-8-jgg@ziepe.ca> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180320211850.10090-1-jgg@ziepe.ca> References: <20180320211850.10090-1-jgg@ziepe.ca> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jason Gunthorpe The kernel ABI structs should always be used, even if they happen to match todays ABI struct out of the library. This prevents future bugs if someone decides to modify the library ABI. Signed-off-by: Jason Gunthorpe --- providers/mlx5/mlx5-abi.h | 13 ++++--------- providers/mlx5/verbs.c | 22 ++++++++++++++++++---- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h index d5bb4c7191b3f4..23f3cc4cda574c 100644 --- a/providers/mlx5/mlx5-abi.h +++ b/providers/mlx5/mlx5-abi.h @@ -225,23 +225,18 @@ struct mlx5_query_device_ex { struct ibv_query_device_ex ibv_cmd; }; -struct mlx5_striding_rq_caps { - struct mlx5dv_striding_rq_caps caps; - __u32 reserved; -}; - struct mlx5_query_device_ex_resp { struct ib_uverbs_ex_query_device_resp ibv_resp; __u32 comp_mask; __u32 response_length; - struct ibv_tso_caps tso_caps; + struct mlx5_ib_tso_caps tso_caps; struct mlx5_ib_rss_caps rss_caps; /* vendor data channel */ - struct mlx5dv_cqe_comp_caps cqe_comp_caps; + struct mlx5_ib_cqe_comp_caps cqe_comp_caps; struct mlx5_packet_pacing_caps packet_pacing_caps; __u32 support_multi_pkt_send_wqe; __u32 flags; /* Use enum mlx5_query_dev_resp_flags */ - struct mlx5dv_sw_parsing_caps sw_parsing_caps; - struct mlx5_striding_rq_caps striding_rq_caps; + struct mlx5_ib_sw_parsing_caps sw_parsing_caps; + struct mlx5_ib_striding_rq_caps striding_rq_caps; __u32 tunnel_offloads_caps; __u32 reserved; }; diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index cbdb76978d56ea..e2b010f5e826ff 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -2617,7 +2617,8 @@ int mlx5_query_device_ex(struct ibv_context *context, if (err) return err; - attr->tso_caps = resp.tso_caps; + attr->tso_caps.max_tso = resp.tso_caps.max_tso; + attr->tso_caps.supported_qpts = resp.tso_caps.supported_qpts; attr->rss_caps.rx_hash_fields_mask = resp.rss_caps.rx_hash_fields_mask; attr->rss_caps.rx_hash_function = resp.rss_caps.rx_hash_function; attr->packet_pacing_caps.qp_rate_limit_min = @@ -2633,9 +2634,22 @@ int mlx5_query_device_ex(struct ibv_context *context, if (resp.support_multi_pkt_send_wqe & MLX5_IB_SUPPORT_EMPW) mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW; - mctx->cqe_comp_caps = resp.cqe_comp_caps; - mctx->sw_parsing_caps = resp.sw_parsing_caps; - mctx->striding_rq_caps = resp.striding_rq_caps.caps; + mctx->cqe_comp_caps.max_num = resp.cqe_comp_caps.max_num; + mctx->cqe_comp_caps.supported_format = resp.cqe_comp_caps.supported_format; + mctx->sw_parsing_caps.sw_parsing_offloads = + resp.sw_parsing_caps.sw_parsing_offloads; + mctx->sw_parsing_caps.supported_qpts = + resp.sw_parsing_caps.supported_qpts; + mctx->striding_rq_caps.min_single_stride_log_num_of_bytes = + resp.striding_rq_caps.min_single_stride_log_num_of_bytes; + mctx->striding_rq_caps.max_single_stride_log_num_of_bytes = + resp.striding_rq_caps.max_single_stride_log_num_of_bytes; + mctx->striding_rq_caps.min_single_wqe_log_num_of_strides = + resp.striding_rq_caps.min_single_wqe_log_num_of_strides; + mctx->striding_rq_caps.max_single_wqe_log_num_of_strides = + resp.striding_rq_caps.max_single_wqe_log_num_of_strides; + mctx->striding_rq_caps.supported_qpts = + resp.striding_rq_caps.supported_qpts; mctx->tunnel_offloads_caps = resp.tunnel_offloads_caps; mctx->packet_pacing_caps = resp.packet_pacing_caps;