From patchwork Mon Sep 11 11:43:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9947271 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 E539D602C9 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 0A4B128BB6 for ; Mon, 11 Sep 2017 11:43:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F33FA28BBC; 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 88D8228BB8 for ; Mon, 11 Sep 2017 11:43:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751065AbdIKLn0 (ORCPT ); Mon, 11 Sep 2017 07:43:26 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:44398 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751114AbdIKLnZ (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 v8BBhMdo030145; 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 v8BBhMkM032737; 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 v8BBhM8I032736; 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 2/2] mlx5: Report enhanced multi packet send WQE capability Date: Mon, 11 Sep 2017 14:43:05 +0300 Message-Id: <1505130185-32658-3-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 Report if enhanced multi packet send WQE is supported through mlx5 direct verbs. Signed-off-by: Bodong Wang Reviewed-by: Yishai Hadas --- providers/mlx5/man/mlx5dv_query_device.3 | 1 + providers/mlx5/mlx5-abi.h | 1 + providers/mlx5/mlx5.c | 3 +++ providers/mlx5/mlx5.h | 1 + providers/mlx5/mlx5dv.h | 1 + providers/mlx5/verbs.c | 3 +++ 6 files changed, 10 insertions(+) diff --git a/providers/mlx5/man/mlx5dv_query_device.3 b/providers/mlx5/man/mlx5dv_query_device.3 index c2f8bf4..9238b4f 100644 --- a/providers/mlx5/man/mlx5dv_query_device.3 +++ b/providers/mlx5/man/mlx5dv_query_device.3 @@ -37,6 +37,7 @@ enum mlx5dv_context_flags { MLX5DV_CONTEXT_FLAGS_CQE_V1 = (1 << 0), MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1), /* Obsoleted */ MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED = (1 << 2), /* Multi packet WQE is allowed */ + MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW = (1 << 3), /* Enhanced multi packet WQE is supported or not */ .in -8 }; .fi diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h index c9d3ec2..a741801 100644 --- a/providers/mlx5/mlx5-abi.h +++ b/providers/mlx5/mlx5-abi.h @@ -276,6 +276,7 @@ struct mlx5_packet_pacing_caps { enum mlx5_mpw_caps { MLX5_MPW_RESERVED = 1 << 0, /* Obsoleted, don't use */ MLX5_ALLOW_MPW = 1 << 1, + MLX5_SUPPORT_EMPW = 1 << 2, }; struct mlx5_query_device_ex_resp { diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c index 84a67e9..e7adf14 100644 --- a/providers/mlx5/mlx5.c +++ b/providers/mlx5/mlx5.c @@ -633,6 +633,9 @@ int mlx5dv_query_device(struct ibv_context *ctx_in, comp_mask_out |= MLX5DV_CONTEXT_MASK_CQE_COMPRESION; } + if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW) + attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW; + attrs_out->comp_mask = comp_mask_out; return 0; diff --git a/providers/mlx5/mlx5.h b/providers/mlx5/mlx5.h index c8d9fe9..42ccb57 100644 --- a/providers/mlx5/mlx5.h +++ b/providers/mlx5/mlx5.h @@ -184,6 +184,7 @@ enum { enum mlx5_vendor_cap_flags { MLX5_VENDOR_CAP_FLAGS_MPW = 1 << 0, /* Obsoleted */ MLX5_VENDOR_CAP_FLAGS_MPW_ALLOWED = 1 << 1, + MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW = 1 << 2, }; enum { diff --git a/providers/mlx5/mlx5dv.h b/providers/mlx5/mlx5dv.h index cf49b63..c0d47c7 100644 --- a/providers/mlx5/mlx5dv.h +++ b/providers/mlx5/mlx5dv.h @@ -83,6 +83,7 @@ enum mlx5dv_context_flags { MLX5DV_CONTEXT_FLAGS_CQE_V1 = (1 << 0), MLX5DV_CONTEXT_FLAGS_MPW = (1 << 1), /* Obsoleted */ MLX5DV_CONTEXT_FLAGS_MPW_ALLOWED = (1 << 2), + MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW = (1 << 3), }; enum mlx5dv_cq_init_attr_mask { diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index 0e8a9a3..6c5e29f 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -1968,6 +1968,9 @@ int mlx5_query_device_ex(struct ibv_context *context, if (resp.support_multi_pkt_send_wqe & MLX5_ALLOW_MPW) mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_MPW_ALLOWED; + if (resp.support_multi_pkt_send_wqe & MLX5_SUPPORT_EMPW) + mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW; + mctx->cqe_comp_caps = resp.cqe_comp_caps; major = (raw_fw_ver >> 32) & 0xffff;