From patchwork Wed Feb 7 23:49:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10206347 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 941216020F for ; Wed, 7 Feb 2018 23:49:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84EC7290F1 for ; Wed, 7 Feb 2018 23:49:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7953D290F6; Wed, 7 Feb 2018 23:49:24 +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 DF28C290F1 for ; Wed, 7 Feb 2018 23:49:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750736AbeBGXtX (ORCPT ); Wed, 7 Feb 2018 18:49:23 -0500 Received: from mail-eopbgr10079.outbound.protection.outlook.com ([40.107.1.79]:29971 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750729AbeBGXtW (ORCPT ); Wed, 7 Feb 2018 18:49:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GILAl/A0Pw45HdQwHu+5m2OVPseyzKLCxUqAEqRzBzs=; b=wC/t2JUwbmFqLa+I7ULDJ46zN1MXKILIYLAdJ52iLgg7lK9RIDyZgHGzmEJcsgiTxxzQxDKpIbpk09athuf5xeqykZKk4JVpnnhHrZ2Wo9bJW9P2qqQBJbV8JKYme6rK4CmHR+6nGppI+EI7LIkEI+CfdWNhfj44qM6sPqjVax8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jgg@mellanox.com; Received: from mlx.ziepe.ca (70.74.179.152) by VI1PR0501MB2863.eurprd05.prod.outlook.com (2603:10a6:800:9b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Wed, 7 Feb 2018 23:49:18 +0000 Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1ejZSg-0003po-Rk; Wed, 07 Feb 2018 16:49:10 -0700 Date: Wed, 7 Feb 2018 16:49:10 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org, Moni Shoua Subject: [PATCH] rxe: Do not use 'struct sockaddr' in a uapi header Message-ID: <20180207234910.GA14608@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [70.74.179.152] X-ClientProxiedBy: HE1PR0102CA0047.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::24) To VI1PR0501MB2863.eurprd05.prod.outlook.com (2603:10a6:800:9b::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 92980532-e5a7-4b9f-219a-08d56e856736 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0501MB2863; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2863; 3:o7lJ/q7Jok1d84MnFb/GlzXTHRNB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RyxDOcYK6j0XGkacVQrO5nGtieZuOX9oF2iO3gzrcUpmNYdRL0w7l0sgBILGjFaG//9tXdAGxgVx0KHxt++cEDe8TTL64jO6zcR/5/zAb/wqtk3jtl++U1whiyHTPMIVCWWEkCVJ3UwWj2lw3pZ7lQIX/maz0IdqD6JrEErW0QfMMykjC++asRVNCFH5Bc0bcTIjLUgKRrQUA9eHinn1JbsOLkCqmjO8vsxQKucsnTxih6ag1SfMbcfvxryxMsL3t600hO6UrkKdiNGxrGX76xy8BGxBK0UPXnIAndw3DwLJL2afR/LyhaJPc5DDqDdctfYno; 4:V0/evJM8RPsg2Yb9btdzNqLXOumXDnvXLS9kPfwKlHqZagp04/Yq4TLjGPzaVOST2hcKOtbU1DLIUsN9eXiKRzHmfapw57QXHiQxrBE763b+nQ+f7viia1jxPLkhC9qjc9cLtXgKbSb0an3hSJnQ9eJU4e1wYzx1MhPyzS8pGZQ20GAXvtw0b9nBE68PQxvBUa0etCwohak6yP1XFj5HSyVo5krebSsA2eIb2XbscXV+rn3MSoShVvnMypBTtjTLRpsu9GHNONuHqcbyyBy8RA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(3231101)(2400082)(944501161)(10201501046)(6055026)(6041288)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:VI1PR0501MB2863; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2863; X-Forefront-PRVS: 0576145E86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(396003)(39380400002)(366004)(199004)(189003)(50466002)(83506002)(122856001)(9686003)(1857600001)(36756003)(5660300001)(53936002)(478600001)(97736004)(58126008)(316002)(52116002)(69596002)(16586007)(6862004)(33656002)(1076002)(26005)(105586002)(47776003)(23726003)(6116002)(3846002)(66066001)(6636002)(46656002)(68736007)(86362001)(186003)(2906002)(57986006)(305945005)(8936002)(9746002)(106356001)(9786002)(7736002)(8676002)(81166006)(33896004)(81156014)(386003)(83796002)(18370500001)(24400500001)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2863; H:mlx.ziepe.ca; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2863; 23:LGHk6LUmBHVW5BiiUGU4VUWFzJnnDNS8DJ1z/f+?= =?us-ascii?Q?rYjmJ1R5AHkjKa6LAvjc44KN224MUoJrzRipJrj3N4e5+pIMfekPbIS6sUMm?= =?us-ascii?Q?F4qouObeMA9j20yuqVu0nUYE6XwfCS0ze+ouY3vxQmt3Os2vd4m4A4w7e1R7?= =?us-ascii?Q?nVEMHRRyZt4M2+M2KI6m8Gfg/7btQAvyngaYUfsIRfIqWizNIJZr4Udrugop?= =?us-ascii?Q?rjVD6+/GtQ5aKlFrlv4yCUQdwRennYKHSXXbMtDRuProeTIFvmLd28ho0Osw?= =?us-ascii?Q?6zSuAg2bVr+E0p+XOQ3n4lrrl/Dfk5PguZ246jEqttbXtwG27R2eAd67bBvp?= =?us-ascii?Q?1rmdSH6YxdRW+xo3ccLsh5nfuafipW6E1yKeE3F2rwezE6+w1E4ZtbO8dbNW?= =?us-ascii?Q?y0FDCeRa5I6IDLBuiVGZQptieoGH7O3uDdKmH5tqkLSKrRxA6edCbbSWqfxz?= =?us-ascii?Q?S2ZxTicAvDVKwm66gqRDkp1imtufsG4bUhM5YmUQeX/cXCwypqkHyfYcq1mO?= =?us-ascii?Q?b69WgGNeoIYiR4reVyLv2DbED/gbFbkNAyDKlp0zgEEoWInpW5TsaXUdWnR2?= =?us-ascii?Q?2SHaQixOL6qdqr/jmIA/DgFAkV/O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vzDKQpH66S8QMmcjfruH4sZ9tUHxyygsJp5ruwUefhNS2ixc1iOx9HNdUc20xTQ5TTxgwoQtm9WMqXPKIGOvHCXPt5Gc03o6fwEYL451C2CdwnjUsRow6/bHs4cL9QoxRdEotUpL6ca3zU1+A=; 5:BV/xsNymt+BSsCWmp9JiCz1CgMCsvsHmzeDa+bvNUXi0aSWQCUT2eLtldSeC2040l1CFhrjXlG/Ip74WPNomuAywJ9T86D4GQHrpFQGGGt5ic760En2ZDQAfKKuvgElcpDLlvNYeoVrR1h9O4tcWPmZbfcYM89OiCYcuYps7jBg=; 24:gnoorfTQ9UM0GLni41QT5EeIzBP+p42VvEIkXv+39UqO8tA6EEO/AnXo64cUBB/w6INSxgExfQ6LgpAXbEtZgJ8qeFIqGWQtRLsd55C2yfw=; 7:vfzmruxTBrLTTqREQQqjiBTohep7Ph0lI2uWxk1S4821o1TG8Ry9WfhDBWZxXlmQqpghCWdukXTFpyhiR58RE8/33OMzJzDPjbe5YdnGWwadLLLli/zyvRLLKQVOB4gCFmowAGthU9dsgyQKJ8TOV1uwIQ92qSqckgECNjLXixHkhoOiXiGhgJxp04kYdkrsfsgLYBlpJcY0j+NkJQUhonMikqsYuXrw0GOKI5gEaDU8okn7lWSI43FsJWeT3gHl SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2018 23:49:18.1912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92980532-e5a7-4b9f-219a-08d56e856736 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2863 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 Linux has two 'linux/socket.h' files - and only the one in the kernel defines struct sockaddr - the user space one does not. Signed-off-by: Jason Gunthorpe --- drivers/infiniband/sw/rxe/rxe_av.c | 5 +++-- include/uapi/rdma/rdma_user_rxe.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_av.c b/drivers/infiniband/sw/rxe/rxe_av.c index 7522d1af3ae2a3..7f1ae364088a07 100644 --- a/drivers/infiniband/sw/rxe/rxe_av.c +++ b/drivers/infiniband/sw/rxe/rxe_av.c @@ -74,8 +74,9 @@ void rxe_av_fill_ip_info(struct rxe_av *av, struct ib_gid_attr *sgid_attr, union ib_gid *sgid) { - rdma_gid2ip(&av->sgid_addr._sockaddr, sgid); - rdma_gid2ip(&av->dgid_addr._sockaddr, &rdma_ah_read_grh(attr)->dgid); + rdma_gid2ip((struct sockaddr *)&av->sgid_addr, sgid); + rdma_gid2ip((struct sockaddr *)&av->dgid_addr, + &rdma_ah_read_grh(attr)->dgid); av->network_type = ib_gid_to_network_type(sgid_attr->gid_type, sgid); } diff --git a/include/uapi/rdma/rdma_user_rxe.h b/include/uapi/rdma/rdma_user_rxe.h index bdeea948b2f3a4..e3e6852b58eb45 100644 --- a/include/uapi/rdma/rdma_user_rxe.h +++ b/include/uapi/rdma/rdma_user_rxe.h @@ -35,6 +35,9 @@ #define RDMA_USER_RXE_H #include +#include +#include +#include union rxe_gid { __u8 raw[16]; @@ -57,7 +60,6 @@ struct rxe_av { __u8 network_type; struct rxe_global_route grh; union { - struct sockaddr _sockaddr; struct sockaddr_in _sockaddr_in; struct sockaddr_in6 _sockaddr_in6; } sgid_addr, dgid_addr;