replace use of rte_memcpy() with fixed size
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest32 patches 5 repliesIn review
- v430 patches 4 repliesSuperseded
- v330 patches 5 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 71 patches | 18 replies | Superseded | |
| v1 | 71 patches | 7 replies | Superseded |
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/32 | cocci/rte_memcpy: add script to eliminate fixed size rte_memcpydevtools/ | +11 | 0 replies | |
| 2/32 | eal: replace use of fixed size rte_memcpylib/ | +3 | 0 replies | |
| 3/32 | ethdev: replace uses of rte_memcpylib/ lib/ | +53 | 0 replies | |
| 4/32 | eventdev: replace use of fixed size rte_memcpylib/ lib/ lib/ | +4 | 0 replies | |
| 5/32 | cryptodev: replace use of fixed size rte_memcpylib/ | +1 | 0 replies | |
| 6/32 | ip_frag: replace use of fixed size rte_memcpylib/ lib/ | +3 | 0 replies | |
| 7/32 | net: replace use of fixed size rte_memcpylib/ | +1 | 0 replies | |
| 8/32 | lpm: replace use of fixed size rte_memcpylib/ | +1 | 0 replies | |
| 9/32 | node: replace use of fixed size rte_memcpylib/ | +4 | 0 replies | |
| 10/32 | pdcp: replace use of fixed size rte_memcpylib/ | +18 | 0 replies | |
| 11/32 | pipeline: replace use of fixed size rte_memcpylib/ | +4 | 0 replies | |
| 12/32 | rib: replace use of fixed size rte_memcpylib/ lib/ | +4 | 0 replies | |
| 13/32 | security: replace use of fixed size rte_memcpylib/ | +2 | 0 replies | |
| 14/32 | bus: remove unneeded rte_memcpy.h includedrivers/ drivers/ drivers/ +4 more | +0 | 0 replies | |
| 15/32 | raw: replace use of fixed size rte_memcpydrivers/ drivers/ drivers/ +4 more | +15 | 0 replies | |
| 16/32 | baseband: replace use of fixed size rte_memcpydrivers/ drivers/ drivers/ | +19 | 1 reply | |
| 17/32 | common: replace use of fixed size rte_memcpydrivers/ drivers/ drivers/ +1 more | +16 | 0 replies | |
| 18/32 | crypto: replace use of fixed size rte_memcpydrivers/ drivers/ drivers/ +5 more | +44 | 0 replies | |
| 19/32 | event: replace use of fixed size rte_memcpydrivers/ drivers/ drivers/ +6 more | +9 | 0 replies | |
| 20/32 | mempool: replace use of fixed size rte_memcpydrivers/ drivers/ | +4 | 0 replies | |
| 21/32 | ml/cnxk: replace use of fixed size rte_memcpydrivers/ drivers/ drivers/ +2 more | +23 | 0 replies | |
| 22/32 | app/test-pmd: replace use of fixed size rte_memcpyapp/ app/ app/ +8 more | +40 | 0 replies | |
| 23/32 | app/graph: replace use of fixed size rte_memcpyapp/ | +4 | 0 replies | |
| 24/32 | app/test-eventdev: replace use of fixed size rte_memcpyapp/ | +7 | 0 replies | |
| 25/32 | app/test: replace use of fixed size rte_memcpyapp/ app/ app/ +17 more | +46 | 0 replies | |
| 26/32 | app/test-pipeline: remove unused rte_memcpy.h includeapp/ app/ app/ +1 more | +0 | 0 replies | |
| 27/32 | app/test-bbdev: remove unnecessary include of rte_memcpy.happ/ | +0 | 0 replies | |
| 28/32 | examples: replace use of fixed size rte_memcpyexamples/ examples/ examples/ +21 more | +18 | 0 replies | |
| 29/32 | net/null: replace use of fixed size memcpydrivers/ | +3 | 0 replies | |
| 30/32 | net/tap: replace use of fixed size rte_memcpydrivers/ | +7 | 0 replies | |
| 31/32 | net/pcap: replace use of fixed size rte_memcpydrivers/ drivers/ drivers/ | +3 | 0 replies | |
| 32/32 | net/af_xdp:: replace use of fixed size rte_memcpydrivers/ | +1 | 0 replies |
Reviews trailers per patch
2 of 32 patches have a Reviewed-by or Acked-by.
| Patch | Hemant Agrawal |
|---|---|
| 1/32 | |
| 2/32 | |
| 3/32 | |
| 4/32 | |
| 5/32 | |
| 6/32 | |
| 7/32 | |
| 8/32 | |
| 9/32 | |
| 10/32 | |
| 11/32 | |
| 12/32 | |
| 13/32 | |
| 14/32 | |
| 15/32 | |
| 16/32 | |
| 17/32 | |
| 18/32 | A-b |
| 19/32 | |
| 20/32 | A-b |
| 21/32 | |
| 22/32 | |
| 23/32 | |
| 24/32 | |
| 25/32 | |
| 26/32 | |
| 27/32 | |
| 28/32 | |
| 29/32 | |
| 30/32 | |
| 31/32 | |
| 32/32 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 00/32] replace use of rte_memcpy() with fixed size
The DPDK has a lot of unnecessary usage of rte_memcpy. This patch set replaces cases where rte_memcpy is used with a fixed size constant size.
Typical example is:
rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN); which can be replaced with: memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN);
This does not change the resulting binary on almost all architectures because x86 version of intrisics and glibc are the same, and other architectures were using __builtin_constant_p().
The main benefit is that analysis tools like fortify, Coverity, and ASAN analyzers can check these memcpy's. A recent example is that on Ubuntu 22.04 detected undefined use of memcpy such as:
memcpy(dst, NULL, 0)
The first patch is a simple coccinelle script to do the replacement and the rest are the results broken out by module. The script can be used again to make sure more bad usage doesn't creep in with new drivers.
v5 - rebase and fix a couple of the SW drivers.
rewording of commit messages
v4 - replace other unnecessary rte_memcpy in ethdev.
replace memcpy with structure assignment where possible. fixup formatting in a couple places.
v3 - rebase and rerun coccinelle script on 24.03
- consolidate patches by subtree
- remove inclusion of rte_memcpy.h when no longer used.
Stephen Hemminger (32):
cocci/rte_memcpy: add script to eliminate fixed size rte_memcpy
eal: replace use of fixed size rte_memcpy
ethdev: replace uses of rte_memcpy
eventdev: replace use of fixed size rte_memcpy
cryptodev: replace use of fixed size rte_memcpy
ip_frag: replace use of fixed size rte_memcpy
net: replace use of fixed size rte_memcpy
lpm: replace use of fixed size rte_memcpy
node: replace use of fixed size rte_memcpy
pdcp: replace use of fixed size rte_memcpy
pipeline: replace use of fixed size rte_memcpy
rib: replace use of fixed size rte_memcpy
security: replace use of fixed size rte_memcpy
bus: remove unneeded rte_memcpy.h include
raw: replace use of fixed size rte_memcpy baseband: replace use of fixed size rte_memcpy common: replace use of fixed size rte_memcpy crypto: replace use of fixed size rte_memcpy event: replace use of fixed size rte_memcpy mempool: replace use of fixed size rte_memcpy ml/cnxk: replace use of fixed size rte_memcpy app/test-pmd: replace use of fixed size rte_memcpy app/graph: replace use of fixed size rte_memcpy app/test-eventdev: replace use of fixed size rte_memcpy app/test: replace use of fixed size rte_memcpy app/test-pipeline: remove unused rte_memcpy.h include app/test-bbdev: remove unnecessary include of rte_memcpy.h examples: replace use of fixed size rte_memcpy net/null: replace use of fixed size memcpy net/tap: replace use of fixed size rte_memcpy net/pcap: replace use of fixed size rte_memcpy net/af_xdp:: replace use of fixed size rte_memcpy
app/graph/neigh.c | 8 +- app/test-bbdev/test_bbdev.c | 1 - app/test-eventdev/test_pipeline_common.c | 19 ++-- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - app/test-pmd/cmdline.c | 48 ++++----- app/test-pmd/cmdline_flow.c | 24 ++--- app/test-pmd/config.c | 8 +- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - app/test/commands.c | 1 - app/test/packet_burst_generator.c | 4 +- app/test/test_crc.c | 5 +- app/test/test_cryptodev.c | 18 ++-- app/test/test_cryptodev_asym.c | 1 - app/test/test_cryptodev_security_pdcp.c | 1 - app/test/test_efd.c | 1 - app/test/test_efd_perf.c | 1 - app/test/test_event_crypto_adapter.c | 12 +-- app/test/test_event_dma_adapter.c | 4 +- app/test/test_eventdev.c | 1 - app/test/test_ipsec.c | 6 +- app/test/test_link_bonding_mode4.c | 8 +- app/test/test_mbuf.c | 1 - app/test/test_member.c | 1 - app/test/test_member_perf.c | 1 - app/test/test_rawdev.c | 1 - app/test/test_security_inline_proto.c | 36 +++---- app/test/test_service_cores.c | 1 - app/test/virtual_pmd.c | 3 +- devtools/cocci/rte_memcpy.cocci | 11 ++ drivers/baseband/acc/rte_acc100_pmd.c | 16 ++- drivers/baseband/acc/rte_vrb_pmd.c | 21 ++-- drivers/baseband/la12xx/bbdev_la12xx.c | 4 +- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/common/idpf/idpf_common_device.c | 4 +- drivers/common/idpf/idpf_common_virtchnl.c | 10 +- drivers/common/qat/qat_qp.c | 10 +- drivers/compress/qat/qat_comp.c | 8 +- drivers/crypto/ccp/ccp_crypto.c | 14 +-- drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 +- drivers/crypto/qat/qat_sym_session.c | 52 +++++---- .../scheduler/rte_cryptodev_scheduler.c | 6 +- drivers/crypto/scheduler/scheduler_failover.c | 12 +-- drivers/event/cnxk/cnxk_eventdev_selftest.c | 1 - drivers/event/cnxk/cnxk_tim_evdev.c | 4 +- drivers/event/dlb2/dlb2.c | 4 +- drivers/event/dpaa/dpaa_eventdev.c | 1 - drivers/event/dpaa2/dpaa2_eventdev.c | 7 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 1 - drivers/event/dpaa2/dpaa2_hw_dpcon.c | 1 - drivers/event/octeontx/ssovf_evdev_selftest.c | 1 - drivers/event/octeontx/timvf_evdev.c | 4 +- drivers/mempool/dpaa/dpaa_mempool.c | 4 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 5 +- drivers/ml/cnxk/cn10k_ml_model.c | 8 +- drivers/ml/cnxk/cn10k_ml_ops.c | 11 +- drivers/ml/cnxk/cnxk_ml_ops.c | 2 +- drivers/ml/cnxk/mvtvm_ml_model.c | 8 +- drivers/ml/cnxk/mvtvm_ml_ops.c | 8 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/null/rte_eth_null.c | 6 +- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pcap/pcap_osdep_freebsd.c | 2 +- drivers/net/pcap/pcap_osdep_linux.c | 2 +- drivers/net/tap/rte_eth_tap.c | 14 +-- drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +- drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +- drivers/raw/ifpga/afu_pmd_n3000.c | 8 +- drivers/raw/ifpga/ifpga_rawdev.c | 11 +- drivers/raw/skeleton/skeleton_rawdev.c | 8 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 1 - examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 1 - examples/ip_fragmentation/main.c | 1 - examples/ip_reassembly/main.c | 1 - examples/ipv4_multicast/main.c | 1 - examples/l2fwd-cat/cat.c | 4 +- examples/l2fwd-jobstats/main.c | 1 - examples/l2fwd-keepalive/main.c | 1 - examples/l2fwd-macsec/main.c | 1 - examples/l2fwd/main.c | 1 - examples/l3fwd-power/main.c | 1 - examples/l3fwd/main.c | 1 - examples/link_status_interrupt/main.c | 1 - .../client_server_mp/mp_server/init.c | 1 - .../client_server_mp/mp_server/main.c | 1 - examples/multi_process/symmetric_mp/main.c | 1 - examples/ptpclient/ptpclient.c | 11 +- examples/qos_sched/app_thread.c | 1 - examples/qos_sched/main.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/vhost/main.c | 6 +- examples/vmdq/main.c | 7 +- examples/vmdq_dcb/main.c | 15 +-- lib/cryptodev/rte_cryptodev.c | 2 +- lib/eal/common/eal_common_options.c | 7 +- lib/ethdev/rte_ethdev.c | 12 +-- lib/ethdev/rte_flow.c | 101 +++++++++--------- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_dma_adapter.c | 4 +- lib/eventdev/rte_event_timer_adapter.c | 2 +- lib/fib/trie.c | 2 +- lib/ip_frag/rte_ipv6_fragmentation.c | 4 +- lib/ip_frag/rte_ipv6_reassembly.c | 6 +- lib/lpm/rte_lpm6.c | 3 +- lib/net/rte_ether.c | 2 +- lib/node/ip6_lookup.c | 8 +- lib/pdcp/pdcp_process.c | 36 +++---- lib/pipeline/rte_table_action.c | 8 +- lib/rib/rte_rib6.h | 5 +- lib/security/rte_security.c | 4 +- 131 files changed, 368 insertions(+), 450 deletions(-) create mode 100644 devtools/cocci/rte_memcpy.cocci
Signature · 1 line
2.43.0