All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: irusskikh@marvell.com
Cc: kuba@kernel.org, netdev@vger.kernel.org,
	mstarovoitov@marvell.com, dbogdanov@marvell.com
Subject: Re: [EXT] Re: [PATCH net-next 08/17] net: atlantic: A2 driver-firmware interface
Date: Mon, 27 Apr 2020 13:20:09 -0700 (PDT)	[thread overview]
Message-ID: <20200427.132009.1387378104495053173.davem@davemloft.net> (raw)
In-Reply-To: <be1461d3-f87e-0bfa-0b37-6eef4a2519e6@marvell.com>

From: Igor Russkikh <irusskikh@marvell.com>
Date: Mon, 27 Apr 2020 23:04:24 +0300

> This means I have to dig each and every structure in this header and
> understand whether it may suffer from implicit alignment/holes or not.
> 
> Not mentioning the fact that these alignment rules are different on other
> compilers, or on say 32-bit archs.
> 
> I also see a lot of code through the kernel using pack(1) for the exact same
> reason - declare hw sensitive structures and eliminate any unexpected holes.

Your resistence to this feedback is becomming irritating.

Just because something is used elsewhere doesn't mean you are open to
do the same, there is a lot of code where issues like this have not
been caught through reivew and the code still ended up in the tree.

Using packed arbitrarily is being lazy and will result in suboptimal
code generation on several platforms.

Fixed sized types have well defined padding on _all_ cpus and targets,
so if you use them properly and pad up your structures, there is
absolutely _nothing_ to worry about.

When I was very active writing hardware drivers with many HW defined
structures and whatnot, I never once considered packed.  It never even
crossed my mind, because I simply defined the data structure properly
with well defined fixed sized types and padded them out as necessary.

So please stop pushing back on this feedback and get rid of the packed
attribute.

Thank you.

  reply	other threads:[~2020-04-27 20:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24  7:27 [PATCH net-next 00/17] net: atlantic: A2 support Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 01/17] net: atlantic: update company name in the driver description Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 02/17] net: atlantic: add A2 device IDs Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 03/17] net: atlantic: add defines for 10M and EEE 100M link mode Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 04/17] net: atlantic: add hw_soft_reset, hw_prepare to hw_ops Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 05/17] net: atlantic: simplify hw_get_fw_version() usage Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 06/17] net: atlantic: make hw_get_regs optional Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 07/17] net: atlantic: move IS_CHIP_FEATURE to aq_hw.h Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 08/17] net: atlantic: A2 driver-firmware interface Igor Russkikh
2020-04-25  0:44   ` Jakub Kicinski
2020-04-25  1:25     ` David Miller
2020-04-26  8:50       ` [EXT] " Igor Russkikh
2020-04-27  1:05         ` David Miller
2020-04-27 15:38           ` Igor Russkikh
2020-04-27 19:03             ` Jakub Kicinski
2020-04-27 20:04               ` Igor Russkikh
2020-04-27 20:20                 ` David Miller [this message]
2020-04-28  8:58                   ` Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 09/17] net: atlantic: minimal A2 HW bindings required for fw_ops Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 10/17] net: atlantic: minimal A2 fw_ops Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 11/17] net: atlantic: A2 hw_ops skeleton Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 12/17] net: atlantic: HW bindings for A2 RFP Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 13/17] net: atlantic: add A2 RPF hw_ops Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 14/17] net: atlantic: HW bindings for basic A2 init/deinit hw_ops Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 15/17] net: atlantic: common functions needed " Igor Russkikh
2020-04-24  7:27 ` [PATCH net-next 16/17] net: atlantic: " Igor Russkikh
2020-04-25  0:48   ` Jakub Kicinski
2020-04-24  7:27 ` [PATCH net-next 17/17] net: atlantic: A2 ingress / egress hw configuration Igor Russkikh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200427.132009.1387378104495053173.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dbogdanov@marvell.com \
    --cc=irusskikh@marvell.com \
    --cc=kuba@kernel.org \
    --cc=mstarovoitov@marvell.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.