From patchwork Sun Nov 19 16:56:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10065681 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 EA80F6023A for ; Sun, 19 Nov 2017 16:57:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC1E929081 for ; Sun, 19 Nov 2017 16:57:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0192290DC; Sun, 19 Nov 2017 16:57:01 +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 4AB5B29081 for ; Sun, 19 Nov 2017 16:57:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750955AbdKSQ5A (ORCPT ); Sun, 19 Nov 2017 11:57:00 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:44952 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750946AbdKSQ5A (ORCPT ); Sun, 19 Nov 2017 11:57:00 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 19 Nov 2017 18:56:56 +0200 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 vAJGuurG013753; Sun, 19 Nov 2017 18:56:56 +0200 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 vAJGupuZ020185; Sun, 19 Nov 2017 18:56:51 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id vAJGuhVD020153; Sun, 19 Nov 2017 18:56:43 +0200 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, guyle@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core] mlx4: Add a report of RSS capabilities in ibv_query_device_ex Date: Sun, 19 Nov 2017 18:56:22 +0200 Message-Id: <1511110582-20014-1-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 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: Guy Levi Report few extra RSS capabilities that were missed in previous patches. Signed-off-by: Guy Levi Reviewed-by: Yishai Hadas --- The matching kernel part was already merged into 4.15. PR was sent: https://github.com/linux-rdma/rdma-core/pull/256 providers/mlx4/mlx4-abi.h | 8 +++++++- providers/mlx4/verbs.c | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/providers/mlx4/mlx4-abi.h b/providers/mlx4/mlx4-abi.h index 4f2132c..c4783d2 100644 --- a/providers/mlx4/mlx4-abi.h +++ b/providers/mlx4/mlx4-abi.h @@ -99,13 +99,19 @@ struct mlx4_resize_cq { __u64 buf_addr; }; +struct mlx4_rss_caps { + __u64 rx_hash_fields_mask; /* enum ibv_rx_hash_fields */ + __u8 rx_hash_function; /* enum ibv_rx_hash_function_flags */ + __u8 reserved[7]; +}; + struct mlx4_query_device_ex_resp { struct ibv_query_device_resp_ex ibv_resp; __u32 comp_mask; __u32 response_length; __u64 hca_core_clock_offset; __u32 max_inl_recv_sz; - __u32 reserved; + struct mlx4_rss_caps rss_caps; /* vendor data channel */ }; struct mlx4_query_device_ex { diff --git a/providers/mlx4/verbs.c b/providers/mlx4/verbs.c index 8532882..8a2773f 100644 --- a/providers/mlx4/verbs.c +++ b/providers/mlx4/verbs.c @@ -87,6 +87,9 @@ int mlx4_query_device_ex(struct ibv_context *context, if (err) return err; + 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; + if (resp.comp_mask & MLX4_QUERY_DEV_RESP_MASK_CORE_CLOCK_OFFSET) { mctx->core_clock.offset = resp.hca_core_clock_offset; mctx->core_clock.offset_valid = 1;