lkml.org 
[lkml]   [2021]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2021-04-09 15:36    [W:0.062 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site