DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Stephen Hemminger" <stephen@networkplumber.org>, <dev@dpdk.org>
Cc: "Olivier Matz" <olivier.matz@6wind.com>,
	"Steven Webster" <steven.webster@windriver.com>,
	"Matt Peters" <matt.peters@windriver.com>,
	"Andrew Rybchenko" <andrew.rybchenko@oktetlabs.ru>
Subject: RE: [PATCH 01/20] mbuf: replace term sanity check
Date: Thu, 18 May 2023 00:58:34 +0200	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D8792F@smartserver.smartshare.dk> (raw)
In-Reply-To: <20230517161603.117728-2-stephen@networkplumber.org>

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Wednesday, 17 May 2023 18.16
> 
> The term sanity check is on the Tier 2 list of words
> that should be replaced.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---

Naming is hard... I have shared a bunch of unfiltered thoughts below, mainly about trying to reuse the same terms everywhere. The quality varies, so just disregard the comments you consider silly.

Anyway, thank you for the effort put into this, Stephen!

[...]

> -	rte_mbuf_sanity_check(m, 1);
> -	rte_mbuf_sanity_check(m, 0);
> +	rte_mbuf_validate(m, 1);
> +	rte_mbuf_validate(m, 0);

Note: "mbuf_sanity_check()" -> "mbuf_validate()"

[...]

> --- a/doc/guides/prog_guide/mbuf_lib.rst
> +++ b/doc/guides/prog_guide/mbuf_lib.rst
> @@ -266,8 +266,8 @@ can be found in several of the sample applications,
> for example, the IPv4 Multic
>  Debug
>  -----
> 
> -In debug mode, the functions of the mbuf library perform sanity checks
> before any operation (such as, buffer corruption,
> -bad type, and so on).
> +In debug mode, the functions of the mbuf library perform consistency
> checks
> +before any operation (such as, buffer corruption, bad type, and so on).

Note: "sanity checks" -> "consistency checks"

[...]

> -#define avp_dev_buffer_sanity_check(a, b) \
> -	__avp_dev_buffer_sanity_check((a), (b))
> +#define avp_dev_buffer_check(a, b) \
> +	__avp_dev_buffer_check((a), (b))
> 
>  #else /* RTE_LIBRTE_AVP_DEBUG_BUFFERS */
> 
> -#define avp_dev_buffer_sanity_check(a, b) do {} while (0)
> +#define avp_dev_buffer_check(a, b) do {} while (0)

Note: "buffer_sanity_check()" -> "buffer_check()"

Shouldn't these become "buffer_validate()" instead of "buffer_check()"?

[...]

> +++ b/lib/mbuf/rte_mbuf.c
> @@ -363,9 +363,9 @@ rte_pktmbuf_pool_create_extbuf(const char *name,
> unsigned int n,
>  	return mp;
>  }
> 
> -/* do some sanity checks on a mbuf: panic if it fails */
> +/* do some checks on a mbuf: panic if it fails */

Trying to make the description resemble the function name, suggest: "validate mbuf consistency; panic if it fails"

>  void
> -rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
> +rte_mbuf_validate(const struct rte_mbuf *m, int is_header)

[...]

> +++ b/lib/mbuf/rte_mbuf.h
> @@ -339,13 +339,13 @@ rte_pktmbuf_priv_flags(struct rte_mempool *mp)
> 
>  #ifdef RTE_LIBRTE_MBUF_DEBUG
> 
> -/**  check mbuf type in debug mode */
> -#define __rte_mbuf_sanity_check(m, is_h) rte_mbuf_sanity_check(m, is_h)
> +/**  do mbuf type in debug mode */

"do mbuf type" -> "validate mbuf consistency"

> +#define __rte_mbuf_validate(m, is_h) rte_mbuf_validate(m, is_h)
> 
>  #else /*  RTE_LIBRTE_MBUF_DEBUG */
> 
> -/**  check mbuf type in debug mode */
> -#define __rte_mbuf_sanity_check(m, is_h) do { } while (0)
> +/**  ignore mbuf checks if not in debug mode */

Good improvement mentioning that they are ignored.

Trying to make the description resemble the function name, suggest: "ignore mbuf consistency validation if not in debug mode"

> +#define __rte_mbuf_validate(m, is_h) do { } while (0)
> 
>  #endif /*  RTE_LIBRTE_MBUF_DEBUG */
> 
> @@ -514,7 +514,7 @@ rte_mbuf_ext_refcnt_update(struct
> rte_mbuf_ext_shared_info *shinfo,
> 
> 
>  /**
> - * Sanity checks on an mbuf.
> + * Consistency checks on an mbuf.

Trying to make the description resemble the function name, suggest: "Validate mbuf consistency."

>   *
>   * Check the consistency of the given mbuf. The function will cause a
>   * panic if corruption is detected.
> @@ -526,12 +526,19 @@ rte_mbuf_ext_refcnt_update(struct
> rte_mbuf_ext_shared_info *shinfo,
>   *   of a packet (in this case, some fields like nb_segs are not
> checked)
>   */
>  void
> -rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header);
> +rte_mbuf_validate(const struct rte_mbuf *m, int is_header);
> +
> +/* Older deprecated name for rte_mbuf_validate() */
> +static inline __rte_deprecated
> +void rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
> +{
> +	rte_mbuf_validate(m, is_header);
> +}
> 
>  /**
> - * Sanity checks on a mbuf.
> + * Do consistency checks on a mbuf.

Trying to make the description resemble the function name, suggest: "Validate mbuf consistency." Nothing wrong with using the exact same description headline.

>   *
> - * Almost like rte_mbuf_sanity_check(), but this function gives the
> reason
> + * Almost like rte_mbuf_validate(), but this function gives the reason
>   * if corruption is detected rather than panic.
>   *
>   * @param m
> @@ -551,7 +558,7 @@ int rte_mbuf_check(const struct rte_mbuf *m, int
> is_header,
>  		   const char **reason);
> 
>  /**
> - * Sanity checks on a reinitialized mbuf in debug mode.
> + * Do checks on a reinitialized mbuf in debug mode.

Trying to make the description resemble the function name, suggest: "Validate consistency of a reinitialized mbuf in debug mode."

>   *
>   * Check the consistency of the given reinitialized mbuf.
>   * The function will cause a panic if corruption is detected.

[...]

>  /** For backwards compatibility. */
> -#define MBUF_RAW_ALLOC_CHECK(m) __rte_mbuf_raw_sanity_check(m)
> +#define MBUF_RAW_ALLOC_CHECK(m) __rte_mbuf_raw_validate(m)

This macro is not used in DPDK, and we are renaming the related functions anyway; let's remove this macro while we are at it. (The macro also lacks the RTE_ prefix.)

[...]

> +++ b/lib/mbuf/version.map
> @@ -27,7 +27,6 @@ DPDK_23 {
>  	rte_mbuf_dynflag_register;
>  	rte_mbuf_dynflag_register_bitnum;
>  	rte_mbuf_platform_mempool_ops;
> -	rte_mbuf_sanity_check;
>  	rte_mbuf_set_platform_mempool_ops;
>  	rte_mbuf_set_user_mempool_ops;
>  	rte_mbuf_user_mempool_ops;
> @@ -39,6 +38,7 @@ DPDK_23 {
>  	rte_pktmbuf_pool_create;
>  	rte_pktmbuf_pool_create_by_ops;
>  	rte_pktmbuf_pool_init;
> +	rte_mbuf_validate;

The public function is renamed, so it belongs in the next API version, not DPDK_23.

> 
>  	local: *;
>  };


  reply	other threads:[~2023-05-17 22:58 UTC|newest]

Thread overview: 122+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-17 16:15 [PATCH 00/20] Replace use of term sanity-check Stephen Hemminger
2023-05-17 16:15 ` [PATCH 01/20] mbuf: replace term sanity check Stephen Hemminger
2023-05-17 22:58   ` Morten Brørup [this message]
2023-05-22  6:52   ` Andrew Rybchenko
2023-05-17 16:15 ` [PATCH 02/20] eal: replace use of sanity check in comments and messages Stephen Hemminger
2023-05-18 11:39   ` Burakov, Anatoly
2023-05-17 16:15 ` [PATCH 03/20] net/ring: replace use of sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 04/20] test: replace use word sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 05/20] examples: remove term sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 06/20] lib: replace use of sanity check in comments and messages Stephen Hemminger
2023-05-17 16:15 ` [PATCH 07/20] net/nfp: remove word sanity Stephen Hemminger
2023-05-18  1:37   ` Chaoyong He
2023-05-17 16:15 ` [PATCH 08/20] doc/eventdev_pipeline: remove sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 09/20] net/fm10k, net/ixgbe: remove word sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 10/20] net/mlx[45]: " Stephen Hemminger
2023-05-17 16:15 ` [PATCH 11/20] net/sfc: remove term "sanity check" Stephen Hemminger
2023-05-22  6:53   ` Andrew Rybchenko
2023-05-17 16:15 ` [PATCH 12/20] net/ark: replace use of term sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 13/20] net/bnxt: " Stephen Hemminger
2023-05-17 16:15 ` [PATCH 14/20] net/bnx2x: remove reference to sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 15/20] cnxk: replace term sanity Stephen Hemminger
2023-05-17 16:15 ` [PATCH 16/20] event/opdl: remove " Stephen Hemminger
2023-05-17 16:16 ` [PATCH 17/20] net/txgbe: replace " Stephen Hemminger
2023-05-17 16:16 ` [PATCH 18/20] net/cxgbe: remove use of " Stephen Hemminger
2023-05-17 16:16 ` [PATCH 19/20] crypto/bcmfs: replace term sanity check Stephen Hemminger
2023-05-17 16:16 ` [PATCH 20/20] Remove use of " Stephen Hemminger
2023-05-18  9:21   ` [EXT] " Devendra Singh Rawat
2023-05-18 10:24   ` Hemant Agrawal
2023-05-17 22:05 ` [PATCH 00/20] Replace use of term sanity-check Tyler Retzlaff
2023-05-18 16:45 ` [PATCH v2 00/19] Replace use of the " Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 01/19] mbuf: replace term sanity check Stephen Hemminger
2023-05-18 16:52     ` Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 02/19] eal: replace use of sanity check in comments and messages Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 03/19] test: replace use word sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 04/19] examples: remove term sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 05/19] lib: replace use of sanity check in comments and messages Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 06/19] doc/eventdev_pipeline: remove sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 07/19] net/ring: replace use of sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 08/19] net/fm10k, net/ixgbe: remove word sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 09/19] net/mlx[45]: " Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 10/19] net/sfc: remove term "sanity check" Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 11/19] net/ark: replace use of term sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 12/19] net/bnxt: " Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 13/19] net/bnx2x: remove reference to sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 14/19] cnxk: replace term sanity Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 15/19] event/opdl: remove " Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 16/19] net/txgbe: replace " Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 17/19] net/cxgbe: remove use of " Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 18/19] crypto/bcmfs: replace term sanity check Stephen Hemminger
2023-05-18 16:45   ` [PATCH v2 19/19] Remove use of " Stephen Hemminger
2023-05-19 17:45 ` [PATCH v3 00/19] Replace use "sanity check" Stephen Hemminger
2023-05-19 17:45   ` [PATCH v3 01/19] mbuf: replace term sanity check Stephen Hemminger
2023-05-20  7:08     ` Morten Brørup
2023-05-22  6:54     ` Andrew Rybchenko
2023-05-19 17:45   ` [PATCH v3 02/19] eal: replace use of sanity check in comments and messages Stephen Hemminger
2023-05-19 17:45   ` [PATCH v3 03/19] test: replace use word sanity Stephen Hemminger
2023-05-19 17:45   ` [PATCH v3 04/19] examples: remove term sanity Stephen Hemminger
2023-05-19 17:45   ` [PATCH v3 05/19] lib: replace use of sanity check in comments and messages Stephen Hemminger
2023-05-19 17:45   ` [PATCH v3 06/19] doc/eventdev_pipeline: remove sanity Stephen Hemminger
2023-05-19 17:45   ` [PATCH v3 07/19] net/ring: replace use of sanity Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 08/19] net/fm10k, net/ixgbe: remove word sanity Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 09/19] net/mlx[45]: " Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 10/19] net/sfc: remove term "sanity check" Stephen Hemminger
2023-05-22  6:54     ` Andrew Rybchenko
2023-05-19 17:46   ` [PATCH v3 11/19] net/ark: replace use of term sanity Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 12/19] net/bnxt: " Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 13/19] net/bnx2x: remove reference to sanity Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 14/19] cnxk: replace term sanity Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 15/19] event/opdl: remove " Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 16/19] net/txgbe: replace " Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 17/19] net/cxgbe: remove use of " Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 18/19] crypto/bcmfs: replace term sanity check Stephen Hemminger
2023-05-19 17:46   ` [PATCH v3 19/19] Remove use of " Stephen Hemminger
2023-05-19 20:12   ` [PATCH v3 00/19] Replace use "sanity check" Ajit Khaparde
2023-08-02 23:25 ` [PATCH v4 00/19] replace use of term " Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 01/19] mbuf: replace term sanity check Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 02/19] eal: replace use of sanity check in comments and messages Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 03/19] test: replace use word sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 04/19] examples: remove term sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 05/19] lib: replace use of sanity check in comments and messages Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 06/19] doc/eventdev_pipeline: remove sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 07/19] net/ring: replace use of sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 08/19] net/fm10k, net/ixgbe: remove word sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 09/19] net/mlx[45]: " Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 10/19] net/sfc: remove term "sanity check" Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 11/19] net/ark: replace use of term sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 12/19] net/bnxt: " Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 13/19] net/bnx2x: remove reference to sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 14/19] cnxk: replace term sanity Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 15/19] event/opdl: remove " Stephen Hemminger
2023-08-21 15:52     ` Liang Ma
2023-08-02 23:25   ` [PATCH v4 16/19] net/txgbe: replace " Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 17/19] net/cxgbe: remove use of " Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 18/19] crypto/bcmfs: replace term sanity check Stephen Hemminger
2023-08-02 23:25   ` [PATCH v4 19/19] drivers: remove use of " Stephen Hemminger
2023-08-03  3:13     ` [EXT] " Devendra Singh Rawat
2023-11-29 17:25   ` [PATCH v5 00/19] remove use of the term "sanity check" Stephen Hemminger
2023-11-29 17:25     ` [PATCH v5 01/19] mbuf: replace term sanity check Stephen Hemminger
2023-11-29 17:25     ` [PATCH v5 02/19] eal: replace use of sanity check in comments and messages Stephen Hemminger
2023-11-29 17:25     ` [PATCH v5 03/19] test: replace use word sanity Stephen Hemminger
2023-11-30  5:48       ` Hemant Agrawal
2023-11-29 17:25     ` [PATCH v5 04/19] examples: remove term sanity Stephen Hemminger
2023-11-29 17:25     ` [PATCH v5 05/19] lib: replace use of sanity check in comments and messages Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 06/19] doc/eventdev_pipeline: remove sanity Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 07/19] net/ring: replace use of sanity Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 08/19] net/fm10k, net/ixgbe: remove word sanity Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 09/19] net/mlx[45]: " Stephen Hemminger
2023-12-07  8:50       ` Dariusz Sosnowski
2023-11-29 17:26     ` [PATCH v5 10/19] net/sfc: remove term "sanity check" Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 11/19] net/ark: replace use of term sanity Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 12/19] net/bnxt: " Stephen Hemminger
2023-11-30  3:31       ` Somnath Kotur
2023-11-29 17:26     ` [PATCH v5 13/19] net/bnx2x: remove reference to sanity Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 14/19] cnxk: replace term sanity Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 15/19] event/opdl: remove " Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 16/19] net/txgbe: replace " Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 17/19] net/cxgbe: remove use of " Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 18/19] crypto/bcmfs: replace term sanity check Stephen Hemminger
2023-11-29 17:26     ` [PATCH v5 19/19] drivers: remove use of " Stephen Hemminger
2023-11-30  1:21       ` Chaoyong He
2023-11-30  2:14       ` [EXT] " Devendra Singh Rawat
2023-11-30  5:37         ` Hemant Agrawal

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=98CBD80474FA8B44BF855DF32C47DC35D8792F@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=matt.peters@windriver.com \
    --cc=olivier.matz@6wind.com \
    --cc=stephen@networkplumber.org \
    --cc=steven.webster@windriver.com \
    /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).