From patchwork Tue Mar 20 20:19:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10297825 X-Patchwork-Delegate: jgg@ziepe.ca 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 0FB96600F6 for ; Tue, 20 Mar 2018 20:20:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F14FE28F5F for ; Tue, 20 Mar 2018 20:20:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E676229621; Tue, 20 Mar 2018 20:20:23 +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 ED07129577 for ; Tue, 20 Mar 2018 20:20:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751485AbeCTUUS (ORCPT ); Tue, 20 Mar 2018 16:20:18 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:43176 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751391AbeCTUUQ (ORCPT ); Tue, 20 Mar 2018 16:20:16 -0400 Received: by mail-wr0-f193.google.com with SMTP id o1so3014701wro.10 for ; Tue, 20 Mar 2018 13:20:16 -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=qLNq1SUYEaArHLXGShG6ZaqHly083KyjxFRgE4d6L5o=; b=m+cXCwgHFUxRLe846j5gR7lU2hceEsp2+beLzZ43A3NDtvQj+Tu7ltS/kW/DRQLrQt 5ngXeSJWJLFlRajfWtBwpU11G3iBO1ZYtc245fxQme1SK1foC+fAbU+qmxXiFBKlilWv xWO6MmE/OS1akDXxGAWfVaPR29a2ro4ZBsGWY/FePNJqXA/2VonV6cXsjhSyB1BVBD2q LGZFr/H9BKixzn7SGR52K9edH22jkx+DfWMrQLpoOcvDkMWYmxdVNk5iJEFCue0GzWFK 3M2LjYXvTY35XcKOuyUN16TsSJKDYHPdqQzlvmMElnLL+W+9/135diDMcPPGLvFkPAiI FWrQ== 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=qLNq1SUYEaArHLXGShG6ZaqHly083KyjxFRgE4d6L5o=; b=iwA+k9mM9W6/LbtvBJ6WtKtE71Mv0KGr+DHTOYp/CENXWXLMNMtCL+xR/Lju0emNd1 FfnDpKC842LC5ls4PgIkfB+I9n73uYupoDDBnsQ37BZESJeBzo7ESw+ONuX3tEUGTv7f YOnpzbq2J9dnbnYC9IySux9JHuUpbcIGsk5zFZzjeZHO1FUWRbRhrEJ8m74hWd3+b0U9 h7vDzPvc3uPl9iyiTbvzP8YqPEbjBOMDFa1YNJ4qSUxlqzzzzyzCZi8lDr/NX3vbnGZH d0UPhZXnsxWD05aFgsRfJRzY6Kng0GXg8fHPUIFy9Az6TmeiIHKzgT9QfwygneaZkLfQ Nunw== X-Gm-Message-State: AElRT7F035mXeuITPu4cjvrhjcXPTi63cWFihfugiqFAelTrRD+34TmQ 0ODRDq3vLJ52BpyDITa5K7fRwvwFbas= X-Google-Smtp-Source: AG47ELs1Z88BgJQoBAkOGh+1KkbyeW0AJ4SXFgz3qLTna7ydiAzVjOhEqXx2dNqu1bcss5YFYd5xwg== X-Received: by 10.223.184.188 with SMTP id i57mr14094284wrf.105.1521577215574; Tue, 20 Mar 2018 13:20:15 -0700 (PDT) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id b99sm2526453wrd.75.2018.03.20.13.20.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Mar 2018 13:20:12 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eyNjt-0001Nd-RP; Tue, 20 Mar 2018 14:20:09 -0600 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org, Michal Kalderon Cc: Jason Gunthorpe Subject: [PATCH 3/6] RDMA/qedr: Fix uABI structure layouts for 32/64 compat Date: Tue, 20 Mar 2018 14:19:48 -0600 Message-Id: <20180320201951.4998-4-jgg@ziepe.ca> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180320201951.4998-1-jgg@ziepe.ca> References: <20180320201951.4998-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 struct qedr_alloc_ucontext_resp is a different length in 32 and 64 bit compiles due to implicit compiler padding. The structs alloc_pd_uresp, create_cq_uresp and create_qp_uresp are not padded by the compiler, but in user space the compiler pads them due to the way the core and driver structs are concatenated. Make this padding explicit and consistent for future sanity. The kernel driver can already handle the user buffer being smaller than required and copies correctly, so no compat or ABI break happens from introducing the explicit padding. Signed-off-by: Jason Gunthorpe Acked-by: Michal Kalderon --- include/uapi/rdma/qedr-abi.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/uapi/rdma/qedr-abi.h b/include/uapi/rdma/qedr-abi.h index 261c6db4623e28..39665606293197 100644 --- a/include/uapi/rdma/qedr-abi.h +++ b/include/uapi/rdma/qedr-abi.h @@ -53,6 +53,7 @@ struct qedr_alloc_ucontext_resp { __u8 dpm_enabled; __u8 wids_enabled; __u16 wid_count; + __u32 reserved; }; struct qedr_alloc_pd_ureq { @@ -61,6 +62,7 @@ struct qedr_alloc_pd_ureq { struct qedr_alloc_pd_uresp { __u32 pd_id; + __u32 reserved; }; struct qedr_create_cq_ureq { @@ -71,6 +73,7 @@ struct qedr_create_cq_ureq { struct qedr_create_cq_uresp { __u32 db_offset; __u16 icid; + __u16 reserved; }; struct qedr_create_qp_ureq { @@ -105,6 +108,7 @@ struct qedr_create_qp_uresp { __u16 rq_icid; __u32 rq_db2_offset; + __u32 reserved; }; #endif /* __QEDR_USER_H__ */