From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56DA2C433B4 for ; Fri, 9 Apr 2021 13:35:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28EB860241 for ; Fri, 9 Apr 2021 13:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233672AbhDINgD (ORCPT ); Fri, 9 Apr 2021 09:36:03 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:42640 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231127AbhDINgB (ORCPT ); Fri, 9 Apr 2021 09:36:01 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1lUrIO-00FmRk-5c; Fri, 09 Apr 2021 15:35:36 +0200 Date: Fri, 9 Apr 2021 15:35:36 +0200 From: Andrew Lunn To: Haiyang Zhang Cc: David Miller , Dexuan Cui , "kuba@kernel.org" , KY Srinivasan , Stephen Hemminger , "wei.liu@kernel.org" , Wei Liu , "netdev@vger.kernel.org" , "leon@kernel.org" , "bernd@petrovitsch.priv.at" , "rdunlap@infradead.org" , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" Subject: Re: [PATCH v3 net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA) Message-ID: References: <20210408225840.26304-1-decui@microsoft.com> <20210408.164618.597563844564989065.davem@davemloft.net> <20210408.174122.1793350393067698495.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For the structs containing variables with the same sizes, or already size aligned > variables, we knew the __packed has no effect. And for these structs, it doesn't > cause performance impact either, correct? > > But in the future, if different sized variables are added, the __packed may > become necessary again. To prevent anyone accidently forget to add __packed > when adding new variables to these structs, can we keep the __packed for all > messages going through the "wire"? It should not be a problem because anybody adding new variables should know packed is not liked in the kernel and will take care. If you want to be paranoid add a BUILD_BUG_ON(size(struct foo) != 42); Andrew