From patchwork Mon Sep 11 11:43:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9947269 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 633BE602C9 for ; Mon, 11 Sep 2017 11:43:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C38428BB6 for ; Mon, 11 Sep 2017 11:43:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7114A28BBF; Mon, 11 Sep 2017 11:43:29 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 4A01528BB6 for ; Mon, 11 Sep 2017 11:43:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751555AbdIKLn0 (ORCPT ); Mon, 11 Sep 2017 07:43:26 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:44396 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751065AbdIKLnZ (ORCPT ); Mon, 11 Sep 2017 07:43:25 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 11 Sep 2017 14:43:22 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v8BBhMep030142; Mon, 11 Sep 2017 14:43:22 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id v8BBhM1M032733; Mon, 11 Sep 2017 14:43:22 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v8BBhM8v032729; Mon, 11 Sep 2017 14:43:22 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, bodong@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 1/2] mlx5: Report if kernel allows using MPW in SQ Date: Mon, 11 Sep 2017 14:43:04 +0300 Message-Id: <1505130185-32658-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1505130185-32658-1-git-send-email-yishaih@mellanox.com> References: <1505130185-32658-1-git-send-email-yishaih@mellanox.com> 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: Bodong Wang Use flag MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED to indicate hardware supports multi packet WQE and it's enabled in SQ context. Flag MLX5DV_CONTEXT_FLAGS_MPW is deprecated, shall not be used in new applications. Signed-off-by: Bodong Wang Reviewed-by: Yishai Hadas --- providers/mlx5/man/mlx5dv_query_device.3 | 3 ++- providers/mlx5/mlx5-abi.h | 5 +++++ providers/mlx5/mlx5.c | 4 ++-- providers/mlx5/mlx5.h | 3 ++- providers/mlx5/mlx5dv.h | 3 ++- providers/mlx5/verbs.c | 4 ++-- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/providers/mlx5/man/mlx5dv_query_device.3 b/providers/mlx5/man/mlx5dv_query_device.3 index b33a75b..c2f8bf4 100644 --- a/providers/mlx5/man/mlx5dv_query_device.3 +++ b/providers/mlx5/man/mlx5dv_query_device.3 @@ -35,7 +35,8 @@ enum mlx5dv_context_flags { * This flag indicates if CQE version 0 or 1 is needed. */ MLX5DV_CONTEXT_FLAGS_CQE_V1 = (1 << 0), - MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1), /* Multi packet WQE is supported or not */ + MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1), /* Obsoleted */ + MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED = (1 << 2), /* Multi packet WQE is allowed */ .in -8 }; .fi diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h index d05cb40..c9d3ec2 100644 --- a/providers/mlx5/mlx5-abi.h +++ b/providers/mlx5/mlx5-abi.h @@ -273,6 +273,11 @@ struct mlx5_packet_pacing_caps { __u32 reserved; }; +enum mlx5_mpw_caps { + MLX5_MPW_RESERVED = 1 << 0, /* Obsoleted, don't use */ + MLX5_ALLOW_MPW = 1 << 1, +}; + struct mlx5_query_device_ex_resp { struct ibv_query_device_resp_ex ibv_resp; __u32 comp_mask; diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c index 0e4d65f..84a67e9 100644 --- a/providers/mlx5/mlx5.c +++ b/providers/mlx5/mlx5.c @@ -625,8 +625,8 @@ int mlx5dv_query_device(struct ibv_context *ctx_in, if (mctx->cqe_version == MLX5_CQE_VERSION_V1) attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_CQE_V1; - if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_MPW) - attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_MPW; + if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_MPW_ALLOWED) + attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED; if (attrs_out->comp_mask & MLX5DV_CONTEXT_MASK_CQE_COMPRESION) { attrs_out->cqe_comp_caps = mctx->cqe_comp_caps; diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h index ad36cbf..c8d9fe9 100644 --- a/providers/mlx5/mlx5.h +++ b/providers/mlx5/mlx5.h @@ -182,7 +182,8 @@ enum { }; enum mlx5_vendor_cap_flags { - MLX5_VENDOR_CAP_FLAGS_MPW = 1 << 0, + MLX5_VENDOR_CAP_FLAGS_MPW = 1 << 0, /* Obsoleted */ + MLX5_VENDOR_CAP_FLAGS_MPW_ALLOWED = 1 << 1, }; enum { diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h index 34b4d27..cf49b63 100644 --- a/providers/mlx5/mlx5dv.h +++ b/providers/mlx5/mlx5dv.h @@ -81,7 +81,8 @@ enum mlx5dv_context_flags { * This flag indicates if CQE version 0 or 1 is needed. */ MLX5DV_CONTEXT_FLAGS_CQE_V1 = (1 << 0), - MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1), + MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1), /* Obsoleted */ + MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED = (1 << 2), }; enum mlx5dv_cq_init_attr_mask { diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index fc63ae9..0e8a9a3 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -1965,8 +1965,8 @@ int mlx5_query_device_ex(struct ibv_context *context, attr->rss_caps.rx_hash_function = resp.rss_caps.rx_hash_function; attr->packet_pacing_caps = resp.packet_pacing_caps.caps; - if (resp.support_multi_pkt_send_wqe) - mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_MPW; + if (resp.support_multi_pkt_send_wqe & MLX5_ALLOW_MPW) + mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_MPW_ALLOWED; mctx->cqe_comp_caps = resp.cqe_comp_caps;