From patchwork Tue Jan 10 19:08:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9508385 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 4E70D60231 for ; Tue, 10 Jan 2017 19:12:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42B2F27F89 for ; Tue, 10 Jan 2017 19:12:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 379A828595; Tue, 10 Jan 2017 19:12:56 +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 1393728553 for ; Tue, 10 Jan 2017 19:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757782AbdAJTKP (ORCPT ); Tue, 10 Jan 2017 14:10:15 -0500 Received: from mail-bl2nam02on0050.outbound.protection.outlook.com ([104.47.38.50]:4277 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S936608AbdAJTIc (ORCPT ); Tue, 10 Jan 2017 14:08:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=W0J/UIkh4w3Bz96g6VdxOGz8XKnuaNOvye1opunOA68=; b=rawbdxFPRE4VQGP4ss7fT+gzn2grTdZ+znm4/PCC2siaJuUB52/xJIHVGUiEZqaHXhXAH1a+VULM2fkBMf7S8ziFo60O4XlspsaQ/62REraOTAMANJb9ngn9+H6s2Hs7cbZQhWjdzVUsJLQiP4RgB8OFuWq7BR9hrUtwbZOjetk= Received: from BLUPR0201CA0003.namprd02.prod.outlook.com (10.163.116.13) by CY1PR02MB1413.namprd02.prod.outlook.com (10.161.171.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Tue, 10 Jan 2017 19:08:30 +0000 Received: from BN1BFFO11FD001.protection.gbl (2a01:111:f400:7c10::1:134) by BLUPR0201CA0003.outlook.office365.com (2a01:111:e400:52e7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12 via Frontend Transport; Tue, 10 Jan 2017 19:08:29 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.225) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=bestguesspass action=none header.from=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.225 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.225; helo=milsmgep14.sandisk.com; Received: from milsmgep14.sandisk.com (63.163.107.225) by BN1BFFO11FD001.mail.protection.outlook.com (10.58.144.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.803.8 via Frontend Transport; Tue, 10 Jan 2017 19:08:28 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 84.87.01420.11F25785; Tue, 10 Jan 2017 10:59:29 -0800 (PST) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Tue, 10 Jan 2017 11:08:25 -0800 X-AuditID: 0ac94371-7ee9b9800001058c-f5-58752f112a64 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.9.6]) by (Symantec Messaging Gateway) with SMTP id 68.38.16817.82135785; Tue, 10 Jan 2017 11:08:24 -0800 (PST) From: Bart Van Assche To: Doug Ledford CC: , Moni Shoua Subject: [PATCH v2 06/15] IB/rxe: Enable type checking on SKB_TO_PKT() and PKT_TO_SKB() arguments Date: Tue, 10 Jan 2017 11:08:13 -0800 Message-ID: <20170110190822.16953-7-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170110190822.16953-6-bart.vanassche@sandisk.com> References: <20170110190822.16953-1-bart.vanassche@sandisk.com> <20170110190822.16953-2-bart.vanassche@sandisk.com> <20170110190822.16953-3-bart.vanassche@sandisk.com> <20170110190822.16953-4-bart.vanassche@sandisk.com> <20170110190822.16953-5-bart.vanassche@sandisk.com> <20170110190822.16953-6-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrNLMWRmVeSWpSXmKPExsXCddJ5ka6gfmmEwcu/ehYvz39gtXh2qJfF YsP7NewOzB7Pph9m8ni/7yqbx+dNcgHMUVw2Kak5mWWpRfp2CVwZM9pmMxcc56x4cGM1ewPj ZI4uRk4OCQETiVOtF1m7GLk4hASWMkn8vjiLGSQhJLCDUWLp8hCYoku3pzNBxDcySrRfLQax 2QSMJL69n8kCYosIqElserWIHcRmFnCUuDTtE1i9sECixJEnU9i6GDk4WARUJSY3BIGEeQXs JRpuXWWBGC8vsasN5AZODk4BB4mtdy8yQtxzlkmi89A3NhBHQuA5i8TZO0eZILoFJU7OfMIC sUxC4uCLF1BHq0ucXDKfaQKj0CwkZbOQlC1gZFrFKJabmVOcm55aYGiiV5yYl5JZnK2XnJ+7 iRESxIU7GF/f9j7EKMDBqMTD2/GsJEKINbGsuDL3EKMEB7OSCG+qXmmEEG9KYmVValF+fFFp TmrxIUZpDhYlcd6L0R/DhATSE0tSs1NTC1KLYLJMHJxSDYy8+/5ZfPZuPjR9Uv320gn3Z3y9 Ze3xqtVQ8I+xxEMr84ynPIou5qzTvl6q+luj+kltZ/eKvmqP2Gim3G36M7e7KxaplKW/flma lunP1m3YM0uITTx5/z4r48yemr8Clb5Cbxorp6w/n6ud6H46Jsmafe78H4fF/B5wC3bNVq94 w3qlfmJEghJLcUaioRZzUXEiAAXFDvVeAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprIJMWRmVeSWpSXmKPExsXCtZGTTVfDsDTC4ORMDYuX5z+wWjw71Mti seH9GnYHZo9n0w8zebzfd5XN4/MmuQDmKC6blNSczLLUIn27BK6MGW2zmQuOc1Y8uLGavYFx MkcXIyeHhICJxKXb05m6GLk4hATWM0q0He5nB0mwCRhJfHs/kwXEFhFQk9j0ahFQnIODWcBR 4vb5EJCwsECixJEnU9hAwiwCqhKTG4JAwrwC9hKrH/xkhxgvL7Gr7SIriM0p4CCx9e5FRohV Z5kkOg99Y5vAyL2AkWEVo1huZk5xbnpmgaGhXnFiXkpmcbZecn7uJkaIpyN3MD6daH6IkYmD U6qB8UD2pW35dxM7e9X2sYRvk9vhs9kt1NuvMqr0fY/Y8QhGMb/osG8qPwTOt0y3mBTtdH7a j+v9Xwyrenz69sz3LekPVO9uUtIvOi8d1S3CocpWfTh6+6t3/8pz5jnczal336rX7XQ6Zb9O X/X62O/nfvR8Vwnia7aZcm2mQI32lCvGeb+q/DcrsRRnJBpqMRcVJwIAgMuKj6QBAAA= MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.225; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39410400002)(39450400003)(39850400002)(39860400002)(39840400002)(2980300002)(438002)(189002)(199003)(5660300001)(2270400002)(81156014)(50226002)(69596002)(8936002)(81166006)(92566002)(97736004)(356003)(86362001)(36756003)(6916009)(626004)(106466001)(189998001)(54906002)(6666003)(68736007)(8676002)(2950100002)(305945005)(48376002)(77096006)(50466002)(93886004)(38730400001)(110136003)(1076002)(47776003)(33646002)(4326007)(2906002)(5003940100001)(50986999)(76176999); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1413; H:milsmgep14.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD001; 1:U//dLNZKglG9MInNgbqZAXA8PwxLktdOp0iTavDzyJpvWqAe4BWAXo4YqgBWnOWulnYl5CSNZfNk2hyu+TyOJXFVifV4jeS7aMK+kL8Q9QsUVyqjlD6njCwbtJlESaDPd9h8xdGyU7fpZxzbV8qGmTIADsbIVZlxCL7m6JOqt8Kotg0CSXjM3/dsWYlB/uUI/kx0JujBDHaditJrguEcPEfce2NmyP33yud16eJeCS2FUsRAZLeI+7Qy8eh2NAyLaaIzSrjJuRFnBTZJW1K30XVyd/7FoIKlcXkqfvKLjj+wMZUmX5VkU52leJ8FqUpicPNFGCjpADwrFCYvj4EZebFiLs4ZcQ+JNo2mzLeQQMXujqvB/SPWXlZwr4cmd3jP4Z9+qCvUHZam+c6ue5Sh8aEzYMnfQCmep9BktM0jMjVLk3eZIauuANaEEVm2t9g/yvUybToHCW80D0JwZSdJyiYAskkkRhOBfFI7loayVIBQ329jtXHy622B2oCv9R46cqA6peGlr65S+EQtSN0NGg== X-MS-Office365-Filtering-Correlation-Id: 35c15cc0-3605-4094-cb16-08d4398c0fde X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:CY1PR02MB1413; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1413; 3:gGuqilJG7XaSp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fZ0YvURfUJ/nwJdTzh1d4bzyBu+yyHhZ+Zn5ykCO6Hiv5krbPvXQCHNcCyPBA6JXNvRlscYeAhPytrb9L+vxJpXliii35YoD9P+vZUJUBrFpSzY2ZQgPlJJ+8jim6Y8LRi2BaM0roJCs=; 20:dlbN3mnzRsqXFU5TjzZJnZwbFmPenagGNfNPZAcAlya2g8lyKsgGQPRB5haHWVtgBeqfLJD38b6ef5zUrM+nideGitm3Z2AnZiVIW6J7ZAtgYH6iVkGH1iEyrOq//hF1ycOJ7Lawdk6wt71GM/aEifvQMr+q6amfkL+ztgzJgVs3LbUND6Ug7Ii41KBRaUk0CjpZgyXrkKJ2gNVJxUx2Qbbqh5WxrhDLvNb+91raw6rwp4Zv+x6WFyKkwdVG47upodKPcBnC0h+Dj8IY2aY9onDXzZue8V3uGtcWgKFmEDcI4BPSX8eYUH8VXAZzGA+MfnA52tb0Co/0z70fNV9f+EKBTIJf/Y11DKx73ANpsUrBdDuZkXmUX/92hlTpmvTiEx/joo6a7lFSFZiPlTxuY4u5sr5kQU2F/EHBNiH8z1L+9tP6EJenQ715T8QDU3FiKIJ3br2loczMrLBEqAEl+g9Fvb172xbn2Nso8Il4ZxnM3aJlPS/l+Gfu6cJ0c0B5 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56004941905204)(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13016025)(13018025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:CY1PR02MB1413; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1413; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1413; 4:Klr91723MnBokwg5KmpjaeJCUCuOH0s5Ppsvr7yOsawUMxhGSe4yhsOlWos1f/VBs/z5hCIi9+niVFhWDjDq+AhLkLlhmH6DcTa/P6DGB++w6135UV1AGoL29Ux6V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?= =?us-ascii?Q?PpLU+dylxrGVn4NnEhbBDdmtoSou7hxiB1c+7uBA9LSpM1NzhejOWz9ybBxc?= =?us-ascii?Q?7cZsGxlk1Gqa4sgS/qOI1hlmh8we6DrNY1xMzx/a4wmzAjtVQbi3B1WSSSOo?= =?us-ascii?Q?WeYxyH9lI6qTaMRDG29txE0Qc51SuM80XbUkTai/jJ0tueRc30+Kdlb0WYRx?= =?us-ascii?Q?NunN4csUWwhQH/evO/EkD1LQXRowgvgq7nmzHKX7QHR7tW//cJQJ9bahxVu1?= =?us-ascii?Q?vei+IhhrHRouq0vcJpb1iXW5pscsJ0HK+UkwTmQeEE+CG025sdNfO8p0nQ9C?= =?us-ascii?Q?NiOZyregklJ865XJahmUI3t5mCJ9KEJ/TnuZVs3s+F+OhRWjAEiXnr7luyQO?= =?us-ascii?Q?7RARgyxArZ4FOVpjz85SFpqyt3kHM3CNVWG1baevaIU2jJt/EuuqbjCdE7/Z?= =?us-ascii?Q?X+lK4Ik+//TESiT9SnXIegSJGAbJeGKegGV87A8n/JdOstLNUt2xTqexKUK4?= =?us-ascii?Q?1QQjwi5CxQqygJekczYBWMXFe8fJmTvxM6FZ9AtR/V7sWSw2EAmW0pzNBzBk?= =?us-ascii?Q?1x8g+9wzzhULVE1pSufaLPE33t6VWVonJvXJGRdSiyFYtRhRZvv+OHSlUkfh?= =?us-ascii?Q?X3YjCRB7y1X2BaV3tRnBUQ5rnc6ehKzma7NJM3M1czZcPb+t7THVrIde4JN/?= =?us-ascii?Q?r9vLkuHpLFqJX1H7RAayuOCxvN2GbzC6NY12EZOTbFY13E5hwbhj8yiJj6R0?= =?us-ascii?Q?wz4XeSIBEQF0hf+66WE4ZN6SgztQSvbHCoFvvEBXov+P1dkpfvScnHOGpNdp?= =?us-ascii?Q?J0zZiWXGmbxEDEHP3uSzH55D4STGZeMzflZ6zhqgjZSAQR2mcQDkg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1413; 6:oFeKRe4mb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KQD224pff5oAiSnuAN2rDisYmYqZ++MpEthMdhyzowKgthBs6hn6LKrDmeCjQL82BOQrCBJp2UMr0HrFfWOkXVp0VrVNKVhOXKE0uWIwanEj4J8418n77kwcBjZ4nRa3cCtnQ7j0XQLZSBTCenn7yAubTcBzIRoK4M08Jq0Ay8HtsESd717IMp4U60WcZoFvJXpLSk0CKvujonBGwI3KF5SS7nD21lLiMKPQ== X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2017 19:08:28.6646 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.225]; Helo=[milsmgep14.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1413 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 Let the compiler check the type of the arguments passed to SKB_TO_PKT() and PKT_TO_SKB(). Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky Reviewed-by: Andrew Boyer Cc: Moni Shoua --- drivers/infiniband/sw/rxe/rxe_hdr.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_hdr.h b/drivers/infiniband/sw/rxe/rxe_hdr.h index d57b5e956ceb..6cb18406f5b8 100644 --- a/drivers/infiniband/sw/rxe/rxe_hdr.h +++ b/drivers/infiniband/sw/rxe/rxe_hdr.h @@ -53,8 +53,16 @@ struct rxe_pkt_info { }; /* Macros should be used only for received skb */ -#define SKB_TO_PKT(skb) ((struct rxe_pkt_info *)(skb)->cb) -#define PKT_TO_SKB(pkt) container_of((void *)(pkt), struct sk_buff, cb) +static inline struct rxe_pkt_info *SKB_TO_PKT(struct sk_buff *skb) +{ + BUILD_BUG_ON(sizeof(struct rxe_pkt_info) > sizeof(skb->cb)); + return (void *)skb->cb; +} + +static inline struct sk_buff *PKT_TO_SKB(struct rxe_pkt_info *pkt) +{ + return container_of((void *)pkt, struct sk_buff, cb); +} /* * IBA header types and methods