Remove use of noninclusive term sanity
Subsystems (5)
v10 cover Remove use of noninclusive term sanity
This is a subset of earlier larger set of changes to fix non inclusive terms in the DPDK.
The term sanity-check is on the Tier 2 word list from the Inclusive Naming project.
https://inclusivenaming.org/word-lists/tier-2/sanity-check/
Rationale
This term might be derogatory to neurodiverse people. Jargon, such as “sanity test”, is difficult to translate and is difficult to understand by readers whose first language is not English.
v9 - reduce to just the smaller subset
- rebase to current 24.07-rc1
Stephen Hemminger (20):
mbuf: replace term sanity check
eal: replace use of sanity check in comments and messages
test: replace use word sanity
examples: remove term sanity
lib: replace use of sanity check in comments and messages doc/eventdev_pipeline: remove sanity
net/ring: replace use of sanity
net/fm10k, net/ixgbe: remove word sanity net/mlx[45]: remove word sanity
net/sfc: remove term "sanity check"
net/ark: replace use of term sanity
net/bnxt: replace use of term sanity
net/bnx2x: remove reference to sanity
net/nfp: replace use of term sanity
net/txgbe: replace term sanity
net/cxgbe: remove use of term sanity
cnxk: replace term sanity
event/opdl: remove term sanity
crypto/bcmfs: replace term sanity check
drivers: remove use of term sanity check
app/test/test_bitmap.c | 4 +- app/test/test_bpf.c | 6 +- app/test/test_common.c | 2 +- app/test/test_distributor.c | 46 ++++++------ app/test/test_eal_flags.c | 20 +++--- app/test/test_hash.c | 2 +- app/test/test_interrupts.c | 9 +-- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_mbuf.c | 30 ++++---- app/test/test_rawdev.c | 2 +- app/test/test_timer.c | 10 +-- doc/guides/gpus/cuda.rst | 2 +- doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 + .../sample_app_ug/eventdev_pipeline.rst | 2 +- doc/guides/tools/testbbdev.rst | 8 +-- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 2 +- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_npa.c | 6 +- drivers/common/dpaax/caamflib/desc.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/sfc_efx/base/ef10_nvram.c | 4 +- drivers/common/sfc_efx/base/efx_rx.c | 2 +- drivers/crypto/bcmfs/hw/bcmfs4_rm.c | 6 +- drivers/crypto/bcmfs/hw/bcmfs5_rm.c | 6 +- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/net/ark/ark_ethdev.c | 8 +-- drivers/net/ark/ark_ethdev_rx.c | 2 +- drivers/net/avp/avp_ethdev.c | 18 ++--- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_stats.c | 8 +-- drivers/net/bnx2x/ecore_sp.c | 2 +- drivers/net/bnx2x/elink.c | 4 +- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/cnxk/cnxk_ethdev.c | 4 +- drivers/net/cxgbe/cxgbe_ethdev.c | 10 +-- drivers/net/cxgbe/cxgbevf_main.c | 4 +- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/fm10k/fm10k_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 6 +- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 +- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx_vec.h | 2 +- drivers/net/mvpp2/mrvl_qos.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/qede/qede_rxtx.c | 6 +- drivers/net/ring/rte_eth_ring.c | 7 +- drivers/net/sfc/sfc_dp_rx.h | 2 +- drivers/net/sfc/sfc_ef100_rx.c | 6 +- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 +- drivers/net/sfc/sfc_ef10_rx.c | 4 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/txgbe/txgbe_ipsec.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 2 +- examples/ipsec-secgw/event_helper.c | 2 +- examples/ipv4_multicast/main.c | 2 +- examples/qos_sched/args.c | 2 +- lib/eal/common/eal_common_memory.c | 2 +- lib/eal/common/eal_common_proc.c | 3 +- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/windows/eal.c | 2 +- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +- lib/mbuf/rte_mbuf.c | 23 +++--- lib/mbuf/rte_mbuf.h | 71 ++++++++++--------- lib/mbuf/version.map | 1 + lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 84 files changed, 234 insertions(+), 229 deletions(-)
Signature · 1 line
2.43.0
PATCH v10 1/20 mbuf: replace term sanity check
Replace rte_mbuf_sanity_check() with rte_mbuf_verify() to match the similar macro RTE_VERIFY() in rte_debug.h
The term sanity check is on the Tier 2 list of words that should be replaced.
--- app/test/test_mbuf.c | 28 +++++------ doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 ++ drivers/net/avp/avp_ethdev.c | 18 +++---- drivers/net/sfc/sfc_ef100_rx.c | 6 +-- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 +- drivers/net/sfc/sfc_ef10_rx.c | 4 +- drivers/net/sfc/sfc_rx.c | 2 +- examples/ipv4_multicast/main.c | 2 +- lib/mbuf/rte_mbuf.c | 23 +++++---- lib/mbuf/rte_mbuf.h | 71 +++++++++++++++------------- lib/mbuf/version.map | 1 + 12 files changed, 90 insertions(+), 76 deletions(-)
app/test/test_mbuf.c +14 -14
@@ -262,8 +262,8 @@ test_one_pktmbuf(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("Buffer should be continuous" );memset (hdr,0x55 ,MBUF_TEST_HDR2_LEN ); -rte_mbuf_sanity_check (m,1 ); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,1 ); +rte_mbuf_verify (m,0 );rte_pktmbuf_dump (stdout, m,0 );/* this prepend should fail */
@@ -1162,7 +1162,7 @@ test_refcnt_mbuf(void)#ifdef RTE_EXEC_ENV_WINDOWS static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {RTE_SET_USED (pktmbuf_pool);return TEST_SKIPPED ;
@@ -1181,12 +1181,12 @@ mbuf_check_pass(struct rte_mbuf *buf) }static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {struct rte_mbuf *buf;struct rte_mbuf badbuf; -printf ("Checking rte_mbuf_sanity_check for failure conditions\n" ); +printf ("Checking rte_mbuf_verify for failure conditions\n" );/* get a good mbuf to use to make copies */ buf =rte_pktmbuf_alloc (pktmbuf_pool);
@@ -1708,7 +1708,7 @@ test_mbuf_validate_tx_offload(const char *test_name,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); m->ol_flags = ol_flags; m->tso_segsz = segsize; ret =rte_validate_tx_offload (m);
@@ -1915,7 +1915,7 @@ test_pktmbuf_read(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); data =rte_pktmbuf_append (m,MBUF_TEST_DATA_LEN2 );if (data ==NULL )
@@ -1964,7 +1964,7 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 );/* prepend an ethernet header */ hdr = (struct ether_hdr *)rte_pktmbuf_prepend (m, hdr_len);
@@ -2109,7 +2109,7 @@ create_packet(struct rte_mempool *pktmbuf_pool,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (pkt_seg) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (pkt_seg,0 ); +rte_mbuf_verify (pkt_seg,0 );/* Add header only for the first segment */ if (test_data->flags ==MBUF_HEADER && seg ==0 ) { hdr_len =sizeof (struct rte_ether_hdr );
@@ -2321,7 +2321,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); ext_buf_addr =rte_malloc ("External buffer" , buf_len,RTE_CACHE_LINE_SIZE );
@@ -2482,8 +2482,8 @@ test_pktmbuf_ext_pinned_buffer(struct rte_mempool *std_pool)GOTO_FAIL ("%s: test_pktmbuf_copy(pinned) failed\n" , __func__); -if (test_failing_mbuf_sanity_check (pinned_pool) <0 ) -GOTO_FAIL ("%s: test_failing_mbuf_sanity_check(pinned)" +if (test_failing_mbuf_verify (pinned_pool) <0 ) +GOTO_FAIL ("%s: test_failing_mbuf_verify(pinned)" " failed\n" , __func__);if (test_mbuf_linearize_check (pinned_pool) <0 )
@@ -2857,8 +2857,8 @@ test_mbuf(void) goto err; } -if (test_failing_mbuf_sanity_check (pktmbuf_pool) <0 ) { -printf ("test_failing_mbuf_sanity_check() failed\n" ); +if (test_failing_mbuf_verify (pktmbuf_pool) <0 ) { +printf ("test_failing_mbuf_verify() failed\n" ); goto err; }
doc/guides/prog_guide/mbuf_lib.rst +2 -2
@@ -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). Use Cases ---------
doc/guides/rel_notes/deprecation.rst +3 -0
@@ -147,3 +147,6 @@ Deprecation Notices will be deprecated and subsequently removed in DPDK 24.11 release. Before this, the new port library API (functions rte_swx_port_*) will gradually transition from experimental to stable status. + +* mbuf: The function ``rte_mbuf_sanity_check`` is deprecated. + Use the new function ``rte_mbuf_verify`` instead.
drivers/net/avp/avp_ethdev.c +9 -9
@@ -1231,7 +1231,7 @@ _avp_mac_filter(struct avp_dev *avp, struct rte_mbuf *m)#ifdef RTE_LIBRTE_AVP_DEBUG_BUFFERS static inline void -__avp_dev_buffer_sanity_check (struct avp_dev *avp,struct rte_avp_desc *buf) +__avp_dev_buffer_check (struct avp_dev *avp,struct rte_avp_desc *buf) {struct rte_avp_desc *first_buf;struct rte_avp_desc *pkt_buf;
@@ -1272,12 +1272,12 @@ __avp_dev_buffer_sanity_check(struct avp_dev *avp, struct rte_avp_desc *buf) first_buf->pkt_len, pkt_len); } -#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)#endif
@@ -1302,7 +1302,7 @@ avp_dev_copy_from_buffers(struct avp_dev *avp,void *pkt_data;unsigned int i; -avp_dev_buffer_sanity_check (avp, buf); +avp_dev_buffer_check (avp, buf);/* setup the first source buffer */ pkt_buf =avp_dev_translate_buffer (avp, buf);
@@ -1370,7 +1370,7 @@ avp_dev_copy_from_buffers(struct avp_dev *avp,rte_pktmbuf_pkt_len (m) = total_length; m->vlan_tci = vlan_tci; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );return m; }
@@ -1614,7 +1614,7 @@ avp_dev_copy_to_buffers(struct avp_dev *avp,char *pkt_data;unsigned int i; -__rte_mbuf_sanity_check (mbuf,1 ); +__rte_mbuf_verify (mbuf,1 ); m = mbuf; src_offset =0 ;
@@ -1680,7 +1680,7 @@ avp_dev_copy_to_buffers(struct avp_dev *avp, first_buf->vlan_tci = mbuf->vlan_tci; } -avp_dev_buffer_sanity_check (avp, buffers[0 ]); +avp_dev_buffer_check (avp, buffers[0 ]);return total_length; }
@@ -1798,7 +1798,7 @@ avp_xmit_scattered_pkts(void *tx_queue,#ifdef RTE_LIBRTE_AVP_DEBUG_BUFFERS for (i =0 ; i < nb_pkts; i++) -avp_dev_buffer_sanity_check (avp, tx_bufs[i]); +avp_dev_buffer_check (avp, tx_bufs[i]);#endif /* send the packets */
drivers/net/sfc/sfc_ef100_rx.c +3 -3
@@ -179,7 +179,7 @@ sfc_ef100_rx_qrefill(struct sfc_ef100_rxq *rxq)struct sfc_ef100_rx_sw_desc *rxd;rte_iova_t dma_addr; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); dma_addr =rte_mbuf_data_iova_default (m);if (rxq->flags &SFC_EF100_RXQ_NIC_DMA_MAP ) {
@@ -551,7 +551,7 @@ sfc_ef100_rx_process_ready_pkts(struct sfc_ef100_rxq *rxq, rxq->ready_pkts--; pkt =sfc_ef100_rx_next_mbuf (rxq); -__rte_mbuf_raw_sanity_check (pkt); +__rte_mbuf_raw_verify (pkt);RTE_BUILD_BUG_ON (sizeof (pkt->rearm_data[0 ]) !=sizeof (rxq->rearm_data));
@@ -575,7 +575,7 @@ sfc_ef100_rx_process_ready_pkts(struct sfc_ef100_rxq *rxq,struct rte_mbuf *seg; seg =sfc_ef100_rx_next_mbuf (rxq); -__rte_mbuf_raw_sanity_check (seg); +__rte_mbuf_raw_verify (seg); seg->data_off =RTE_PKTMBUF_HEADROOM ;
drivers/net/sfc/sfc_ef10_essb_rx.c +2 -2
@@ -125,7 +125,7 @@ sfc_ef10_essb_next_mbuf(const struct sfc_ef10_essb_rxq *rxq,struct rte_mbuf *m; m = (struct rte_mbuf *)((uintptr_t )mbuf + rxq->buf_stride); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);return m; }
@@ -136,7 +136,7 @@ sfc_ef10_essb_mbuf_by_index(const struct sfc_ef10_essb_rxq *rxq,struct rte_mbuf *m; m = (struct rte_mbuf *)((uintptr_t )mbuf + idx * rxq->buf_stride); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);return m; }
drivers/net/sfc/sfc_ef10_rx.c +2 -2
@@ -148,7 +148,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)struct sfc_ef10_rx_sw_desc *rxd;rte_iova_t phys_addr; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);SFC_ASSERT ((id & ~ptr_mask) ==0 ); rxd = &rxq->sw_ring[id];
@@ -297,7 +297,7 @@ sfc_ef10_rx_process_event(struct sfc_ef10_rxq *rxq, efx_qword_t rx_ev, rxd = &rxq->sw_ring[pending++ & ptr_mask]; m = rxd->mbuf; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); m->data_off =RTE_PKTMBUF_HEADROOM ;rte_pktmbuf_data_len (m) = seg_len;
drivers/net/sfc/sfc_rx.c +1 -1
@@ -120,7 +120,7 @@ sfc_efx_rx_qrefill(struct sfc_efx_rxq *rxq) ++i, id = (id + 1) & rxq->ptr_mask) { m = objs[i]; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); rxd = &rxq->sw_desc[id]; rxd->mbuf = m;
examples/ipv4_multicast/main.c +1 -1
@@ -258,7 +258,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) hdr->pkt_len = (uint16_t )(hdr->data_len + pkt->pkt_len); hdr->nb_segs = pkt->nb_segs +1 ; -__rte_mbuf_sanity_check (hdr,1 ); +__rte_mbuf_verify (hdr,1 );return hdr; }/* >8 End of mcast_out_kt. */
lib/mbuf/rte_mbuf.c +15 -8
@@ -367,9 +367,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 */ void -rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +rte_mbuf_verify (const struct rte_mbuf *m,int is_header) {const char *reason;
@@ -377,6 +377,13 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)rte_panic ("%s\n" , reason); } +/* For ABI compatibility, to be removed in next release */ +void +rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +{ +rte_mbuf_verify (m, is_header); +} +int rte_mbuf_check (const struct rte_mbuf *m,int is_header,const char **reason) {
@@ -496,7 +503,7 @@ void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)if (unlikely (m ==NULL ))continue ; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); do { m_next = m->next;
@@ -546,7 +553,7 @@ rte_pktmbuf_clone(struct rte_mbuf *md, struct rte_mempool *mp)return NULL ; } -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }
@@ -596,7 +603,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, struct rte_mempool *mp,struct rte_mbuf *mc, *m_last, **prev;/* garbage in check */ -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );/* check for request to copy at offset past end of mbuf */ if (unlikely (off >= m->pkt_len))
@@ -660,7 +667,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, struct rte_mempool *mp, }/* garbage out check */ -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }
@@ -671,7 +678,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)unsigned int len;unsigned int nb_segs; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );fprintf (f,"dump mbuf at %p, iova=%#" PRIx64", buf_len=%u\n" , m,rte_mbuf_iova_get (m), m->buf_len);
@@ -689,7 +696,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len) nb_segs = m->nb_segs;while (m && nb_segs !=0 ) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 ); fprintf(f, " segment at %p, data=%p, len=%u, off=%u, refcnt=%u\n", m, rte_pktmbuf_mtod(m, void *),
lib/mbuf/rte_mbuf.h +37 -34
224 lines not on this page · raw message
lib/mbuf/version.map +1 -0
@@ -31,6 +31,7 @@ DPDK_24 { rte_mbuf_set_platform_mempool_ops; rte_mbuf_set_user_mempool_ops; rte_mbuf_user_mempool_ops; + rte_mbuf_verify; rte_pktmbuf_clone; rte_pktmbuf_copy; rte_pktmbuf_dump;
Signature · 1 line
2.43.0
PATCH v10 2/20 eal: replace use of sanity check in comments and messages
In reply to Stephen HemmingerSanity check is on the Tier 2 non-inclusive list.
Replace or remove it.
--- lib/eal/common/eal_common_memory.c | 2 +- lib/eal/common/eal_common_proc.c | 3 ++- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/windows/eal.c | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-)
lib/eal/common/eal_common_memory.c +1 -1
@@ -562,7 +562,7 @@ check_dma_mask(uint8_t maskbits, bool thread_unsafe)uint64_t mask;int ret; -/* Sanity check. We only check width can be managed with 64 bits +/* We only check width can be managed with 64 bits * variables. Indeed any higher value is likely wrong. */ if (maskbits >MAX_DMA_MASK_BITS ) { EAL_LOG(ERR, "wrong dma mask size %u (Max: %u)",
lib/eal/common/eal_common_proc.c +2 -1
@@ -309,7 +309,8 @@ read_msg(int fd, struct mp_msg_internal *m, struct sockaddr_un *s)break ; } } -/* sanity-check the response */ + +/* Check that the response is valid */ if (m->msg.num_fds <0 || m->msg.num_fds >RTE_MP_MAX_FD_NUM ) {EAL_LOG (ERR ,"invalid number of fd's received" );return -1 ;
lib/eal/common/eal_common_trace.c +1 -1
@@ -468,7 +468,7 @@ __rte_trace_point_register(rte_trace_point_t *handle, const char *name,struct trace_point *tp;uint16_t sz; -/* Sanity checks of arguments */ +/* Check arguments */ if (name ==NULL || register_fn ==NULL || handle ==NULL ) {trace_err ("invalid arguments" ); rte_errno =EINVAL ;
lib/eal/common/eal_memcfg.h +1 -1
@@ -18,7 +18,7 @@* Memory configuration shared across multiple processes. */ struct rte_mem_config { -volatile uint32_t magic;/**< Magic number - sanity check. */ +volatile uint32_t magic;/**< Magic number check. */ uint32_t version;/**< Prevent secondary processes using different DPDK versions. */
lib/eal/common/rte_malloc.c +1 -1
@@ -654,7 +654,7 @@ rte_malloc_heap_destroy(const char *heap_name) ret =-1 ; goto unlock; } -/* sanity checks done, now we can destroy the heap */ +/* checks done, now we can destroy the heap */ rte_spinlock_lock (&heap->lock); ret =malloc_heap_destroy (heap);rte_spinlock_unlock (&heap->lock);
lib/eal/freebsd/eal.c +1 -1
@@ -501,7 +501,7 @@ eal_parse_args(int argc, char **argv) goto out; } -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname); ret =-1 ;
lib/eal/linux/eal.c +1 -1
@@ -803,7 +803,7 @@ eal_parse_args(int argc, char **argv) goto out; } -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname); ret =-1 ;
lib/eal/windows/eal.c +1 -1
@@ -194,7 +194,7 @@ eal_parse_args(int argc, char **argv)if (eal_adjust_config (internal_conf) !=0 )return -1 ; -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname);return -1 ;
Signature · 1 line
2.43.0
RE: [PATCH v10 02/20] eal: replace use of sanity check in comments and messages
Quoted 9 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, 30 May 2024 01.34Sanity check is on the Tier 2 non-inclusive list. Replace or remove it.
Signed-off-by Stephen Hemminger <[email protected]>Acked-by Anatoly Burakov <[email protected]>---
PATCH v10 3/20 test: replace use word sanity
In reply to Stephen HemmingerThe word "sanity" is on the not-allowed inclusive naming list. Replace the unnecessary usage in tests.
--- app/test/test_bitmap.c | 4 +-- app/test/test_bpf.c | 6 ++-- app/test/test_common.c | 2 +- app/test/test_distributor.c | 46 +++++++++++++++--------------- app/test/test_eal_flags.c | 20 ++++++------- app/test/test_hash.c | 2 +- app/test/test_interrupts.c | 9 +++--- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_mbuf.c | 2 +- app/test/test_rawdev.c | 2 +- app/test/test_timer.c | 10 +++---- 11 files changed, 53 insertions(+), 52 deletions(-)
app/test/test_bitmap.c +2 -2
@@ -33,7 +33,7 @@ test_bitmap_scan_operations(struct rte_bitmap *bmp) }if (slab1_magic != out_slab) { -printf ("Scan operation sanity failed.\n" ); +printf ("Scan operation magic number check failed.\n" );return TEST_FAILED ; }
@@ -43,7 +43,7 @@ test_bitmap_scan_operations(struct rte_bitmap *bmp) }if (slab2_magic != out_slab) { -printf ("Scan operation sanity failed.\n" ); +printf ("Scan operation magic number check failed.\n" );return TEST_FAILED ; }
app/test/test_bpf.c +3 -3
@@ -3343,9 +3343,9 @@ test_bpf_match(pcap_t *pcap, const char *str,return ret; } -/* Basic sanity test can we match a IP packet */ +/* Basic test can we match a IP packet */ static int -test_bpf_filter_sanity (pcap_t *pcap) +test_bpf_filter_match (pcap_t *pcap) {const uint32_t plen =100 ;struct rte_mbuf mb, *m;
@@ -3478,7 +3478,7 @@ test_bpf_convert(void)return -1 ; } - rc =test_bpf_filter_sanity (pcap); + rc =test_bpf_filter_match (pcap);for (i =0 ; i <RTE_DIM (sample_filters); i++) rc |=test_bpf_filter (pcap, sample_filters[i]);
app/test/test_common.c +1 -1
@@ -19,7 +19,7 @@ {printf (x"() test failed!\n" );\return -1 ;} -/* this is really a sanity check */ +/* this is really a consistency check */ static int test_macros(int __rte_unused unused_parm) {
app/test/test_distributor.c +23 -23
177 lines not on this page · raw message
app/test/test_eal_flags.c +10 -10
@@ -314,7 +314,7 @@ get_number_of_sockets(void)/* * Test that the app doesn't run with invalid allow option. -* Final tests ensures it does run with valid options as sanity check (one +* Final tests ensures it does run with valid options as basic test (one * test for with Domain+BDF, second for just with BDF) */ static int
@@ -382,7 +382,7 @@ test_allow_flag(void)/* * Test that the app doesn't run with invalid blocklist option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options as basic check. */ static int test_invalid_b_flag (void )
@@ -429,7 +429,7 @@ test_invalid_b_flag(void)/* * Test that the app doesn't run with invalid vdev option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options basic check. */ static int test_invalid_vdev_flag (void )
@@ -554,7 +554,7 @@ test_missing_c_flag(void)/* bad coremask value */ const char *argv3[] = { prgname, prefix, mp_flag,"-c" ,"error" }; -/* sanity check of tests - valid coremask value */ +/* check of tests - valid coremask value */ const char *argv4[] = { prgname, prefix, mp_flag,"-c" ,"1" };/* -l flag but no corelist value */
@@ -581,7 +581,7 @@ test_missing_c_flag(void) "-l", RTE_STR(RTE_MAX_LCORE) };const char *const argv14[] = { prgname, prefix, mp_flag,"-l" ,"1-" RTE_STR (RTE_MAX_LCORE ) }; -/* sanity check test - valid corelist value */ +/* check test - valid corelist value */ const char *const argv15[] = { prgname, prefix, mp_flag,"-l" ,"1-2,3" };
@@ -613,7 +613,7 @@ test_missing_c_flag(void) "--lcores", "(4-7)=(1,3)" };const char *const argv28[] = { prgname, prefix, mp_flag,"--lcores" ,"[4-7]@(1,3)" }; -/* sanity check of tests - valid lcores value */ +/* more complex valid lcores value */ const char *const argv29[] = { prgname, prefix, mp_flag,"--lcores" ,"0-1,2@(5-7),(3-5)@(0,2),(0,6),7" };
@@ -744,7 +744,7 @@ test_main_lcore_flag(void)/* * Test that the app doesn't run with invalid -n flag option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options as basic check. * Since -n is not compulsory for MP, we instead use --no-huge and --no-shconf * flags. */
@@ -772,10 +772,10 @@ test_invalid_n_flag(void)/* zero is invalid */ const char *argv3[] = { prgname, prefix, no_huge, no_shconf,"-n" ,"0" }; -/* sanity test - check with good value */ +/* check with good value */ const char *argv4[] = { prgname, prefix, no_huge, no_shconf,"-n" ,"2" }; -/* sanity test - check with no -n flag */ +/* check with no -n flag */ const char *argv5[] = { prgname, prefix, no_huge, no_shconf}; if (launch_proc(argv1) == 0
@@ -977,7 +977,7 @@ test_misc_flags(void)* All cases, apart from the first, app should run. * No further testing of output done. */ -/* sanity check - failure with invalid option */ +/* failure with invalid option */ const char *argv0[] = {prgname, prefix, mp_flag,"--invalid-opt" };/* With --no-pci */
app/test/test_hash.c +1 -1
@@ -1088,7 +1088,7 @@ fbk_hash_unit_test(void) .socket_id = 0, }; -/* this is a sanity check for "same name" test +/* this is a check for "same name" test * creating this hash will check if we are actually able to create * multiple hashes with different names (instead of having just one). */
app/test/test_interrupts.c +5 -4
@@ -48,7 +48,7 @@ static union intr_pipefds pfds;* Check if the interrupt handle is valid. */ static inline int -test_interrupt_handle_sanity_check (struct rte_intr_handle *intr_handle) +test_interrupt_handle_check (struct rte_intr_handle *intr_handle) {if (!intr_handle ||rte_intr_fd_get (intr_handle) <0 )return -1 ;
@@ -164,7 +164,7 @@ test_interrupt_handle_compare(struct rte_intr_handle *intr_handle_l,#else /* to be implemented for bsd later */ static inline int -test_interrupt_handle_sanity_check (struct rte_intr_handle *intr_handle) +test_interrupt_handle_check (struct rte_intr_handle *intr_handle) {RTE_SET_USED (intr_handle);
@@ -215,7 +215,7 @@ test_interrupt_callback(void *arg)return ; } -if (test_interrupt_handle_sanity_check (intr_handle) <0 ) { +if (test_interrupt_handle_check (intr_handle) <0 ) {printf ("null or invalid intr_handle for %s\n" , __func__); flag =-1 ;return ;
@@ -241,7 +241,8 @@ static void test_interrupt_callback_1(void *arg) {struct rte_intr_handle *intr_handle = arg; -if (test_interrupt_handle_sanity_check (intr_handle) <0 ) { + +if (test_interrupt_handle_check (intr_handle) <0 ) {printf ("null or invalid intr_handle for %s\n" , __func__); flag =-1 ;return ;
app/test/test_link_bonding_mode4.c +1 -1
@@ -224,7 +224,7 @@ add_member(struct member_conf *member, uint8_t start)struct rte_ether_addr addr, addr_check;int retval; -/* Some sanity check */ +/* Some basic tests. */ RTE_VERIFY (test_params.member_ports <= member && member - test_params.member_ports < (int )RTE_DIM (test_params.member_ports));RTE_VERIFY (member->bonding ==0 );
app/test/test_mbuf.c +1 -1
@@ -1702,7 +1702,7 @@ test_mbuf_validate_tx_offload(const char *test_name,struct rte_mbuf *m =NULL ;int ret =0 ; -/* alloc a mbuf and do sanity check */ +/* alloc a mbuf and do some basic checks */ m =rte_pktmbuf_alloc (pktmbuf_pool);if (m ==NULL )GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);
app/test/test_rawdev.c +1 -1
@@ -47,7 +47,7 @@ test_rawdev_selftests(void)int ret =0 ;int i; -/* basic sanity on rawdev infrastructure */ +/* basic check on rawdev infrastructure */ if (test_rawdev_selftest_skeleton () <0 )return -1 ;
app/test/test_timer.c +5 -5
@@ -498,11 +498,11 @@ timer_basic_main_loop(__rte_unused void *arg) }static int -timer_sanity_check (void ) +timer_check (void ) {#ifdef RTE_LIBEAL_USE_HPET if (eal_timer_source !=EAL_TIMER_HPET ) { -printf ("Not using HPET, can't sanity check timer sources\n" ); +printf ("Not using HPET, can't check timer sources\n" );return 0 ; }
@@ -546,9 +546,9 @@ test_timer(void)return TEST_SKIPPED ; } -/* sanity check our timer sources and timer config values */ -if (timer_sanity_check () <0 ) { -printf ("Timer sanity checks failed\n" ); +/* check our timer sources and timer config values */ +if (timer_check () <0 ) { +printf ("Timer checks failed\n" );return TEST_FAILED ; }
Signature · 1 line
2.43.0
PATCH v10 4/20 examples: remove term sanity
In reply to Stephen HemmingerDo not use non-inclusive terms.
--- examples/ipsec-secgw/event_helper.c | 2 +- examples/qos_sched/args.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
examples/ipsec-secgw/event_helper.c +1 -1
@@ -2100,7 +2100,7 @@ eh_launch_worker(struct eh_conf *conf, struct eh_app_worker_params *app_wrkr, goto clean_and_exit; } -/* Verify sanity of the matched worker */ +/* Verify validity of the matched worker */ if (eh_verify_match_worker (match_wrkr) !=1 ) {EH_LOG_ERR ("Failed to validate the matched worker" ); goto clean_and_exit;
examples/qos_sched/args.c +1 -1
@@ -386,7 +386,7 @@ app_parse_args(int argc, char **argv)return -1 ; } -/* sanity check for cores assignment */ +/* check for cores assignment */ for (i =0 ; i < nb_pfc; i++) {if (qos_conf[i].rx_core >=RTE_MAX_LCORE ) { RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1,
Signature · 1 line
2.43.0
PATCH v10 5/20 lib: replace use of sanity check in comments and messages
In reply to Stephen HemmingerSanity check is on the Tier 2 non-inclusive list.
Replace or remove it.
--- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +++--- lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-)
lib/graph/graph.c +1 -1
@@ -344,7 +344,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)graph_spinlock_lock (); -/* Check arguments sanity */ +/* Check argument validity */ if (prm ==NULL )SET_ERR_JMP (EINVAL , fail,"Param should not be NULL" );
lib/graph/graph_stats.c +1 -1
@@ -317,7 +317,7 @@ rte_graph_cluster_stats_create(const struct rte_graph_cluster_stats_param *prm)const char *pattern;rte_graph_t i; -/* Sanity checks */ +/* Validate arguments */ if (!rte_graph_has_stats_feature ())SET_ERR_JMP (EINVAL , fail,"Stats feature is not enabled" );
lib/graph/node.c +1 -1
@@ -68,7 +68,7 @@ __rte_node_register(const struct rte_node_register *reg)graph_spinlock_lock (); -/* Check sanity */ +/* Check argument validity */ if (reg ==NULL || reg->process ==NULL ) { rte_errno =EINVAL ; goto fail;
lib/jobstats/rte_jobstats.c +3 -3
@@ -124,7 +124,7 @@ rte_jobstats_start(struct rte_jobstats_context *ctx, struct rte_jobstats *job) {uint64_t now; -/* Some sanity check. */ +/* Check validity of arguments. */ if (unlikely (ctx ==NULL || job ==NULL || job->context !=NULL ))return -EINVAL ;
@@ -144,7 +144,7 @@ rte_jobstats_abort(struct rte_jobstats *job)struct rte_jobstats_context *ctx;uint64_t now, exec_time; -/* Some sanity check. */ +/* Check that arguments are valid */ if (unlikely (job ==NULL || job->context ==NULL ))return -EINVAL ;
@@ -165,7 +165,7 @@ rte_jobstats_finish(struct rte_jobstats *job, int64_t job_value)uint64_t now, exec_time;int need_update; -/* Some sanity check. */ +/* Check arguments */ if (unlikely (job ==NULL || job->context ==NULL ))return -EINVAL ;
lib/metrics/rte_metrics.c +1 -1
@@ -120,7 +120,7 @@ rte_metrics_reg_names(const char * const *names, uint16_t cnt_names)uint16_t idx_name;uint16_t idx_base; -/* Some sanity checks */ +/* Some consistency checks */ if (cnt_names <1 || names ==NULL )return -EINVAL ;for (idx_name =0 ; idx_name < cnt_names; idx_name++)
lib/pcapng/rte_pcapng.c +1 -1
@@ -620,7 +620,7 @@ rte_pcapng_write_packets(rte_pcapng_t *self,struct pcapng_enhance_packet_block *epb;uint64_t cycles, timestamp; -/* sanity check that is really a pcapng mbuf */ +/* Check that is really a pcapng mbuf */ epb = rte_pktmbuf_mtod(m, struct pcapng_enhance_packet_block *);if (unlikely (epb->block_type !=PCAPNG_ENHANCED_PACKET_BLOCK || epb->block_length !=rte_pktmbuf_data_len (m))) {
Signature · 1 line
2.43.0
PATCH v10 6/20 doc/eventdev_pipeline: remove sanity
In reply to Stephen HemmingerThe word sanity check is unnecessary here.
--- doc/guides/gpus/cuda.rst | 2 +- doc/guides/sample_app_ug/eventdev_pipeline.rst | 2 +- doc/guides/tools/testbbdev.rst | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
doc/guides/gpus/cuda.rst +1 -1
@@ -80,7 +80,7 @@ Similarly to CUDA shared library, if the **libgdrapi.so** shared library is not installed in default locations (e.g. /usr/local/lib), you can use the variable ``GDRCOPY_PATH_L``. -As an example, to enable the CPU map feature sanity check, +As an example, to enable the CPU map feature check, run the ``app/test-gpudev`` application with: .. code-block:: console
doc/guides/sample_app_ug/eventdev_pipeline.rst +1 -1
@@ -50,7 +50,7 @@ these settings is shown below: ./<build_dir>/examples/dpdk-eventdev_pipeline -l 0,2,8-15 --vdev event_sw0 \ -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D -The application has some sanity checking built-in, so if there is a function +The application has some internal validation, so if there is a function (e.g.; the RX core) which doesn't have a cpu core mask assigned, the application will print an error message:
doc/guides/tools/testbbdev.rst +4 -4
@@ -9,7 +9,7 @@ dpdk-test-bbdev Application The ``dpdk-test-bbdev`` tool is a Data Plane Development Kit (DPDK) utility that allows measuring performance parameters of PMDs available in the bbdev framework. Tests available for execution are: latency, throughput, validation, -bler and sanity tests. Execution of tests can be customized using various +bler and basic functionality. Execution of tests can be customized using various parameters passed to a python running script.
@@ -97,8 +97,8 @@ Test Cases There are 7 main test cases that can be executed using testbbdev tool: -* Sanity checks [-c unittest] - - Performs sanity checks on BBDEV interface, validating basic functionality +* Functional checks [-c unittest] + - Performs checks on BBDEV interface, validating basic functionality * Validation tests [-c validation] - Performs full operation of enqueue and dequeue
@@ -232,7 +232,7 @@ vector name refer more explicitly processing specificity such as is purely read/written for external DDR, lbrm when limited buffer rate matching is expected, or crc_fail when a CRC failure is expected. They are chosen to have a good coverage across sizes and processing -parameters while still keeping their number limited as part of sanity +parameters while still keeping their number limited as part of functional regression. Shortened tree of isg_cid-wireless_dpdk_ae with dpdk compiled and output
Signature · 1 line
2.43.0
PATCH v10 7/20 net/ring: replace use of sanity
In reply to Stephen HemmingerDon't use term sanity check
--- drivers/net/ring/rte_eth_ring.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ring/rte_eth_ring.c +2 -5
@@ -34,7 +34,7 @@ struct ring_internal_args {struct rte_ring *const *tx_queues;const unsigned int nb_tx_queues;const unsigned int numa_node; -void *addr;/* self addr for sanity check */ +void *addr;/* self addr for verification */ };enum dev_action {
@@ -606,10 +606,7 @@ static int parse_kvlist(const char *key __rte_unused, *action ='\0' ; action++; -/* -* Need to do some sanity checking here -*/ - +/* Check the command argument is valid action */ if (strcmp (action,ETH_RING_ACTION_ATTACH ) ==0 ) info->list[info->count].action =DEV_ATTACH ;else if (strcmp (action,ETH_RING_ACTION_CREATE ) ==0 )
Signature · 1 line
2.43.0
PATCH v10 8/20 net/fm10k, net/ixgbe: remove word sanity
In reply to Stephen HemmingerRemove non-inclusive term sanity from these Intel drivers.
--- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/fm10k/fm10k_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -1758,7 +1758,7 @@ mempool_element_size_valid(struct rte_mempool *mp)/* account for up to 512B of alignment */ min_size -=FM10K_RX_DATABUF_ALIGN ; -/* sanity check for overflow */ +/* check for overflow */ if (min_size > mp->elt_size)return 0 ;
drivers/net/fm10k/fm10k_rxtx.c +1 -1
@@ -646,7 +646,7 @@ fm10k_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,if (q->nb_free < mb->nb_segs)break ; -/* sanity check to make sure the mbuf is valid */ +/* check to make sure the mbuf is valid */ if ((mb->nb_segs ==0 ) || ((mb->nb_segs >1 ) && (mb->next ==NULL )))break ;
drivers/net/ixgbe/ixgbe_fdir.c +1 -1
@@ -1130,7 +1130,7 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,return -ENOTSUP ;/* -* Sanity check for x550. +* Check for x550. * When adding a new filter with flow type set to IPv4, * the flow director mask should be configed before, * and the L4 protocol and ports are masked.
drivers/net/ixgbe/ixgbe_ipsec.c +1 -1
@@ -615,7 +615,7 @@ ixgbe_crypto_enable_ipsec(struct rte_eth_dev *dev) rx_offloads = dev->data->dev_conf.rxmode.offloads; tx_offloads = dev->data->dev_conf.txmode.offloads; -/* sanity checks */ +/* input validation */ if (rx_offloads &RTE_ETH_RX_OFFLOAD_TCP_LRO ) {PMD_DRV_LOG (ERR ,"RSC and IPsec not supported" );return -1 ;
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -4983,7 +4983,7 @@ ixgbe_set_rsc(struct rte_eth_dev *dev)uint32_t rdrxctl;uint32_t rfctl; -/* Sanity check */ +/* Offload check */ dev->dev_ops->dev_infos_get (dev, &dev_info);if (dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_TCP_LRO ) rsc_capable = true;
Signature · 1 line
2.43.0
PATCH v10 9/20 net/mlx[45]: remove word sanity
In reply to Stephen HemmingerThe term "sanity" is on non-inclusive naming list. Remove it from the Nvidia drivers.
--- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 6 +++--- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 ++---- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx_vec.h | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-)
drivers/common/mlx5/linux/mlx5_common_os.c +1 -1
@@ -235,7 +235,7 @@ mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname)/** * Suffix RTE_EAL_PMD_PATH with "-glue". * -* This function performs a sanity check on RTE_EAL_PMD_PATH before +* This function performs a check on RTE_EAL_PMD_PATH before * suffixing its last component. * * @param buf[out]
drivers/net/mlx4/mlx4.c +1 -1
@@ -1216,7 +1216,7 @@ static struct rte_pci_driver mlx4_driver = {/** * Suffix RTE_EAL_PMD_PATH with "-glue". * -* This function performs a sanity check on RTE_EAL_PMD_PATH before +* This function performs a check on RTE_EAL_PMD_PATH before * suffixing its last component. * * @param buf[out]
drivers/net/mlx4/mlx4_flow.c +3 -3
@@ -514,7 +514,7 @@ mlx4_flow_merge_tcp(struct rte_flow *flow, }/** -* Perform basic sanity checks on a pattern item. +* Perform basic checks on a pattern item. * * @param[in] item * Item specification.
@@ -730,7 +730,7 @@ mlx4_flow_prepare(struct mlx4_priv *priv, goto exit_item_not_supported; proc = next;/* -* Perform basic sanity checks only once, while handle is +* Perform basic checks only once, while handle is * not allocated. */ if (flow == &temp) {
@@ -799,7 +799,7 @@ mlx4_flow_prepare(struct mlx4_priv *priv, rss_key = mlx4_rss_hash_key_default; rss_key_len =MLX4_RSS_HASH_KEY_SIZE ; } -/* Sanity checks. */ +/* Input checks. */ for (i =0 ; i < rss->queue_num; ++i)if (rss->queue[i] >=ETH_DEV (priv)->data->nb_rx_queues)
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -9089,7 +9089,7 @@ flow_dv_prepare(struct rte_eth_dev *dev,#ifdef RTE_LIBRTE_MLX5_DEBUG /** -* Sanity check for match mask and value. Similar to check_valid_spec() in +* Check for match mask and value. Similar to check_valid_spec() in * kernel driver. If unmasked bit is present in value, it returns failure. * * @param match_mask
drivers/net/mlx5/mlx5_flow_hw.c +2 -4
@@ -8452,11 +8452,10 @@ flow_hw_tx_tag_regc_mask(struct rte_eth_dev *dev)struct mlx5_priv *priv = dev->data->dev_private;uint32_t mask = priv->sh->dv_regc0_mask; -/* Mask is verified during device initialization. Sanity checking here. */ +/* Mask is verified during device initialization. */ MLX5_ASSERT (mask !=0 );/* * Availability of sufficient number of bits in REG_C_0 is verified on initialization. -* Sanity checking here. */ MLX5_ASSERT (rte_popcount32 (mask) >=rte_popcount32 (priv->vport_meta_mask));return mask;
@@ -8468,12 +8467,11 @@ flow_hw_tx_tag_regc_value(struct rte_eth_dev *dev)struct mlx5_priv *priv = dev->data->dev_private;uint32_t tag; -/* Mask is verified during device initialization. Sanity checking here. */ +/* Mask is verified during device initialization. */ MLX5_ASSERT (priv->vport_meta_mask !=0 ); tag = priv->vport_meta_tag >> (rte_bsf32 (priv->vport_meta_mask));/* * Availability of sufficient number of bits in REG_C_0 is verified on initialization. -* Sanity checking here. */ MLX5_ASSERT ((tag & priv->sh->dv_regc0_mask) == tag);return tag;
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -1442,7 +1442,7 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev) desc *=4 ; obj_num = desc +MLX5_MPRQ_MP_CACHE_SZ * n_ibv;/* -* rte_mempool_create_empty() has sanity check to refuse large cache +* rte_mempool_create_empty() has basic check to refuse large cache * size compared to the number of elements. * CALC_CACHE_FLUSHTHRESH() is defined in a C file, so using a * constant number 2 instead.
drivers/net/mlx5/mlx5_rxtx_vec.h +1 -1
@@ -21,7 +21,7 @@ RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)/* -* Compile time sanity check for vectorized functions. +* Compile time checks for vectorized functions. */ #define S_ASSERT_RTE_MBUF (s) \
Signature · 1 line
2.43.0
PATCH v10 10/20 net/sfc: remove term "sanity check"
In reply to Stephen HemmingerRemove term sanity check in comment.
--- drivers/net/sfc/sfc_dp_rx.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/sfc/sfc_dp_rx.h +1 -1
@@ -59,7 +59,7 @@ struct sfc_dp_rx_qcreate_info {/** * Maximum number of Rx descriptors completed in one Rx event. -* Just for sanity checks if datapath would like to do. +* Checks if datapath would like to do. */ unsigned int batch_max;
Signature · 1 line
2.43.0
PATCH v10 11/20 net/ark: replace use of term sanity
In reply to Stephen HemmingerDo not use non inclusive terms.
--- drivers/net/ark/ark_ethdev.c | 8 ++++---- drivers/net/ark/ark_ethdev_rx.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/ark/ark_ethdev.c +4 -4
@@ -349,10 +349,10 @@ eth_ark_dev_init(struct rte_eth_dev *dev)ARK_PMD_LOG (NOTICE ,"Arkville HW Commit_ID: %08x\n" ,rte_be_to_cpu_32 (ark->sysctrl.t32[0x20 /4 ])); -/* If HW sanity test fails, return an error */ +/* If HW test fails, return an error */ if (ark->sysctrl.t32[4 ] !=0xcafef00d ) {ARK_PMD_LOG (ERR , -"HW Sanity test has failed, expected constant" +"HW test has failed, expected constant" " 0x%x, read 0x%x (%s)\n" ,0xcafef00d , ark->sysctrl.t32[4 ], __func__);
@@ -360,7 +360,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) }ARK_PMD_LOG (DEBUG , -"HW Sanity test has PASSED, expected constant" +"HW test has PASSED, expected constant" " 0x%x, read 0x%x (%s)\n" ,0xcafef00d , ark->sysctrl.t32[4 ], __func__);
@@ -590,7 +590,7 @@ eth_ark_dev_start(struct rte_eth_dev *dev)rte_thread_t thread;/* Delay packet generator start allow the hardware to be ready -* This is only used for sanity checking with internal generator +* This is only used for checking with internal generator */ char tname[RTE_THREAD_INTERNAL_NAME_SIZE ];snprintf (tname,sizeof (tname),"ark-pg%d" , dev->data->port_id);
drivers/net/ark/ark_ethdev_rx.c +1 -1
@@ -283,7 +283,7 @@ eth_ark_recv_pkts(void *rx_queue, mbuf->pkt_len = meta->pkt_len; mbuf->data_len = meta->pkt_len; -if (ARK_DEBUG_CORE ) {/* debug sanity checks */ +if (ARK_DEBUG_CORE ) {/* debug checks */ if ((meta->pkt_len > (1024 *16 )) || (meta->pkt_len ==0 )) {
Signature · 1 line
2.43.0
PATCH v10 12/20 net/bnxt: replace use of term sanity
In reply to Stephen HemmingerDo not use non-inclusive terms.
--- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/bnxt/bnxt_hwrm.c +1 -1
@@ -575,7 +575,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, done =bnxt_check_cq_hwrm_done (cpr, is_tx, is_rx, i == timeout -1 ); -/* Sanity check on the resp->resp_len */ +/* Input check on the resp->resp_len */ rte_io_rmb ();if (resp->resp_len && resp->resp_len <= bp->max_resp_len) {/* Last byte of resp contains the valid key */
drivers/net/bnxt/hsi_struct_def_dpdk.h +1 -1
@@ -56770,7 +56770,7 @@ struct hwrm_tfc_ident_alloc_output {* Requests the firmware to free a TFC resource identifier. * A resource subtype and session id are passed in. * An identifier (previously allocated) corresponding to all these is -* freed, only after various sanity checks are completed. +* freed, only after various checks are completed. */ /* hwrm_tfc_ident_free_input (size:192b/24B) */ struct hwrm_tfc_ident_free_input {
Signature · 1 line
2.43.0
PATCH v10 13/20 net/bnx2x: remove reference to sanity
In reply to Stephen HemmingerReplace "sanity check"
--- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_stats.c | 8 ++++---- drivers/net/bnx2x/ecore_sp.c | 2 +- drivers/net/bnx2x/elink.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/bnx2x/bnx2x.c +1 -1
@@ -7820,7 +7820,7 @@ static int bnx2x_check_valid_mf_cfg(struct bnx2x_softc *sc)uint32_t ovlan2;uint8_t i, j; -/* various MF mode sanity checks... */ +/* various MF mode checks... */ if (mf_info->mf_config[SC_VN (sc)] &FUNC_MF_CFG_FUNC_HIDE ) { PMD_DRV_LOG(NOTICE, sc,
drivers/net/bnx2x/bnx2x_stats.c +4 -4
@@ -181,7 +181,7 @@ bnx2x_stats_pmf_update(struct bnx2x_softc *sc)*/ return ; } -/* sanity */ +/* input validation */ if (!sc->port.pmf || !sc->port.port_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -231,7 +231,7 @@ bnx2x_port_stats_init(struct bnx2x_softc *sc)uint32_t mac_addr;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->link_vars.link_up || !sc->port.pmf) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -457,7 +457,7 @@ bnx2x_func_stats_init(struct bnx2x_softc *sc)struct dmae_command *dmae = &sc->stats_dmae;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->func_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -1280,7 +1280,7 @@ bnx2x_port_stats_base_init(struct bnx2x_softc *sc)struct dmae_command *dmae;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->port.pmf || !sc->port.port_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
drivers/net/bnx2x/ecore_sp.c +1 -1
@@ -207,7 +207,7 @@ static int ecore_exe_queue_step(struct bnx2x_softc *sc,break ; } -/* Sanity check */ +/* Argument check */ if (!cur_len)return ECORE_SUCCESS ;
drivers/net/bnx2x/elink.c +2 -2
@@ -1088,7 +1088,7 @@ static void elink_get_epio(struct bnx2x_softc *sc, uint32_t epio_pin, {uint32_t epio_mask, gp_oenable; *en =0 ; -/* Sanity check */ +/* Input check */ if (epio_pin >31 ) {ELINK_DEBUG_P1 (sc,"Invalid EPIO pin %d to get" , epio_pin);return ;
@@ -1105,7 +1105,7 @@ static void elink_set_epio(struct bnx2x_softc *sc, uint32_t epio_pin, uint32_t e {uint32_t epio_mask, gp_output, gp_oenable; -/* Sanity check */ +/* Input check */ if (epio_pin >31 ) {ELINK_DEBUG_P1 (sc,"Invalid EPIO pin %d to set" , epio_pin);return ;
Signature · 1 line
2.43.0
PATCH v10 14/20 net/nfp: replace use of term sanity
In reply to Stephen HemmingerReplace "sanity check"
--- drivers/net/nfp/nfp_net_flow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/nfp/nfp_net_flow.c +1 -1
@@ -519,7 +519,7 @@ nfp_net_flow_compile_items(const struct rte_flow_item items[],break ; } -/* Perform basic sanity checks */ +/* Perform basic checks */ ret =nfp_net_flow_item_check (item, proc);if (ret !=0 ) {PMD_DRV_LOG (ERR ,"NFP flow item %d check failed" , item->type);
Signature · 1 line
2.43.0
PATCH v10 15/20 net/txgbe: replace term sanity
In reply to Stephen HemmingerDon't use term sanity.
--- drivers/net/txgbe/txgbe_ipsec.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/txgbe/txgbe_ipsec.c +1 -1
@@ -595,7 +595,7 @@ txgbe_crypto_enable_ipsec(struct rte_eth_dev *dev) rx_offloads = dev->data->dev_conf.rxmode.offloads; tx_offloads = dev->data->dev_conf.txmode.offloads; -/* sanity checks */ +/* offload checks */ if (rx_offloads &RTE_ETH_RX_OFFLOAD_TCP_LRO ) {PMD_DRV_LOG (ERR ,"RSC and IPsec not supported" );return -1 ;
drivers/net/txgbe/txgbe_rxtx.c +1 -1
@@ -4115,7 +4115,7 @@ txgbe_set_rsc(struct rte_eth_dev *dev)uint32_t rdrxctl;uint32_t rfctl; -/* Sanity check */ +/* Offload check */ dev->dev_ops->dev_infos_get (dev, &dev_info);if (dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_TCP_LRO ) rsc_capable = true;
Signature · 1 line
2.43.0
PATCH v10 16/20 net/cxgbe: remove use of term sanity
In reply to Stephen HemmingerRemove non-inclusive terminolgy.
--- drivers/net/cxgbe/cxgbe_ethdev.c | 10 ++-------- drivers/net/cxgbe/cxgbevf_main.c | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-)
drivers/net/cxgbe/cxgbe_ethdev.c +2 -8
@@ -524,10 +524,7 @@ int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, eth_dev->data->tx_queues[queue_idx] = (void *)txq; -/* Sanity Checking -* -* nb_desc should be > 1023 and <= CXGBE_MAX_RING_DESC_SIZE -*/ +/* nb_desc should be > 1023 and <= CXGBE_MAX_RING_DESC_SIZE */ temp_nb_desc = nb_desc;if (nb_desc <CXGBE_MIN_RING_DESC_SIZE ) { dev_warn(adapter, "%s: number of descriptors must be >= %d. Using default [%d]\n",
@@ -648,10 +645,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, eth_dev->data->rx_queues[queue_idx] = (void *)rxq; -/* Sanity Checking -* -* nb_desc should be > 0 and <= CXGBE_MAX_RING_DESC_SIZE -*/ +/* nb_desc should be > 0 and <= CXGBE_MAX_RING_DESC_SIZE */ temp_nb_desc = nb_desc;if (nb_desc <CXGBE_MIN_RING_DESC_SIZE ) { dev_warn(adapter, "%s: number of descriptors must be >= %d. Using default [%d]\n",
drivers/net/cxgbe/cxgbevf_main.c +2 -2
@@ -137,7 +137,7 @@ static int adap_init0vf(struct adapter *adapter)/* * Grab our Virtual Interface resource allocation, extract the -* features that we're interested in and do a bit of sanity testing on +* features that we're interested in and do a bit of testing on * what we discover. */ err =t4vf_get_vfres (adapter);
@@ -148,7 +148,7 @@ static int adap_init0vf(struct adapter *adapter) }/* -* Check for various parameter sanity issues. +* Check for various parameter issues. */ if (adapter->params.vfres.pmask ==0 ) { dev_err(adapter->pdev_dev, "no port access configured\n"
Signature · 1 line
2.43.0
PATCH v10 17/20 cnxk: replace term sanity
In reply to Stephen HemmingerDo not use non-inclusive naming.
--- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_npa.c | 4 ++-- drivers/net/cnxk/cnxk_ethdev.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/common/cnxk/roc_nix_tm_ops.c +1 -1
@@ -528,7 +528,7 @@ roc_nix_tm_hierarchy_disable(struct roc_nix *roc_nix) node->flags &= ~NIX_TM_NODE_ENABLED ; } -/* Verify sanity of all tx queues */ +/* Verify all tx queues */ for (i =0 ; i < sq_cnt; i++) { sq = nix->sqs[i];if (!sq)
drivers/common/cnxk/roc_npa.c +2 -2
@@ -458,7 +458,7 @@ npa_aura_pool_pair_alloc(struct npa_lf *lf, const uint32_t block_size,char name[PLT_MEMZONE_NAMESIZE ];const struct plt_memzone *mz; -/* Sanity check */ +/* argument checks */ if (!lf || !block_size || !block_count || !pool || !aura || !aura_handle)return NPA_ERR_PARAM ;
@@ -1096,7 +1096,7 @@ npa_dev_init(struct npa_lf *lf, uintptr_t base, struct mbox *mbox)uint8_t aura_sz;int rc; -/* Sanity checks */ +/* Input checks */ if (!lf || !base || !mbox)return NPA_ERR_PARAM ;
drivers/net/cnxk/cnxk_ethdev.c +2 -2
@@ -636,7 +636,7 @@ cnxk_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,struct rte_mempool *lpb_pool = mp;struct rte_mempool *spb_pool =NULL ; -/* Sanity checks */ +/* input checks */ if (rx_conf->rx_deferred_start ==1 ) {plt_err ("Deferred Rx start is not supported" ); goto fail;
@@ -1205,7 +1205,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev) rc = -EINVAL ; -/* Sanity checks */ +/* baseline checks */ if (rte_eal_has_hugepages () ==0 ) {plt_err ("Huge page is not configured" ); goto fail_configure;
Signature · 1 line
2.43.0
PATCH v10 18/20 event/opdl: remove term sanity
In reply to Stephen HemmingerDon't use non-inclusive term.
--- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/event/opdl/opdl_evdev.c +1 -1
@@ -241,7 +241,7 @@ opdl_queue_setup(struct rte_eventdev *dev,struct opdl_evdev *device =opdl_pmd_priv (dev); -/* Extra sanity check, probably not needed */ +/* Extra check, probably not needed */ if (queue_id ==OPDL_INVALID_QID ) { PMD_DRV_LOG(ERR, "DEV_ID:[%02d] : " "Invalid queue id %u requested\n",
drivers/event/opdl/opdl_evdev_init.c +1 -1
@@ -300,7 +300,7 @@ static int opdl_add_deps(struct opdl_evdev *device,struct opdl_queue *queue_deps = &device->queue[deps_q_id];struct opdl_stage *dep_stages[OPDL_PORTS_MAX ]; -/* sanity check that all stages are for same opdl ring */ +/* check that all stages are for same opdl ring */ for (i =0 ; i < queue->nb_ports; i++) {struct opdl_ring *r =opdl_stage_get_opdl_ring (stage_for_port (queue, i));
Signature · 1 line
2.43.0
PATCH v10 19/20 crypto/bcmfs: replace term sanity check
In reply to Stephen HemmingerDo not use non-inclusive naming here.
--- drivers/crypto/bcmfs/hw/bcmfs4_rm.c | 6 +++--- drivers/crypto/bcmfs/hw/bcmfs5_rm.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/crypto/bcmfs/hw/bcmfs4_rm.c +3 -3
@@ -317,7 +317,7 @@ bcmfs4_mdst_desc(uint64_t addr, unsigned int length_div_16) }static bool -bcmfs4_sanity_check (struct bcmfs_qp_message *msg) +bcmfs4_message_check (struct bcmfs_qp_message *msg) {unsigned int i =0 ;
@@ -458,8 +458,8 @@ bcmfs4_enqueue_single_request_qp(struct bcmfs_qp *qp, void *op)struct bcmfs_queue *txq = &qp->tx_q;struct bcmfs_qp_message *msg = (struct bcmfs_qp_message *)op; -/* Do sanity check on message */ -if (!bcmfs4_sanity_check (msg)) { +/* Do check on message */ +if (!bcmfs4_message_check (msg)) {BCMFS_DP_LOG (ERR ,"Invalid msg on queue %d" , qp->qpair_id);return -EIO ; }
drivers/crypto/bcmfs/hw/bcmfs5_rm.c +3 -3
@@ -293,7 +293,7 @@ bcmfs5_mdst_desc(uint64_t addr, unsigned int len_div_16) }static bool -bcmfs5_sanity_check (struct bcmfs_qp_message *msg) +bcmfs5_message_check (struct bcmfs_qp_message *msg) {unsigned int i =0 ;
@@ -389,8 +389,8 @@ bcmfs5_enqueue_single_request_qp(struct bcmfs_qp *qp, void *op)struct bcmfs_queue *txq = &qp->tx_q;struct bcmfs_qp_message *msg = (struct bcmfs_qp_message *)op; -/* Do sanity check on message */ -if (!bcmfs5_sanity_check (msg)) { +/* Do check on message */ +if (!bcmfs5_message_check (msg)) {BCMFS_DP_LOG (ERR ,"Invalid msg on queue %d" , qp->qpair_id);return -EIO ; }
Signature · 1 line
2.43.0
PATCH v10 20/20 drivers: remove use of term sanity check
In reply to Stephen HemmingerReplace non-inclusive language with better comments. Covers multiple drivers
--- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 2 +- drivers/common/cnxk/roc_npa.c | 2 +- drivers/common/dpaax/caamflib/desc.h | 2 +- drivers/common/sfc_efx/base/ef10_nvram.c | 4 ++-- drivers/common/sfc_efx/base/efx_rx.c | 2 +- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/mvpp2/mrvl_qos.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- drivers/net/qede/qede_rxtx.c | 6 +++--- 10 files changed, 13 insertions(+), 13 deletions(-)
drivers/bus/fslmc/qbman/qbman_sys_decl.h +1 -1
@@ -9,7 +9,7 @@#include <compat.h> #include <fsl_qbman_base.h> -/* Sanity check */ +/* Byte order check */ #if (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) && \ (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)#error "Unknown endianness!"
drivers/common/cnxk/roc_npa.c +1 -1
@@ -622,7 +622,7 @@ npa_aura_alloc(struct npa_lf *lf, const uint32_t block_count, int pool_id, {int rc, aura_id; -/* Sanity check */ +/* parameter check */ if (!lf || !aura || !aura_handle)return NPA_ERR_PARAM ;
drivers/common/dpaax/caamflib/desc.h +1 -1
@@ -107,7 +107,7 @@ extern enum rta_sec_era rta_sec_era;/* * ONE - should always be set. Combination of ONE (always -* set) and ZRO (always clear) forms an endianness sanity check +* set) and ZRO (always clear) forms an endianness check */ #define HDR_ONE BIT(23)#define HDR_ZRO BIT(15)
drivers/common/sfc_efx/base/ef10_nvram.c +2 -2
@@ -595,13 +595,13 @@ tlv_update_partition_len_and_cks(/* * We just modified the partition, so the total length may not be -* valid. Don't use tlv_find(), which performs some sanity checks +* valid. Don't use tlv_find(), which performs some checks * that may fail here. */ partition.data = cursor->block;memcpy (&partition.tlv_cursor, cursor,sizeof (*cursor)); header = (struct tlv_partition_header *)partition.data; -/* Sanity check. */ +/* Header check */ if (__LE_TO_CPU_32 (header->tag) !=TLV_TAG_PARTITION_HEADER ) { rc =EFAULT ; goto fail1;
drivers/common/sfc_efx/base/efx_rx.c +1 -1
@@ -930,7 +930,7 @@ efx_rx_qcreate_internal( ndescs, id, flags, eep, erp)) != 0) goto fail4; -/* Sanity check queue creation result */ +/* Check queue creation result */ if (flags &EFX_RXQ_FLAG_RSS_HASH ) {const efx_rx_prefix_layout_t *erplp = &erp->er_prefix_layout;const efx_rx_prefix_field_info_t *rss_hash_field;
drivers/dma/idxd/idxd_pci.c +1 -1
@@ -205,7 +205,7 @@ init_pci_device(struct rte_pci_device *dev, struct idxd_dmadev *idxd, goto err; } -/* sanity check device status */ +/* check device status */ if (pci->regs->gensts &GENSTS_DEV_STATE_MASK ) {/* need function-level-reset (FLR) or is enabled */ IDXD_PMD_ERR ("Device status is not disabled, cannot init" );
drivers/net/bonding/rte_eth_bond_8023ad.c +1 -1
@@ -1476,7 +1476,7 @@ bond_8023ad_setup_validate(uint16_t port_id,return -EINVAL ;if (conf !=NULL ) { -/* Basic sanity check */ +/* Basic input check */ if (conf->slow_periodic_ms == 0 || conf->fast_periodic_ms >= conf->slow_periodic_ms || conf->long_timeout_ms == 0 ||
drivers/net/mvpp2/mrvl_qos.c +1 -1
@@ -260,7 +260,7 @@ get_entry_values(const char *entry, uint8_t *tab,if (nb_rng_tokens !=2 )return -3 ; -/* Range and sanity checks. */ +/* Range and input checks. */ if (get_val_securely (rng_tokens[0 ], &token_val) <0 )return -4 ; beg = (char )token_val;
drivers/net/nfp/flower/nfp_flower_flow.c +1 -1
@@ -2079,7 +2079,7 @@ nfp_flow_compile_item_proc(struct nfp_flower_representor *repr,break ; } -/* Perform basic sanity checks */ +/* Perform basic checks */ ret =nfp_flow_item_check (item, proc);if (ret !=0 ) {PMD_DRV_LOG (ERR ,"nfp flow item %d check failed" , item->type);
drivers/net/qede/qede_rxtx.c +3 -3
@@ -1383,7 +1383,7 @@ qede_rx_process_tpa_end_cqe(struct qede_dev *qdev, cqe->len_list[0]);/* Update total length and frags based on end TPA */ rx_mb = rxq->tpa_info[cqe->tpa_agg_index].tpa_head; -/* TODO: Add Sanity Checks */ +/* TODO: Add more checks */ rx_mb->nb_segs = cqe->num_of_bds; rx_mb->pkt_len = cqe->total_packet_len;
@@ -2211,7 +2211,7 @@ qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,#ifdef RTE_LIBRTE_QEDE_DEBUG_TX static inline void -qede_mpls_tunn_tx_sanity_check (struct rte_mbuf *mbuf, +qede_mpls_tunn_tx_basic_check (struct rte_mbuf *mbuf,struct qede_tx_queue *txq) {if (((mbuf->outer_l2_len + mbuf->outer_l3_len) /2 ) >0xff )
@@ -2473,7 +2473,7 @@ qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) RTE_MBUF_F_TX_TUNNEL_MPLSINUDP) { mplsoudp_flg = true;#ifdef RTE_LIBRTE_QEDE_DEBUG_TX -qede_mpls_tunn_tx_sanity_check (mbuf, txq); +qede_mpls_tunn_tx_basic_check (mbuf, txq);#endif /* Outer L4 offset in two byte words */ tunn_l4_hdr_start_offset =
Signature · 1 line
2.43.0
v11 cover Remove usage of wording sanity check
In reply to Stephen HemmingerRemove use of expression sanity check across DPDK drivers and documentation.
The term sanity-check is on the Tier 2 word list from the Inclusive Naming project.
https://inclusivenaming.org/word-lists/tier-2/sanity-check/
Rationale
This term might be derogatory to neurodiverse people. Jargon, such as “sanity test”, is difficult to translate and is difficult to understand by readers whose first language is not English.
v10 - rebase and consolidate patches for easier review
Stephen Hemminger (7):
mbuf: replace term sanity check
eal: replace use of sanity check in comments and messages
test: replace use word sanity
examples: remove term sanity
lib: replace use of sanity check in comments and messages
doc: remove sanity
drivers: remove use of term sanity check
app/test/test_bitmap.c | 4 +- app/test/test_bpf.c | 6 +- app/test/test_common.c | 2 +- app/test/test_distributor.c | 46 ++++++------ app/test/test_eal_flags.c | 20 +++--- app/test/test_hash.c | 2 +- app/test/test_interrupts.c | 9 +-- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_mbuf.c | 30 ++++---- app/test/test_rawdev.c | 2 +- app/test/test_timer.c | 10 +-- doc/guides/gpus/cuda.rst | 2 +- doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 + .../sample_app_ug/eventdev_pipeline.rst | 2 +- doc/guides/tools/testbbdev.rst | 8 +-- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 2 +- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_npa.c | 6 +- drivers/common/dpaax/caamflib/desc.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/sfc_efx/base/ef10_nvram.c | 4 +- drivers/common/sfc_efx/base/efx_rx.c | 2 +- drivers/crypto/bcmfs/hw/bcmfs4_rm.c | 6 +- drivers/crypto/bcmfs/hw/bcmfs5_rm.c | 6 +- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/net/ark/ark_ethdev.c | 8 +-- drivers/net/ark/ark_ethdev_rx.c | 2 +- drivers/net/avp/avp_ethdev.c | 18 ++--- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_stats.c | 8 +-- drivers/net/bnx2x/ecore_sp.c | 2 +- drivers/net/bnx2x/elink.c | 4 +- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/cnxk/cnxk_ethdev.c | 4 +- drivers/net/cxgbe/cxgbe_ethdev.c | 10 +-- drivers/net/cxgbe/cxgbevf_main.c | 4 +- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/fm10k/fm10k_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 6 +- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 +- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx_vec.h | 2 +- drivers/net/mvpp2/mrvl_qos.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/qede/qede_rxtx.c | 6 +- drivers/net/ring/rte_eth_ring.c | 7 +- drivers/net/sfc/sfc_dp_rx.h | 2 +- drivers/net/sfc/sfc_ef100_rx.c | 6 +- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 +- drivers/net/sfc/sfc_ef10_rx.c | 4 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/txgbe/txgbe_ipsec.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 2 +- examples/ipsec-secgw/event_helper.c | 2 +- examples/ipv4_multicast/main.c | 2 +- examples/qos_sched/args.c | 2 +- lib/eal/common/eal_common_memory.c | 2 +- lib/eal/common/eal_common_proc.c | 3 +- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/windows/eal.c | 2 +- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +- lib/mbuf/rte_mbuf.c | 23 +++--- lib/mbuf/rte_mbuf.h | 71 ++++++++++--------- lib/mbuf/version.map | 1 + lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 84 files changed, 234 insertions(+), 229 deletions(-)
Signature · 1 line
2.43.0
PATCH v11 1/7 mbuf: replace term sanity check
Replace rte_mbuf_sanity_check() with rte_mbuf_verify() to match the similar macro RTE_VERIFY() in rte_debug.h
The term sanity check is on the Tier 2 list of words that should be replaced.
--- app/test/test_mbuf.c | 28 +++++------ doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 ++ drivers/net/avp/avp_ethdev.c | 18 +++---- drivers/net/sfc/sfc_ef100_rx.c | 6 +-- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 +- drivers/net/sfc/sfc_ef10_rx.c | 4 +- drivers/net/sfc/sfc_rx.c | 2 +- examples/ipv4_multicast/main.c | 2 +- lib/mbuf/rte_mbuf.c | 23 +++++---- lib/mbuf/rte_mbuf.h | 71 +++++++++++++++------------- lib/mbuf/version.map | 1 + 12 files changed, 90 insertions(+), 76 deletions(-)
app/test/test_mbuf.c +14 -14
@@ -262,8 +262,8 @@ test_one_pktmbuf(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("Buffer should be continuous" );memset (hdr,0x55 ,MBUF_TEST_HDR2_LEN ); -rte_mbuf_sanity_check (m,1 ); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,1 ); +rte_mbuf_verify (m,0 );rte_pktmbuf_dump (stdout, m,0 );/* this prepend should fail */
@@ -1162,7 +1162,7 @@ test_refcnt_mbuf(void)#ifdef RTE_EXEC_ENV_WINDOWS static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {RTE_SET_USED (pktmbuf_pool);return TEST_SKIPPED ;
@@ -1181,12 +1181,12 @@ mbuf_check_pass(struct rte_mbuf *buf) }static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {struct rte_mbuf *buf;struct rte_mbuf badbuf; -printf ("Checking rte_mbuf_sanity_check for failure conditions\n" ); +printf ("Checking rte_mbuf_verify for failure conditions\n" );/* get a good mbuf to use to make copies */ buf =rte_pktmbuf_alloc (pktmbuf_pool);
@@ -1708,7 +1708,7 @@ test_mbuf_validate_tx_offload(const char *test_name,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); m->ol_flags = ol_flags; m->tso_segsz = segsize; ret =rte_validate_tx_offload (m);
@@ -1915,7 +1915,7 @@ test_pktmbuf_read(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); data =rte_pktmbuf_append (m,MBUF_TEST_DATA_LEN2 );if (data ==NULL )
@@ -1964,7 +1964,7 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 );/* prepend an ethernet header */ hdr = (struct ether_hdr *)rte_pktmbuf_prepend (m, hdr_len);
@@ -2109,7 +2109,7 @@ create_packet(struct rte_mempool *pktmbuf_pool,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (pkt_seg) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (pkt_seg,0 ); +rte_mbuf_verify (pkt_seg,0 );/* Add header only for the first segment */ if (test_data->flags ==MBUF_HEADER && seg ==0 ) { hdr_len =sizeof (struct rte_ether_hdr );
@@ -2321,7 +2321,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); ext_buf_addr =rte_malloc ("External buffer" , buf_len,RTE_CACHE_LINE_SIZE );
@@ -2482,8 +2482,8 @@ test_pktmbuf_ext_pinned_buffer(struct rte_mempool *std_pool)GOTO_FAIL ("%s: test_pktmbuf_copy(pinned) failed\n" , __func__); -if (test_failing_mbuf_sanity_check (pinned_pool) <0 ) -GOTO_FAIL ("%s: test_failing_mbuf_sanity_check(pinned)" +if (test_failing_mbuf_verify (pinned_pool) <0 ) +GOTO_FAIL ("%s: test_failing_mbuf_verify(pinned)" " failed\n" , __func__);if (test_mbuf_linearize_check (pinned_pool) <0 )
@@ -2857,8 +2857,8 @@ test_mbuf(void) goto err; } -if (test_failing_mbuf_sanity_check (pktmbuf_pool) <0 ) { -printf ("test_failing_mbuf_sanity_check() failed\n" ); +if (test_failing_mbuf_verify (pktmbuf_pool) <0 ) { +printf ("test_failing_mbuf_verify() failed\n" ); goto err; }
doc/guides/prog_guide/mbuf_lib.rst +2 -2
@@ -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). Use Cases ---------
doc/guides/rel_notes/deprecation.rst +3 -0
@@ -230,3 +230,6 @@ Deprecation Notices The structures ``rte_node``, ``rte_node_register`` and ``rte_graph_cluster_node_stats`` will be extended to include node error counters and error description. + +* mbuf: The function ``rte_mbuf_sanity_check`` is deprecated. + Use the new function ``rte_mbuf_verify`` instead.
drivers/net/avp/avp_ethdev.c +9 -9
@@ -1231,7 +1231,7 @@ _avp_mac_filter(struct avp_dev *avp, struct rte_mbuf *m)#ifdef RTE_LIBRTE_AVP_DEBUG_BUFFERS static inline void -__avp_dev_buffer_sanity_check (struct avp_dev *avp,struct rte_avp_desc *buf) +__avp_dev_buffer_check (struct avp_dev *avp,struct rte_avp_desc *buf) {struct rte_avp_desc *first_buf;struct rte_avp_desc *pkt_buf;
@@ -1272,12 +1272,12 @@ __avp_dev_buffer_sanity_check(struct avp_dev *avp, struct rte_avp_desc *buf) first_buf->pkt_len, pkt_len); } -#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)#endif
@@ -1302,7 +1302,7 @@ avp_dev_copy_from_buffers(struct avp_dev *avp,void *pkt_data;unsigned int i; -avp_dev_buffer_sanity_check (avp, buf); +avp_dev_buffer_check (avp, buf);/* setup the first source buffer */ pkt_buf =avp_dev_translate_buffer (avp, buf);
@@ -1370,7 +1370,7 @@ avp_dev_copy_from_buffers(struct avp_dev *avp,rte_pktmbuf_pkt_len (m) = total_length; m->vlan_tci = vlan_tci; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );return m; }
@@ -1614,7 +1614,7 @@ avp_dev_copy_to_buffers(struct avp_dev *avp,char *pkt_data;unsigned int i; -__rte_mbuf_sanity_check (mbuf,1 ); +__rte_mbuf_verify (mbuf,1 ); m = mbuf; src_offset =0 ;
@@ -1680,7 +1680,7 @@ avp_dev_copy_to_buffers(struct avp_dev *avp, first_buf->vlan_tci = mbuf->vlan_tci; } -avp_dev_buffer_sanity_check (avp, buffers[0 ]); +avp_dev_buffer_check (avp, buffers[0 ]);return total_length; }
@@ -1798,7 +1798,7 @@ avp_xmit_scattered_pkts(void *tx_queue,#ifdef RTE_LIBRTE_AVP_DEBUG_BUFFERS for (i =0 ; i < nb_pkts; i++) -avp_dev_buffer_sanity_check (avp, tx_bufs[i]); +avp_dev_buffer_check (avp, tx_bufs[i]);#endif /* send the packets */
drivers/net/sfc/sfc_ef100_rx.c +3 -3
@@ -179,7 +179,7 @@ sfc_ef100_rx_qrefill(struct sfc_ef100_rxq *rxq)struct sfc_ef100_rx_sw_desc *rxd;rte_iova_t dma_addr; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); dma_addr =rte_mbuf_data_iova_default (m);if (rxq->flags &SFC_EF100_RXQ_NIC_DMA_MAP ) {
@@ -551,7 +551,7 @@ sfc_ef100_rx_process_ready_pkts(struct sfc_ef100_rxq *rxq, rxq->ready_pkts--; pkt =sfc_ef100_rx_next_mbuf (rxq); -__rte_mbuf_raw_sanity_check (pkt); +__rte_mbuf_raw_verify (pkt);RTE_BUILD_BUG_ON (sizeof (pkt->rearm_data[0 ]) !=sizeof (rxq->rearm_data));
@@ -575,7 +575,7 @@ sfc_ef100_rx_process_ready_pkts(struct sfc_ef100_rxq *rxq,struct rte_mbuf *seg; seg =sfc_ef100_rx_next_mbuf (rxq); -__rte_mbuf_raw_sanity_check (seg); +__rte_mbuf_raw_verify (seg); seg->data_off =RTE_PKTMBUF_HEADROOM ;
drivers/net/sfc/sfc_ef10_essb_rx.c +2 -2
@@ -125,7 +125,7 @@ sfc_ef10_essb_next_mbuf(const struct sfc_ef10_essb_rxq *rxq,struct rte_mbuf *m; m = (struct rte_mbuf *)((uintptr_t )mbuf + rxq->buf_stride); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);return m; }
@@ -136,7 +136,7 @@ sfc_ef10_essb_mbuf_by_index(const struct sfc_ef10_essb_rxq *rxq,struct rte_mbuf *m; m = (struct rte_mbuf *)((uintptr_t )mbuf + idx * rxq->buf_stride); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);return m; }
drivers/net/sfc/sfc_ef10_rx.c +2 -2
@@ -148,7 +148,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)struct sfc_ef10_rx_sw_desc *rxd;rte_iova_t phys_addr; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);SFC_ASSERT ((id & ~ptr_mask) ==0 ); rxd = &rxq->sw_ring[id];
@@ -297,7 +297,7 @@ sfc_ef10_rx_process_event(struct sfc_ef10_rxq *rxq, efx_qword_t rx_ev, rxd = &rxq->sw_ring[pending++ & ptr_mask]; m = rxd->mbuf; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); m->data_off =RTE_PKTMBUF_HEADROOM ;rte_pktmbuf_data_len (m) = seg_len;
drivers/net/sfc/sfc_rx.c +1 -1
@@ -120,7 +120,7 @@ sfc_efx_rx_qrefill(struct sfc_efx_rxq *rxq) ++i, id = (id + 1) & rxq->ptr_mask) { m = objs[i]; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); rxd = &rxq->sw_desc[id]; rxd->mbuf = m;
examples/ipv4_multicast/main.c +1 -1
@@ -258,7 +258,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) hdr->pkt_len = (uint16_t )(hdr->data_len + pkt->pkt_len); hdr->nb_segs = pkt->nb_segs +1 ; -__rte_mbuf_sanity_check (hdr,1 ); +__rte_mbuf_verify (hdr,1 );return hdr; }/* >8 End of mcast_out_kt. */
lib/mbuf/rte_mbuf.c +15 -8
@@ -367,9 +367,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 */ void -rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +rte_mbuf_verify (const struct rte_mbuf *m,int is_header) {const char *reason;
@@ -377,6 +377,13 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)rte_panic ("%s\n" , reason); } +/* For ABI compatibility, to be removed in next release */ +void +rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +{ +rte_mbuf_verify (m, is_header); +} +int rte_mbuf_check (const struct rte_mbuf *m,int is_header,const char **reason) {
@@ -496,7 +503,7 @@ void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)if (unlikely (m ==NULL ))continue ; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); do { m_next = m->next;
@@ -546,7 +553,7 @@ rte_pktmbuf_clone(struct rte_mbuf *md, struct rte_mempool *mp)return NULL ; } -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }
@@ -596,7 +603,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, struct rte_mempool *mp,struct rte_mbuf *mc, *m_last, **prev;/* garbage in check */ -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );/* check for request to copy at offset past end of mbuf */ if (unlikely (off >= m->pkt_len))
@@ -660,7 +667,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, struct rte_mempool *mp, }/* garbage out check */ -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }
@@ -671,7 +678,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)unsigned int len;unsigned int nb_segs; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );fprintf (f,"dump mbuf at %p, iova=%#" PRIx64", buf_len=%u\n" , m,rte_mbuf_iova_get (m), m->buf_len);
@@ -689,7 +696,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len) nb_segs = m->nb_segs;while (m && nb_segs !=0 ) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 ); fprintf(f, " segment at %p, data=%p, len=%u, off=%u, refcnt=%u\n", m, rte_pktmbuf_mtod(m, void *),
lib/mbuf/rte_mbuf.h +37 -34
224 lines not on this page · raw message
lib/mbuf/version.map +1 -0
@@ -31,6 +31,7 @@ DPDK_24 { rte_mbuf_set_platform_mempool_ops; rte_mbuf_set_user_mempool_ops; rte_mbuf_user_mempool_ops; + rte_mbuf_verify; rte_pktmbuf_clone; rte_pktmbuf_copy; rte_pktmbuf_dump;
Signature · 1 line
2.43.0
PATCH v11 2/7 eal: replace use of sanity check in comments and messages
In reply to Stephen HemmingerSanity check is on the Tier 2 non-inclusive list.
Replace or remove it.
--- lib/eal/common/eal_common_memory.c | 2 +- lib/eal/common/eal_common_proc.c | 3 ++- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/windows/eal.c | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-)
lib/eal/common/eal_common_memory.c +1 -1
@@ -562,7 +562,7 @@ check_dma_mask(uint8_t maskbits, bool thread_unsafe)uint64_t mask;int ret; -/* Sanity check. We only check width can be managed with 64 bits +/* We only check width can be managed with 64 bits * variables. Indeed any higher value is likely wrong. */ if (maskbits >MAX_DMA_MASK_BITS ) { EAL_LOG(ERR, "wrong dma mask size %u (Max: %u)",
lib/eal/common/eal_common_proc.c +2 -1
@@ -309,7 +309,8 @@ read_msg(int fd, struct mp_msg_internal *m, struct sockaddr_un *s)break ; } } -/* sanity-check the response */ + +/* Check that the response is valid */ if (m->msg.num_fds <0 || m->msg.num_fds >RTE_MP_MAX_FD_NUM ) {EAL_LOG (ERR ,"invalid number of fd's received" );return -1 ;
lib/eal/common/eal_common_trace.c +1 -1
@@ -468,7 +468,7 @@ __rte_trace_point_register(rte_trace_point_t *handle, const char *name,struct trace_point *tp;uint16_t sz; -/* Sanity checks of arguments */ +/* Check arguments */ if (name ==NULL || register_fn ==NULL || handle ==NULL ) {trace_err ("invalid arguments" ); rte_errno =EINVAL ;
lib/eal/common/eal_memcfg.h +1 -1
@@ -18,7 +18,7 @@* Memory configuration shared across multiple processes. */ struct rte_mem_config { -volatile uint32_t magic;/**< Magic number - sanity check. */ +volatile uint32_t magic;/**< Magic number check. */ uint32_t version;/**< Prevent secondary processes using different DPDK versions. */
lib/eal/common/rte_malloc.c +1 -1
@@ -654,7 +654,7 @@ rte_malloc_heap_destroy(const char *heap_name) ret =-1 ; goto unlock; } -/* sanity checks done, now we can destroy the heap */ +/* checks done, now we can destroy the heap */ rte_spinlock_lock (&heap->lock); ret =malloc_heap_destroy (heap);rte_spinlock_unlock (&heap->lock);
lib/eal/freebsd/eal.c +1 -1
@@ -501,7 +501,7 @@ eal_parse_args(int argc, char **argv) goto out; } -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname); ret =-1 ;
lib/eal/linux/eal.c +1 -1
@@ -803,7 +803,7 @@ eal_parse_args(int argc, char **argv) goto out; } -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname); ret =-1 ;
lib/eal/windows/eal.c +1 -1
@@ -194,7 +194,7 @@ eal_parse_args(int argc, char **argv)if (eal_adjust_config (internal_conf) !=0 )return -1 ; -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname);return -1 ;
Signature · 1 line
2.43.0
PATCH v11 3/7 test: replace use word sanity
In reply to Stephen HemmingerThe word "sanity" is on the not-allowed inclusive naming list. Replace the unnecessary usage in tests.
--- app/test/test_bitmap.c | 4 +-- app/test/test_bpf.c | 6 ++-- app/test/test_common.c | 2 +- app/test/test_distributor.c | 46 +++++++++++++++--------------- app/test/test_eal_flags.c | 20 ++++++------- app/test/test_hash.c | 2 +- app/test/test_interrupts.c | 9 +++--- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_mbuf.c | 2 +- app/test/test_rawdev.c | 2 +- app/test/test_timer.c | 10 +++---- 11 files changed, 53 insertions(+), 52 deletions(-)
app/test/test_bitmap.c +2 -2
@@ -33,7 +33,7 @@ test_bitmap_scan_operations(struct rte_bitmap *bmp) }if (slab1_magic != out_slab) { -printf ("Scan operation sanity failed.\n" ); +printf ("Scan operation magic number check failed.\n" );return TEST_FAILED ; }
@@ -43,7 +43,7 @@ test_bitmap_scan_operations(struct rte_bitmap *bmp) }if (slab2_magic != out_slab) { -printf ("Scan operation sanity failed.\n" ); +printf ("Scan operation magic number check failed.\n" );return TEST_FAILED ; }
app/test/test_bpf.c +3 -3
@@ -3343,9 +3343,9 @@ test_bpf_match(pcap_t *pcap, const char *str,return ret; } -/* Basic sanity test can we match a IP packet */ +/* Basic test can we match a IP packet */ static int -test_bpf_filter_sanity (pcap_t *pcap) +test_bpf_filter_match (pcap_t *pcap) {const uint32_t plen =100 ;struct rte_mbuf mb, *m;
@@ -3484,7 +3484,7 @@ test_bpf_convert(void)return -1 ; } - rc =test_bpf_filter_sanity (pcap); + rc =test_bpf_filter_match (pcap);for (i =0 ; i <RTE_DIM (sample_filters); i++) rc |=test_bpf_filter (pcap, sample_filters[i]);
app/test/test_common.c +1 -1
@@ -19,7 +19,7 @@ {printf (x"() test failed!\n" );\return -1 ;} -/* this is really a sanity check */ +/* this is really a consistency check */ static int test_macros(int __rte_unused unused_parm) {
app/test/test_distributor.c +23 -23
177 lines not on this page · raw message
app/test/test_eal_flags.c +10 -10
@@ -314,7 +314,7 @@ get_number_of_sockets(void)/* * Test that the app doesn't run with invalid allow option. -* Final tests ensures it does run with valid options as sanity check (one +* Final tests ensures it does run with valid options as basic test (one * test for with Domain+BDF, second for just with BDF) */ static int
@@ -382,7 +382,7 @@ test_allow_flag(void)/* * Test that the app doesn't run with invalid blocklist option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options as basic check. */ static int test_invalid_b_flag (void )
@@ -429,7 +429,7 @@ test_invalid_b_flag(void)/* * Test that the app doesn't run with invalid vdev option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options basic check. */ static int test_invalid_vdev_flag (void )
@@ -554,7 +554,7 @@ test_missing_c_flag(void)/* bad coremask value */ const char *argv3[] = { prgname, prefix, mp_flag,"-c" ,"error" }; -/* sanity check of tests - valid coremask value */ +/* check of tests - valid coremask value */ const char *argv4[] = { prgname, prefix, mp_flag,"-c" ,"1" };/* -l flag but no corelist value */
@@ -581,7 +581,7 @@ test_missing_c_flag(void) "-l", RTE_STR(RTE_MAX_LCORE) };const char *const argv14[] = { prgname, prefix, mp_flag,"-l" ,"1-" RTE_STR (RTE_MAX_LCORE ) }; -/* sanity check test - valid corelist value */ +/* check test - valid corelist value */ const char *const argv15[] = { prgname, prefix, mp_flag,"-l" ,"1-2,3" };
@@ -613,7 +613,7 @@ test_missing_c_flag(void) "--lcores", "(4-7)=(1,3)" };const char *const argv28[] = { prgname, prefix, mp_flag,"--lcores" ,"[4-7]@(1,3)" }; -/* sanity check of tests - valid lcores value */ +/* more complex valid lcores value */ const char *const argv29[] = { prgname, prefix, mp_flag,"--lcores" ,"0-1,2@(5-7),(3-5)@(0,2),(0,6),7" };
@@ -744,7 +744,7 @@ test_main_lcore_flag(void)/* * Test that the app doesn't run with invalid -n flag option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options as basic check. * Since -n is not compulsory for MP, we instead use --no-huge and --no-shconf * flags. */
@@ -772,10 +772,10 @@ test_invalid_n_flag(void)/* zero is invalid */ const char *argv3[] = { prgname, prefix, no_huge, no_shconf,"-n" ,"0" }; -/* sanity test - check with good value */ +/* check with good value */ const char *argv4[] = { prgname, prefix, no_huge, no_shconf,"-n" ,"2" }; -/* sanity test - check with no -n flag */ +/* check with no -n flag */ const char *argv5[] = { prgname, prefix, no_huge, no_shconf}; if (launch_proc(argv1) == 0
@@ -977,7 +977,7 @@ test_misc_flags(void)* All cases, apart from the first, app should run. * No further testing of output done. */ -/* sanity check - failure with invalid option */ +/* failure with invalid option */ const char *argv0[] = {prgname, prefix, mp_flag,"--invalid-opt" };/* With --no-pci */
app/test/test_hash.c +1 -1
@@ -1140,7 +1140,7 @@ fbk_hash_unit_test(void) .socket_id = 0, }; -/* this is a sanity check for "same name" test +/* this is a check for "same name" test * creating this hash will check if we are actually able to create * multiple hashes with different names (instead of having just one). */
app/test/test_interrupts.c +5 -4
@@ -48,7 +48,7 @@ static union intr_pipefds pfds;* Check if the interrupt handle is valid. */ static inline int -test_interrupt_handle_sanity_check (struct rte_intr_handle *intr_handle) +test_interrupt_handle_check (struct rte_intr_handle *intr_handle) {if (!intr_handle ||rte_intr_fd_get (intr_handle) <0 )return -1 ;
@@ -164,7 +164,7 @@ test_interrupt_handle_compare(struct rte_intr_handle *intr_handle_l,#else /* to be implemented for bsd later */ static inline int -test_interrupt_handle_sanity_check (struct rte_intr_handle *intr_handle) +test_interrupt_handle_check (struct rte_intr_handle *intr_handle) {RTE_SET_USED (intr_handle);
@@ -215,7 +215,7 @@ test_interrupt_callback(void *arg)return ; } -if (test_interrupt_handle_sanity_check (intr_handle) <0 ) { +if (test_interrupt_handle_check (intr_handle) <0 ) {printf ("null or invalid intr_handle for %s\n" , __func__); flag =-1 ;return ;
@@ -241,7 +241,8 @@ static void test_interrupt_callback_1(void *arg) {struct rte_intr_handle *intr_handle = arg; -if (test_interrupt_handle_sanity_check (intr_handle) <0 ) { + +if (test_interrupt_handle_check (intr_handle) <0 ) {printf ("null or invalid intr_handle for %s\n" , __func__); flag =-1 ;return ;
app/test/test_link_bonding_mode4.c +1 -1
@@ -224,7 +224,7 @@ add_member(struct member_conf *member, uint8_t start)struct rte_ether_addr addr, addr_check;int retval; -/* Some sanity check */ +/* Some basic tests. */ RTE_VERIFY (test_params.member_ports <= member && member - test_params.member_ports < (int )RTE_DIM (test_params.member_ports));RTE_VERIFY (member->bonding ==0 );
app/test/test_mbuf.c +1 -1
@@ -1702,7 +1702,7 @@ test_mbuf_validate_tx_offload(const char *test_name,struct rte_mbuf *m =NULL ;int ret =0 ; -/* alloc a mbuf and do sanity check */ +/* alloc a mbuf and do some basic checks */ m =rte_pktmbuf_alloc (pktmbuf_pool);if (m ==NULL )GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);
app/test/test_rawdev.c +1 -1
@@ -47,7 +47,7 @@ test_rawdev_selftests(void)int ret =0 ;int i; -/* basic sanity on rawdev infrastructure */ +/* basic check on rawdev infrastructure */ if (test_rawdev_selftest_skeleton () <0 )return -1 ;
app/test/test_timer.c +5 -5
@@ -498,11 +498,11 @@ timer_basic_main_loop(__rte_unused void *arg) }static int -timer_sanity_check (void ) +timer_check (void ) {#ifdef RTE_LIBEAL_USE_HPET if (eal_timer_source !=EAL_TIMER_HPET ) { -printf ("Not using HPET, can't sanity check timer sources\n" ); +printf ("Not using HPET, can't check timer sources\n" );return 0 ; }
@@ -546,9 +546,9 @@ test_timer(void)return TEST_SKIPPED ; } -/* sanity check our timer sources and timer config values */ -if (timer_sanity_check () <0 ) { -printf ("Timer sanity checks failed\n" ); +/* check our timer sources and timer config values */ +if (timer_check () <0 ) { +printf ("Timer checks failed\n" );return TEST_FAILED ; }
Signature · 1 line
2.43.0
PATCH v11 4/7 examples: remove term sanity
In reply to Stephen HemmingerDo not use non-inclusive terms.
--- examples/ipsec-secgw/event_helper.c | 2 +- examples/qos_sched/args.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
examples/ipsec-secgw/event_helper.c +1 -1
@@ -2100,7 +2100,7 @@ eh_launch_worker(struct eh_conf *conf, struct eh_app_worker_params *app_wrkr, goto clean_and_exit; } -/* Verify sanity of the matched worker */ +/* Verify validity of the matched worker */ if (eh_verify_match_worker (match_wrkr) !=1 ) {EH_LOG_ERR ("Failed to validate the matched worker" ); goto clean_and_exit;
examples/qos_sched/args.c +1 -1
@@ -386,7 +386,7 @@ app_parse_args(int argc, char **argv)return -1 ; } -/* sanity check for cores assignment */ +/* check for cores assignment */ for (i =0 ; i < nb_pfc; i++) {if (qos_conf[i].rx_core >=RTE_MAX_LCORE ) { RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1,
Signature · 1 line
2.43.0
PATCH v11 5/7 lib: replace use of sanity check in comments and messages
In reply to Stephen HemmingerSanity check is on the Tier 2 non-inclusive list.
Replace or remove it.
--- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +++--- lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-)
lib/graph/graph.c +1 -1
@@ -389,7 +389,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)graph_spinlock_lock (); -/* Check arguments sanity */ +/* Check argument validity */ if (prm ==NULL )SET_ERR_JMP (EINVAL , fail,"Param should not be NULL" );
lib/graph/graph_stats.c +1 -1
@@ -332,7 +332,7 @@ rte_graph_cluster_stats_create(const struct rte_graph_cluster_stats_param *prm)const char *pattern;rte_graph_t i; -/* Sanity checks */ +/* Validate arguments */ if (!rte_graph_has_stats_feature ())SET_ERR_JMP (EINVAL , fail,"Stats feature is not enabled" );
lib/graph/node.c +1 -1
@@ -68,7 +68,7 @@ __rte_node_register(const struct rte_node_register *reg)graph_spinlock_lock (); -/* Check sanity */ +/* Check argument validity */ if (reg ==NULL || reg->process ==NULL ) { rte_errno =EINVAL ; goto fail;
lib/jobstats/rte_jobstats.c +3 -3
@@ -124,7 +124,7 @@ rte_jobstats_start(struct rte_jobstats_context *ctx, struct rte_jobstats *job) {uint64_t now; -/* Some sanity check. */ +/* Check validity of arguments. */ if (unlikely (ctx ==NULL || job ==NULL || job->context !=NULL ))return -EINVAL ;
@@ -144,7 +144,7 @@ rte_jobstats_abort(struct rte_jobstats *job)struct rte_jobstats_context *ctx;uint64_t now, exec_time; -/* Some sanity check. */ +/* Check that arguments are valid */ if (unlikely (job ==NULL || job->context ==NULL ))return -EINVAL ;
@@ -165,7 +165,7 @@ rte_jobstats_finish(struct rte_jobstats *job, int64_t job_value)uint64_t now, exec_time;int need_update; -/* Some sanity check. */ +/* Check arguments */ if (unlikely (job ==NULL || job->context ==NULL ))return -EINVAL ;
lib/metrics/rte_metrics.c +1 -1
@@ -120,7 +120,7 @@ rte_metrics_reg_names(const char * const *names, uint16_t cnt_names)uint16_t idx_name;uint16_t idx_base; -/* Some sanity checks */ +/* Some consistency checks */ if (cnt_names <1 || names ==NULL )return -EINVAL ;for (idx_name =0 ; idx_name < cnt_names; idx_name++)
lib/pcapng/rte_pcapng.c +1 -1
@@ -620,7 +620,7 @@ rte_pcapng_write_packets(rte_pcapng_t *self,struct pcapng_enhance_packet_block *epb;uint64_t cycles, timestamp; -/* sanity check that is really a pcapng mbuf */ +/* Check that is really a pcapng mbuf */ epb = rte_pktmbuf_mtod(m, struct pcapng_enhance_packet_block *);if (unlikely (epb->block_type !=PCAPNG_ENHANCED_PACKET_BLOCK || epb->block_length !=rte_pktmbuf_data_len (m))) {
Signature · 1 line
2.43.0
PATCH v11 6/7 doc: remove sanity
In reply to Stephen HemmingerDon't use the word sanity in the documentation
--- doc/guides/gpus/cuda.rst | 2 +- doc/guides/sample_app_ug/eventdev_pipeline.rst | 2 +- doc/guides/tools/testbbdev.rst | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
doc/guides/gpus/cuda.rst +1 -1
@@ -80,7 +80,7 @@ Similarly to CUDA shared library, if the **libgdrapi.so** shared library is not installed in default locations (e.g. /usr/local/lib), you can use the variable ``GDRCOPY_PATH_L``. -As an example, to enable the CPU map feature sanity check, +As an example, to enable the CPU map feature check, run the ``app/test-gpudev`` application with: .. code-block:: console
doc/guides/sample_app_ug/eventdev_pipeline.rst +1 -1
@@ -50,7 +50,7 @@ these settings is shown below: ./<build_dir>/examples/dpdk-eventdev_pipeline -l 0,2,8-15 --vdev event_sw0 \ -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D -The application has some sanity checking built-in, so if there is a function +The application has some internal validation, so if there is a function (e.g.; the RX core) which doesn't have a cpu core mask assigned, the application will print an error message:
doc/guides/tools/testbbdev.rst +4 -4
@@ -9,7 +9,7 @@ dpdk-test-bbdev Application The ``dpdk-test-bbdev`` tool is a Data Plane Development Kit (DPDK) utility that allows measuring performance parameters of PMDs available in the bbdev framework. Tests available for execution are: latency, throughput, validation, -bler and sanity tests. Execution of tests can be customized using various +bler and basic functionality. Execution of tests can be customized using various parameters passed to a python running script.
@@ -97,8 +97,8 @@ Test Cases There are 7 main test cases that can be executed using testbbdev tool: -* Sanity checks [-c unittest] - - Performs sanity checks on BBDEV interface, validating basic functionality +* Functional checks [-c unittest] + - Performs checks on BBDEV interface, validating basic functionality * Validation tests [-c validation] - Performs full operation of enqueue and dequeue
@@ -232,7 +232,7 @@ vector name refer more explicitly processing specificity such as is purely read/written for external DDR, lbrm when limited buffer rate matching is expected, or crc_fail when a CRC failure is expected. They are chosen to have a good coverage across sizes and processing -parameters while still keeping their number limited as part of sanity +parameters while still keeping their number limited as part of functional regression. Shortened tree of isg_cid-wireless_dpdk_ae with dpdk compiled and output
Signature · 1 line
2.43.0
PATCH v11 7/7 drivers: remove use of term sanity check
In reply to Stephen HemmingerDon't use term "sanity" because it is considered derogatory.
--- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 2 +- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_npa.c | 6 +++--- drivers/common/dpaax/caamflib/desc.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/sfc_efx/base/ef10_nvram.c | 4 ++-- drivers/common/sfc_efx/base/efx_rx.c | 2 +- drivers/crypto/bcmfs/hw/bcmfs4_rm.c | 6 +++--- drivers/crypto/bcmfs/hw/bcmfs5_rm.c | 6 +++--- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/net/ark/ark_ethdev.c | 8 ++++---- drivers/net/ark/ark_ethdev_rx.c | 2 +- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_stats.c | 8 ++++---- drivers/net/bnx2x/ecore_sp.c | 2 +- drivers/net/bnx2x/elink.c | 4 ++-- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/cnxk/cnxk_ethdev.c | 4 ++-- drivers/net/cxgbe/cxgbe_ethdev.c | 10 ++-------- drivers/net/cxgbe/cxgbevf_main.c | 4 ++-- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/fm10k/fm10k_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 6 +++--- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 ++---- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx_vec.h | 2 +- drivers/net/mvpp2/mrvl_qos.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/qede/qede_rxtx.c | 6 +++--- drivers/net/ring/rte_eth_ring.c | 7 ++----- drivers/net/sfc/sfc_dp_rx.h | 2 +- drivers/net/txgbe/txgbe_ipsec.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 2 +- 43 files changed, 66 insertions(+), 77 deletions(-)
drivers/bus/fslmc/qbman/qbman_sys_decl.h +1 -1
@@ -9,7 +9,7 @@#include <compat.h> #include <fsl_qbman_base.h> -/* Sanity check */ +/* Byte order check */ #if (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) && \ (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)#error "Unknown endianness!"
drivers/common/cnxk/roc_nix_tm_ops.c +1 -1
@@ -528,7 +528,7 @@ roc_nix_tm_hierarchy_disable(struct roc_nix *roc_nix) node->flags &= ~NIX_TM_NODE_ENABLED ; } -/* Verify sanity of all tx queues */ +/* Verify all tx queues */ for (i =0 ; i < sq_cnt; i++) { sq = nix->sqs[i];if (!sq)
drivers/common/cnxk/roc_npa.c +3 -3
@@ -458,7 +458,7 @@ npa_aura_pool_pair_alloc(struct npa_lf *lf, const uint32_t block_size,char name[PLT_MEMZONE_NAMESIZE ];const struct plt_memzone *mz; -/* Sanity check */ +/* argument checks */ if (!lf || !block_size || !block_count || !pool || !aura || !aura_handle)return NPA_ERR_PARAM ;
@@ -622,7 +622,7 @@ npa_aura_alloc(struct npa_lf *lf, const uint32_t block_count, int pool_id, {int rc, aura_id; -/* Sanity check */ +/* parameter check */ if (!lf || !aura || !aura_handle)return NPA_ERR_PARAM ;
@@ -1096,7 +1096,7 @@ npa_dev_init(struct npa_lf *lf, uintptr_t base, struct mbox *mbox)uint8_t aura_sz;int rc; -/* Sanity checks */ +/* Input checks */ if (!lf || !base || !mbox)return NPA_ERR_PARAM ;
drivers/common/dpaax/caamflib/desc.h +1 -1
@@ -107,7 +107,7 @@ extern enum rta_sec_era rta_sec_era;/* * ONE - should always be set. Combination of ONE (always -* set) and ZRO (always clear) forms an endianness sanity check +* set) and ZRO (always clear) forms an endianness check */ #define HDR_ONE BIT(23)#define HDR_ZRO BIT(15)
drivers/common/mlx5/linux/mlx5_common_os.c +1 -1
@@ -235,7 +235,7 @@ mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname)/** * Suffix RTE_EAL_PMD_PATH with "-glue". * -* This function performs a sanity check on RTE_EAL_PMD_PATH before +* This function performs a check on RTE_EAL_PMD_PATH before * suffixing its last component. * * @param buf[out]
drivers/common/sfc_efx/base/ef10_nvram.c +2 -2
@@ -595,13 +595,13 @@ tlv_update_partition_len_and_cks(/* * We just modified the partition, so the total length may not be -* valid. Don't use tlv_find(), which performs some sanity checks +* valid. Don't use tlv_find(), which performs some checks * that may fail here. */ partition.data = cursor->block;memcpy (&partition.tlv_cursor, cursor,sizeof (*cursor)); header = (struct tlv_partition_header *)partition.data; -/* Sanity check. */ +/* Header check */ if (__LE_TO_CPU_32 (header->tag) !=TLV_TAG_PARTITION_HEADER ) { rc =EFAULT ; goto fail1;
drivers/common/sfc_efx/base/efx_rx.c +1 -1
@@ -930,7 +930,7 @@ efx_rx_qcreate_internal( ndescs, id, flags, eep, erp)) != 0) goto fail4; -/* Sanity check queue creation result */ +/* Check queue creation result */ if (flags &EFX_RXQ_FLAG_RSS_HASH ) {const efx_rx_prefix_layout_t *erplp = &erp->er_prefix_layout;const efx_rx_prefix_field_info_t *rss_hash_field;
drivers/crypto/bcmfs/hw/bcmfs4_rm.c +3 -3
@@ -317,7 +317,7 @@ bcmfs4_mdst_desc(uint64_t addr, unsigned int length_div_16) }static bool -bcmfs4_sanity_check (struct bcmfs_qp_message *msg) +bcmfs4_message_check (struct bcmfs_qp_message *msg) {unsigned int i =0 ;
@@ -458,8 +458,8 @@ bcmfs4_enqueue_single_request_qp(struct bcmfs_qp *qp, void *op)struct bcmfs_queue *txq = &qp->tx_q;struct bcmfs_qp_message *msg = (struct bcmfs_qp_message *)op; -/* Do sanity check on message */ -if (!bcmfs4_sanity_check (msg)) { +/* Do check on message */ +if (!bcmfs4_message_check (msg)) {BCMFS_DP_LOG (ERR ,"Invalid msg on queue %d" , qp->qpair_id);return -EIO ; }
drivers/crypto/bcmfs/hw/bcmfs5_rm.c +3 -3
@@ -293,7 +293,7 @@ bcmfs5_mdst_desc(uint64_t addr, unsigned int len_div_16) }static bool -bcmfs5_sanity_check (struct bcmfs_qp_message *msg) +bcmfs5_message_check (struct bcmfs_qp_message *msg) {unsigned int i =0 ;
@@ -389,8 +389,8 @@ bcmfs5_enqueue_single_request_qp(struct bcmfs_qp *qp, void *op)struct bcmfs_queue *txq = &qp->tx_q;struct bcmfs_qp_message *msg = (struct bcmfs_qp_message *)op; -/* Do sanity check on message */ -if (!bcmfs5_sanity_check (msg)) { +/* Do check on message */ +if (!bcmfs5_message_check (msg)) {BCMFS_DP_LOG (ERR ,"Invalid msg on queue %d" , qp->qpair_id);return -EIO ; }
drivers/dma/idxd/idxd_pci.c +1 -1
@@ -205,7 +205,7 @@ init_pci_device(struct rte_pci_device *dev, struct idxd_dmadev *idxd, goto err; } -/* sanity check device status */ +/* check device status */ if (pci->regs->gensts &GENSTS_DEV_STATE_MASK ) {/* need function-level-reset (FLR) or is enabled */ IDXD_PMD_ERR ("Device status is not disabled, cannot init" );
drivers/event/opdl/opdl_evdev.c +1 -1
@@ -241,7 +241,7 @@ opdl_queue_setup(struct rte_eventdev *dev,struct opdl_evdev *device =opdl_pmd_priv (dev); -/* Extra sanity check, probably not needed */ +/* Extra check, probably not needed */ if (queue_id ==OPDL_INVALID_QID ) { PMD_DRV_LOG(ERR, "DEV_ID:[%02d] : " "Invalid queue id %u requested\n",
drivers/event/opdl/opdl_evdev_init.c +1 -1
@@ -300,7 +300,7 @@ static int opdl_add_deps(struct opdl_evdev *device,struct opdl_queue *queue_deps = &device->queue[deps_q_id];struct opdl_stage *dep_stages[OPDL_PORTS_MAX ]; -/* sanity check that all stages are for same opdl ring */ +/* check that all stages are for same opdl ring */ for (i =0 ; i < queue->nb_ports; i++) {struct opdl_ring *r =opdl_stage_get_opdl_ring (stage_for_port (queue, i));
drivers/net/ark/ark_ethdev.c +4 -4
@@ -349,10 +349,10 @@ eth_ark_dev_init(struct rte_eth_dev *dev)ARK_PMD_LOG (NOTICE ,"Arkville HW Commit_ID: %08x\n" ,rte_be_to_cpu_32 (ark->sysctrl.t32[0x20 /4 ])); -/* If HW sanity test fails, return an error */ +/* If HW test fails, return an error */ if (ark->sysctrl.t32[4 ] !=0xcafef00d ) {ARK_PMD_LOG (ERR , -"HW Sanity test has failed, expected constant" +"HW test has failed, expected constant" " 0x%x, read 0x%x (%s)\n" ,0xcafef00d , ark->sysctrl.t32[4 ], __func__);
@@ -360,7 +360,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) }ARK_PMD_LOG (DEBUG , -"HW Sanity test has PASSED, expected constant" +"HW test has PASSED, expected constant" " 0x%x, read 0x%x (%s)\n" ,0xcafef00d , ark->sysctrl.t32[4 ], __func__);
@@ -590,7 +590,7 @@ eth_ark_dev_start(struct rte_eth_dev *dev)rte_thread_t thread;/* Delay packet generator start allow the hardware to be ready -* This is only used for sanity checking with internal generator +* This is only used for checking with internal generator */ char tname[RTE_THREAD_INTERNAL_NAME_SIZE ];snprintf (tname,sizeof (tname),"ark-pg%d" , dev->data->port_id);
drivers/net/ark/ark_ethdev_rx.c +1 -1
@@ -283,7 +283,7 @@ eth_ark_recv_pkts(void *rx_queue, mbuf->pkt_len = meta->pkt_len; mbuf->data_len = meta->pkt_len; -if (ARK_DEBUG_CORE ) {/* debug sanity checks */ +if (ARK_DEBUG_CORE ) {/* debug checks */ if ((meta->pkt_len > (1024 *16 )) || (meta->pkt_len ==0 )) {
drivers/net/bnx2x/bnx2x.c +1 -1
@@ -7820,7 +7820,7 @@ static int bnx2x_check_valid_mf_cfg(struct bnx2x_softc *sc)uint32_t ovlan2;uint8_t i, j; -/* various MF mode sanity checks... */ +/* various MF mode checks... */ if (mf_info->mf_config[SC_VN (sc)] &FUNC_MF_CFG_FUNC_HIDE ) { PMD_DRV_LOG(NOTICE, sc,
drivers/net/bnx2x/bnx2x_stats.c +4 -4
@@ -181,7 +181,7 @@ bnx2x_stats_pmf_update(struct bnx2x_softc *sc)*/ return ; } -/* sanity */ +/* input validation */ if (!sc->port.pmf || !sc->port.port_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -231,7 +231,7 @@ bnx2x_port_stats_init(struct bnx2x_softc *sc)uint32_t mac_addr;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->link_vars.link_up || !sc->port.pmf) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -457,7 +457,7 @@ bnx2x_func_stats_init(struct bnx2x_softc *sc)struct dmae_command *dmae = &sc->stats_dmae;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->func_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -1280,7 +1280,7 @@ bnx2x_port_stats_base_init(struct bnx2x_softc *sc)struct dmae_command *dmae;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->port.pmf || !sc->port.port_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
drivers/net/bnx2x/ecore_sp.c +1 -1
@@ -207,7 +207,7 @@ static int ecore_exe_queue_step(struct bnx2x_softc *sc,break ; } -/* Sanity check */ +/* Argument check */ if (!cur_len)return ECORE_SUCCESS ;
drivers/net/bnx2x/elink.c +2 -2
@@ -1088,7 +1088,7 @@ static void elink_get_epio(struct bnx2x_softc *sc, uint32_t epio_pin, {uint32_t epio_mask, gp_oenable; *en =0 ; -/* Sanity check */ +/* Input check */ if (epio_pin >31 ) {ELINK_DEBUG_P1 (sc,"Invalid EPIO pin %d to get" , epio_pin);return ;
@@ -1105,7 +1105,7 @@ static void elink_set_epio(struct bnx2x_softc *sc, uint32_t epio_pin, uint32_t e {uint32_t epio_mask, gp_output, gp_oenable; -/* Sanity check */ +/* Input check */ if (epio_pin >31 ) {ELINK_DEBUG_P1 (sc,"Invalid EPIO pin %d to set" , epio_pin);return ;
drivers/net/bnxt/bnxt_hwrm.c +1 -1
@@ -538,7 +538,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, done =bnxt_check_cq_hwrm_done (cpr, is_tx, is_rx, i == timeout -1 ); -/* Sanity check on the resp->resp_len */ +/* Input check on the resp->resp_len */ rte_io_rmb ();if (resp->resp_len && resp->resp_len <= bp->max_resp_len) {/* Last byte of resp contains the valid key */
drivers/net/bnxt/hsi_struct_def_dpdk.h +1 -1
@@ -56770,7 +56770,7 @@ struct hwrm_tfc_ident_alloc_output {* Requests the firmware to free a TFC resource identifier. * A resource subtype and session id are passed in. * An identifier (previously allocated) corresponding to all these is -* freed, only after various sanity checks are completed. +* freed, only after various checks are completed. */ /* hwrm_tfc_ident_free_input (size:192b/24B) */ struct hwrm_tfc_ident_free_input {
drivers/net/bonding/rte_eth_bond_8023ad.c +1 -1
@@ -1473,7 +1473,7 @@ bond_8023ad_setup_validate(uint16_t port_id,return -EINVAL ;if (conf !=NULL ) { -/* Basic sanity check */ +/* Basic input check */ if (conf->slow_periodic_ms == 0 || conf->fast_periodic_ms >= conf->slow_periodic_ms || conf->long_timeout_ms == 0 ||
drivers/net/cnxk/cnxk_ethdev.c +2 -2
@@ -643,7 +643,7 @@ cnxk_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,struct rte_mempool *lpb_pool = mp;struct rte_mempool *spb_pool =NULL ; -/* Sanity checks */ +/* input checks */ if (rx_conf->rx_deferred_start ==1 ) {plt_err ("Deferred Rx start is not supported" ); goto fail;
@@ -1212,7 +1212,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev) rc = -EINVAL ; -/* Sanity checks */ +/* baseline checks */ if (rte_eal_has_hugepages () ==0 ) {plt_err ("Huge page is not configured" ); goto fail_configure;
drivers/net/cxgbe/cxgbe_ethdev.c +2 -8
@@ -525,10 +525,7 @@ int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, eth_dev->data->tx_queues[queue_idx] = (void *)txq; -/* Sanity Checking -* -* nb_desc should be > 1023 and <= CXGBE_MAX_RING_DESC_SIZE -*/ +/* nb_desc should be > 1023 and <= CXGBE_MAX_RING_DESC_SIZE */ temp_nb_desc = nb_desc;if (nb_desc <CXGBE_MIN_RING_DESC_SIZE ) { dev_warn(adapter, "%s: number of descriptors must be >= %d. Using default [%d]\n",
@@ -649,10 +646,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, eth_dev->data->rx_queues[queue_idx] = (void *)rxq; -/* Sanity Checking -* -* nb_desc should be > 0 and <= CXGBE_MAX_RING_DESC_SIZE -*/ +/* nb_desc should be > 0 and <= CXGBE_MAX_RING_DESC_SIZE */ temp_nb_desc = nb_desc;if (nb_desc <CXGBE_MIN_RING_DESC_SIZE ) { dev_warn(adapter, "%s: number of descriptors must be >= %d. Using default [%d]\n",
drivers/net/cxgbe/cxgbevf_main.c +2 -2
@@ -137,7 +137,7 @@ static int adap_init0vf(struct adapter *adapter)/* * Grab our Virtual Interface resource allocation, extract the -* features that we're interested in and do a bit of sanity testing on +* features that we're interested in and do a bit of testing on * what we discover. */ err =t4vf_get_vfres (adapter);
@@ -148,7 +148,7 @@ static int adap_init0vf(struct adapter *adapter) }/* -* Check for various parameter sanity issues. +* Check for various parameter issues. */ if (adapter->params.vfres.pmask ==0 ) { dev_err(adapter->pdev_dev, "no port access configured\n"
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -1758,7 +1758,7 @@ mempool_element_size_valid(struct rte_mempool *mp)/* account for up to 512B of alignment */ min_size -=FM10K_RX_DATABUF_ALIGN ; -/* sanity check for overflow */ +/* check for overflow */ if (min_size > mp->elt_size)return 0 ;
drivers/net/fm10k/fm10k_rxtx.c +1 -1
@@ -646,7 +646,7 @@ fm10k_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,if (q->nb_free < mb->nb_segs)break ; -/* sanity check to make sure the mbuf is valid */ +/* check to make sure the mbuf is valid */ if ((mb->nb_segs ==0 ) || ((mb->nb_segs >1 ) && (mb->next ==NULL )))break ;
drivers/net/ixgbe/ixgbe_fdir.c +1 -1
@@ -1130,7 +1130,7 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,return -ENOTSUP ;/* -* Sanity check for x550. +* Check for x550. * When adding a new filter with flow type set to IPv4, * the flow director mask should be configed before, * and the L4 protocol and ports are masked.
drivers/net/ixgbe/ixgbe_ipsec.c +1 -1
@@ -615,7 +615,7 @@ ixgbe_crypto_enable_ipsec(struct rte_eth_dev *dev) rx_offloads = dev->data->dev_conf.rxmode.offloads; tx_offloads = dev->data->dev_conf.txmode.offloads; -/* sanity checks */ +/* input validation */ if (rx_offloads &RTE_ETH_RX_OFFLOAD_TCP_LRO ) {PMD_DRV_LOG (ERR ,"RSC and IPsec not supported" );return -1 ;
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -4983,7 +4983,7 @@ ixgbe_set_rsc(struct rte_eth_dev *dev)uint32_t rdrxctl;uint32_t rfctl; -/* Sanity check */ +/* Offload check */ dev->dev_ops->dev_infos_get (dev, &dev_info);if (dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_TCP_LRO ) rsc_capable = true;
drivers/net/mlx4/mlx4.c +1 -1
@@ -1216,7 +1216,7 @@ static struct rte_pci_driver mlx4_driver = {/** * Suffix RTE_EAL_PMD_PATH with "-glue". * -* This function performs a sanity check on RTE_EAL_PMD_PATH before +* This function performs a check on RTE_EAL_PMD_PATH before * suffixing its last component. * * @param buf[out]
drivers/net/mlx4/mlx4_flow.c +3 -3
@@ -514,7 +514,7 @@ mlx4_flow_merge_tcp(struct rte_flow *flow, }/** -* Perform basic sanity checks on a pattern item. +* Perform basic checks on a pattern item. * * @param[in] item * Item specification.
@@ -730,7 +730,7 @@ mlx4_flow_prepare(struct mlx4_priv *priv, goto exit_item_not_supported; proc = next;/* -* Perform basic sanity checks only once, while handle is +* Perform basic checks only once, while handle is * not allocated. */ if (flow == &temp) {
@@ -799,7 +799,7 @@ mlx4_flow_prepare(struct mlx4_priv *priv, rss_key = mlx4_rss_hash_key_default; rss_key_len =MLX4_RSS_HASH_KEY_SIZE ; } -/* Sanity checks. */ +/* Input checks. */ for (i =0 ; i < rss->queue_num; ++i)if (rss->queue[i] >=ETH_DEV (priv)->data->nb_rx_queues)
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -9212,7 +9212,7 @@ flow_dv_prepare(struct rte_eth_dev *dev,#ifdef RTE_LIBRTE_MLX5_DEBUG /** -* Sanity check for match mask and value. Similar to check_valid_spec() in +* Check for match mask and value. Similar to check_valid_spec() in * kernel driver. If unmasked bit is present in value, it returns failure. * * @param match_mask
drivers/net/mlx5/mlx5_flow_hw.c +2 -4
@@ -9536,11 +9536,10 @@ flow_hw_tx_tag_regc_mask(struct rte_eth_dev *dev)struct mlx5_priv *priv = dev->data->dev_private;uint32_t mask = priv->sh->dv_regc0_mask; -/* Mask is verified during device initialization. Sanity checking here. */ +/* Mask is verified during device initialization. */ MLX5_ASSERT (mask !=0 );/* * Availability of sufficient number of bits in REG_C_0 is verified on initialization. -* Sanity checking here. */ MLX5_ASSERT (rte_popcount32 (mask) >=rte_popcount32 (priv->vport_meta_mask));return mask;
@@ -9552,12 +9551,11 @@ flow_hw_tx_tag_regc_value(struct rte_eth_dev *dev)struct mlx5_priv *priv = dev->data->dev_private;uint32_t tag; -/* Mask is verified during device initialization. Sanity checking here. */ +/* Mask is verified during device initialization. */ MLX5_ASSERT (priv->vport_meta_mask !=0 ); tag = priv->vport_meta_tag >> (rte_bsf32 (priv->vport_meta_mask));/* * Availability of sufficient number of bits in REG_C_0 is verified on initialization. -* Sanity checking here. */ MLX5_ASSERT ((tag & priv->sh->dv_regc0_mask) == tag);return tag;
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -1442,7 +1442,7 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev) desc *=4 ; obj_num = desc +MLX5_MPRQ_MP_CACHE_SZ * n_ibv;/* -* rte_mempool_create_empty() has sanity check to refuse large cache +* rte_mempool_create_empty() has basic check to refuse large cache * size compared to the number of elements. * CALC_CACHE_FLUSHTHRESH() is defined in a C file, so using a * constant number 2 instead.
drivers/net/mlx5/mlx5_rxtx_vec.h +1 -1
@@ -21,7 +21,7 @@ RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)/* -* Compile time sanity check for vectorized functions. +* Compile time checks for vectorized functions. */ #define S_ASSERT_RTE_MBUF (s) \
drivers/net/mvpp2/mrvl_qos.c +1 -1
@@ -260,7 +260,7 @@ get_entry_values(const char *entry, uint8_t *tab,if (nb_rng_tokens !=2 )return -3 ; -/* Range and sanity checks. */ +/* Range and input checks. */ if (get_val_securely (rng_tokens[0 ], &token_val) <0 )return -4 ; beg = (char )token_val;
drivers/net/nfp/flower/nfp_flower_flow.c +1 -1
@@ -2732,7 +2732,7 @@ nfp_flow_compile_item_proc(struct nfp_flower_representor *repr,break ; } -/* Perform basic sanity checks */ +/* Perform basic checks */ ret =nfp_flow_item_check (item, proc);if (ret !=0 ) {PMD_DRV_LOG (ERR ,"nfp flow item %d check failed" , item->type);
drivers/net/nfp/nfp_net_flow.c +1 -1
@@ -527,7 +527,7 @@ nfp_net_flow_compile_items(const struct rte_flow_item items[],break ; } -/* Perform basic sanity checks */ +/* Perform basic checks */ ret =nfp_net_flow_item_check (item, proc);if (ret !=0 ) {PMD_DRV_LOG (ERR ,"NFP flow item %d check failed" , item->type);
drivers/net/qede/qede_rxtx.c +3 -3
@@ -1383,7 +1383,7 @@ qede_rx_process_tpa_end_cqe(struct qede_dev *qdev, cqe->len_list[0]);/* Update total length and frags based on end TPA */ rx_mb = rxq->tpa_info[cqe->tpa_agg_index].tpa_head; -/* TODO: Add Sanity Checks */ +/* TODO: Add more checks */ rx_mb->nb_segs = cqe->num_of_bds; rx_mb->pkt_len = cqe->total_packet_len;
@@ -2211,7 +2211,7 @@ qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,#ifdef RTE_LIBRTE_QEDE_DEBUG_TX static inline void -qede_mpls_tunn_tx_sanity_check (struct rte_mbuf *mbuf, +qede_mpls_tunn_tx_basic_check (struct rte_mbuf *mbuf,struct qede_tx_queue *txq) {if (((mbuf->outer_l2_len + mbuf->outer_l3_len) /2 ) >0xff )
@@ -2473,7 +2473,7 @@ qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) RTE_MBUF_F_TX_TUNNEL_MPLSINUDP) { mplsoudp_flg = true;#ifdef RTE_LIBRTE_QEDE_DEBUG_TX -qede_mpls_tunn_tx_sanity_check (mbuf, txq); +qede_mpls_tunn_tx_basic_check (mbuf, txq);#endif /* Outer L4 offset in two byte words */ tunn_l4_hdr_start_offset =
drivers/net/ring/rte_eth_ring.c +2 -5
@@ -34,7 +34,7 @@ struct ring_internal_args {struct rte_ring *const *tx_queues;const unsigned int nb_tx_queues;const unsigned int numa_node; -void *addr;/* self addr for sanity check */ +void *addr;/* self addr for verification */ };enum dev_action {
@@ -612,10 +612,7 @@ static int parse_kvlist(const char *key __rte_unused, *action ='\0' ; action++; -/* -* Need to do some sanity checking here -*/ - +/* Check the command argument is valid action */ if (strcmp (action,ETH_RING_ACTION_ATTACH ) ==0 ) info->list[info->count].action =DEV_ATTACH ;else if (strcmp (action,ETH_RING_ACTION_CREATE ) ==0 )
drivers/net/sfc/sfc_dp_rx.h +1 -1
@@ -59,7 +59,7 @@ struct sfc_dp_rx_qcreate_info {/** * Maximum number of Rx descriptors completed in one Rx event. -* Just for sanity checks if datapath would like to do. +* Checks if datapath would like to do. */ unsigned int batch_max;
drivers/net/txgbe/txgbe_ipsec.c +1 -1
@@ -595,7 +595,7 @@ txgbe_crypto_enable_ipsec(struct rte_eth_dev *dev) rx_offloads = dev->data->dev_conf.rxmode.offloads; tx_offloads = dev->data->dev_conf.txmode.offloads; -/* sanity checks */ +/* offload checks */ if (rx_offloads &RTE_ETH_RX_OFFLOAD_TCP_LRO ) {PMD_DRV_LOG (ERR ,"RSC and IPsec not supported" );return -1 ;
drivers/net/txgbe/txgbe_rxtx.c +1 -1
@@ -4181,7 +4181,7 @@ txgbe_set_rsc(struct rte_eth_dev *dev)uint32_t rdrxctl;uint32_t rfctl; -/* Sanity check */ +/* Offload check */ dev->dev_ops->dev_infos_get (dev, &dev_info);if (dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_TCP_LRO ) rsc_capable = true;
Signature · 1 line
2.43.0
v12 cover replace use of term sanity check
In reply to Stephen HemmingerRemove use of expression sanity check across DPDK drivers and documentation.
The term sanity-check is on the Tier 2 word list from the Inclusive Naming project.
https://inclusivenaming.org/word-lists/tier-2/sanity-check/
Rationale
This term might be derogatory to neurodiverse people. Jargon, such as “sanity test”, is difficult to translate and is difficult to understand by readers whose first language is not English.
v12 - rebase on 25.07
mark old mbuf API functions as deprecated
Stephen Hemminger (10):
mbuf: replace term sanity check
net/avp: replace use of rte_mbuf_sanity_check net/sfc: replace use of rte_mbuf_sanity_check
examples: remove term sanity
eal: replace use of sanity check in comments and messages
test: replace use word sanity
dts: replace use of sanity check in comment
doc: remove sanity
lib: replace use of sanity check in comments and
drivers: remove use of term sanity check
app/test/test_bitmap.c | 4 +- app/test/test_bpf.c | 6 +- app/test/test_common.c | 2 +- app/test/test_cryptodev.c | 2 +- app/test/test_distributor.c | 46 +++++------ app/test/test_eal_flags.c | 20 ++--- app/test/test_hash.c | 2 +- app/test/test_interrupts.c | 9 ++- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_mbuf.c | 30 +++---- app/test/test_rawdev.c | 2 +- app/test/test_timer.c | 10 +-- doc/guides/gpus/cuda.rst | 2 +- doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 + .../sample_app_ug/eventdev_pipeline.rst | 2 +- doc/guides/tools/testbbdev.rst | 8 +- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 2 +- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_npa.c | 6 +- drivers/common/dpaax/caamflib/desc.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/sfc_efx/base/ef10_nvram.c | 4 +- drivers/common/sfc_efx/base/efx_rx.c | 2 +- drivers/crypto/bcmfs/hw/bcmfs4_rm.c | 6 +- drivers/crypto/bcmfs/hw/bcmfs5_rm.c | 6 +- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/net/ark/ark_ethdev.c | 8 +- drivers/net/ark/ark_ethdev_rx.c | 2 +- drivers/net/avp/avp_ethdev.c | 18 ++--- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_stats.c | 8 +- drivers/net/bnx2x/ecore_sp.c | 2 +- drivers/net/bnx2x/elink.c | 4 +- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/cnxk/cnxk_ethdev.c | 4 +- drivers/net/cxgbe/cxgbe_ethdev.c | 10 +-- drivers/net/cxgbe/cxgbevf_main.c | 4 +- drivers/net/intel/fm10k/fm10k_ethdev.c | 2 +- drivers/net/intel/fm10k/fm10k_rxtx.c | 2 +- drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/intel/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 6 +- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 +- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx_vec.h | 2 +- drivers/net/mvpp2/mrvl_qos.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/ntnic/nthw/nthw_rac.c | 2 +- drivers/net/qede/qede_rxtx.c | 6 +- drivers/net/ring/rte_eth_ring.c | 7 +- drivers/net/sfc/sfc_dp_rx.h | 2 +- drivers/net/sfc/sfc_ef100_rx.c | 6 +- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 +- drivers/net/sfc/sfc_ef10_rx.c | 4 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/txgbe/txgbe_ipsec.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 2 +- dts/tests/TestSuite_blocklist.py | 2 +- examples/ipsec-secgw/event_helper.c | 2 +- examples/ipv4_multicast/main.c | 2 +- examples/qos_sched/args.c | 2 +- lib/eal/common/eal_common_memory.c | 2 +- lib/eal/common/eal_common_proc.c | 3 +- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/linux/eal_timer.c | 2 +- lib/eal/windows/eal.c | 2 +- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +- lib/mbuf/rte_mbuf.c | 23 ++++-- lib/mbuf/rte_mbuf.h | 79 ++++++++++--------- lib/mbuf/version.map | 1 + lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 88 files changed, 244 insertions(+), 235 deletions(-)
Signature · 1 line
2.47.2
PATCH v12 1/10 mbuf: replace term sanity check
Replace rte_mbuf_sanity_check() with rte_mbuf_verify() to match the similar macro RTE_VERIFY() in rte_debug.h
The term sanity check is on the Tier 2 list of words that should be replaced.
For this release keep old API functions but mark them as deprecated.
--- app/test/test_cryptodev.c | 2 +- app/test/test_mbuf.c | 28 +++++----- doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 ++ lib/mbuf/rte_mbuf.c | 23 +++++--- lib/mbuf/rte_mbuf.h | 79 +++++++++++++++------------- lib/mbuf/version.map | 1 + 7 files changed, 79 insertions(+), 61 deletions(-)
app/test/test_cryptodev.c +1 -1
@@ -264,7 +264,7 @@ create_mbuf_from_heap(int pkt_len, uint8_t pattern) m->port =RTE_MBUF_PORT_INVALID ; m->buf_len =MBUF_SIZE -sizeof (struct rte_mbuf ) -RTE_PKTMBUF_HEADROOM ;rte_pktmbuf_reset_headroom (m); -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); m->buf_addr = (char *)m +sizeof (struct rte_mbuf ) +RTE_PKTMBUF_HEADROOM ;
app/test/test_mbuf.c +14 -14
@@ -262,8 +262,8 @@ test_one_pktmbuf(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("Buffer should be continuous" );memset (hdr,0x55 ,MBUF_TEST_HDR2_LEN ); -rte_mbuf_sanity_check (m,1 ); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,1 ); +rte_mbuf_verify (m,0 );rte_pktmbuf_dump (stdout, m,0 );/* this prepend should fail */
@@ -1162,7 +1162,7 @@ test_refcnt_mbuf(void)#ifdef RTE_EXEC_ENV_WINDOWS static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {RTE_SET_USED (pktmbuf_pool);return TEST_SKIPPED ;
@@ -1181,12 +1181,12 @@ mbuf_check_pass(struct rte_mbuf *buf) }static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {struct rte_mbuf *buf;struct rte_mbuf badbuf; -printf ("Checking rte_mbuf_sanity_check for failure conditions\n" ); +printf ("Checking rte_mbuf_verify for failure conditions\n" );/* get a good mbuf to use to make copies */ buf =rte_pktmbuf_alloc (pktmbuf_pool);
@@ -1708,7 +1708,7 @@ test_mbuf_validate_tx_offload(const char *test_name,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); m->ol_flags = ol_flags; m->tso_segsz = segsize; ret =rte_validate_tx_offload (m);
@@ -1915,7 +1915,7 @@ test_pktmbuf_read(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); data =rte_pktmbuf_append (m,MBUF_TEST_DATA_LEN2 );if (data ==NULL )
@@ -1964,7 +1964,7 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 );/* prepend an ethernet header */ hdr = (struct ether_hdr *)rte_pktmbuf_prepend (m, hdr_len);
@@ -2109,7 +2109,7 @@ create_packet(struct rte_mempool *pktmbuf_pool,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (pkt_seg) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (pkt_seg,0 ); +rte_mbuf_verify (pkt_seg,0 );/* Add header only for the first segment */ if (test_data->flags ==MBUF_HEADER && seg ==0 ) { hdr_len =sizeof (struct rte_ether_hdr );
@@ -2321,7 +2321,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); ext_buf_addr =rte_malloc ("External buffer" , buf_len,RTE_CACHE_LINE_SIZE );
@@ -2482,8 +2482,8 @@ test_pktmbuf_ext_pinned_buffer(struct rte_mempool *std_pool)GOTO_FAIL ("%s: test_pktmbuf_copy(pinned) failed\n" , __func__); -if (test_failing_mbuf_sanity_check (pinned_pool) <0 ) -GOTO_FAIL ("%s: test_failing_mbuf_sanity_check(pinned)" +if (test_failing_mbuf_verify (pinned_pool) <0 ) +GOTO_FAIL ("%s: test_failing_mbuf_verify(pinned)" " failed\n" , __func__);if (test_mbuf_linearize_check (pinned_pool) <0 )
@@ -2857,8 +2857,8 @@ test_mbuf(void) goto err; } -if (test_failing_mbuf_sanity_check (pktmbuf_pool) <0 ) { -printf ("test_failing_mbuf_sanity_check() failed\n" ); +if (test_failing_mbuf_verify (pktmbuf_pool) <0 ) { +printf ("test_failing_mbuf_verify() failed\n" ); goto err; }
doc/guides/prog_guide/mbuf_lib.rst +2 -2
@@ -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). Use Cases ---------
doc/guides/rel_notes/deprecation.rst +3 -0
@@ -142,3 +142,6 @@ Deprecation Notices * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK. Those API functions are used internally by DPDK core and netvsc PMD. + +* mbuf: The function ``rte_mbuf_sanity_check`` is deprecated. + Use the new function ``rte_mbuf_verify`` instead.
lib/mbuf/rte_mbuf.c +15 -8
@@ -367,9 +367,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 */ void -rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +rte_mbuf_verify (const struct rte_mbuf *m,int is_header) {const char *reason;
@@ -377,6 +377,13 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)rte_panic ("%s\n" , reason); } +/* For ABI compatibility, to be removed in next release */ +void +rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +{ +rte_mbuf_verify (m, is_header); +} +int rte_mbuf_check (const struct rte_mbuf *m,int is_header,const char **reason) {
@@ -496,7 +503,7 @@ void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)if (unlikely (m ==NULL ))continue ; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); do { m_next = m->next;
@@ -546,7 +553,7 @@ rte_pktmbuf_clone(struct rte_mbuf *md, struct rte_mempool *mp)return NULL ; } -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }
@@ -596,7 +603,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, struct rte_mempool *mp,struct rte_mbuf *mc, *m_last, **prev;/* garbage in check */ -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );/* check for request to copy at offset past end of mbuf */ if (unlikely (off >= m->pkt_len))
@@ -660,7 +667,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, struct rte_mempool *mp, }/* garbage out check */ -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }
@@ -671,7 +678,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)unsigned int len;unsigned int nb_segs; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );fprintf (f,"dump mbuf at %p, iova=%#" PRIx64", buf_len=%u\n" , m,rte_mbuf_iova_get (m), m->buf_len);
@@ -689,7 +696,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len) nb_segs = m->nb_segs;while (m && nb_segs !=0 ) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 ); fprintf(f, " segment at %p, data=%p, len=%u, off=%u, refcnt=%u\n", m, rte_pktmbuf_mtod(m, void *),
lib/mbuf/rte_mbuf.h +43 -36
249 lines not on this page · raw message
lib/mbuf/version.map +1 -0
@@ -31,6 +31,7 @@ DPDK_25 { rte_mbuf_set_platform_mempool_ops; rte_mbuf_set_user_mempool_ops; rte_mbuf_user_mempool_ops; + rte_mbuf_verify; rte_pktmbuf_clone; rte_pktmbuf_copy; rte_pktmbuf_dump;
Signature · 1 line
2.47.2
RE: [PATCH v12 01/10] mbuf: replace term sanity check
Quoted 584 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, 3 April 2025 01.23Replace
rte_mbuf_sanity_check()withrte_mbuf_verify()to match the similar macroRTE_VERIFY()inrte_debug.hThe term sanity check is on the Tier 2 list of words that should be replaced.
For this release keep old API functions but mark them as deprecated.
Signed-off-by Stephen Hemminger <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Morten Brørup <[email protected]>--- app/test/test_cryptodev.c | 2 +- app/test/test_mbuf.c | 28 +++++----- doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 ++ lib/mbuf/rte_mbuf.c | 23 +++++--- lib/mbuf/rte_mbuf.h | 79 +++++++++++++++------------- lib/mbuf/version.map | 1 + 7 files changed, 79 insertions(+), 61 deletions(-)app/test/test_cryptodev.c +1
-1@@ -264,7 +264,7 @@ create_mbuf_from_heap(int pkt_len, uint8_t pattern) m->port =RTE_MBUF_PORT_INVALID ; m->buf_len =MBUF_SIZE -sizeof (struct rte_mbuf ) -RTE_PKTMBUF_HEADROOM ;rte_pktmbuf_reset_headroom (m); -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); m->buf_addr = (char *)m +sizeof (struct rte_mbuf ) +RTE_PKTMBUF_HEADROOM ;app/test/test_mbuf.c +8
-8@@ -262,8 +262,8 @@ test_one_pktmbuf(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("Buffer should be continuous" );memset (hdr,0x55 ,MBUF_TEST_HDR2_LEN ); -rte_mbuf_sanity_check (m,1 ); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,1 ); +rte_mbuf_verify (m,0 );rte_pktmbuf_dump (stdout, m,0 );/* this prepend should fail */ @@ -1162,7 +1162,7 @@ test_refcnt_mbuf(void)#ifdef RTE_EXEC_ENV_WINDOWS static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {RTE_SET_USED (pktmbuf_pool);return TEST_SKIPPED ;@@ -1181,12 +1181,12 @@ mbuf_check_pass(struct rte_mbuf *buf) }static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {struct rte_mbuf *buf;struct rte_mbuf badbuf; -printf ("Checking rte_mbuf_sanity_check for failure conditions\n" ); +printf ("Checking rte_mbuf_verify for failure conditions\n" );/* get a good mbuf to use to make copies */ buf =rte_pktmbuf_alloc (pktmbuf_pool);@@ -1708,7 +1708,7 @@ test_mbuf_validate_tx_offload(const char *test_name,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); m->ol_flags = ol_flags; m->tso_segsz = segsize; ret =rte_validate_tx_offload (m);@@ -1915,7 +1915,7 @@ test_pktmbuf_read(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); data =rte_pktmbuf_append (m,MBUF_TEST_DATA_LEN2 );if (data ==NULL )@@ -1964,7 +1964,7 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 );/* prepend an ethernet header */ app/test/test_mbuf.c +2
-2hdr = (struct ether_hdr *)rte_pktmbuf_prepend (m, hdr_len);@@ -2109,7 +2109,7 @@ create_packet(struct rte_mempool *pktmbuf_pool,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (pkt_seg) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (pkt_seg,0 ); +rte_mbuf_verify (pkt_seg,0 );/* Add header only for the first segment */ if (test_data->flags ==MBUF_HEADER && seg ==0 ) { hdr_len =sizeof (struct rte_ether_hdr );@@ -2321,7 +2321,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); ext_buf_addr = rte_malloc("External buffer", buf_len,app/test/test_mbuf.c +2
-2RTE_CACHE_LINE_SIZE);@@ -2482,8 +2482,8 @@ test_pktmbuf_ext_pinned_buffer(struct rte_mempool *std_pool)GOTO_FAIL ("%s: test_pktmbuf_copy(pinned) failed\n" , __func__); -if (test_failing_mbuf_sanity_check (pinned_pool) <0 ) -GOTO_FAIL ("%s: test_failing_mbuf_sanity_check(pinned)" +if (test_failing_mbuf_verify (pinned_pool) <0 ) +GOTO_FAIL ("%s: test_failing_mbuf_verify(pinned)" " failed\n" , __func__);app/test/test_mbuf.c +2
-2if (test_mbuf_linearize_check (pinned_pool) <0 )@@ -2857,8 +2857,8 @@ test_mbuf(void) goto err; } -if (test_failing_mbuf_sanity_check (pktmbuf_pool) <0 ) { -printf ("test_failing_mbuf_sanity_check() failed\n" ); +if (test_failing_mbuf_verify (pktmbuf_pool) <0 ) { +printf ("test_failing_mbuf_verify() failed\n" ); goto err; }doc/guides/prog_guide/mbuf_lib.rst +0
-0@@ -266,8 +266,8 @@ can be found in several of the sample applications, forexample, the IPv4 Multic
Debug
------In debug mode, the functions of the mbuf library perform sanity checks before any operation (such as, buffer corruption,
doc/guides/prog_guide/mbuf_lib.rst +2
-1-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). Use Cases ---------doc/guides/rel_notes/deprecation.rst +3
-0@@ -142,3 +142,6 @@ Deprecation Notices * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK. Those API functions are used internally by DPDK core and netvsc PMD. + +* mbuf: The function ``rte_mbuf_sanity_check`` is deprecated. + Use the new function ``rte_mbuf_verify`` instead.lib/mbuf/rte_mbuf.c +9
-2@@ -367,9 +367,9 @@ rte_pktmbuf_pool_create_extbuf(const char *name, unsignedint n, return mp; } -/* do some sanity checks on a mbuf: panic if it fails */ +/* do some checks on a mbuf: panic if it fails */ void -rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +rte_mbuf_verify (const struct rte_mbuf *m,int is_header) {const char *reason;@@ -377,6 +377,13 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header) rte_panic("%s\n", reason); } +/* For ABI compatibility, to be removed in next release */ +void +rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +{ +rte_mbuf_verify (m, is_header); +} +int rte_mbuf_check (const struct rte_mbuf *m,int is_header,const char **reason){
lib/mbuf/rte_mbuf.c +1
-1@@ -496,7 +503,7 @@ void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)if (unlikely (m ==NULL ))continue ; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); do {lib/mbuf/rte_mbuf.c +2
-2m_next = m->next;@@ -546,7 +553,7 @@ rte_pktmbuf_clone(struct rte_mbuf *md, struct rte_mempool *mp)return NULL ; } -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }@@ -596,7 +603,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, structrte_mempool *mp, struct rte_mbuf *mc, *m_last, **prev;/* garbage in check */ -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );/* check for request to copy at offset past end of mbuf */ lib/mbuf/rte_mbuf.c +2
-2if (unlikely (off >= m->pkt_len))@@ -660,7 +667,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, structrte_mempool *mp, }/* garbage out check */ - __rte_mbuf_sanity_check(mc, 1); + __rte_mbuf_verify(mc, 1);return mc; }@@ -671,7 +678,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)unsigned int len;unsigned int nb_segs; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); fprintf(f, "dump mbuf at %p, iova=%#" PRIx64 ", buf_len=%u\n", m,
rte_mbuf_iova_get(m),lib/mbuf/rte_mbuf.c +1
-1m->buf_len);@@ -689,7 +696,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len) nb_segs = m->nb_segs;while (m && nb_segs !=0 ) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 ); fprintf(f, " segment at %p, data=%p, len=%u, off=%u,refcnt=%u\n",
lib/mbuf/rte_mbuf.c +0
-0m, rte_pktmbuf_mtod(m, void *),lib/mbuf/rte_mbuf.h +8
-4@@ -339,16 +339,20 @@ 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 */ +#define __rte_mbuf_verify (m, is_h) rte_mbuf_verify(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 */ +#define __rte_mbuf_verify (m, is_h) do { } while (0)#endif /* RTE_LIBRTE_MBUF_DEBUG */ +/* deprecated version of the macro */ +#define __rte_mbuf_sanity_check (m, is_h) RTE_DEPRECATED(__rte_mbuf_sanity_check) \ + __rte_mbuf_verify(m, is_h) +#ifdef RTE_MBUF_REFCNT_ATOMIC /**
lib/mbuf/rte_mbuf.h +2
-3@@ -514,10 +518,9 @@ rte_mbuf_ext_refcnt_update(struct rte_mbuf_ext_shared_info *shinfo,/** -* Sanity checks on an mbuf. +* Check that the mbuf is valid and panic if corrupted. * -* Check the consistency of the given mbuf. The function will cause a -* panic if corruption is detected. +* Acts assertion that mbuf is consistent. If not it calls rte_panic(). * * @param m * The mbuf to be checked.
lib/mbuf/rte_mbuf.h +7
-3@@ -526,13 +529,17 @@ rte_mbuf_ext_refcnt_update(structrte_mbuf_ext_shared_info *shinfo, * of a packet (in this case, some fields like nb_segs are not checked) */ void +rte_mbuf_verify (const struct rte_mbuf *m,int is_header); + +__rte_deprecated +voidrte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header);/** -* Sanity checks on a mbuf. +* Do consistency checks on a mbuf. * -* Almost like rte_mbuf_sanity_check(), but this function gives the reason -* if corruption is detected rather than panic. +* Check the consistency of the given mbuf and if not valid +* return the reason. * * @param m * The mbuf to be checked.
lib/mbuf/rte_mbuf.h +1
-1@@ -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. * * Check the consistency of the given reinitialized mbuf. * The function will cause a panic if corruption is detected.
lib/mbuf/rte_mbuf.h +1
-1@@ -563,7 +570,7 @@ int rte_mbuf_check(const struct rte_mbuf *m, intis_header, * The mbuf to be checked. */ static __rte_always_inline void -__rte_mbuf_raw_sanity_check(__rte_unused const struct rte_mbuf *m) +__rte_mbuf_raw_verify(__rte_unused const struct rte_mbuf *m) {RTE_ASSERT (rte_mbuf_refcnt_read (m) ==1 );lib/mbuf/rte_mbuf.h +2
-2RTE_ASSERT (m->next ==NULL );@@ -572,11 +579,11 @@ __rte_mbuf_raw_sanity_check(__rte_unused const struct rte_mbuf *m) RTE_ASSERT(!RTE_MBUF_HAS_EXTBUF(m) || (RTE_MBUF_HAS_PINNED_EXTBUF(m) && rte_mbuf_ext_refcnt_read(m->shinfo) == 1)); -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 ); }/** For backwards compatibility. */ -#define MBUF_RAW_ALLOC_CHECK (m) __rte_mbuf_raw_sanity_check(m) +#define MBUF_RAW_ALLOC_CHECK (m) __rte_mbuf_raw_verify(m)/** * Allocate an uninitialized mbuf from mempool *mp*.
lib/mbuf/rte_mbuf.h +1
-1@@ -606,7 +613,7 @@ static inline struct rte_mbuf *rte_mbuf_raw_alloc(struct rte_mempool *mp)if (rte_mempool_get (mp, &ret.ptr) <0 )return NULL ; -__rte_mbuf_raw_sanity_check (ret.m); +__rte_mbuf_raw_verify (ret.m);return ret.m; }@@ -644,7 +651,7 @@ rte_mbuf_raw_alloc_bulk(struct rte_mempool *mp, struct
rte_mbuf**mbufs, unsignelib/mbuf/rte_mbuf.h +1
-1int rc =rte_mempool_get_bulk (mp, (void **)mbufs, count);if (likely (rc ==0 ))for (unsigned int idx =0 ; idx < count; idx++) -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);return rc; }@@ -665,7 +672,7 @@ rte_mbuf_raw_alloc_bulk(struct rte_mempool *mp, struct
rte_mbuf**mbufs, unsigne
static__rte_always_inlinevoid
rte_mbuf_raw_free(struct rte_mbuf *m)
{lib/mbuf/rte_mbuf.h +1
-1-__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);rte_mempool_put (m->pool, m); }@@ -700,7 +707,7 @@ rte_mbuf_raw_free_bulk(struct rte_mempool *mp, struct
rte_mbuf**mbufs, unsignedlib/mbuf/rte_mbuf.h +6
-6const struct rte_mbuf *m = mbufs[idx];RTE_ASSERT (m !=NULL );RTE_ASSERT (m->pool == mp); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); }rte_mempool_put_bulk (mp, (void **)mbufs, count);@@ -965,7 +972,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)rte_pktmbuf_reset_headroom (m); m->data_len =0 ; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); }/** @@ -1021,22 +1028,22 @@ static inline int rte_pktmbuf_alloc_bulk(struct rte_mempool *pool, switch (count % 4) {case 0 :while (idx != count) { -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;/* fall-through */ case 3 : -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;/* fall-through */ case 2 : -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;/* fall-through */ case 1 : -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;lib/mbuf/rte_mbuf.h +2
-2/* fall-through */ @@ -1267,8 +1274,8 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m) mi->pkt_len = mi->data_len; mi->nb_segs =1 ; -__rte_mbuf_sanity_check (mi,1 ); -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (mi,1 ); +__rte_mbuf_verify (m,0 ); }/**
lib/mbuf/rte_mbuf.h +3
-3@@ -1423,7 +1430,7 @@ static inline int __rte_pktmbuf_pinned_extbuf_decref(struct rte_mbuf *m) static __rte_always_inline struct rte_mbuf *rte_pktmbuf_prefree_seg (struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 );if (likely (rte_mbuf_refcnt_read (m) ==1 )) {@@ -1494,7 +1501,7 @@ static inline void rte_pktmbuf_free(struct rte_mbuf *m)struct rte_mbuf *m_next;if (m !=NULL ) -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );while (m !=NULL ) { m_next = m->next;@@ -1575,7 +1582,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, structrte_mempool *mp, */ static inline void rte_pktmbuf_refcnt_update (struct rte_mbuf *m,int16_t v) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); do {lib/mbuf/rte_mbuf.h +2
-2rte_mbuf_refcnt_update (m, v);@@ -1592,7 +1599,7 @@ static inline void rte_pktmbuf_refcnt_update(structrte_mbuf *m, int16_t v) */ static inline uint16_t rte_pktmbuf_headroom (const struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 );return m->data_off; }@@ -1606,7 +1613,7 @@ static inline uint16_t rte_pktmbuf_headroom(const structrte_mbuf *m) */ static inline uint16_t rte_pktmbuf_tailroom (const struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 );return (uint16_t )(m->buf_len -rte_pktmbuf_headroom (m) - m->data_len);}
lib/mbuf/rte_mbuf.h +1
-1@@ -1621,7 +1628,7 @@ static inline uint16_t rte_pktmbuf_tailroom(const structrte_mbuf *m) */ static inline struct rte_mbuf *rte_pktmbuf_lastseg (struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );while (m->next !=NULL ) m = m->next;lib/mbuf/rte_mbuf.h +1
-1return m;@@ -1665,7 +1672,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)static inline char *rte_pktmbuf_prepend (struct rte_mbuf *m,uint16_t len) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );if (unlikely (len >rte_pktmbuf_headroom (m)))lib/mbuf/rte_mbuf.h +1
-1return NULL ;@@ -1700,7 +1707,7 @@ static inline char *rte_pktmbuf_append(struct rte_mbuf *m, uint16_t len)void *tail;struct rte_mbuf *m_last; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); m_last =rte_pktmbuf_lastseg (m);lib/mbuf/rte_mbuf.h +1
-1if (unlikely (len >rte_pktmbuf_tailroom (m_last)))@@ -1728,7 +1735,7 @@ static inline char *rte_pktmbuf_append(struct rte_mbuf*m, uint16_t len) */ static inline char *rte_pktmbuf_adj (struct rte_mbuf *m,uint16_t len) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );if (unlikely (len > m->data_len))lib/mbuf/rte_mbuf.h +1
-1return NULL ;@@ -1760,7 +1767,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len) {struct rte_mbuf *m_last; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); m_last =rte_pktmbuf_lastseg (m);lib/mbuf/rte_mbuf.h +1
-1if (unlikely (len > m_last->data_len))@@ -1782,7 +1789,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m,uint16_t len) */ static inline int rte_pktmbuf_is_contiguous (const struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );return m->nb_segs ==1 ; }lib/mbuf/version.map +1
-1@@ -31,6 +31,7 @@ DPDK_25 { rte_mbuf_set_platform_mempool_ops; rte_mbuf_set_user_mempool_ops; rte_mbuf_user_mempool_ops; + rte_mbuf_verify; rte_pktmbuf_clone; rte_pktmbuf_copy; rte_pktmbuf_dump; --
Quoted 1 line
2.47.2
Stephen,
I have submitted another patch [1], where __rte_mbuf_raw_sanity_check()'s successor takes one more parameter, so I had to give it a new name __rte_mbuf_raw_sanity_check_mp() for API compatibility. And then I added:
+/** For backwards compatibility. */
+#define __rte_mbuf_raw_sanity_check(m) __rte_mbuf_raw_sanity_check_mp(m, NULL)
If you proceed with your patch, __rte_mbuf_raw_sanity_check() will be renamed to __rte_mbuf_raw_verify(), and __rte_mbuf_raw_sanity_check() disappears.
Would it make sense to change your patch, so __rte_mbuf_raw_verify() replaces __rte_mbuf_raw_sanity_check_mp() instead of __rte_mbuf_raw_sanity_check()? If your patch changes the API anyway, adding an extra parameter to the function should be acceptable.
[1]: https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
Re: [PATCH v12 01/10] mbuf: replace term sanity check
Quoted 592 lines · On Mon, 11 Aug 2025 11:55:31 +0200 Morten Brørup <[email protected]>…
Quoted 584 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, 3 April 2025 01.23Replace
rte_mbuf_sanity_check()withrte_mbuf_verify()to match the similar macroRTE_VERIFY()inrte_debug.hThe term sanity check is on the Tier 2 list of words that should be replaced.
For this release keep old API functions but mark them as deprecated.
Signed-off-by Stephen Hemminger <[email protected]>Acked-by Andrew Rybchenko <[email protected]>Acked-by Morten Brørup <[email protected]>--- app/test/test_cryptodev.c | 2 +- app/test/test_mbuf.c | 28 +++++----- doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 ++ lib/mbuf/rte_mbuf.c | 23 +++++--- lib/mbuf/rte_mbuf.h | 79 +++++++++++++++------------- lib/mbuf/version.map | 1 + 7 files changed, 79 insertions(+), 61 deletions(-)app/test/test_cryptodev.c +1
-1@@ -264,7 +264,7 @@ create_mbuf_from_heap(int pkt_len, uint8_t pattern) m->port =RTE_MBUF_PORT_INVALID ; m->buf_len =MBUF_SIZE -sizeof (struct rte_mbuf ) -RTE_PKTMBUF_HEADROOM ;rte_pktmbuf_reset_headroom (m); -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); m->buf_addr = (char *)m +sizeof (struct rte_mbuf ) +RTE_PKTMBUF_HEADROOM ;app/test/test_mbuf.c +8
-8@@ -262,8 +262,8 @@ test_one_pktmbuf(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("Buffer should be continuous" );memset (hdr,0x55 ,MBUF_TEST_HDR2_LEN ); -rte_mbuf_sanity_check (m,1 ); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,1 ); +rte_mbuf_verify (m,0 );rte_pktmbuf_dump (stdout, m,0 );/* this prepend should fail */ @@ -1162,7 +1162,7 @@ test_refcnt_mbuf(void)#ifdef RTE_EXEC_ENV_WINDOWS static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {RTE_SET_USED (pktmbuf_pool);return TEST_SKIPPED ;@@ -1181,12 +1181,12 @@ mbuf_check_pass(struct rte_mbuf *buf) }static int -test_failing_mbuf_sanity_check (struct rte_mempool *pktmbuf_pool) +test_failing_mbuf_verify (struct rte_mempool *pktmbuf_pool) {struct rte_mbuf *buf;struct rte_mbuf badbuf; -printf ("Checking rte_mbuf_sanity_check for failure conditions\n" ); +printf ("Checking rte_mbuf_verify for failure conditions\n" );/* get a good mbuf to use to make copies */ buf =rte_pktmbuf_alloc (pktmbuf_pool);@@ -1708,7 +1708,7 @@ test_mbuf_validate_tx_offload(const char *test_name,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); m->ol_flags = ol_flags; m->tso_segsz = segsize; ret =rte_validate_tx_offload (m);@@ -1915,7 +1915,7 @@ test_pktmbuf_read(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); data =rte_pktmbuf_append (m,MBUF_TEST_DATA_LEN2 );if (data ==NULL )@@ -1964,7 +1964,7 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 );/* prepend an ethernet header */ app/test/test_mbuf.c +2
-2hdr = (struct ether_hdr *)rte_pktmbuf_prepend (m, hdr_len);@@ -2109,7 +2109,7 @@ create_packet(struct rte_mempool *pktmbuf_pool,GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (pkt_seg) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (pkt_seg,0 ); +rte_mbuf_verify (pkt_seg,0 );/* Add header only for the first segment */ if (test_data->flags ==MBUF_HEADER && seg ==0 ) { hdr_len =sizeof (struct rte_ether_hdr );@@ -2321,7 +2321,7 @@ test_pktmbuf_ext_shinfo_init_helper(struct rte_mempool *pktmbuf_pool)GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);if (rte_pktmbuf_pkt_len (m) !=0 )GOTO_FAIL ("%s: Bad packet length\n" , __func__); -rte_mbuf_sanity_check (m,0 ); +rte_mbuf_verify (m,0 ); ext_buf_addr = rte_malloc("External buffer", buf_len,app/test/test_mbuf.c +2
-2RTE_CACHE_LINE_SIZE);@@ -2482,8 +2482,8 @@ test_pktmbuf_ext_pinned_buffer(struct rte_mempool *std_pool)GOTO_FAIL ("%s: test_pktmbuf_copy(pinned) failed\n" , __func__); -if (test_failing_mbuf_sanity_check (pinned_pool) <0 ) -GOTO_FAIL ("%s: test_failing_mbuf_sanity_check(pinned)" +if (test_failing_mbuf_verify (pinned_pool) <0 ) +GOTO_FAIL ("%s: test_failing_mbuf_verify(pinned)" " failed\n" , __func__);app/test/test_mbuf.c +2
-2if (test_mbuf_linearize_check (pinned_pool) <0 )@@ -2857,8 +2857,8 @@ test_mbuf(void) goto err; } -if (test_failing_mbuf_sanity_check (pktmbuf_pool) <0 ) { -printf ("test_failing_mbuf_sanity_check() failed\n" ); +if (test_failing_mbuf_verify (pktmbuf_pool) <0 ) { +printf ("test_failing_mbuf_verify() failed\n" ); goto err; }doc/guides/prog_guide/mbuf_lib.rst +0
-0@@ -266,8 +266,8 @@ can be found in several of the sample applications, forexample, the IPv4 Multic
Debug
------In debug mode, the functions of the mbuf library perform sanity checks before any operation (such as, buffer corruption,
doc/guides/prog_guide/mbuf_lib.rst +2
-1-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). Use Cases ---------doc/guides/rel_notes/deprecation.rst +3
-0@@ -142,3 +142,6 @@ Deprecation Notices * bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK. Those API functions are used internally by DPDK core and netvsc PMD. + +* mbuf: The function ``rte_mbuf_sanity_check`` is deprecated. + Use the new function ``rte_mbuf_verify`` instead.lib/mbuf/rte_mbuf.c +9
-2@@ -367,9 +367,9 @@ rte_pktmbuf_pool_create_extbuf(const char *name, unsignedint n, return mp; } -/* do some sanity checks on a mbuf: panic if it fails */ +/* do some checks on a mbuf: panic if it fails */ void -rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +rte_mbuf_verify (const struct rte_mbuf *m,int is_header) {const char *reason;@@ -377,6 +377,13 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header) rte_panic("%s\n", reason); } +/* For ABI compatibility, to be removed in next release */ +void +rte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header) +{ +rte_mbuf_verify (m, is_header); +} +int rte_mbuf_check (const struct rte_mbuf *m,int is_header,const char **reason){
lib/mbuf/rte_mbuf.c +1
-1@@ -496,7 +503,7 @@ void rte_pktmbuf_free_bulk(struct rte_mbuf **mbufs, unsigned int count)if (unlikely (m ==NULL ))continue ; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); do {lib/mbuf/rte_mbuf.c +2
-2m_next = m->next;@@ -546,7 +553,7 @@ rte_pktmbuf_clone(struct rte_mbuf *md, struct rte_mempool *mp)return NULL ; } -__rte_mbuf_sanity_check (mc,1 ); +__rte_mbuf_verify (mc,1 );return mc; }@@ -596,7 +603,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, structrte_mempool *mp, struct rte_mbuf *mc, *m_last, **prev;/* garbage in check */ -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );/* check for request to copy at offset past end of mbuf */ lib/mbuf/rte_mbuf.c +2
-2if (unlikely (off >= m->pkt_len))@@ -660,7 +667,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, structrte_mempool *mp, }/* garbage out check */ - __rte_mbuf_sanity_check(mc, 1); + __rte_mbuf_verify(mc, 1);return mc; }@@ -671,7 +678,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len)unsigned int len;unsigned int nb_segs; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); fprintf(f, "dump mbuf at %p, iova=%#" PRIx64 ", buf_len=%u\n", m,
rte_mbuf_iova_get(m),lib/mbuf/rte_mbuf.c +1
-1m->buf_len);@@ -689,7 +696,7 @@ rte_pktmbuf_dump(FILE *f, const struct rte_mbuf *m, unsigned dump_len) nb_segs = m->nb_segs;while (m && nb_segs !=0 ) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 ); fprintf(f, " segment at %p, data=%p, len=%u, off=%u,refcnt=%u\n",
lib/mbuf/rte_mbuf.c +0
-0m, rte_pktmbuf_mtod(m, void *),lib/mbuf/rte_mbuf.h +8
-4@@ -339,16 +339,20 @@ 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 */ +#define __rte_mbuf_verify (m, is_h) rte_mbuf_verify(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 */ +#define __rte_mbuf_verify (m, is_h) do { } while (0)#endif /* RTE_LIBRTE_MBUF_DEBUG */ +/* deprecated version of the macro */ +#define __rte_mbuf_sanity_check (m, is_h) RTE_DEPRECATED(__rte_mbuf_sanity_check) \ + __rte_mbuf_verify(m, is_h) +#ifdef RTE_MBUF_REFCNT_ATOMIC /**
lib/mbuf/rte_mbuf.h +2
-3@@ -514,10 +518,9 @@ rte_mbuf_ext_refcnt_update(struct rte_mbuf_ext_shared_info *shinfo,/** -* Sanity checks on an mbuf. +* Check that the mbuf is valid and panic if corrupted. * -* Check the consistency of the given mbuf. The function will cause a -* panic if corruption is detected. +* Acts assertion that mbuf is consistent. If not it calls rte_panic(). * * @param m * The mbuf to be checked.
lib/mbuf/rte_mbuf.h +7
-3@@ -526,13 +529,17 @@ rte_mbuf_ext_refcnt_update(structrte_mbuf_ext_shared_info *shinfo, * of a packet (in this case, some fields like nb_segs are not checked) */ void +rte_mbuf_verify (const struct rte_mbuf *m,int is_header); + +__rte_deprecated +voidrte_mbuf_sanity_check (const struct rte_mbuf *m,int is_header);/** -* Sanity checks on a mbuf. +* Do consistency checks on a mbuf. * -* Almost like rte_mbuf_sanity_check(), but this function gives the reason -* if corruption is detected rather than panic. +* Check the consistency of the given mbuf and if not valid +* return the reason. * * @param m * The mbuf to be checked.
lib/mbuf/rte_mbuf.h +1
-1@@ -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. * * Check the consistency of the given reinitialized mbuf. * The function will cause a panic if corruption is detected.
lib/mbuf/rte_mbuf.h +1
-1@@ -563,7 +570,7 @@ int rte_mbuf_check(const struct rte_mbuf *m, intis_header, * The mbuf to be checked. */ static __rte_always_inline void -__rte_mbuf_raw_sanity_check(__rte_unused const struct rte_mbuf *m) +__rte_mbuf_raw_verify(__rte_unused const struct rte_mbuf *m) {RTE_ASSERT (rte_mbuf_refcnt_read (m) ==1 );lib/mbuf/rte_mbuf.h +2
-2RTE_ASSERT (m->next ==NULL );@@ -572,11 +579,11 @@ __rte_mbuf_raw_sanity_check(__rte_unused const struct rte_mbuf *m) RTE_ASSERT(!RTE_MBUF_HAS_EXTBUF(m) || (RTE_MBUF_HAS_PINNED_EXTBUF(m) && rte_mbuf_ext_refcnt_read(m->shinfo) == 1)); -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 ); }/** For backwards compatibility. */ -#define MBUF_RAW_ALLOC_CHECK (m) __rte_mbuf_raw_sanity_check(m) +#define MBUF_RAW_ALLOC_CHECK (m) __rte_mbuf_raw_verify(m)/** * Allocate an uninitialized mbuf from mempool *mp*.
lib/mbuf/rte_mbuf.h +1
-1@@ -606,7 +613,7 @@ static inline struct rte_mbuf *rte_mbuf_raw_alloc(struct rte_mempool *mp)if (rte_mempool_get (mp, &ret.ptr) <0 )return NULL ; -__rte_mbuf_raw_sanity_check (ret.m); +__rte_mbuf_raw_verify (ret.m);return ret.m; }@@ -644,7 +651,7 @@ rte_mbuf_raw_alloc_bulk(struct rte_mempool *mp, struct
rte_mbuf**mbufs, unsignelib/mbuf/rte_mbuf.h +1
-1int rc =rte_mempool_get_bulk (mp, (void **)mbufs, count);if (likely (rc ==0 ))for (unsigned int idx =0 ; idx < count; idx++) -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);return rc; }@@ -665,7 +672,7 @@ rte_mbuf_raw_alloc_bulk(struct rte_mempool *mp, struct
rte_mbuf**mbufs, unsigne
static__rte_always_inlinevoid
rte_mbuf_raw_free(struct rte_mbuf *m)
{lib/mbuf/rte_mbuf.h +1
-1-__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);rte_mempool_put (m->pool, m); }@@ -700,7 +707,7 @@ rte_mbuf_raw_free_bulk(struct rte_mempool *mp, struct
rte_mbuf**mbufs, unsignedlib/mbuf/rte_mbuf.h +6
-6const struct rte_mbuf *m = mbufs[idx];RTE_ASSERT (m !=NULL );RTE_ASSERT (m->pool == mp); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); }rte_mempool_put_bulk (mp, (void **)mbufs, count);@@ -965,7 +972,7 @@ static inline void rte_pktmbuf_reset(struct rte_mbuf *m)rte_pktmbuf_reset_headroom (m); m->data_len =0 ; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); }/** @@ -1021,22 +1028,22 @@ static inline int rte_pktmbuf_alloc_bulk(struct rte_mempool *pool, switch (count % 4) {case 0 :while (idx != count) { -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;/* fall-through */ case 3 : -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;/* fall-through */ case 2 : -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;/* fall-through */ case 1 : -__rte_mbuf_raw_sanity_check (mbufs[idx]); +__rte_mbuf_raw_verify (mbufs[idx]);rte_pktmbuf_reset (mbufs[idx]); idx++;lib/mbuf/rte_mbuf.h +2
-2/* fall-through */ @@ -1267,8 +1274,8 @@ static inline void rte_pktmbuf_attach(struct rte_mbuf *mi, struct rte_mbuf *m) mi->pkt_len = mi->data_len; mi->nb_segs =1 ; -__rte_mbuf_sanity_check (mi,1 ); -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (mi,1 ); +__rte_mbuf_verify (m,0 ); }/**
lib/mbuf/rte_mbuf.h +3
-3@@ -1423,7 +1430,7 @@ static inline int __rte_pktmbuf_pinned_extbuf_decref(struct rte_mbuf *m) static __rte_always_inline struct rte_mbuf *rte_pktmbuf_prefree_seg (struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 );if (likely (rte_mbuf_refcnt_read (m) ==1 )) {@@ -1494,7 +1501,7 @@ static inline void rte_pktmbuf_free(struct rte_mbuf *m)struct rte_mbuf *m_next;if (m !=NULL ) -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );while (m !=NULL ) { m_next = m->next;@@ -1575,7 +1582,7 @@ rte_pktmbuf_copy(const struct rte_mbuf *m, structrte_mempool *mp, */ static inline void rte_pktmbuf_refcnt_update (struct rte_mbuf *m,int16_t v) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); do {lib/mbuf/rte_mbuf.h +2
-2rte_mbuf_refcnt_update (m, v);@@ -1592,7 +1599,7 @@ static inline void rte_pktmbuf_refcnt_update(structrte_mbuf *m, int16_t v) */ static inline uint16_t rte_pktmbuf_headroom (const struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 );return m->data_off; }@@ -1606,7 +1613,7 @@ static inline uint16_t rte_pktmbuf_headroom(const structrte_mbuf *m) */ static inline uint16_t rte_pktmbuf_tailroom (const struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,0 ); +__rte_mbuf_verify (m,0 );return (uint16_t )(m->buf_len -rte_pktmbuf_headroom (m) - m->data_len);}
lib/mbuf/rte_mbuf.h +1
-1@@ -1621,7 +1628,7 @@ static inline uint16_t rte_pktmbuf_tailroom(const structrte_mbuf *m) */ static inline struct rte_mbuf *rte_pktmbuf_lastseg (struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );while (m->next !=NULL ) m = m->next;lib/mbuf/rte_mbuf.h +1
-1return m;@@ -1665,7 +1672,7 @@ static inline struct rte_mbuf *rte_pktmbuf_lastseg(struct rte_mbuf *m)static inline char *rte_pktmbuf_prepend (struct rte_mbuf *m,uint16_t len) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );if (unlikely (len >rte_pktmbuf_headroom (m)))lib/mbuf/rte_mbuf.h +1
-1return NULL ;@@ -1700,7 +1707,7 @@ static inline char *rte_pktmbuf_append(struct rte_mbuf *m, uint16_t len)void *tail;struct rte_mbuf *m_last; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); m_last =rte_pktmbuf_lastseg (m);lib/mbuf/rte_mbuf.h +1
-1if (unlikely (len >rte_pktmbuf_tailroom (m_last)))@@ -1728,7 +1735,7 @@ static inline char *rte_pktmbuf_append(struct rte_mbuf*m, uint16_t len) */ static inline char *rte_pktmbuf_adj (struct rte_mbuf *m,uint16_t len) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );if (unlikely (len > m->data_len))lib/mbuf/rte_mbuf.h +1
-1return NULL ;@@ -1760,7 +1767,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m, uint16_t len) {struct rte_mbuf *m_last; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 ); m_last =rte_pktmbuf_lastseg (m);lib/mbuf/rte_mbuf.h +1
-1if (unlikely (len > m_last->data_len))@@ -1782,7 +1789,7 @@ static inline int rte_pktmbuf_trim(struct rte_mbuf *m,uint16_t len) */ static inline int rte_pktmbuf_is_contiguous (const struct rte_mbuf *m) { -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );return m->nb_segs ==1 ; }lib/mbuf/version.map +1
-1@@ -31,6 +31,7 @@ DPDK_25 { rte_mbuf_set_platform_mempool_ops; rte_mbuf_set_user_mempool_ops; rte_mbuf_user_mempool_ops; + rte_mbuf_verify; rte_pktmbuf_clone; rte_pktmbuf_copy; rte_pktmbuf_dump; --Quoted 1 line
2.47.2
Stephen,
I have submitted another patch [1], where __rte_mbuf_raw_sanity_check()'s successor takes one more parameter, so I had to give it a new name
__rte_mbuf_raw_sanity_check_mp()for API compatibility. And then I added:(quoted diff) +2
-0+/** For backwards compatibility. */ +#define __rte_mbuf_raw_sanity_check(m) __rte_mbuf_raw_sanity_check_mp(m, NULL)
Quoted 4 lines
If you proceed with your patch,
__rte_mbuf_raw_sanity_check()will be renamed to__rte_mbuf_raw_verify(), and__rte_mbuf_raw_sanity_check()disappears.
Would it make sense to change your patch, so__rte_mbuf_raw_verify()replaces__rte_mbuf_raw_sanity_check_mp()instead of__rte_mbuf_raw_sanity_check()? If your patch changes the API anyway, adding an extra parameter to the function should be acceptable.[1]: https://patchwork.dpdk.org/project/dpdk/patch/[email protected]/
Sure will go back and rebase old patches in a few weeks.
PATCH v12 2/10 net/avp: replace use of rte_mbuf_sanity_check
In reply to Stephen HemmingerRenamed to rte_mbuf_verify.
--- drivers/net/avp/avp_ethdev.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/net/avp/avp_ethdev.c +9 -9
@@ -1231,7 +1231,7 @@ _avp_mac_filter(struct avp_dev *avp, struct rte_mbuf *m)#ifdef RTE_LIBRTE_AVP_DEBUG_BUFFERS static inline void -__avp_dev_buffer_sanity_check (struct avp_dev *avp,struct rte_avp_desc *buf) +__avp_dev_buffer_check (struct avp_dev *avp,struct rte_avp_desc *buf) {struct rte_avp_desc *first_buf;struct rte_avp_desc *pkt_buf;
@@ -1272,12 +1272,12 @@ __avp_dev_buffer_sanity_check(struct avp_dev *avp, struct rte_avp_desc *buf) first_buf->pkt_len, pkt_len); } -#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)#endif
@@ -1302,7 +1302,7 @@ avp_dev_copy_from_buffers(struct avp_dev *avp,void *pkt_data;unsigned int i; -avp_dev_buffer_sanity_check (avp, buf); +avp_dev_buffer_check (avp, buf);/* setup the first source buffer */ pkt_buf =avp_dev_translate_buffer (avp, buf);
@@ -1370,7 +1370,7 @@ avp_dev_copy_from_buffers(struct avp_dev *avp,rte_pktmbuf_pkt_len (m) = total_length; m->vlan_tci = vlan_tci; -__rte_mbuf_sanity_check (m,1 ); +__rte_mbuf_verify (m,1 );return m; }
@@ -1614,7 +1614,7 @@ avp_dev_copy_to_buffers(struct avp_dev *avp,char *pkt_data;unsigned int i; -__rte_mbuf_sanity_check (mbuf,1 ); +__rte_mbuf_verify (mbuf,1 ); m = mbuf; src_offset =0 ;
@@ -1680,7 +1680,7 @@ avp_dev_copy_to_buffers(struct avp_dev *avp, first_buf->vlan_tci = mbuf->vlan_tci; } -avp_dev_buffer_sanity_check (avp, buffers[0 ]); +avp_dev_buffer_check (avp, buffers[0 ]);return total_length; }
@@ -1797,7 +1797,7 @@ avp_xmit_scattered_pkts(void *tx_queue,#ifdef RTE_LIBRTE_AVP_DEBUG_BUFFERS for (i =0 ; i < nb_pkts; i++) -avp_dev_buffer_sanity_check (avp, tx_bufs[i]); +avp_dev_buffer_check (avp, tx_bufs[i]);#endif /* send the packets */
Signature · 1 line
2.47.2
PATCH v12 3/10 net/sfc: replace use of rte_mbuf_sanity_check
In reply to Stephen HemmingerRenamed to rte_mbuf_verify.
--- drivers/net/sfc/sfc_ef100_rx.c | 6 +++--- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 ++-- drivers/net/sfc/sfc_ef10_rx.c | 4 ++-- drivers/net/sfc/sfc_rx.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/sfc/sfc_ef100_rx.c +3 -3
@@ -179,7 +179,7 @@ sfc_ef100_rx_qrefill(struct sfc_ef100_rxq *rxq)struct sfc_ef100_rx_sw_desc *rxd;rte_iova_t dma_addr; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); dma_addr =rte_mbuf_data_iova_default (m);if (rxq->flags &SFC_EF100_RXQ_NIC_DMA_MAP ) {
@@ -551,7 +551,7 @@ sfc_ef100_rx_process_ready_pkts(struct sfc_ef100_rxq *rxq, rxq->ready_pkts--; pkt =sfc_ef100_rx_next_mbuf (rxq); -__rte_mbuf_raw_sanity_check (pkt); +__rte_mbuf_raw_verify (pkt);RTE_BUILD_BUG_ON (sizeof (pkt->rearm_data[0 ]) !=sizeof (rxq->rearm_data));
@@ -575,7 +575,7 @@ sfc_ef100_rx_process_ready_pkts(struct sfc_ef100_rxq *rxq,struct rte_mbuf *seg; seg =sfc_ef100_rx_next_mbuf (rxq); -__rte_mbuf_raw_sanity_check (seg); +__rte_mbuf_raw_verify (seg); seg->data_off =RTE_PKTMBUF_HEADROOM ;
drivers/net/sfc/sfc_ef10_essb_rx.c +2 -2
@@ -125,7 +125,7 @@ sfc_ef10_essb_next_mbuf(const struct sfc_ef10_essb_rxq *rxq,struct rte_mbuf *m; m = (struct rte_mbuf *)((uintptr_t )mbuf + rxq->buf_stride); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);return m; }
@@ -136,7 +136,7 @@ sfc_ef10_essb_mbuf_by_index(const struct sfc_ef10_essb_rxq *rxq,struct rte_mbuf *m; m = (struct rte_mbuf *)((uintptr_t )mbuf + idx * rxq->buf_stride); -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);return m; }
drivers/net/sfc/sfc_ef10_rx.c +2 -2
@@ -148,7 +148,7 @@ sfc_ef10_rx_qrefill(struct sfc_ef10_rxq *rxq)struct sfc_ef10_rx_sw_desc *rxd;rte_iova_t phys_addr; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m);SFC_ASSERT ((id & ~ptr_mask) ==0 ); rxd = &rxq->sw_ring[id];
@@ -297,7 +297,7 @@ sfc_ef10_rx_process_event(struct sfc_ef10_rxq *rxq, efx_qword_t rx_ev, rxd = &rxq->sw_ring[pending++ & ptr_mask]; m = rxd->mbuf; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); m->data_off =RTE_PKTMBUF_HEADROOM ;rte_pktmbuf_data_len (m) = seg_len;
drivers/net/sfc/sfc_rx.c +1 -1
@@ -120,7 +120,7 @@ sfc_efx_rx_qrefill(struct sfc_efx_rxq *rxq) ++i, id = (id + 1) & rxq->ptr_mask) { m = objs[i]; -__rte_mbuf_raw_sanity_check (m); +__rte_mbuf_raw_verify (m); rxd = &rxq->sw_desc[id]; rxd->mbuf = m;
Signature · 1 line
2.47.2
Re: [PATCH v12 03/10] net/sfc: replace use of rte_mbuf_sanity_check
Quoted 3 lines · Stephen Hemminger
Renamed to
rte_mbuf_verify.Signed-off-by Stephen Hemminger <[email protected]>
Thanks Stephen,
PATCH v12 4/10 examples: remove term sanity
In reply to Stephen HemmingerDo not use non-inclusive terms.
--- examples/ipsec-secgw/event_helper.c | 2 +- examples/ipv4_multicast/main.c | 2 +- examples/qos_sched/args.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
examples/ipsec-secgw/event_helper.c +1 -1
@@ -2106,7 +2106,7 @@ eh_launch_worker(struct eh_conf *conf, struct eh_app_worker_params *app_wrkr, goto clean_and_exit; } -/* Verify sanity of the matched worker */ +/* Verify validity of the matched worker */ if (eh_verify_match_worker (match_wrkr) !=1 ) {EH_LOG_ERR ("Failed to validate the matched worker" ); goto clean_and_exit;
examples/ipv4_multicast/main.c +1 -1
@@ -258,7 +258,7 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) hdr->pkt_len = (uint16_t )(hdr->data_len + pkt->pkt_len); hdr->nb_segs = pkt->nb_segs +1 ; -__rte_mbuf_sanity_check (hdr,1 ); +__rte_mbuf_verify (hdr,1 );return hdr; }/* >8 End of mcast_out_kt. */
examples/qos_sched/args.c +1 -1
@@ -386,7 +386,7 @@ app_parse_args(int argc, char **argv)return -1 ; } -/* sanity check for cores assignment */ +/* check for cores assignment */ for (i =0 ; i < nb_pfc; i++) {if (qos_conf[i].rx_core >=RTE_MAX_LCORE ) { RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1,
Signature · 1 line
2.47.2
PATCH v12 5/10 eal: replace use of sanity check in comments and messages
In reply to Stephen HemmingerSanity check is on the Tier 2 non-inclusive list.
Replace or remove it.
--- lib/eal/common/eal_common_memory.c | 2 +- lib/eal/common/eal_common_proc.c | 3 ++- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/windows/eal.c | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-)
lib/eal/common/eal_common_memory.c +1 -1
@@ -564,7 +564,7 @@ check_dma_mask(uint8_t maskbits, bool thread_unsafe)uint64_t mask;int ret; -/* Sanity check. We only check width can be managed with 64 bits +/* We only check width can be managed with 64 bits * variables. Indeed any higher value is likely wrong. */ if (maskbits >MAX_DMA_MASK_BITS ) { EAL_LOG(ERR, "wrong dma mask size %u (Max: %u)",
lib/eal/common/eal_common_proc.c +2 -1
@@ -309,7 +309,8 @@ read_msg(int fd, struct mp_msg_internal *m, struct sockaddr_un *s)break ; } } -/* sanity-check the response */ + +/* Check that the response is valid */ if (m->msg.num_fds <0 || m->msg.num_fds >RTE_MP_MAX_FD_NUM ) {EAL_LOG (ERR ,"invalid number of fd's received" );return -1 ;
lib/eal/common/eal_common_trace.c +1 -1
@@ -468,7 +468,7 @@ __rte_trace_point_register(rte_trace_point_t *handle, const char *name,struct trace_point *tp;uint16_t sz; -/* Sanity checks of arguments */ +/* Check arguments */ if (name ==NULL || register_fn ==NULL || handle ==NULL ) {trace_err ("invalid arguments" ); rte_errno =EINVAL ;
lib/eal/common/eal_memcfg.h +1 -1
@@ -18,7 +18,7 @@* Memory configuration shared across multiple processes. */ struct rte_mem_config { -volatile uint32_t magic;/**< Magic number - sanity check. */ +volatile uint32_t magic;/**< Magic number check. */ uint32_t version;/**< Prevent secondary processes using different DPDK versions. */
lib/eal/common/rte_malloc.c +1 -1
@@ -654,7 +654,7 @@ rte_malloc_heap_destroy(const char *heap_name) ret =-1 ; goto unlock; } -/* sanity checks done, now we can destroy the heap */ +/* checks done, now we can destroy the heap */ rte_spinlock_lock (&heap->lock); ret =malloc_heap_destroy (heap);rte_spinlock_unlock (&heap->lock);
lib/eal/freebsd/eal.c +1 -1
@@ -460,7 +460,7 @@ eal_parse_args(int argc, char **argv) goto out; } -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname); ret =-1 ;
lib/eal/linux/eal.c +1 -1
@@ -765,7 +765,7 @@ eal_parse_args(int argc, char **argv) goto out; } -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname); ret =-1 ;
lib/eal/windows/eal.c +1 -1
@@ -160,7 +160,7 @@ eal_parse_args(int argc, char **argv)if (eal_adjust_config (internal_conf) !=0 )return -1 ; -/* sanity checks */ +/* options checks */ if (eal_check_common_options (internal_conf) !=0 ) {eal_usage (prgname);return -1 ;
Signature · 1 line
2.47.2
PATCH v12 6/10 test: replace use word sanity
In reply to Stephen HemmingerThe word "sanity" is on the not-allowed inclusive naming list. Replace the unnecessary usage in tests.
--- app/test/test_bitmap.c | 4 +-- app/test/test_bpf.c | 6 ++-- app/test/test_common.c | 2 +- app/test/test_distributor.c | 46 +++++++++++++++--------------- app/test/test_eal_flags.c | 20 ++++++------- app/test/test_hash.c | 2 +- app/test/test_interrupts.c | 9 +++--- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_mbuf.c | 2 +- app/test/test_rawdev.c | 2 +- app/test/test_timer.c | 10 +++---- 11 files changed, 53 insertions(+), 52 deletions(-)
app/test/test_bitmap.c +2 -2
@@ -33,7 +33,7 @@ test_bitmap_scan_operations(struct rte_bitmap *bmp) }if (slab1_magic != out_slab) { -printf ("Scan operation sanity failed.\n" ); +printf ("Scan operation magic number check failed.\n" );return TEST_FAILED ; }
@@ -43,7 +43,7 @@ test_bitmap_scan_operations(struct rte_bitmap *bmp) }if (slab2_magic != out_slab) { -printf ("Scan operation sanity failed.\n" ); +printf ("Scan operation magic number check failed.\n" );return TEST_FAILED ; }
app/test/test_bpf.c +3 -3
@@ -3343,9 +3343,9 @@ test_bpf_match(pcap_t *pcap, const char *str,return ret; } -/* Basic sanity test can we match a IP packet */ +/* Basic test can we match a IP packet */ static int -test_bpf_filter_sanity (pcap_t *pcap) +test_bpf_filter_match (pcap_t *pcap) {const uint32_t plen =100 ;struct rte_mbuf mb, *m;
@@ -3484,7 +3484,7 @@ test_bpf_convert(void)return -1 ; } - rc =test_bpf_filter_sanity (pcap); + rc =test_bpf_filter_match (pcap);for (i =0 ; i <RTE_DIM (sample_filters); i++) rc |=test_bpf_filter (pcap, sample_filters[i]);
app/test/test_common.c +1 -1
@@ -20,7 +20,7 @@ {printf (x"() test failed!\n" );\return -1 ;} -/* this is really a sanity check */ +/* this is really a consistency check */ static int test_macros(int __rte_unused unused_parm) {
app/test/test_distributor.c +23 -23
177 lines not on this page · raw message
app/test/test_eal_flags.c +10 -10
@@ -314,7 +314,7 @@ get_number_of_sockets(void)/* * Test that the app doesn't run with invalid allow option. -* Final tests ensures it does run with valid options as sanity check (one +* Final tests ensures it does run with valid options as basic test (one * test for with Domain+BDF, second for just with BDF) */ static int
@@ -382,7 +382,7 @@ test_allow_flag(void)/* * Test that the app doesn't run with invalid blocklist option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options as basic check. */ static int test_invalid_b_flag (void )
@@ -429,7 +429,7 @@ test_invalid_b_flag(void)/* * Test that the app doesn't run with invalid vdev option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options basic check. */ static int test_invalid_vdev_flag (void )
@@ -554,7 +554,7 @@ test_missing_c_flag(void)/* bad coremask value */ const char *argv3[] = { prgname, prefix, mp_flag,"-c" ,"error" }; -/* sanity check of tests - valid coremask value */ +/* check of tests - valid coremask value */ const char *argv4[] = { prgname, prefix, mp_flag,"-c" ,"1" };/* -l flag but no corelist value */
@@ -581,7 +581,7 @@ test_missing_c_flag(void) "-l", RTE_STR(RTE_MAX_LCORE) };const char *const argv14[] = { prgname, prefix, mp_flag,"-l" ,"1-" RTE_STR (RTE_MAX_LCORE ) }; -/* sanity check test - valid corelist value */ +/* check test - valid corelist value */ const char *const argv15[] = { prgname, prefix, mp_flag,"-l" ,"1-2,3" };
@@ -613,7 +613,7 @@ test_missing_c_flag(void) "--lcores", "(4-7)=(1,3)" };const char *const argv28[] = { prgname, prefix, mp_flag,"--lcores" ,"[4-7]@(1,3)" }; -/* sanity check of tests - valid lcores value */ +/* more complex valid lcores value */ const char *const argv29[] = { prgname, prefix, mp_flag,"--lcores" ,"0-1,2@(5-7),(3-5)@(0,2),(0,6),7" };
@@ -744,7 +744,7 @@ test_main_lcore_flag(void)/* * Test that the app doesn't run with invalid -n flag option. -* Final test ensures it does run with valid options as sanity check +* Final test ensures it does run with valid options as basic check. * Since -n is not compulsory for MP, we instead use --no-huge and --no-shconf * flags. */
@@ -772,10 +772,10 @@ test_invalid_n_flag(void)/* zero is invalid */ const char *argv3[] = { prgname, prefix, no_huge, no_shconf,"-n" ,"0" }; -/* sanity test - check with good value */ +/* check with good value */ const char *argv4[] = { prgname, prefix, no_huge, no_shconf,"-n" ,"2" }; -/* sanity test - check with no -n flag */ +/* check with no -n flag */ const char *argv5[] = { prgname, prefix, no_huge, no_shconf}; if (launch_proc(argv1) == 0
@@ -977,7 +977,7 @@ test_misc_flags(void)* All cases, apart from the first, app should run. * No further testing of output done. */ -/* sanity check - failure with invalid option */ +/* failure with invalid option */ const char *argv0[] = {prgname, prefix, mp_flag,"--invalid-opt" };/* With --no-pci */
app/test/test_hash.c +1 -1
@@ -1140,7 +1140,7 @@ fbk_hash_unit_test(void) .socket_id = 0, }; -/* this is a sanity check for "same name" test +/* this is a check for "same name" test * creating this hash will check if we are actually able to create * multiple hashes with different names (instead of having just one). */
app/test/test_interrupts.c +5 -4
@@ -48,7 +48,7 @@ static union intr_pipefds pfds;* Check if the interrupt handle is valid. */ static inline int -test_interrupt_handle_sanity_check (struct rte_intr_handle *intr_handle) +test_interrupt_handle_check (struct rte_intr_handle *intr_handle) {if (!intr_handle ||rte_intr_fd_get (intr_handle) <0 )return -1 ;
@@ -164,7 +164,7 @@ test_interrupt_handle_compare(struct rte_intr_handle *intr_handle_l,#else /* to be implemented for bsd later */ static inline int -test_interrupt_handle_sanity_check (struct rte_intr_handle *intr_handle) +test_interrupt_handle_check (struct rte_intr_handle *intr_handle) {RTE_SET_USED (intr_handle);
@@ -215,7 +215,7 @@ test_interrupt_callback(void *arg)return ; } -if (test_interrupt_handle_sanity_check (intr_handle) <0 ) { +if (test_interrupt_handle_check (intr_handle) <0 ) {printf ("null or invalid intr_handle for %s\n" , __func__); flag =-1 ;return ;
@@ -241,7 +241,8 @@ static void test_interrupt_callback_1(void *arg) {struct rte_intr_handle *intr_handle = arg; -if (test_interrupt_handle_sanity_check (intr_handle) <0 ) { + +if (test_interrupt_handle_check (intr_handle) <0 ) {printf ("null or invalid intr_handle for %s\n" , __func__); flag =-1 ;return ;
app/test/test_link_bonding_mode4.c +1 -1
@@ -224,7 +224,7 @@ add_member(struct member_conf *member, uint8_t start)struct rte_ether_addr addr, addr_check;int retval; -/* Some sanity check */ +/* Some basic tests. */ RTE_VERIFY (test_params.member_ports <= member && member - test_params.member_ports < (int )RTE_DIM (test_params.member_ports));RTE_VERIFY (member->bonding ==0 );
app/test/test_mbuf.c +1 -1
@@ -1702,7 +1702,7 @@ test_mbuf_validate_tx_offload(const char *test_name,struct rte_mbuf *m =NULL ;int ret =0 ; -/* alloc a mbuf and do sanity check */ +/* alloc a mbuf and do some basic checks */ m =rte_pktmbuf_alloc (pktmbuf_pool);if (m ==NULL )GOTO_FAIL ("%s: mbuf allocation failed!\n" , __func__);
app/test/test_rawdev.c +1 -1
@@ -47,7 +47,7 @@ test_rawdev_selftests(void)int ret =0 ;int i; -/* basic sanity on rawdev infrastructure */ +/* basic check on rawdev infrastructure */ if (test_rawdev_selftest_skeleton () <0 )return -1 ;
app/test/test_timer.c +5 -5
@@ -498,11 +498,11 @@ timer_basic_main_loop(__rte_unused void *arg) }static int -timer_sanity_check (void ) +timer_check (void ) {#ifdef RTE_LIBEAL_USE_HPET if (eal_timer_source !=EAL_TIMER_HPET ) { -printf ("Not using HPET, can't sanity check timer sources\n" ); +printf ("Not using HPET, can't check timer sources\n" );return 0 ; }
@@ -546,9 +546,9 @@ test_timer(void)return TEST_SKIPPED ; } -/* sanity check our timer sources and timer config values */ -if (timer_sanity_check () <0 ) { -printf ("Timer sanity checks failed\n" ); +/* check our timer sources and timer config values */ +if (timer_check () <0 ) { +printf ("Timer checks failed\n" );return TEST_FAILED ; }
Signature · 1 line
2.47.2
PATCH v12 7/10 dts: replace use of sanity check in comment
In reply to Stephen HemmingerReplace with better words.
--- dts/tests/TestSuite_blocklist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
dts/tests/TestSuite_blocklist.py +1 -1
@@ -22,7 +22,7 @@ def verify_blocklisted_ports(self, ports_to_block: list[Port]): allowlisted_ports = {port.device_name for port in testpmd.show_port_info_all()} blocklisted_ports = {port.pci for port in ports_to_block} - # sanity check + # ensure at least one port is allowed allowed_len = len(allowlisted_ports - blocklisted_ports) self.verify(allowed_len > 0, "At least one port should have been allowed")
Signature · 1 line
2.47.2
Re: [PATCH v12 07/10] dts: replace use of sanity check in comment
Unfortunately I do find myself saying sanity check often... something to cut out from my vocabulary. From a quick google it looks like many are using coherence check in its place, or just explicitly writing out what the check is as you did.
It would also probably be fine to just remove the comment entirely given the assert immediately following it also contains its own explanation of the check. But, I guess the original author thought it was useful to have the comment, so we can keep it.
Quoted 28 lines · Stephen Hemminger
Replace with better words.
Signed-off-by Stephen Hemminger <[email protected]>--- dts/tests/TestSuite_blocklist.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)dts/tests/TestSuite_blocklist.py +0
-0@@ -22,7 +22,7 @@ def verify_blocklisted_ports(self, ports_to_block:list[Port]):
allowlisted_ports= {port.device_name for port intestpmd.show_port_info_all()}blocklisted_ports = {port.pci for port in ports_to_block}dts/tests/TestSuite_blocklist.py +1
-1- # sanity check + # ensure at least one port is allowed allowed_len = len(allowlisted_ports - blocklisted_ports) self.verify(allowed_len > 0, "At least one port should havebeen allowed")
--
2.47.2
Re: [PATCH v12 07/10] dts: replace use of sanity check in comment
In reply to Stephen HemmingerI'm happy with the change. The original intention of the comment was to make sure that non-involved ports were still being allowed, and that there were no side effects. The comment change somewhat becomes redundant as it's repeating the subsequent message. So if it were to stay as proposed, I guess it'd drop it altogether.
PATCH v12 8/10 doc: remove sanity
In reply to Stephen HemmingerDon't use the word sanity in the documentation
--- doc/guides/gpus/cuda.rst | 2 +- doc/guides/sample_app_ug/eventdev_pipeline.rst | 2 +- doc/guides/tools/testbbdev.rst | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-)
doc/guides/gpus/cuda.rst +1 -1
@@ -80,7 +80,7 @@ Similarly to CUDA shared library, if the **libgdrapi.so** shared library is not installed in default locations (e.g. /usr/local/lib), you can use the variable ``GDRCOPY_PATH_L``. -As an example, to enable the CPU map feature sanity check, +As an example, to enable the CPU map feature check, run the ``app/test-gpudev`` application with: .. code-block:: console
doc/guides/sample_app_ug/eventdev_pipeline.rst +1 -1
@@ -50,7 +50,7 @@ these settings is shown below: ./<build_dir>/examples/dpdk-eventdev_pipeline -l 0,2,8-15 --vdev event_sw0 \ -- -r1 -t1 -e4 -w FF00 -s4 -n0 -c32 -W1000 -D -The application has some sanity checking built-in, so if there is a function +The application has some internal validation, so if there is a function (e.g.; the RX core) which doesn't have a cpu core mask assigned, the application will print an error message:
doc/guides/tools/testbbdev.rst +4 -4
@@ -9,7 +9,7 @@ dpdk-test-bbdev Application The ``dpdk-test-bbdev`` tool is a Data Plane Development Kit (DPDK) utility that allows measuring performance parameters of PMDs available in the bbdev framework. Tests available for execution are: latency, throughput, validation, -bler and sanity tests. Execution of tests can be customized using various +bler and basic functionality. Execution of tests can be customized using various parameters passed to a python running script.
@@ -97,8 +97,8 @@ Test Cases There are 7 main test cases that can be executed using testbbdev tool: -* Sanity checks [-c unittest] - - Performs sanity checks on BBDEV interface, validating basic functionality +* Functional checks [-c unittest] + - Performs checks on BBDEV interface, validating basic functionality * Validation tests [-c validation] - Performs full operation of enqueue and dequeue
@@ -232,7 +232,7 @@ vector name refer more explicitly processing specificity such as is purely read/written for external DDR, lbrm when limited buffer rate matching is expected, or crc_fail when a CRC failure is expected. They are chosen to have a good coverage across sizes and processing -parameters while still keeping their number limited as part of sanity +parameters while still keeping their number limited as part of functional regression. Shortened tree of isg_cid-wireless_dpdk_ae with dpdk compiled and output
Signature · 1 line
2.47.2
PATCH v12 9/10 lib: replace use of sanity check in comments and
In reply to Stephen HemmingerSanity check is on the Tier 2 non-inclusive list.
Replace or remove it.
--- lib/eal/linux/eal_timer.c | 2 +- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +++--- lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-)
lib/eal/linux/eal_timer.c +1 -1
@@ -247,7 +247,7 @@ get_tsc_freq(uint64_t arch_hz) tsc_hz = (uint64_t )((end - start)/secs);if (arch_hz) { -/* Make sure we're within 1% for sanity check */ +/* Make sure we're within 1% */ if (RTE_MAX (arch_hz, tsc_hz) -RTE_MIN (arch_hz, tsc_hz) > arch_hz /100 )return arch_hz;
lib/graph/graph.c +1 -1
@@ -389,7 +389,7 @@ rte_graph_create(const char *name, struct rte_graph_param *prm)graph_spinlock_lock (); -/* Check arguments sanity */ +/* Check argument validity */ if (prm ==NULL )SET_ERR_JMP (EINVAL , fail,"Param should not be NULL" );
lib/graph/graph_stats.c +1 -1
@@ -385,7 +385,7 @@ rte_graph_cluster_stats_create(const struct rte_graph_cluster_stats_param *prm)const char *pattern;rte_graph_t i; -/* Sanity checks */ +/* Validate arguments */ if (!rte_graph_has_stats_feature ())SET_ERR_JMP (EINVAL , fail,"Stats feature is not enabled" );
lib/graph/node.c +1 -1
@@ -68,7 +68,7 @@ __rte_node_register(const struct rte_node_register *reg)graph_spinlock_lock (); -/* Check sanity */ +/* Check argument validity */ if (reg ==NULL || reg->process ==NULL ) { rte_errno =EINVAL ; goto fail;
lib/jobstats/rte_jobstats.c +3 -3
@@ -124,7 +124,7 @@ rte_jobstats_start(struct rte_jobstats_context *ctx, struct rte_jobstats *job) {uint64_t now; -/* Some sanity check. */ +/* Check validity of arguments. */ if (unlikely (ctx ==NULL || job ==NULL || job->context !=NULL ))return -EINVAL ;
@@ -144,7 +144,7 @@ rte_jobstats_abort(struct rte_jobstats *job)struct rte_jobstats_context *ctx;uint64_t now, exec_time; -/* Some sanity check. */ +/* Check that arguments are valid */ if (unlikely (job ==NULL || job->context ==NULL ))return -EINVAL ;
@@ -165,7 +165,7 @@ rte_jobstats_finish(struct rte_jobstats *job, int64_t job_value)uint64_t now, exec_time;int need_update; -/* Some sanity check. */ +/* Check arguments */ if (unlikely (job ==NULL || job->context ==NULL ))return -EINVAL ;
lib/metrics/rte_metrics.c +1 -1
@@ -120,7 +120,7 @@ rte_metrics_reg_names(const char * const *names, uint16_t cnt_names)uint16_t idx_name;uint16_t idx_base; -/* Some sanity checks */ +/* Some consistency checks */ if (cnt_names <1 || names ==NULL )return -EINVAL ;for (idx_name =0 ; idx_name < cnt_names; idx_name++)
lib/pcapng/rte_pcapng.c +1 -1
@@ -620,7 +620,7 @@ rte_pcapng_write_packets(rte_pcapng_t *self,struct pcapng_enhance_packet_block *epb;uint64_t cycles, timestamp; -/* sanity check that is really a pcapng mbuf */ +/* Check that is really a pcapng mbuf */ epb = rte_pktmbuf_mtod(m, struct pcapng_enhance_packet_block *);if (unlikely (epb->block_type !=PCAPNG_ENHANCED_PACKET_BLOCK || epb->block_length !=rte_pktmbuf_pkt_len (m))) {
Signature · 1 line
2.47.2
PATCH v12 10/10 drivers: remove use of term sanity check
In reply to Stephen HemmingerDon't use term "sanity" because it is considered derogatory.
--- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 2 +- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_npa.c | 6 +++--- drivers/common/dpaax/caamflib/desc.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/sfc_efx/base/ef10_nvram.c | 4 ++-- drivers/common/sfc_efx/base/efx_rx.c | 2 +- drivers/crypto/bcmfs/hw/bcmfs4_rm.c | 6 +++--- drivers/crypto/bcmfs/hw/bcmfs5_rm.c | 6 +++--- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/net/ark/ark_ethdev.c | 8 ++++---- drivers/net/ark/ark_ethdev_rx.c | 2 +- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_stats.c | 8 ++++---- drivers/net/bnx2x/ecore_sp.c | 2 +- drivers/net/bnx2x/elink.c | 4 ++-- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/cnxk/cnxk_ethdev.c | 4 ++-- drivers/net/cxgbe/cxgbe_ethdev.c | 10 ++-------- drivers/net/cxgbe/cxgbevf_main.c | 4 ++-- drivers/net/intel/fm10k/fm10k_ethdev.c | 2 +- drivers/net/intel/fm10k/fm10k_rxtx.c | 2 +- drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/intel/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 6 +++--- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 ++---- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx_vec.h | 2 +- drivers/net/mvpp2/mrvl_qos.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/ntnic/nthw/nthw_rac.c | 2 +- drivers/net/qede/qede_rxtx.c | 6 +++--- drivers/net/ring/rte_eth_ring.c | 7 ++----- drivers/net/sfc/sfc_dp_rx.h | 2 +- drivers/net/txgbe/txgbe_ipsec.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 2 +- 44 files changed, 67 insertions(+), 78 deletions(-)
drivers/bus/fslmc/qbman/qbman_sys_decl.h +1 -1
@@ -9,7 +9,7 @@#include <compat.h> #include <fsl_qbman_base.h> -/* Sanity check */ +/* Byte order check */ #if (__BYTE_ORDER__ != __ORDER_BIG_ENDIAN__) && \ (__BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__)#error "Unknown endianness!"
drivers/common/cnxk/roc_nix_tm_ops.c +1 -1
@@ -539,7 +539,7 @@ roc_nix_tm_hierarchy_disable(struct roc_nix *roc_nix) node->flags &= ~NIX_TM_NODE_ENABLED ; } -/* Verify sanity of all tx queues */ +/* Verify all tx queues */ for (i =0 ; i < sq_cnt; i++) { sq = nix->sqs[i];if (!sq)
drivers/common/cnxk/roc_npa.c +3 -3
@@ -527,7 +527,7 @@ npa_aura_pool_pair_alloc(struct npa_lf *lf, const uint32_t block_size,char name[PLT_MEMZONE_NAMESIZE ];const struct plt_memzone *mz; -/* Sanity check */ +/* argument checks */ if (!lf || !block_size || !block_count || !pool || !aura || !aura_handle)return NPA_ERR_PARAM ;
@@ -691,7 +691,7 @@ npa_aura_alloc(struct npa_lf *lf, const uint32_t block_count, int pool_id, {int rc, aura_id; -/* Sanity check */ +/* parameter check */ if (!lf || !aura || !aura_handle)return NPA_ERR_PARAM ;
@@ -1178,7 +1178,7 @@ npa_dev_init(struct npa_lf *lf, uintptr_t base, struct mbox *mbox)uint8_t aura_sz;int rc; -/* Sanity checks */ +/* Input checks */ if (!lf || !base || !mbox)return NPA_ERR_PARAM ;
drivers/common/dpaax/caamflib/desc.h +1 -1
@@ -107,7 +107,7 @@ extern enum rta_sec_era rta_sec_era;/* * ONE - should always be set. Combination of ONE (always -* set) and ZRO (always clear) forms an endianness sanity check +* set) and ZRO (always clear) forms an endianness check */ #define HDR_ONE BIT(23)#define HDR_ZRO BIT(15)
drivers/common/mlx5/linux/mlx5_common_os.c +1 -1
@@ -235,7 +235,7 @@ mlx5_get_ifname_sysfs(const char *ibdev_path, char *ifname)/** * Suffix RTE_EAL_PMD_PATH with "-glue". * -* This function performs a sanity check on RTE_EAL_PMD_PATH before +* This function performs a check on RTE_EAL_PMD_PATH before * suffixing its last component. * * @param buf[out]
drivers/common/sfc_efx/base/ef10_nvram.c +2 -2
@@ -595,13 +595,13 @@ tlv_update_partition_len_and_cks(/* * We just modified the partition, so the total length may not be -* valid. Don't use tlv_find(), which performs some sanity checks +* valid. Don't use tlv_find(), which performs some checks * that may fail here. */ partition.data = cursor->block;memcpy (&partition.tlv_cursor, cursor,sizeof (*cursor)); header = (struct tlv_partition_header *)partition.data; -/* Sanity check. */ +/* Header check */ if (__LE_TO_CPU_32 (header->tag) !=TLV_TAG_PARTITION_HEADER ) { rc =EFAULT ; goto fail1;
drivers/common/sfc_efx/base/efx_rx.c +1 -1
@@ -930,7 +930,7 @@ efx_rx_qcreate_internal( ndescs, id, flags, eep, erp)) != 0) goto fail4; -/* Sanity check queue creation result */ +/* Check queue creation result */ if (flags &EFX_RXQ_FLAG_RSS_HASH ) {const efx_rx_prefix_layout_t *erplp = &erp->er_prefix_layout;const efx_rx_prefix_field_info_t *rss_hash_field;
drivers/crypto/bcmfs/hw/bcmfs4_rm.c +3 -3
@@ -317,7 +317,7 @@ bcmfs4_mdst_desc(uint64_t addr, unsigned int length_div_16) }static bool -bcmfs4_sanity_check (struct bcmfs_qp_message *msg) +bcmfs4_message_check (struct bcmfs_qp_message *msg) {unsigned int i =0 ;
@@ -458,8 +458,8 @@ bcmfs4_enqueue_single_request_qp(struct bcmfs_qp *qp, void *op)struct bcmfs_queue *txq = &qp->tx_q;struct bcmfs_qp_message *msg = (struct bcmfs_qp_message *)op; -/* Do sanity check on message */ -if (!bcmfs4_sanity_check (msg)) { +/* Do check on message */ +if (!bcmfs4_message_check (msg)) {BCMFS_DP_LOG (ERR ,"Invalid msg on queue %d" , qp->qpair_id);return -EIO ; }
drivers/crypto/bcmfs/hw/bcmfs5_rm.c +3 -3
@@ -293,7 +293,7 @@ bcmfs5_mdst_desc(uint64_t addr, unsigned int len_div_16) }static bool -bcmfs5_sanity_check (struct bcmfs_qp_message *msg) +bcmfs5_message_check (struct bcmfs_qp_message *msg) {unsigned int i =0 ;
@@ -389,8 +389,8 @@ bcmfs5_enqueue_single_request_qp(struct bcmfs_qp *qp, void *op)struct bcmfs_queue *txq = &qp->tx_q;struct bcmfs_qp_message *msg = (struct bcmfs_qp_message *)op; -/* Do sanity check on message */ -if (!bcmfs5_sanity_check (msg)) { +/* Do check on message */ +if (!bcmfs5_message_check (msg)) {BCMFS_DP_LOG (ERR ,"Invalid msg on queue %d" , qp->qpair_id);return -EIO ; }
drivers/dma/idxd/idxd_pci.c +1 -1
@@ -219,7 +219,7 @@ init_pci_device(struct rte_pci_device *dev, struct idxd_dmadev *idxd, goto err; } -/* sanity check device status */ +/* check device status */ if (pci->regs->gensts &GENSTS_DEV_STATE_MASK ) {/* need function-level-reset (FLR) or is enabled */ IDXD_PMD_ERR ("Device status is not disabled, cannot init" );
drivers/event/opdl/opdl_evdev.c +1 -1
@@ -241,7 +241,7 @@ opdl_queue_setup(struct rte_eventdev *dev,struct opdl_evdev *device =opdl_pmd_priv (dev); -/* Extra sanity check, probably not needed */ +/* Extra check, probably not needed */ if (queue_id ==OPDL_INVALID_QID ) { PMD_DRV_LOG(ERR, "DEV_ID:[%02d] : " "Invalid queue id %u requested",
drivers/event/opdl/opdl_evdev_init.c +1 -1
@@ -300,7 +300,7 @@ static int opdl_add_deps(struct opdl_evdev *device,struct opdl_queue *queue_deps = &device->queue[deps_q_id];struct opdl_stage *dep_stages[OPDL_PORTS_MAX ]; -/* sanity check that all stages are for same opdl ring */ +/* check that all stages are for same opdl ring */ for (i =0 ; i < queue->nb_ports; i++) {struct opdl_ring *r =opdl_stage_get_opdl_ring (stage_for_port (queue, i));
drivers/net/ark/ark_ethdev.c +4 -4
@@ -349,10 +349,10 @@ eth_ark_dev_init(struct rte_eth_dev *dev)ARK_PMD_LOG (NOTICE ,"Arkville HW Commit_ID: %08x\n" ,rte_be_to_cpu_32 (ark->sysctrl.t32[0x20 /4 ])); -/* If HW sanity test fails, return an error */ +/* If HW test fails, return an error */ if (ark->sysctrl.t32[4 ] !=0xcafef00d ) {ARK_PMD_LOG (ERR , -"HW Sanity test has failed, expected constant" +"HW test has failed, expected constant" " 0x%x, read 0x%x (%s)\n" ,0xcafef00d , ark->sysctrl.t32[4 ], __func__);
@@ -360,7 +360,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) }ARK_PMD_LOG (DEBUG , -"HW Sanity test has PASSED, expected constant" +"HW test has PASSED, expected constant" " 0x%x, read 0x%x (%s)\n" ,0xcafef00d , ark->sysctrl.t32[4 ], __func__);
@@ -590,7 +590,7 @@ eth_ark_dev_start(struct rte_eth_dev *dev)rte_thread_t thread;/* Delay packet generator start allow the hardware to be ready -* This is only used for sanity checking with internal generator +* This is only used for checking with internal generator */ char tname[RTE_THREAD_INTERNAL_NAME_SIZE ];snprintf (tname,sizeof (tname),"ark-pg%d" , dev->data->port_id);
drivers/net/ark/ark_ethdev_rx.c +1 -1
@@ -283,7 +283,7 @@ eth_ark_recv_pkts(void *rx_queue, mbuf->pkt_len = meta->pkt_len; mbuf->data_len = meta->pkt_len; -if (ARK_DEBUG_CORE ) {/* debug sanity checks */ +if (ARK_DEBUG_CORE ) {/* debug checks */ if ((meta->pkt_len > (1024 *16 )) || (meta->pkt_len ==0 )) {
drivers/net/bnx2x/bnx2x.c +1 -1
@@ -7816,7 +7816,7 @@ static int bnx2x_check_valid_mf_cfg(struct bnx2x_softc *sc)uint32_t ovlan2;uint8_t i, j; -/* various MF mode sanity checks... */ +/* various MF mode checks... */ if (mf_info->mf_config[SC_VN (sc)] &FUNC_MF_CFG_FUNC_HIDE ) { PMD_DRV_LOG(NOTICE, sc,
drivers/net/bnx2x/bnx2x_stats.c +4 -4
@@ -178,7 +178,7 @@ bnx2x_stats_pmf_update(struct bnx2x_softc *sc)*/ return ; } -/* sanity */ +/* input validation */ if (!sc->port.pmf || !sc->port.port_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -228,7 +228,7 @@ bnx2x_port_stats_init(struct bnx2x_softc *sc)uint32_t mac_addr;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->link_vars.link_up || !sc->port.pmf) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -454,7 +454,7 @@ bnx2x_func_stats_init(struct bnx2x_softc *sc)struct dmae_command *dmae = &sc->stats_dmae;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->func_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
@@ -1277,7 +1277,7 @@ bnx2x_port_stats_base_init(struct bnx2x_softc *sc)struct dmae_command *dmae;uint32_t *stats_comp =BNX2X_SP (sc, stats_comp); -/* sanity */ +/* input validation */ if (!sc->port.pmf || !sc->port.port_stx) {PMD_DRV_LOG (ERR , sc,"BUG!" );return ;
drivers/net/bnx2x/ecore_sp.c +1 -1
@@ -207,7 +207,7 @@ static int ecore_exe_queue_step(struct bnx2x_softc *sc,break ; } -/* Sanity check */ +/* Argument check */ if (!cur_len)return ECORE_SUCCESS ;
drivers/net/bnx2x/elink.c +2 -2
@@ -1088,7 +1088,7 @@ static void elink_get_epio(struct bnx2x_softc *sc, uint32_t epio_pin, {uint32_t epio_mask, gp_oenable; *en =0 ; -/* Sanity check */ +/* Input check */ if (epio_pin >31 ) {ELINK_DEBUG_P1 (sc,"Invalid EPIO pin %d to get" , epio_pin);return ;
@@ -1105,7 +1105,7 @@ static void elink_set_epio(struct bnx2x_softc *sc, uint32_t epio_pin, uint32_t e {uint32_t epio_mask, gp_output, gp_oenable; -/* Sanity check */ +/* Input check */ if (epio_pin >31 ) {ELINK_DEBUG_P1 (sc,"Invalid EPIO pin %d to set" , epio_pin);return ;
drivers/net/bnxt/bnxt_hwrm.c +1 -1
@@ -585,7 +585,7 @@ static int bnxt_hwrm_send_message(struct bnxt *bp, void *msg, done =bnxt_check_cq_hwrm_done (cpr, is_tx, is_rx, i == timeout -1 ); -/* Sanity check on the resp->resp_len */ +/* Input check on the resp->resp_len */ rte_io_rmb ();if (resp->resp_len && resp->resp_len <= bp->max_resp_len) {/* Last byte of resp contains the valid key */
drivers/net/bnxt/hsi_struct_def_dpdk.h +1 -1
@@ -60454,7 +60454,7 @@ struct __rte_packed_begin hwrm_tfc_ident_alloc_output {* Requests the firmware to free a TFC resource identifier. * A resource subtype and session id are passed in. * An identifier (previously allocated) corresponding to all these is -* freed, only after various sanity checks are completed. +* freed, only after various checks are completed. */ /* hwrm_tfc_ident_free_input (size:192b/24B) */ struct __rte_packed_begin hwrm_tfc_ident_free_input {
drivers/net/bonding/rte_eth_bond_8023ad.c +1 -1
@@ -1473,7 +1473,7 @@ bond_8023ad_setup_validate(uint16_t port_id,return -EINVAL ;if (conf !=NULL ) { -/* Basic sanity check */ +/* Basic input check */ if (conf->slow_periodic_ms == 0 || conf->fast_periodic_ms >= conf->slow_periodic_ms || conf->long_timeout_ms == 0 ||
drivers/net/cnxk/cnxk_ethdev.c +2 -2
@@ -659,7 +659,7 @@ cnxk_nix_rx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,struct rte_mempool *lpb_pool = mp;struct rte_mempool *spb_pool =NULL ; -/* Sanity checks */ +/* input checks */ if (rx_conf->rx_deferred_start ==1 ) {plt_err ("Deferred Rx start is not supported" ); goto fail;
@@ -1228,7 +1228,7 @@ cnxk_nix_configure(struct rte_eth_dev *eth_dev) rc = -EINVAL ; -/* Sanity checks */ +/* baseline checks */ if (rte_eal_has_hugepages () ==0 ) {plt_err ("Huge page is not configured" ); goto fail_configure;
drivers/net/cxgbe/cxgbe_ethdev.c +2 -8
@@ -525,10 +525,7 @@ int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, eth_dev->data->tx_queues[queue_idx] = (void *)txq; -/* Sanity Checking -* -* nb_desc should be > 1023 and <= CXGBE_MAX_RING_DESC_SIZE -*/ +/* nb_desc should be > 1023 and <= CXGBE_MAX_RING_DESC_SIZE */ temp_nb_desc = nb_desc;if (nb_desc <CXGBE_MIN_RING_DESC_SIZE ) { dev_warn(adapter, "%s: number of descriptors must be >= %d. Using default [%d]\n",
@@ -649,10 +646,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, eth_dev->data->rx_queues[queue_idx] = (void *)rxq; -/* Sanity Checking -* -* nb_desc should be > 0 and <= CXGBE_MAX_RING_DESC_SIZE -*/ +/* nb_desc should be > 0 and <= CXGBE_MAX_RING_DESC_SIZE */ temp_nb_desc = nb_desc;if (nb_desc <CXGBE_MIN_RING_DESC_SIZE ) { dev_warn(adapter, "%s: number of descriptors must be >= %d. Using default [%d]\n",
drivers/net/cxgbe/cxgbevf_main.c +2 -2
@@ -137,7 +137,7 @@ static int adap_init0vf(struct adapter *adapter)/* * Grab our Virtual Interface resource allocation, extract the -* features that we're interested in and do a bit of sanity testing on +* features that we're interested in and do a bit of testing on * what we discover. */ err =t4vf_get_vfres (adapter);
@@ -148,7 +148,7 @@ static int adap_init0vf(struct adapter *adapter) }/* -* Check for various parameter sanity issues. +* Check for various parameter issues. */ if (adapter->params.vfres.pmask ==0 ) { dev_err(adapter->pdev_dev, "no port access configured\n"
drivers/net/intel/fm10k/fm10k_ethdev.c +1 -1
@@ -1760,7 +1760,7 @@ mempool_element_size_valid(struct rte_mempool *mp)/* account for up to 512B of alignment */ min_size -=FM10K_RX_DATABUF_ALIGN ; -/* sanity check for overflow */ +/* check for overflow */ if (min_size > mp->elt_size)return 0 ;
drivers/net/intel/fm10k/fm10k_rxtx.c +1 -1
@@ -646,7 +646,7 @@ fm10k_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,if (q->nb_free < mb->nb_segs)break ; -/* sanity check to make sure the mbuf is valid */ +/* check to make sure the mbuf is valid */ if ((mb->nb_segs ==0 ) || ((mb->nb_segs >1 ) && (mb->next ==NULL )))break ;
drivers/net/intel/ixgbe/ixgbe_fdir.c +1 -1
@@ -1131,7 +1131,7 @@ ixgbe_fdir_filter_program(struct rte_eth_dev *dev,return -ENOTSUP ;/* -* Sanity check for x550. +* Check for x550. * When adding a new filter with flow type set to IPv4, * the flow director mask should be configed before, * and the L4 protocol and ports are masked.
drivers/net/intel/ixgbe/ixgbe_ipsec.c +1 -1
@@ -615,7 +615,7 @@ ixgbe_crypto_enable_ipsec(struct rte_eth_dev *dev) rx_offloads = dev->data->dev_conf.rxmode.offloads; tx_offloads = dev->data->dev_conf.txmode.offloads; -/* sanity checks */ +/* input validation */ if (rx_offloads &RTE_ETH_RX_OFFLOAD_TCP_LRO ) {PMD_DRV_LOG (ERR ,"RSC and IPsec not supported" );return -1 ;
drivers/net/intel/ixgbe/ixgbe_rxtx.c +1 -1
@@ -4971,7 +4971,7 @@ ixgbe_set_rsc(struct rte_eth_dev *dev)uint32_t rdrxctl;uint32_t rfctl; -/* Sanity check */ +/* Offload check */ dev->dev_ops->dev_infos_get (dev, &dev_info);if (dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_TCP_LRO ) rsc_capable = true;
drivers/net/mlx4/mlx4.c +1 -1
@@ -1216,7 +1216,7 @@ static struct rte_pci_driver mlx4_driver = {/** * Suffix RTE_EAL_PMD_PATH with "-glue". * -* This function performs a sanity check on RTE_EAL_PMD_PATH before +* This function performs a check on RTE_EAL_PMD_PATH before * suffixing its last component. * * @param buf[out]
drivers/net/mlx4/mlx4_flow.c +3 -3
@@ -514,7 +514,7 @@ mlx4_flow_merge_tcp(struct rte_flow *flow, }/** -* Perform basic sanity checks on a pattern item. +* Perform basic checks on a pattern item. * * @param[in] item * Item specification.
@@ -730,7 +730,7 @@ mlx4_flow_prepare(struct mlx4_priv *priv, goto exit_item_not_supported; proc = next;/* -* Perform basic sanity checks only once, while handle is +* Perform basic checks only once, while handle is * not allocated. */ if (flow == &temp) {
@@ -799,7 +799,7 @@ mlx4_flow_prepare(struct mlx4_priv *priv, rss_key = mlx4_rss_hash_key_default; rss_key_len =MLX4_RSS_HASH_KEY_SIZE ; } -/* Sanity checks. */ +/* Input checks. */ for (i =0 ; i < rss->queue_num; ++i)if (rss->queue[i] >=ETH_DEV (priv)->data->nb_rx_queues)
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -9227,7 +9227,7 @@ flow_dv_prepare(struct rte_eth_dev *dev,#ifdef RTE_LIBRTE_MLX5_DEBUG /** -* Sanity check for match mask and value. Similar to check_valid_spec() in +* Check for match mask and value. Similar to check_valid_spec() in * kernel driver. If unmasked bit is present in value, it returns failure. * * @param match_mask
drivers/net/mlx5/mlx5_flow_hw.c +2 -4
@@ -9797,11 +9797,10 @@ flow_hw_tx_tag_regc_mask(struct rte_eth_dev *dev)struct mlx5_priv *priv = dev->data->dev_private;uint32_t mask = priv->sh->dv_regc0_mask; -/* Mask is verified during device initialization. Sanity checking here. */ +/* Mask is verified during device initialization. */ MLX5_ASSERT (mask !=0 );/* * Availability of sufficient number of bits in REG_C_0 is verified on initialization. -* Sanity checking here. */ MLX5_ASSERT (rte_popcount32 (mask) >=rte_popcount32 (priv->vport_meta_mask));return mask;
@@ -9813,12 +9812,11 @@ flow_hw_tx_tag_regc_value(struct rte_eth_dev *dev)struct mlx5_priv *priv = dev->data->dev_private;uint32_t tag; -/* Mask is verified during device initialization. Sanity checking here. */ +/* Mask is verified during device initialization. */ MLX5_ASSERT (priv->vport_meta_mask !=0 ); tag = priv->vport_meta_tag >> (rte_bsf32 (priv->vport_meta_mask));/* * Availability of sufficient number of bits in REG_C_0 is verified on initialization. -* Sanity checking here. */ MLX5_ASSERT ((tag & priv->sh->dv_regc0_mask) == tag);return tag;
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -1488,7 +1488,7 @@ mlx5_mprq_alloc_mp(struct rte_eth_dev *dev) desc *=4 ; obj_num = desc +MLX5_MPRQ_MP_CACHE_SZ * n_ibv;/* -* rte_mempool_create_empty() has sanity check to refuse large cache +* rte_mempool_create_empty() has basic check to refuse large cache * size compared to the number of elements. * CALC_CACHE_FLUSHTHRESH() is defined in a C file, so using a * constant number 2 instead.
drivers/net/mlx5/mlx5_rxtx_vec.h +1 -1
@@ -21,7 +21,7 @@ RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)/* -* Compile time sanity check for vectorized functions. +* Compile time checks for vectorized functions. */ #define S_ASSERT_RTE_MBUF (s) \
drivers/net/mvpp2/mrvl_qos.c +1 -1
@@ -260,7 +260,7 @@ get_entry_values(const char *entry, uint8_t *tab,if (nb_rng_tokens !=2 )return -3 ; -/* Range and sanity checks. */ +/* Range and input checks. */ if (get_val_securely (rng_tokens[0 ], &token_val) <0 )return -4 ; beg = (char )token_val;
drivers/net/nfp/flower/nfp_flower_flow.c +1 -1
@@ -2769,7 +2769,7 @@ nfp_flow_compile_item_proc(struct nfp_flower_representor *repr,break ; } -/* Perform basic sanity checks */ +/* Perform basic checks */ ret =nfp_flow_item_check (item, proc);if (ret !=0 ) {PMD_DRV_LOG (ERR ,"NFP flow item %d check failed." , item->type);
drivers/net/nfp/nfp_net_flow.c +1 -1
@@ -528,7 +528,7 @@ nfp_net_flow_compile_items(const struct rte_flow_item items[],break ; } -/* Perform basic sanity checks */ +/* Perform basic checks */ ret =nfp_net_flow_item_check (item, proc);if (ret !=0 ) {PMD_DRV_LOG (ERR ,"NFP flow item %d check failed." , item->type);
drivers/net/ntnic/nthw/nthw_rac.c +1 -1
@@ -76,7 +76,7 @@ int nthw_rac_init(nthw_rac_t *p, nthw_fpga_t *p_fpga, struct fpga_info_s *p_fpga p->mn_fld_rab_init_bw =nthw_field_get_bit_width (p->mp_fld_rab_init); p->mn_fld_rab_init_mask =nthw_field_get_mask (p->mp_fld_rab_init); -/* RAC_RAB_INIT_RAB reg/field sanity checks: */ +/* make sure RAC_RAB_INIT_RAB reg/field is valid */ RTE_ASSERT (p->mn_fld_rab_init_mask == ((1UL << p->mn_fld_rab_init_bw) -1 ));RTE_ASSERT (p->mn_fld_rab_init_bw == p->mn_param_rac_rab_interfaces);
drivers/net/qede/qede_rxtx.c +3 -3
@@ -1383,7 +1383,7 @@ qede_rx_process_tpa_end_cqe(struct qede_dev *qdev, cqe->len_list[0]);/* Update total length and frags based on end TPA */ rx_mb = rxq->tpa_info[cqe->tpa_agg_index].tpa_head; -/* TODO: Add Sanity Checks */ +/* TODO: Add more checks */ rx_mb->nb_segs = cqe->num_of_bds; rx_mb->pkt_len = cqe->total_packet_len;
@@ -2211,7 +2211,7 @@ qede_xmit_prep_pkts(__rte_unused void *p_txq, struct rte_mbuf **tx_pkts,#ifdef RTE_LIBRTE_QEDE_DEBUG_TX static inline void -qede_mpls_tunn_tx_sanity_check (struct rte_mbuf *mbuf, +qede_mpls_tunn_tx_basic_check (struct rte_mbuf *mbuf,struct qede_tx_queue *txq) {if (((mbuf->outer_l2_len + mbuf->outer_l3_len) /2 ) >0xff )
@@ -2473,7 +2473,7 @@ qede_xmit_pkts(void *p_txq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) RTE_MBUF_F_TX_TUNNEL_MPLSINUDP) { mplsoudp_flg = true;#ifdef RTE_LIBRTE_QEDE_DEBUG_TX -qede_mpls_tunn_tx_sanity_check (mbuf, txq); +qede_mpls_tunn_tx_basic_check (mbuf, txq);#endif /* Outer L4 offset in two byte words */ tunn_l4_hdr_start_offset =
drivers/net/ring/rte_eth_ring.c +2 -5
@@ -34,7 +34,7 @@ struct ring_internal_args {struct rte_ring *const *tx_queues;const unsigned int nb_tx_queues;const unsigned int numa_node; -void *addr;/* self addr for sanity check */ +void *addr;/* self addr for verification */ };enum dev_action {
@@ -612,10 +612,7 @@ static int parse_kvlist(const char *key __rte_unused, *action ='\0' ; action++; -/* -* Need to do some sanity checking here -*/ - +/* Check the command argument is valid action */ if (strcmp (action,ETH_RING_ACTION_ATTACH ) ==0 ) info->list[info->count].action =DEV_ATTACH ;else if (strcmp (action,ETH_RING_ACTION_CREATE ) ==0 )
drivers/net/sfc/sfc_dp_rx.h +1 -1
@@ -59,7 +59,7 @@ struct sfc_dp_rx_qcreate_info {/** * Maximum number of Rx descriptors completed in one Rx event. -* Just for sanity checks if datapath would like to do. +* Checks if datapath would like to do. */ unsigned int batch_max;
drivers/net/txgbe/txgbe_ipsec.c +1 -1
@@ -595,7 +595,7 @@ txgbe_crypto_enable_ipsec(struct rte_eth_dev *dev) rx_offloads = dev->data->dev_conf.rxmode.offloads; tx_offloads = dev->data->dev_conf.txmode.offloads; -/* sanity checks */ +/* offload checks */ if (rx_offloads &RTE_ETH_RX_OFFLOAD_TCP_LRO ) {PMD_DRV_LOG (ERR ,"RSC and IPsec not supported" );return -1 ;
drivers/net/txgbe/txgbe_rxtx.c +1 -1
@@ -4280,7 +4280,7 @@ txgbe_set_rsc(struct rte_eth_dev *dev)uint32_t rdrxctl;uint32_t rfctl; -/* Sanity check */ +/* Offload check */ dev->dev_ops->dev_infos_get (dev, &dev_info);if (dev_info.rx_offload_capa &RTE_ETH_RX_OFFLOAD_TCP_LRO ) rsc_capable = true;
Signature · 1 line
2.47.2
Re: [PATCH v12 10/10] drivers: remove use of term sanity check
Quoted 4 lines · Stephen Hemminger
Don't use term "sanity" because it is considered derogatory.
Signed-off-by Stephen Hemminger <[email protected]>Acked-by Hemant Agrawal <[email protected]>
For sfc:
Re: [PATCH v12 00/10] replace use of term sanity check
In reply to Stephen HemmingerHi Stephen,
I was testing Grout on one of our baremetal servers today while DTS was running at the same time (this was an accident - I thought I had it marked offline in our CI system). Unfortunately as a result DTS conflicted with Grout which was using the same mellanox card, and a false fail was reported for this testsuite.
I will trigger a rerun and the false failure will be overwritten within a couple hours.
Thanks for your patience.
Quoted 122 lines · Stephen Hemminger
Remove use of expression sanity check across DPDK drivers and documentation.
The term sanity-check is on the Tier 2 word list from the Inclusive Naming project.
https://inclusivenaming.org/word-lists/tier-2/sanity-check/Rationale
This term might be derogatory to neurodiverse people. Jargon, such as “sanity test”, is difficult to translate and is
difficult
to understand by readers whose first language is not English.v12 - rebase on 25.07
mark old mbuf API functions as deprecatedStephen Hemminger (10):
mbuf: replace term sanity check
net/avp: replace use ofrte_mbuf_sanity_checknet/sfc: replace use ofrte_mbuf_sanity_check
examples: remove term sanity
eal: replace use of sanity check in comments and messages
test: replace use word sanity
dts: replace use of sanity check in comment
doc: remove sanity
lib: replace use of sanity check in comments and
drivers: remove use of term sanity checkapp/test/test_bitmap.c | 4 +- app/test/test_bpf.c | 6 +- app/test/test_common.c | 2 +- app/test/test_cryptodev.c | 2 +- app/test/test_distributor.c | 46 +++++------ app/test/test_eal_flags.c | 20 ++--- app/test/test_hash.c | 2 +- app/test/test_interrupts.c | 9 ++- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_mbuf.c | 30 +++---- app/test/test_rawdev.c | 2 +- app/test/test_timer.c | 10 +-- doc/guides/gpus/cuda.rst | 2 +- doc/guides/prog_guide/mbuf_lib.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 3 + .../sample_app_ug/eventdev_pipeline.rst | 2 +- doc/guides/tools/testbbdev.rst | 8 +- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 2 +- drivers/common/cnxk/roc_nix_tm_ops.c | 2 +- drivers/common/cnxk/roc_npa.c | 6 +- drivers/common/dpaax/caamflib/desc.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/sfc_efx/base/ef10_nvram.c | 4 +- drivers/common/sfc_efx/base/efx_rx.c | 2 +- drivers/crypto/bcmfs/hw/bcmfs4_rm.c | 6 +- drivers/crypto/bcmfs/hw/bcmfs5_rm.c | 6 +- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/net/ark/ark_ethdev.c | 8 +- drivers/net/ark/ark_ethdev_rx.c | 2 +- drivers/net/avp/avp_ethdev.c | 18 ++--- drivers/net/bnx2x/bnx2x.c | 2 +- drivers/net/bnx2x/bnx2x_stats.c | 8 +- drivers/net/bnx2x/ecore_sp.c | 2 +- drivers/net/bnx2x/elink.c | 4 +- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bnxt/hsi_struct_def_dpdk.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/cnxk/cnxk_ethdev.c | 4 +- drivers/net/cxgbe/cxgbe_ethdev.c | 10 +-- drivers/net/cxgbe/cxgbevf_main.c | 4 +- drivers/net/intel/fm10k/fm10k_ethdev.c | 2 +- drivers/net/intel/fm10k/fm10k_rxtx.c | 2 +- drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/intel/ixgbe/ixgbe_ipsec.c | 2 +- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 6 +- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_flow_hw.c | 6 +- drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx_vec.h | 2 +- drivers/net/mvpp2/mrvl_qos.c | 2 +- drivers/net/nfp/flower/nfp_flower_flow.c | 2 +- drivers/net/nfp/nfp_net_flow.c | 2 +- drivers/net/ntnic/nthw/nthw_rac.c | 2 +- drivers/net/qede/qede_rxtx.c | 6 +- drivers/net/ring/rte_eth_ring.c | 7 +- drivers/net/sfc/sfc_dp_rx.h | 2 +- drivers/net/sfc/sfc_ef100_rx.c | 6 +- drivers/net/sfc/sfc_ef10_essb_rx.c | 4 +- drivers/net/sfc/sfc_ef10_rx.c | 4 +- drivers/net/sfc/sfc_rx.c | 2 +- drivers/net/txgbe/txgbe_ipsec.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 2 +- dts/tests/TestSuite_blocklist.py | 2 +- examples/ipsec-secgw/event_helper.c | 2 +- examples/ipv4_multicast/main.c | 2 +- examples/qos_sched/args.c | 2 +- lib/eal/common/eal_common_memory.c | 2 +- lib/eal/common/eal_common_proc.c | 3 +- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_memcfg.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/linux/eal.c | 2 +- lib/eal/linux/eal_timer.c | 2 +- lib/eal/windows/eal.c | 2 +- lib/graph/graph.c | 2 +- lib/graph/graph_stats.c | 2 +- lib/graph/node.c | 2 +- lib/jobstats/rte_jobstats.c | 6 +- lib/mbuf/rte_mbuf.c | 23 ++++-- lib/mbuf/rte_mbuf.h | 79 ++++++++++--------- lib/mbuf/version.map | 1 + lib/metrics/rte_metrics.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 88 files changed, 244 insertions(+), 235 deletions(-)--
2.47.2