From patchwork Tue Mar 21 17:42:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 9637217 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 958A56020B for ; Tue, 21 Mar 2017 17:52:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D9D126E73 for ; Tue, 21 Mar 2017 17:52:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 821912768C; Tue, 21 Mar 2017 17:52:15 +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 0B26826E73 for ; Tue, 21 Mar 2017 17:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932734AbdCURto (ORCPT ); Tue, 21 Mar 2017 13:49:44 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:48617 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757508AbdCURtM (ORCPT ); Tue, 21 Mar 2017 13:49:12 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 21 Mar 2017 19:42:28 +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 v2LHgSNM005647; Tue, 21 Mar 2017 19:42:28 +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 v2LHgSTa001233; Tue, 21 Mar 2017 19:42:28 +0200 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id v2LHgSc2001232; Tue, 21 Mar 2017 19:42:28 +0200 From: Yishai Hadas To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, yishaih@mellanox.com, bodong@mellanox.com, majd@mellanox.com, jgunthorpe@obsidianresearch.com Subject: [PATCH V1 rdma-core 1/5] mlx5: Explicitly align mlx5 query device response to 64 bit Date: Tue, 21 Mar 2017 19:42:06 +0200 Message-Id: <1490118130-1039-2-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 In-Reply-To: <1490118130-1039-1-git-send-email-yishaih@mellanox.com> References: <1490118130-1039-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 Explicitly align packet pacing response to 64 bit so that further capabilities that going to be read will match to mlx5 kernel response. Signed-off-by: Bodong Wang Reviewed-by: Yishai Hadas --- providers/mlx5/mlx5-abi.h | 7 ++++++- providers/mlx5/verbs.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/providers/mlx5/mlx5-abi.h b/providers/mlx5/mlx5-abi.h index e6ea428..dde46b9 100644 --- a/providers/mlx5/mlx5-abi.h +++ b/providers/mlx5/mlx5-abi.h @@ -264,6 +264,11 @@ struct mlx5_rss_caps { __u8 reserved[7]; }; +struct mlx5_packet_pacing_caps { + struct ibv_packet_pacing_caps caps; + __u32 reserved; +}; + struct mlx5_query_device_ex_resp { struct ibv_query_device_resp_ex ibv_resp; __u32 comp_mask; @@ -271,7 +276,7 @@ struct mlx5_query_device_ex_resp { struct ibv_tso_caps tso_caps; struct mlx5_rss_caps rss_caps; /* vendor data channel */ __u64 reserved_cqe_comp; - struct ibv_packet_pacing_caps packet_pacing_caps; + struct mlx5_packet_pacing_caps packet_pacing_caps; }; #endif /* MLX5_ABI_H */ diff --git a/providers/mlx5/verbs.c b/providers/mlx5/verbs.c index 4d8f26c..e233877 100644 --- a/providers/mlx5/verbs.c +++ b/providers/mlx5/verbs.c @@ -1921,7 +1921,7 @@ int mlx5_query_device_ex(struct ibv_context *context, attr->tso_caps = resp.tso_caps; 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 = resp.packet_pacing_caps; + attr->packet_pacing_caps = resp.packet_pacing_caps.caps; major = (raw_fw_ver >> 32) & 0xffff; minor = (raw_fw_ver >> 16) & 0xffff;