[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YHBYKGwJsX/wuYqn@lunn.ch>
Date:   Fri, 9 Apr 2021 15:35:36 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Haiyang Zhang <haiyangz@...rosoft.com>
Cc:     David Miller <davem@...emloft.net>,
        Dexuan Cui <decui@...rosoft.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        KY Srinivasan <kys@...rosoft.com>,
        Stephen Hemminger <sthemmin@...rosoft.com>,
        "wei.liu@...nel.org" <wei.liu@...nel.org>,
        Wei Liu <liuwe@...rosoft.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "leon@...nel.org" <leon@...nel.org>,
        "bernd@...rovitsch.priv.at" <bernd@...rovitsch.priv.at>,
        "rdunlap@...radead.org" <rdunlap@...radead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>
Subject: Re: [PATCH v3 net-next] net: mana: Add a driver for Microsoft Azure
 Network Adapter (MANA)
 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
Powered by blists - more mailing lists
 
