DPDK patches and discussions
 help / color / mirror / Atom feed
* [RFC 0/2] Eliminate zero length arrays in DPDK
@ 2022-02-15 23:00 Stephen Hemminger
  2022-02-15 23:00 ` [RFC 1/2] devtools: add script to check for zero length array Stephen Hemminger
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Stephen Hemminger @ 2022-02-15 23:00 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Yet another case of applying Linux kernel best practices
to DPDK. Flexible arrays are supported by Clang, GCC and
Microsoft compilers (part of C99).

Stephen Hemminger (2):
  devtools: add script to check for zero length array
  treewide: replace zero-length array with flex array

 app/test/test_table_tables.c                  |  2 +-
 devtools/cocci/zerolengtharray.cocci          | 17 +++++++++++++++++
 drivers/bus/dpaa/include/netcfg.h             |  4 ++--
 drivers/common/cnxk/roc_se.h                  |  2 +-
 drivers/common/dpaax/caamflib/desc/ipsec.h    |  2 +-
 drivers/common/dpaax/dpaax_iova_table.h       |  2 +-
 drivers/common/mlx5/mlx5_prm.h                |  8 ++++----
 drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h     |  2 +-
 drivers/crypto/ipsec_mb/ipsec_mb_private.h    |  4 ++--
 drivers/crypto/virtio/virtio_ring.h           |  4 ++--
 drivers/crypto/virtio/virtqueue.h             |  2 +-
 drivers/net/cxgbe/clip_tbl.h                  |  2 +-
 drivers/net/cxgbe/l2t.h                       |  2 +-
 drivers/net/cxgbe/mps_tcam.h                  |  2 +-
 drivers/net/cxgbe/smt.h                       |  2 +-
 drivers/net/enic/base/vnic_devcmd.h           |  4 ++--
 drivers/net/hinic/hinic_pmd_tx.h              |  2 +-
 drivers/net/nfp/nfpcore/nfp_nsp.h             |  2 +-
 drivers/net/virtio/virtio_ring.h              |  4 ++--
 drivers/net/virtio/virtio_user/vhost_kernel.c |  2 +-
 drivers/net/virtio/virtio_user/vhost_vdpa.c   |  2 +-
 drivers/net/virtio/virtqueue.h                |  2 +-
 drivers/regex/mlx5/mlx5_rxp.h                 |  2 +-
 examples/ip_reassembly/main.c                 |  2 +-
 lib/cryptodev/cryptodev_pmd.h                 |  2 +-
 lib/cryptodev/rte_cryptodev.h                 |  2 +-
 lib/ip_frag/ip_reassembly.h                   |  2 +-
 lib/ipsec/sa.h                                |  2 +-
 lib/rib/rte_rib.c                             |  2 +-
 lib/rib/rte_rib6.c                            |  2 +-
 lib/table/rte_swx_table_learner.c             |  2 +-
 lib/table/rte_table_hash_key16.c              |  4 ++--
 lib/table/rte_table_hash_key32.c              |  4 ++--
 lib/table/rte_table_hash_key8.c               |  4 ++--
 lib/vhost/rte_vhost.h                         |  4 ++--
 35 files changed, 63 insertions(+), 46 deletions(-)
 create mode 100644 devtools/cocci/zerolengtharray.cocci

-- 
2.34.1

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: [RFC 0/2] Eliminate zero length arrays in DPDK
@ 2022-02-16 10:39 Morten Brørup
  2022-02-17  8:32 ` Tyler Retzlaff
  0 siblings, 1 reply; 14+ messages in thread
From: Morten Brørup @ 2022-02-16 10:39 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Stephen Hemminger, dev

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]

My answer is at the end.Sent from a smartphone. Please pardon brevity and spelling.
-------- Oprindelig besked --------Fra: Bruce Richardson <bruce.richardson@intel.com> Dato: 16/02/2022  11.15  (GMT+01:00) Til: Morten Brørup <mb@smartsharesystems.com> Cc: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org Emne: Re: [RFC 0/2] Eliminate zero length arrays in DPDK On Wed, Feb 16, 2022 at 11:05:09AM +0100, Morten Brørup wrote:> > From: Bruce Richardson [mailto:bruce.richardson@intel.com]> > Sent: Wednesday, 16 February 2022 10.33> > > > On Tue, Feb 15, 2022 at 03:00:56PM -0800, Stephen Hemminger wrote:> > > Yet another case of applying Linux kernel best practices> > > to DPDK. Flexible arrays are supported by Clang, GCC and> > > Microsoft compilers (part of C99).> > >> > Do we need to start explicitly stating that DPDK uses C99 features, and> > adding -std=c99 to our build flags? Are we also requiring that> > applications> > are compiled with c99 features to use this (I would hope that they are,> > but> > I'm not sure we can mandate it).> > No to -std=c99. It's >= C99 for applications; we should not prevent them from using a newer C standard.Yes. For build flags, I was referring only to having it in the cflags for thebuild of DPDK itself, not for apps. We definitely need to minimise thebuild flags we expose to apps.> > Adding a note about the C standard version to the DPDK requirements> documentation would be very nice. It only mentions a certain compiler> version required. But I think that documenting the detailed build and> runtime requirements (and why they are that way) is another task.> Sure, we should do that. I am just wanting to be sure that if we specify aminimum of C99, we won't get complaints back from those with legacycodebasees which only support C89/C90. I am therefore wondering if we needto have our public headers C90-compliant?/BruceWe are publicly using C11 for atomics [1]. I'm not sure if that also implies that we are requiring C11 generally.Otherwise,  I agree with your concerns about old code bases.[1]https://www.dpdk.org/blog/2021/03/26/dpdk-adopts-the-c11-memory-model/-Morten

[-- Attachment #2: Type: text/html, Size: 3574 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-02-24 23:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 23:00 [RFC 0/2] Eliminate zero length arrays in DPDK Stephen Hemminger
2022-02-15 23:00 ` [RFC 1/2] devtools: add script to check for zero length array Stephen Hemminger
2022-02-15 23:00 ` [RFC 2/2] treewide: replace zero-length array with flex array Stephen Hemminger
2022-02-16  9:27 ` [RFC 0/2] Eliminate zero length arrays in DPDK Morten Brørup
2022-02-16  9:33 ` Bruce Richardson
2022-02-16 10:05   ` Morten Brørup
2022-02-16 10:10     ` Bruce Richardson
2022-02-17  7:41       ` Tyler Retzlaff
2022-02-24 21:51         ` Morten Brørup
2022-02-24 23:03           ` Stephen Hemminger
2022-02-16 18:56   ` Stephen Hemminger
2022-02-17  8:09 ` Tyler Retzlaff
2022-02-16 10:39 Morten Brørup
2022-02-17  8:32 ` Tyler Retzlaff

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).