From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: David Miller <davem@davemloft.net>
Cc: aelior@marvell.com, kuba@kernel.org,
GR-everest-linux-l2@marvell.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, keescook@chromium.org
Subject: Re: [PATCH][next] qed/qed_ll2: Replace one-element array with flexible-array member
Date: Tue, 29 Sep 2020 08:19:15 -0500 [thread overview]
Message-ID: <20200929131915.GC28922@embeddedor> (raw)
In-Reply-To: <20200928.184814.134218247079915440.davem@davemloft.net>
On Mon, Sep 28, 2020 at 06:48:14PM -0700, David Miller wrote:
> From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
> Date: Mon, 28 Sep 2020 10:16:17 -0500
>
> > There is a regular need in the kernel to provide a way to declare having
> > a dynamically sized set of trailing elements in a structure. Kernel code
> > should always use “flexible array members”[1] for these cases. The older
> > style of one-element or zero-length arrays should no longer be used[2].
> >
> > Refactor the code according to the use of a flexible-array member in
> > struct qed_ll2_tx_packet, instead of a one-element array and use the
> > struct_size() helper to calculate the size for the allocations. Commit
> > f5823fe6897c ("qed: Add ll2 option to limit the number of bds per packet")
> > was used as a reference point for these changes.
> >
> > Also, it's important to notice that flexible-array members should occur
> > last in any structure, and structures containing such arrays and that
> > are members of other structures, must also occur last in the containing
> > structure. That's why _cur_completing_packet_ is now moved to the bottom
> > in struct qed_ll2_tx_queue. _descq_mem_ and _cur_send_packet_ are also
> > moved for unification.
> >
> > [1] https://en.wikipedia.org/wiki/Flexible_array_member
> > [2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays
> >
> > Tested-by: kernel test robot <lkp@intel.com>
>
> I find such tags enormously misleading, because the kernel test robot
> didn't perform any functional testing of this change and honestly
> that's the part I'm more concerned about rather than "does it build".
>
> Anyone can check test the build.
>
I agree. I should add a Built-Tested-by tag instead next time.
> > Link: https://lore.kernel.org/lkml/5f707198.PA1UCZ8MYozYZYAR%25lkp@intel.com/
> > Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
>
> Applied.
Thanks
--
Gustavo
prev parent reply other threads:[~2020-09-29 13:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 15:16 [PATCH][next] qed/qed_ll2: Replace one-element array with flexible-array member Gustavo A. R. Silva
2020-09-29 1:48 ` David Miller
2020-09-29 13:19 ` Gustavo A. R. Silva [this message]
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=20200929131915.GC28922@embeddedor \
--to=gustavoars@kernel.org \
--cc=GR-everest-linux-l2@marvell.com \
--cc=aelior@marvell.com \
--cc=davem@davemloft.net \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).