mbox series

[00/15] prefix network structures

Message ID 20190521161315.25500-1-olivier.matz@6wind.com (mailing list archive)
Headers
Series prefix network structures |

Message

Olivier Matz May 21, 2019, 4:13 p.m. UTC
  The rte_net headers conflict with the libc headers, because
some definitions are duplicated, sometimes with few differences.

This patchset adds the rte_ (or RTE_) prefix to all structures, functions
and defines in rte_net library. This is a big changeset, that will
break the API of many functions, but not the ABI.

This was discussed in [1], and requested by the techboard [2].

patch-v1:
* rease on top of v19.05
* remove uneeded renames in drivers/net/bonding/rte_eth_bond_pmd.c
  and app/test-pmd/icmpecho.c (arp-related variables)
* do not modify base drivers, except cxgbe, thunderx, enetc, qede:
  only files that already contain dpdk definitions are modified.
* fix checkpatch issues when it does not impact the code style too
  much. Big warnings remain about the RTE_IPv4() macros because
  arguments are separated by ',' instead of ', '.
* add a release note patch
* tested compilation on x86_64-linux and x86_64-freebsd.

rfc-v2:
* rebase on top of v19.05-rc1


[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.html


Olivier Matz (15):
  net: add rte prefix to arp structures
  net: add rte prefix to arp defines
  net: add rte prefix to ether structures
  net: add rte prefix to ether functions
  net: add rte prefix to ether defines
  net: add rte prefix to esp structure
  net: add rte prefix to gre structure
  net: add rte prefix to icmp structure
  net: add rte prefix to icmp defines
  net: add rte prefix to ip structure
  net: add rte prefix to ip defines
  net: add rte prefix to sctp structure
  net: add rte prefix to tcp structure
  net: add rte prefix to udp structure
  doc: announce network api change

 app/pdump/main.c                                   |   2 +-
 app/test-acl/main.c                                |   2 +-
 app/test-eventdev/test_perf_common.c               |   2 +-
 app/test-eventdev/test_pipeline_common.c           |   2 +-
 app/test-pipeline/pipeline_acl.c                   |  19 +-
 app/test-pipeline/pipeline_hash.c                  |  12 +-
 app/test-pmd/cmdline.c                             |  90 +++---
 app/test-pmd/cmdline_flow.c                        |  86 +++---
 app/test-pmd/config.c                              |  35 ++-
 app/test-pmd/csumonly.c                            | 169 +++++-----
 app/test-pmd/flowgen.c                             |  30 +-
 app/test-pmd/icmpecho.c                            | 117 +++----
 app/test-pmd/ieee1588fwd.c                         |  18 +-
 app/test-pmd/macfwd.c                              |  12 +-
 app/test-pmd/macswap.h                             |  12 +-
 app/test-pmd/macswap_common.h                      |   4 +-
 app/test-pmd/macswap_neon.h                        |  12 +-
 app/test-pmd/macswap_sse.h                         |  12 +-
 app/test-pmd/parameters.c                          |   6 +-
 app/test-pmd/testpmd.c                             |  23 +-
 app/test-pmd/testpmd.h                             |  30 +-
 app/test-pmd/txonly.c                              |  45 +--
 app/test-pmd/util.c                                |  34 +-
 app/test/packet_burst_generator.c                  | 150 ++++-----
 app/test/packet_burst_generator.h                  |  33 +-
 app/test/test_acl.c                                |   8 +-
 app/test/test_acl.h                                | 122 ++++----
 app/test/test_cmdline_etheraddr.c                  |  16 +-
 app/test/test_efd.c                                |  20 +-
 app/test/test_event_eth_rx_adapter.c               |   2 +-
 app/test/test_event_eth_tx_adapter.c               |   2 +-
 app/test/test_flow_classify.c                      |  70 +++--
 app/test/test_hash.c                               |  20 +-
 app/test/test_ipsec.c                              |  13 +-
 app/test/test_link_bonding.c                       | 342 ++++++++++++---------
 app/test/test_link_bonding_mode4.c                 | 124 ++++----
 app/test/test_link_bonding_rssconf.c               |   6 +-
 app/test/test_lpm.c                                |  76 ++---
 app/test/test_lpm_perf.c                           |  10 +-
 app/test/test_member.c                             |  20 +-
 app/test/test_pmd_perf.c                           |  20 +-
 app/test/test_sched.c                              |  24 +-
 app/test/test_table_acl.c                          |   8 +-
 app/test/test_thash.c                              |  12 +-
 app/test/virtual_pmd.c                             |   6 +-
 app/test/virtual_pmd.h                             |   2 +-
 doc/guides/nics/kni.rst                            |   2 +-
 doc/guides/prog_guide/bbdev.rst                    |   6 +-
 .../prog_guide/packet_classif_access_ctrl.rst      |  18 +-
 doc/guides/prog_guide/rte_flow.rst                 |   4 +-
 doc/guides/rel_notes/deprecation.rst               |   4 -
 doc/guides/rel_notes/release_19_08.rst             |   3 +
 doc/guides/sample_app_ug/flow_classify.rst         |  28 +-
 doc/guides/sample_app_ug/flow_filtering.rst        |   6 +-
 doc/guides/sample_app_ug/ip_frag.rst               |  16 +-
 doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +-
 doc/guides/sample_app_ug/ipv4_multicast.rst        |  16 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   6 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |   6 +-
 doc/guides/sample_app_ug/l3_forward.rst            |  12 +-
 doc/guides/sample_app_ug/link_status_intr.rst      |   6 +-
 doc/guides/sample_app_ug/ptpclient.rst             |   6 +-
 doc/guides/sample_app_ug/rxtx_callbacks.rst        |   2 +-
 doc/guides/sample_app_ug/server_node_efd.rst       |  12 +-
 doc/guides/sample_app_ug/skeleton.rst              |   4 +-
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   4 +-
 drivers/bus/dpaa/include/compat.h                  |   2 +
 drivers/bus/dpaa/include/fman.h                    |   2 +-
 drivers/bus/dpaa/include/netcfg.h                  |   4 +-
 drivers/net/af_packet/rte_eth_af_packet.c          |   2 +-
 drivers/net/af_xdp/rte_eth_af_xdp.c                |   8 +-
 drivers/net/ark/ark_ethdev.c                       |  19 +-
 drivers/net/ark/ark_ext.h                          |   4 +-
 drivers/net/ark/ark_global.h                       |   5 +-
 drivers/net/atlantic/atl_ethdev.c                  |  27 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils.c         |   8 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c    |   4 +-
 drivers/net/avp/avp_ethdev.c                       |  21 +-
 drivers/net/avp/rte_avp_common.h                   |   2 +-
 drivers/net/axgbe/axgbe_dev.c                      |   4 +-
 drivers/net/axgbe/axgbe_ethdev.c                   |  10 +-
 drivers/net/axgbe/axgbe_ethdev.h                   |   4 +-
 drivers/net/axgbe/axgbe_rxtx.c                     |   2 +-
 drivers/net/bnx2x/bnx2x.c                          |  16 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                   |   5 +-
 drivers/net/bnx2x/bnx2x_ethdev.h                   |   3 +-
 drivers/net/bnx2x/bnx2x_vfpf.c                     |   8 +-
 drivers/net/bnx2x/bnx2x_vfpf.h                     |   2 +-
 drivers/net/bnx2x/ecore_sp.h                       |   2 +-
 drivers/net/bnxt/bnxt.h                            |   4 +-
 drivers/net/bnxt/bnxt_ethdev.c                     |  80 ++---
 drivers/net/bnxt/bnxt_filter.c                     |   4 +-
 drivers/net/bnxt/bnxt_filter.h                     |   8 +-
 drivers/net/bnxt/bnxt_flow.c                       |  27 +-
 drivers/net/bnxt/bnxt_hwrm.c                       |  41 +--
 drivers/net/bnxt/bnxt_hwrm.h                       |   2 +-
 drivers/net/bnxt/bnxt_ring.c                       |   8 +-
 drivers/net/bnxt/bnxt_rxq.c                        |   2 +-
 drivers/net/bnxt/bnxt_rxr.c                        |   4 +-
 drivers/net/bnxt/bnxt_vnic.c                       |   2 +-
 drivers/net/bnxt/rte_pmd_bnxt.c                    |  14 +-
 drivers/net/bnxt/rte_pmd_bnxt.h                    |   4 +-
 drivers/net/bonding/rte_eth_bond.h                 |   2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.c          |  30 +-
 drivers/net/bonding/rte_eth_bond_8023ad.h          |  10 +-
 drivers/net/bonding/rte_eth_bond_8023ad_private.h  |   2 +-
 drivers/net/bonding/rte_eth_bond_alb.c             |  98 +++---
 drivers/net/bonding/rte_eth_bond_alb.h             |  10 +-
 drivers/net/bonding/rte_eth_bond_api.c             |   2 +-
 drivers/net/bonding/rte_eth_bond_args.c            |   2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c             | 203 ++++++------
 drivers/net/bonding/rte_eth_bond_private.h         |   8 +-
 drivers/net/cxgbe/base/adapter.h                   |   2 +-
 drivers/net/cxgbe/cxgbe.h                          |   5 +-
 drivers/net/cxgbe/cxgbe_compat.h                   |   1 +
 drivers/net/cxgbe/cxgbe_ethdev.c                   |  14 +-
 drivers/net/cxgbe/cxgbe_filter.h                   |   2 +-
 drivers/net/cxgbe/cxgbe_flow.c                     |  10 +-
 drivers/net/cxgbe/cxgbe_main.c                     |   4 +-
 drivers/net/cxgbe/cxgbe_pfvf.h                     |   2 +-
 drivers/net/cxgbe/cxgbevf_main.c                   |   2 +-
 drivers/net/cxgbe/l2t.c                            |   8 +-
 drivers/net/cxgbe/l2t.h                            |   2 +-
 drivers/net/cxgbe/mps_tcam.c                       |  14 +-
 drivers/net/cxgbe/mps_tcam.h                       |   4 +-
 drivers/net/cxgbe/sge.c                            |   9 +-
 drivers/net/dpaa/dpaa_ethdev.c                     |  20 +-
 drivers/net/dpaa/dpaa_rxtx.c                       |  23 +-
 drivers/net/dpaa2/dpaa2_ethdev.c                   |  37 +--
 drivers/net/dpaa2/dpaa2_flow.c                     |  18 +-
 drivers/net/e1000/e1000_ethdev.h                   |   5 +-
 drivers/net/e1000/em_ethdev.c                      |  39 +--
 drivers/net/e1000/em_rxtx.c                        |  24 +-
 drivers/net/e1000/igb_ethdev.c                     |  76 ++---
 drivers/net/e1000/igb_flow.c                       |  12 +-
 drivers/net/e1000/igb_pf.c                         |  17 +-
 drivers/net/e1000/igb_rxtx.c                       |  23 +-
 drivers/net/ena/ena_ethdev.c                       |  17 +-
 drivers/net/ena/ena_ethdev.h                       |   2 +-
 drivers/net/enetc/base/enetc_hw.h                  |   4 +-
 drivers/net/enetc/enetc_ethdev.c                   |  21 +-
 drivers/net/enic/enic.h                            |   4 +-
 drivers/net/enic/enic_clsf.c                       |  40 +--
 drivers/net/enic/enic_ethdev.c                     |  29 +-
 drivers/net/enic/enic_flow.c                       | 114 +++----
 drivers/net/enic/enic_main.c                       |   4 +-
 drivers/net/enic/enic_res.c                        |   5 +-
 drivers/net/failsafe/failsafe.c                    |   8 +-
 drivers/net/failsafe/failsafe_args.c               |   4 +-
 drivers/net/failsafe/failsafe_ether.c              |   7 +-
 drivers/net/failsafe/failsafe_ops.c                |   6 +-
 drivers/net/failsafe/failsafe_private.h            |   4 +-
 drivers/net/fm10k/fm10k.h                          |   2 +-
 drivers/net/fm10k/fm10k_ethdev.c                   |  18 +-
 drivers/net/i40e/i40e_ethdev.c                     | 143 +++++----
 drivers/net/i40e/i40e_ethdev.h                     |  23 +-
 drivers/net/i40e/i40e_ethdev_vf.c                  |  68 ++--
 drivers/net/i40e/i40e_fdir.c                       | 127 ++++----
 drivers/net/i40e/i40e_flow.c                       |  58 ++--
 drivers/net/i40e/i40e_pf.c                         |  18 +-
 drivers/net/i40e/i40e_rxtx.c                       |  28 +-
 drivers/net/i40e/i40e_vf_representor.c             |   2 +-
 drivers/net/i40e/rte_pmd_i40e.c                    |  31 +-
 drivers/net/i40e/rte_pmd_i40e.h                    |   8 +-
 drivers/net/iavf/iavf.h                            |   4 +-
 drivers/net/iavf/iavf_ethdev.c                     |  53 ++--
 drivers/net/iavf/iavf_rxtx.c                       |  14 +-
 drivers/net/iavf/iavf_vchnl.c                      |   8 +-
 drivers/net/ice/ice_ethdev.c                       |  64 ++--
 drivers/net/ice/ice_ethdev.h                       |   6 +-
 drivers/net/ice/ice_rxtx.c                         |  28 +-
 drivers/net/ipn3ke/ipn3ke_ethdev.h                 |   6 +-
 drivers/net/ipn3ke/ipn3ke_flow.c                   |   4 +-
 drivers/net/ipn3ke/ipn3ke_representor.c            |  21 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                   | 107 ++++---
 drivers/net/ixgbe/ixgbe_ethdev.h                   |   4 +-
 drivers/net/ixgbe/ixgbe_flow.c                     |  22 +-
 drivers/net/ixgbe/ixgbe_pf.c                       |  16 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                     |  18 +-
 drivers/net/ixgbe/ixgbe_vf_representor.c           |   4 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.c                  |  11 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h                  |   2 +-
 drivers/net/kni/rte_eth_kni.c                      |   6 +-
 drivers/net/liquidio/lio_ethdev.c                  |  23 +-
 drivers/net/mlx4/mlx4.c                            |   4 +-
 drivers/net/mlx4/mlx4.h                            |  10 +-
 drivers/net/mlx4/mlx4_ethdev.c                     |  12 +-
 drivers/net/mlx4/mlx4_flow.c                       |  16 +-
 drivers/net/mlx4/mlx4_rxtx.c                       |   2 +-
 drivers/net/mlx5/mlx5.c                            |   4 +-
 drivers/net/mlx5/mlx5.h                            |  15 +-
 drivers/net/mlx5/mlx5_flow.c                       |  22 +-
 drivers/net/mlx5/mlx5_flow_dv.c                    |  44 +--
 drivers/net/mlx5/mlx5_flow_tcf.c                   |  66 ++--
 drivers/net/mlx5/mlx5_flow_verbs.c                 |  30 +-
 drivers/net/mlx5/mlx5_mac.c                        |  18 +-
 drivers/net/mlx5/mlx5_nl.c                         |  28 +-
 drivers/net/mlx5/mlx5_rxtx.c                       |   6 +-
 drivers/net/mlx5/mlx5_rxtx.h                       |   2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h              |   8 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h               |  10 +-
 drivers/net/mlx5/mlx5_trigger.c                    |   6 +-
 drivers/net/mvneta/mvneta_ethdev.c                 |  22 +-
 drivers/net/mvneta/mvneta_ethdev.h                 |   6 +-
 drivers/net/mvpp2/mrvl_ethdev.c                    |  22 +-
 drivers/net/mvpp2/mrvl_ethdev.h                    |   6 +-
 drivers/net/mvpp2/mrvl_flow.c                      |   4 +-
 drivers/net/netvsc/hn_ethdev.c                     |   4 +-
 drivers/net/netvsc/hn_nvs.c                        |   2 +-
 drivers/net/netvsc/hn_rndis.c                      |   2 +-
 drivers/net/netvsc/hn_rxtx.c                       |  12 +-
 drivers/net/netvsc/hn_var.h                        |   4 +-
 drivers/net/netvsc/hn_vf.c                         |   8 +-
 drivers/net/nfb/nfb_ethdev.c                       |  16 +-
 drivers/net/nfp/nfp_net.c                          |  22 +-
 drivers/net/nfp/nfp_net_pmd.h                      |   2 +-
 drivers/net/null/rte_eth_null.c                    |   6 +-
 drivers/net/octeontx/octeontx_ethdev.c             |   9 +-
 drivers/net/octeontx/octeontx_ethdev.h             |   2 +-
 drivers/net/pcap/rte_eth_pcap.c                    |  22 +-
 drivers/net/qede/base/bcm_osal.h                   |   4 +-
 drivers/net/qede/qede_ethdev.c                     |  71 +++--
 drivers/net/qede/qede_ethdev.h                     |   6 +-
 drivers/net/qede/qede_filter.c                     |  68 ++--
 drivers/net/qede/qede_if.h                         |   4 +-
 drivers/net/qede/qede_main.c                       |   6 +-
 drivers/net/qede/qede_rxtx.c                       |  34 +-
 drivers/net/qede/qede_rxtx.h                       |   2 +-
 drivers/net/ring/rte_eth_ring.c                    |   4 +-
 drivers/net/sfc/sfc.h                              |   2 +-
 drivers/net/sfc/sfc_ef10_tx.c                      |   4 +-
 drivers/net/sfc/sfc_ethdev.c                       |  24 +-
 drivers/net/sfc/sfc_flow.c                         |  12 +-
 drivers/net/sfc/sfc_port.c                         |   8 +-
 drivers/net/sfc/sfc_tso.c                          |   4 +-
 drivers/net/sfc/sfc_tso.h                          |   4 +-
 drivers/net/softnic/parser.c                       |  18 +-
 drivers/net/softnic/parser.h                       |   2 +-
 drivers/net/softnic/rte_eth_softnic.c              |   2 +-
 drivers/net/softnic/rte_eth_softnic_flow.c         |   4 +-
 drivers/net/softnic/rte_eth_softnic_pipeline.c     |  40 +--
 drivers/net/szedata2/rte_eth_szedata2.c            |   8 +-
 drivers/net/tap/rte_eth_tap.c                      |  68 ++--
 drivers/net/tap/rte_eth_tap.h                      |   4 +-
 drivers/net/tap/tap_bpf_program.c                  |  14 +-
 drivers/net/tap/tap_flow.c                         |  16 +-
 drivers/net/thunderx/base/nicvf_plat.h             |   5 +-
 drivers/net/thunderx/nicvf_ethdev.c                |  19 +-
 drivers/net/thunderx/nicvf_struct.h                |   2 +-
 drivers/net/vdev_netvsc/vdev_netvsc.c              |  16 +-
 drivers/net/vhost/rte_eth_vhost.c                  |  12 +-
 drivers/net/virtio/virtio_ethdev.c                 |  78 ++---
 drivers/net/virtio/virtio_pci.h                    |   4 +-
 drivers/net/virtio/virtio_rxtx.c                   |  33 +-
 drivers/net/virtio/virtio_user/vhost_kernel_tap.c  |   2 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.c   |   6 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.h   |   2 +-
 drivers/net/virtio/virtio_user_ethdev.c            |   8 +-
 drivers/net/virtio/virtqueue.h                     |   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c               |  12 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.h               |   2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  47 +--
 examples/bbdev_app/main.c                          |  41 +--
 examples/bond/main.c                               |  83 ++---
 examples/distributor/main.c                        |   4 +-
 examples/ethtool/ethtool-app/ethapp.c              |   8 +-
 examples/ethtool/ethtool-app/main.c                |  10 +-
 examples/ethtool/lib/rte_ethtool.c                 |   8 +-
 examples/ethtool/lib/rte_ethtool.h                 |   7 +-
 examples/eventdev_pipeline/main.c                  |   4 +-
 examples/eventdev_pipeline/pipeline_common.h       |  10 +-
 examples/flow_classify/flow_classify.c             |  30 +-
 examples/flow_filtering/main.c                     |  10 +-
 examples/ip_fragmentation/main.c                   |  69 +++--
 examples/ip_pipeline/cli.c                         |   4 +-
 examples/ip_pipeline/kni.c                         |   2 +-
 examples/ip_pipeline/parser.c                      |  18 +-
 examples/ip_pipeline/parser.h                      |   2 +-
 examples/ip_pipeline/pipeline.c                    |  40 +--
 examples/ip_reassembly/main.c                      |  51 +--
 examples/ipsec-secgw/esp.c                         |  47 +--
 examples/ipsec-secgw/ipsec-secgw.c                 |  43 +--
 examples/ipsec-secgw/ipsec.h                       |   2 +-
 examples/ipsec-secgw/parser.c                      |   4 +-
 examples/ipsec-secgw/sa.c                          |  16 +-
 examples/ipv4_multicast/main.c                     |  60 ++--
 examples/kni/main.c                                |  14 +-
 examples/l2fwd-cat/l2fwd-cat.c                     |   4 +-
 examples/l2fwd-crypto/main.c                       |  26 +-
 examples/l2fwd-jobstats/main.c                     |   8 +-
 examples/l2fwd-keepalive/main.c                    |   8 +-
 examples/l2fwd/main.c                              |   8 +-
 examples/l3fwd-acl/main.c                          | 106 ++++---
 examples/l3fwd-power/main.c                        | 102 +++---
 examples/l3fwd-vf/main.c                           |  68 ++--
 examples/l3fwd/l3fwd.h                             |   8 +-
 examples/l3fwd/l3fwd_altivec.h                     |  26 +-
 examples/l3fwd/l3fwd_common.h                      |   4 +-
 examples/l3fwd/l3fwd_em.c                          |  46 +--
 examples/l3fwd/l3fwd_em.h                          |  22 +-
 examples/l3fwd/l3fwd_em_hlm.h                      |  19 +-
 examples/l3fwd/l3fwd_em_hlm_neon.h                 |  20 +-
 examples/l3fwd/l3fwd_em_hlm_sse.h                  |  16 +-
 examples/l3fwd/l3fwd_em_sequential.h               |  19 +-
 examples/l3fwd/l3fwd_lpm.c                         |  50 +--
 examples/l3fwd/l3fwd_lpm.h                         |  22 +-
 examples/l3fwd/l3fwd_lpm_altivec.h                 |  20 +-
 examples/l3fwd/l3fwd_lpm_neon.h                    |  30 +-
 examples/l3fwd/l3fwd_lpm_sse.h                     |  20 +-
 examples/l3fwd/l3fwd_neon.h                        |  26 +-
 examples/l3fwd/l3fwd_sse.h                         |  26 +-
 examples/l3fwd/main.c                              |  20 +-
 examples/link_status_interrupt/main.c              |   8 +-
 examples/load_balancer/runtime.c                   |   8 +-
 .../client_server_mp/mp_server/main.c              |   2 +-
 examples/packet_ordering/main.c                    |   2 +-
 examples/performance-thread/l3fwd-thread/main.c    | 337 ++++++++++----------
 examples/ptpclient/ptpclient.c                     |  32 +-
 examples/qos_meter/main.c                          |   5 +-
 examples/qos_sched/init.c                          |   2 +-
 examples/quota_watermark/qw/main.c                 |   8 +-
 examples/rxtx_callbacks/main.c                     |   4 +-
 examples/server_node_efd/node/node.c               |   6 +-
 examples/server_node_efd/server/main.c             |   8 +-
 examples/skeleton/basicfwd.c                       |   4 +-
 examples/tep_termination/main.c                    |   2 +-
 examples/tep_termination/main.h                    |   2 +-
 examples/tep_termination/vxlan.c                   | 115 +++----
 examples/tep_termination/vxlan.h                   |   8 +-
 examples/tep_termination/vxlan_setup.c             |  32 +-
 examples/tep_termination/vxlan_setup.h             |   2 +-
 examples/vhost/main.c                              |  42 +--
 examples/vhost/main.h                              |   2 +-
 examples/vm_power_manager/channel_monitor.c        |  12 +-
 .../guest_cli/vm_power_cli_guest.c                 |   2 +-
 examples/vm_power_manager/main.c                   |   6 +-
 examples/vmdq/main.c                               |  12 +-
 examples/vmdq_dcb/main.c                           |  12 +-
 lib/librte_ethdev/rte_class_eth.c                  |   4 +-
 lib/librte_ethdev/rte_eth_ctrl.h                   |  12 +-
 lib/librte_ethdev/rte_ethdev.c                     |  59 ++--
 lib/librte_ethdev/rte_ethdev.h                     |  15 +-
 lib/librte_ethdev/rte_ethdev_core.h                |  12 +-
 lib/librte_ethdev/rte_flow.h                       |  34 +-
 lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  33 +-
 lib/librte_gro/gro_tcp4.c                          |  26 +-
 lib/librte_gro/gro_tcp4.h                          |  22 +-
 lib/librte_gro/gro_vxlan_tcp4.c                    |  66 ++--
 lib/librte_gro/gro_vxlan_tcp4.h                    |   6 +-
 lib/librte_gso/gso_common.h                        |  16 +-
 lib/librte_gso/gso_tcp4.c                          |  12 +-
 lib/librte_gso/gso_tunnel_tcp4.c                   |  14 +-
 lib/librte_gso/gso_udp4.c                          |  10 +-
 lib/librte_gso/rte_gso.h                           |   8 +-
 lib/librte_hash/rte_thash.h                        |   3 +-
 lib/librte_ip_frag/rte_ip_frag.h                   |  13 +-
 lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  42 +--
 lib/librte_ip_frag/rte_ipv4_reassembly.c           |  14 +-
 lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  28 +-
 lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
 lib/librte_ipsec/crypto.h                          |   2 +-
 lib/librte_ipsec/esp_inb.c                         |  10 +-
 lib/librte_ipsec/esp_outb.c                        |   8 +-
 lib/librte_ipsec/iph.h                             |   8 +-
 lib/librte_ipsec/sa.c                              |  10 +-
 lib/librte_kni/rte_kni.c                           |   4 +-
 lib/librte_kni/rte_kni.h                           |   2 +-
 lib/librte_net/rte_arp.c                           |  33 +-
 lib/librte_net/rte_arp.h                           |  36 +--
 lib/librte_net/rte_esp.h                           |   2 +-
 lib/librte_net/rte_ether.h                         | 189 ++++++------
 lib/librte_net/rte_gre.h                           |   2 +-
 lib/librte_net/rte_icmp.h                          |   6 +-
 lib/librte_net/rte_ip.h                            |  75 ++---
 lib/librte_net/rte_net.c                           |  94 +++---
 lib/librte_net/rte_net.h                           |  28 +-
 lib/librte_net/rte_sctp.h                          |   2 +-
 lib/librte_net/rte_tcp.h                           |   2 +-
 lib/librte_net/rte_udp.h                           |   2 +-
 lib/librte_pipeline/rte_table_action.c             | 242 ++++++++-------
 lib/librte_pipeline/rte_table_action.h             |   4 +-
 lib/librte_port/rte_port_ras.c                     |  10 +-
 lib/librte_port/rte_port_source_sink.c             |   6 +-
 lib/librte_vhost/vhost.h                           |   2 +-
 lib/librte_vhost/virtio_net.c                      |  43 +--
 385 files changed, 4563 insertions(+), 4234 deletions(-)
  

Comments

Stephen Hemminger May 21, 2019, 4:23 p.m. UTC | #1
On Tue, 21 May 2019 18:13:00 +0200
Olivier Matz <olivier.matz@6wind.com> wrote:

> The rte_net headers conflict with the libc headers, because
> some definitions are duplicated, sometimes with few differences.
> 
> This patchset adds the rte_ (or RTE_) prefix to all structures, functions
> and defines in rte_net library. This is a big changeset, that will
> break the API of many functions, but not the ABI.
> 
> This was discussed in [1], and requested by the techboard [2].
> 
> patch-v1:
> * rease on top of v19.05
> * remove uneeded renames in drivers/net/bonding/rte_eth_bond_pmd.c
>   and app/test-pmd/icmpecho.c (arp-related variables)
> * do not modify base drivers, except cxgbe, thunderx, enetc, qede:
>   only files that already contain dpdk definitions are modified.
> * fix checkpatch issues when it does not impact the code style too
>   much. Big warnings remain about the RTE_IPv4() macros because
>   arguments are separated by ',' instead of ', '.
> * add a release note patch
> * tested compilation on x86_64-linux and x86_64-freebsd.
> 
> rfc-v2:
> * rebase on top of v19.05-rc1
> 
> 
> [1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
> [2] http://mails.dpdk.org/archives/dev/2019-February/125033.html
> 
> 
> Olivier Matz (15):
>   net: add rte prefix to arp structures
>   net: add rte prefix to arp defines
>   net: add rte prefix to ether structures
>   net: add rte prefix to ether functions
>   net: add rte prefix to ether defines
>   net: add rte prefix to esp structure
>   net: add rte prefix to gre structure
>   net: add rte prefix to icmp structure
>   net: add rte prefix to icmp defines
>   net: add rte prefix to ip structure
>   net: add rte prefix to ip defines
>   net: add rte prefix to sctp structure
>   net: add rte prefix to tcp structure
>   net: add rte prefix to udp structure
>   doc: announce network api change
> 
>  app/pdump/main.c                                   |   2 +-
>  app/test-acl/main.c                                |   2 +-
>  app/test-eventdev/test_perf_common.c               |   2 +-
>  app/test-eventdev/test_pipeline_common.c           |   2 +-
>  app/test-pipeline/pipeline_acl.c                   |  19 +-
>  app/test-pipeline/pipeline_hash.c                  |  12 +-
>  app/test-pmd/cmdline.c                             |  90 +++---
>  app/test-pmd/cmdline_flow.c                        |  86 +++---
>  app/test-pmd/config.c                              |  35 ++-
>  app/test-pmd/csumonly.c                            | 169 +++++-----
>  app/test-pmd/flowgen.c                             |  30 +-
>  app/test-pmd/icmpecho.c                            | 117 +++----
>  app/test-pmd/ieee1588fwd.c                         |  18 +-
>  app/test-pmd/macfwd.c                              |  12 +-
>  app/test-pmd/macswap.h                             |  12 +-
>  app/test-pmd/macswap_common.h                      |   4 +-
>  app/test-pmd/macswap_neon.h                        |  12 +-
>  app/test-pmd/macswap_sse.h                         |  12 +-
>  app/test-pmd/parameters.c                          |   6 +-
>  app/test-pmd/testpmd.c                             |  23 +-
>  app/test-pmd/testpmd.h                             |  30 +-
>  app/test-pmd/txonly.c                              |  45 +--
>  app/test-pmd/util.c                                |  34 +-
>  app/test/packet_burst_generator.c                  | 150 ++++-----
>  app/test/packet_burst_generator.h                  |  33 +-
>  app/test/test_acl.c                                |   8 +-
>  app/test/test_acl.h                                | 122 ++++----
>  app/test/test_cmdline_etheraddr.c                  |  16 +-
>  app/test/test_efd.c                                |  20 +-
>  app/test/test_event_eth_rx_adapter.c               |   2 +-
>  app/test/test_event_eth_tx_adapter.c               |   2 +-
>  app/test/test_flow_classify.c                      |  70 +++--
>  app/test/test_hash.c                               |  20 +-
>  app/test/test_ipsec.c                              |  13 +-
>  app/test/test_link_bonding.c                       | 342 ++++++++++++---------
>  app/test/test_link_bonding_mode4.c                 | 124 ++++----
>  app/test/test_link_bonding_rssconf.c               |   6 +-
>  app/test/test_lpm.c                                |  76 ++---
>  app/test/test_lpm_perf.c                           |  10 +-
>  app/test/test_member.c                             |  20 +-
>  app/test/test_pmd_perf.c                           |  20 +-
>  app/test/test_sched.c                              |  24 +-
>  app/test/test_table_acl.c                          |   8 +-
>  app/test/test_thash.c                              |  12 +-
>  app/test/virtual_pmd.c                             |   6 +-
>  app/test/virtual_pmd.h                             |   2 +-
>  doc/guides/nics/kni.rst                            |   2 +-
>  doc/guides/prog_guide/bbdev.rst                    |   6 +-
>  .../prog_guide/packet_classif_access_ctrl.rst      |  18 +-
>  doc/guides/prog_guide/rte_flow.rst                 |   4 +-
>  doc/guides/rel_notes/deprecation.rst               |   4 -
>  doc/guides/rel_notes/release_19_08.rst             |   3 +
>  doc/guides/sample_app_ug/flow_classify.rst         |  28 +-
>  doc/guides/sample_app_ug/flow_filtering.rst        |   6 +-
>  doc/guides/sample_app_ug/ip_frag.rst               |  16 +-
>  doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +-
>  doc/guides/sample_app_ug/ipv4_multicast.rst        |  16 +-
>  doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   6 +-
>  .../sample_app_ug/l2_forward_real_virtual.rst      |   6 +-
>  doc/guides/sample_app_ug/l3_forward.rst            |  12 +-
>  doc/guides/sample_app_ug/link_status_intr.rst      |   6 +-
>  doc/guides/sample_app_ug/ptpclient.rst             |   6 +-
>  doc/guides/sample_app_ug/rxtx_callbacks.rst        |   2 +-
>  doc/guides/sample_app_ug/server_node_efd.rst       |  12 +-
>  doc/guides/sample_app_ug/skeleton.rst              |   4 +-
>  doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   4 +-
>  drivers/bus/dpaa/include/compat.h                  |   2 +
>  drivers/bus/dpaa/include/fman.h                    |   2 +-
>  drivers/bus/dpaa/include/netcfg.h                  |   4 +-
>  drivers/net/af_packet/rte_eth_af_packet.c          |   2 +-
>  drivers/net/af_xdp/rte_eth_af_xdp.c                |   8 +-
>  drivers/net/ark/ark_ethdev.c                       |  19 +-
>  drivers/net/ark/ark_ext.h                          |   4 +-
>  drivers/net/ark/ark_global.h                       |   5 +-
>  drivers/net/atlantic/atl_ethdev.c                  |  27 +-
>  drivers/net/atlantic/hw_atl/hw_atl_utils.c         |   8 +-
>  drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c    |   4 +-
>  drivers/net/avp/avp_ethdev.c                       |  21 +-
>  drivers/net/avp/rte_avp_common.h                   |   2 +-
>  drivers/net/axgbe/axgbe_dev.c                      |   4 +-
>  drivers/net/axgbe/axgbe_ethdev.c                   |  10 +-
>  drivers/net/axgbe/axgbe_ethdev.h                   |   4 +-
>  drivers/net/axgbe/axgbe_rxtx.c                     |   2 +-
>  drivers/net/bnx2x/bnx2x.c                          |  16 +-
>  drivers/net/bnx2x/bnx2x_ethdev.c                   |   5 +-
>  drivers/net/bnx2x/bnx2x_ethdev.h                   |   3 +-
>  drivers/net/bnx2x/bnx2x_vfpf.c                     |   8 +-
>  drivers/net/bnx2x/bnx2x_vfpf.h                     |   2 +-
>  drivers/net/bnx2x/ecore_sp.h                       |   2 +-
>  drivers/net/bnxt/bnxt.h                            |   4 +-
>  drivers/net/bnxt/bnxt_ethdev.c                     |  80 ++---
>  drivers/net/bnxt/bnxt_filter.c                     |   4 +-
>  drivers/net/bnxt/bnxt_filter.h                     |   8 +-
>  drivers/net/bnxt/bnxt_flow.c                       |  27 +-
>  drivers/net/bnxt/bnxt_hwrm.c                       |  41 +--
>  drivers/net/bnxt/bnxt_hwrm.h                       |   2 +-
>  drivers/net/bnxt/bnxt_ring.c                       |   8 +-
>  drivers/net/bnxt/bnxt_rxq.c                        |   2 +-
>  drivers/net/bnxt/bnxt_rxr.c                        |   4 +-
>  drivers/net/bnxt/bnxt_vnic.c                       |   2 +-
>  drivers/net/bnxt/rte_pmd_bnxt.c                    |  14 +-
>  drivers/net/bnxt/rte_pmd_bnxt.h                    |   4 +-
>  drivers/net/bonding/rte_eth_bond.h                 |   2 +-
>  drivers/net/bonding/rte_eth_bond_8023ad.c          |  30 +-
>  drivers/net/bonding/rte_eth_bond_8023ad.h          |  10 +-
>  drivers/net/bonding/rte_eth_bond_8023ad_private.h  |   2 +-
>  drivers/net/bonding/rte_eth_bond_alb.c             |  98 +++---
>  drivers/net/bonding/rte_eth_bond_alb.h             |  10 +-
>  drivers/net/bonding/rte_eth_bond_api.c             |   2 +-
>  drivers/net/bonding/rte_eth_bond_args.c            |   2 +-
>  drivers/net/bonding/rte_eth_bond_pmd.c             | 203 ++++++------
>  drivers/net/bonding/rte_eth_bond_private.h         |   8 +-
>  drivers/net/cxgbe/base/adapter.h                   |   2 +-
>  drivers/net/cxgbe/cxgbe.h                          |   5 +-
>  drivers/net/cxgbe/cxgbe_compat.h                   |   1 +
>  drivers/net/cxgbe/cxgbe_ethdev.c                   |  14 +-
>  drivers/net/cxgbe/cxgbe_filter.h                   |   2 +-
>  drivers/net/cxgbe/cxgbe_flow.c                     |  10 +-
>  drivers/net/cxgbe/cxgbe_main.c                     |   4 +-
>  drivers/net/cxgbe/cxgbe_pfvf.h                     |   2 +-
>  drivers/net/cxgbe/cxgbevf_main.c                   |   2 +-
>  drivers/net/cxgbe/l2t.c                            |   8 +-
>  drivers/net/cxgbe/l2t.h                            |   2 +-
>  drivers/net/cxgbe/mps_tcam.c                       |  14 +-
>  drivers/net/cxgbe/mps_tcam.h                       |   4 +-
>  drivers/net/cxgbe/sge.c                            |   9 +-
>  drivers/net/dpaa/dpaa_ethdev.c                     |  20 +-
>  drivers/net/dpaa/dpaa_rxtx.c                       |  23 +-
>  drivers/net/dpaa2/dpaa2_ethdev.c                   |  37 +--
>  drivers/net/dpaa2/dpaa2_flow.c                     |  18 +-
>  drivers/net/e1000/e1000_ethdev.h                   |   5 +-
>  drivers/net/e1000/em_ethdev.c                      |  39 +--
>  drivers/net/e1000/em_rxtx.c                        |  24 +-
>  drivers/net/e1000/igb_ethdev.c                     |  76 ++---
>  drivers/net/e1000/igb_flow.c                       |  12 +-
>  drivers/net/e1000/igb_pf.c                         |  17 +-
>  drivers/net/e1000/igb_rxtx.c                       |  23 +-
>  drivers/net/ena/ena_ethdev.c                       |  17 +-
>  drivers/net/ena/ena_ethdev.h                       |   2 +-
>  drivers/net/enetc/base/enetc_hw.h                  |   4 +-
>  drivers/net/enetc/enetc_ethdev.c                   |  21 +-
>  drivers/net/enic/enic.h                            |   4 +-
>  drivers/net/enic/enic_clsf.c                       |  40 +--
>  drivers/net/enic/enic_ethdev.c                     |  29 +-
>  drivers/net/enic/enic_flow.c                       | 114 +++----
>  drivers/net/enic/enic_main.c                       |   4 +-
>  drivers/net/enic/enic_res.c                        |   5 +-
>  drivers/net/failsafe/failsafe.c                    |   8 +-
>  drivers/net/failsafe/failsafe_args.c               |   4 +-
>  drivers/net/failsafe/failsafe_ether.c              |   7 +-
>  drivers/net/failsafe/failsafe_ops.c                |   6 +-
>  drivers/net/failsafe/failsafe_private.h            |   4 +-
>  drivers/net/fm10k/fm10k.h                          |   2 +-
>  drivers/net/fm10k/fm10k_ethdev.c                   |  18 +-
>  drivers/net/i40e/i40e_ethdev.c                     | 143 +++++----
>  drivers/net/i40e/i40e_ethdev.h                     |  23 +-
>  drivers/net/i40e/i40e_ethdev_vf.c                  |  68 ++--
>  drivers/net/i40e/i40e_fdir.c                       | 127 ++++----
>  drivers/net/i40e/i40e_flow.c                       |  58 ++--
>  drivers/net/i40e/i40e_pf.c                         |  18 +-
>  drivers/net/i40e/i40e_rxtx.c                       |  28 +-
>  drivers/net/i40e/i40e_vf_representor.c             |   2 +-
>  drivers/net/i40e/rte_pmd_i40e.c                    |  31 +-
>  drivers/net/i40e/rte_pmd_i40e.h                    |   8 +-
>  drivers/net/iavf/iavf.h                            |   4 +-
>  drivers/net/iavf/iavf_ethdev.c                     |  53 ++--
>  drivers/net/iavf/iavf_rxtx.c                       |  14 +-
>  drivers/net/iavf/iavf_vchnl.c                      |   8 +-
>  drivers/net/ice/ice_ethdev.c                       |  64 ++--
>  drivers/net/ice/ice_ethdev.h                       |   6 +-
>  drivers/net/ice/ice_rxtx.c                         |  28 +-
>  drivers/net/ipn3ke/ipn3ke_ethdev.h                 |   6 +-
>  drivers/net/ipn3ke/ipn3ke_flow.c                   |   4 +-
>  drivers/net/ipn3ke/ipn3ke_representor.c            |  21 +-
>  drivers/net/ixgbe/ixgbe_ethdev.c                   | 107 ++++---
>  drivers/net/ixgbe/ixgbe_ethdev.h                   |   4 +-
>  drivers/net/ixgbe/ixgbe_flow.c                     |  22 +-
>  drivers/net/ixgbe/ixgbe_pf.c                       |  16 +-
>  drivers/net/ixgbe/ixgbe_rxtx.c                     |  18 +-
>  drivers/net/ixgbe/ixgbe_vf_representor.c           |   4 +-
>  drivers/net/ixgbe/rte_pmd_ixgbe.c                  |  11 +-
>  drivers/net/ixgbe/rte_pmd_ixgbe.h                  |   2 +-
>  drivers/net/kni/rte_eth_kni.c                      |   6 +-
>  drivers/net/liquidio/lio_ethdev.c                  |  23 +-
>  drivers/net/mlx4/mlx4.c                            |   4 +-
>  drivers/net/mlx4/mlx4.h                            |  10 +-
>  drivers/net/mlx4/mlx4_ethdev.c                     |  12 +-
>  drivers/net/mlx4/mlx4_flow.c                       |  16 +-
>  drivers/net/mlx4/mlx4_rxtx.c                       |   2 +-
>  drivers/net/mlx5/mlx5.c                            |   4 +-
>  drivers/net/mlx5/mlx5.h                            |  15 +-
>  drivers/net/mlx5/mlx5_flow.c                       |  22 +-
>  drivers/net/mlx5/mlx5_flow_dv.c                    |  44 +--
>  drivers/net/mlx5/mlx5_flow_tcf.c                   |  66 ++--
>  drivers/net/mlx5/mlx5_flow_verbs.c                 |  30 +-
>  drivers/net/mlx5/mlx5_mac.c                        |  18 +-
>  drivers/net/mlx5/mlx5_nl.c                         |  28 +-
>  drivers/net/mlx5/mlx5_rxtx.c                       |   6 +-
>  drivers/net/mlx5/mlx5_rxtx.h                       |   2 +-
>  drivers/net/mlx5/mlx5_rxtx_vec_neon.h              |   8 +-
>  drivers/net/mlx5/mlx5_rxtx_vec_sse.h               |  10 +-
>  drivers/net/mlx5/mlx5_trigger.c                    |   6 +-
>  drivers/net/mvneta/mvneta_ethdev.c                 |  22 +-
>  drivers/net/mvneta/mvneta_ethdev.h                 |   6 +-
>  drivers/net/mvpp2/mrvl_ethdev.c                    |  22 +-
>  drivers/net/mvpp2/mrvl_ethdev.h                    |   6 +-
>  drivers/net/mvpp2/mrvl_flow.c                      |   4 +-
>  drivers/net/netvsc/hn_ethdev.c                     |   4 +-
>  drivers/net/netvsc/hn_nvs.c                        |   2 +-
>  drivers/net/netvsc/hn_rndis.c                      |   2 +-
>  drivers/net/netvsc/hn_rxtx.c                       |  12 +-
>  drivers/net/netvsc/hn_var.h                        |   4 +-
>  drivers/net/netvsc/hn_vf.c                         |   8 +-
>  drivers/net/nfb/nfb_ethdev.c                       |  16 +-
>  drivers/net/nfp/nfp_net.c                          |  22 +-
>  drivers/net/nfp/nfp_net_pmd.h                      |   2 +-
>  drivers/net/null/rte_eth_null.c                    |   6 +-
>  drivers/net/octeontx/octeontx_ethdev.c             |   9 +-
>  drivers/net/octeontx/octeontx_ethdev.h             |   2 +-
>  drivers/net/pcap/rte_eth_pcap.c                    |  22 +-
>  drivers/net/qede/base/bcm_osal.h                   |   4 +-
>  drivers/net/qede/qede_ethdev.c                     |  71 +++--
>  drivers/net/qede/qede_ethdev.h                     |   6 +-
>  drivers/net/qede/qede_filter.c                     |  68 ++--
>  drivers/net/qede/qede_if.h                         |   4 +-
>  drivers/net/qede/qede_main.c                       |   6 +-
>  drivers/net/qede/qede_rxtx.c                       |  34 +-
>  drivers/net/qede/qede_rxtx.h                       |   2 +-
>  drivers/net/ring/rte_eth_ring.c                    |   4 +-
>  drivers/net/sfc/sfc.h                              |   2 +-
>  drivers/net/sfc/sfc_ef10_tx.c                      |   4 +-
>  drivers/net/sfc/sfc_ethdev.c                       |  24 +-
>  drivers/net/sfc/sfc_flow.c                         |  12 +-
>  drivers/net/sfc/sfc_port.c                         |   8 +-
>  drivers/net/sfc/sfc_tso.c                          |   4 +-
>  drivers/net/sfc/sfc_tso.h                          |   4 +-
>  drivers/net/softnic/parser.c                       |  18 +-
>  drivers/net/softnic/parser.h                       |   2 +-
>  drivers/net/softnic/rte_eth_softnic.c              |   2 +-
>  drivers/net/softnic/rte_eth_softnic_flow.c         |   4 +-
>  drivers/net/softnic/rte_eth_softnic_pipeline.c     |  40 +--
>  drivers/net/szedata2/rte_eth_szedata2.c            |   8 +-
>  drivers/net/tap/rte_eth_tap.c                      |  68 ++--
>  drivers/net/tap/rte_eth_tap.h                      |   4 +-
>  drivers/net/tap/tap_bpf_program.c                  |  14 +-
>  drivers/net/tap/tap_flow.c                         |  16 +-
>  drivers/net/thunderx/base/nicvf_plat.h             |   5 +-
>  drivers/net/thunderx/nicvf_ethdev.c                |  19 +-
>  drivers/net/thunderx/nicvf_struct.h                |   2 +-
>  drivers/net/vdev_netvsc/vdev_netvsc.c              |  16 +-
>  drivers/net/vhost/rte_eth_vhost.c                  |  12 +-
>  drivers/net/virtio/virtio_ethdev.c                 |  78 ++---
>  drivers/net/virtio/virtio_pci.h                    |   4 +-
>  drivers/net/virtio/virtio_rxtx.c                   |  33 +-
>  drivers/net/virtio/virtio_user/vhost_kernel_tap.c  |   2 +-
>  drivers/net/virtio/virtio_user/virtio_user_dev.c   |   6 +-
>  drivers/net/virtio/virtio_user/virtio_user_dev.h   |   2 +-
>  drivers/net/virtio/virtio_user_ethdev.c            |   8 +-
>  drivers/net/virtio/virtqueue.h                     |   2 +-
>  drivers/net/vmxnet3/vmxnet3_ethdev.c               |  12 +-
>  drivers/net/vmxnet3/vmxnet3_ethdev.h               |   2 +-
>  drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  47 +--
>  examples/bbdev_app/main.c                          |  41 +--
>  examples/bond/main.c                               |  83 ++---
>  examples/distributor/main.c                        |   4 +-
>  examples/ethtool/ethtool-app/ethapp.c              |   8 +-
>  examples/ethtool/ethtool-app/main.c                |  10 +-
>  examples/ethtool/lib/rte_ethtool.c                 |   8 +-
>  examples/ethtool/lib/rte_ethtool.h                 |   7 +-
>  examples/eventdev_pipeline/main.c                  |   4 +-
>  examples/eventdev_pipeline/pipeline_common.h       |  10 +-
>  examples/flow_classify/flow_classify.c             |  30 +-
>  examples/flow_filtering/main.c                     |  10 +-
>  examples/ip_fragmentation/main.c                   |  69 +++--
>  examples/ip_pipeline/cli.c                         |   4 +-
>  examples/ip_pipeline/kni.c                         |   2 +-
>  examples/ip_pipeline/parser.c                      |  18 +-
>  examples/ip_pipeline/parser.h                      |   2 +-
>  examples/ip_pipeline/pipeline.c                    |  40 +--
>  examples/ip_reassembly/main.c                      |  51 +--
>  examples/ipsec-secgw/esp.c                         |  47 +--
>  examples/ipsec-secgw/ipsec-secgw.c                 |  43 +--
>  examples/ipsec-secgw/ipsec.h                       |   2 +-
>  examples/ipsec-secgw/parser.c                      |   4 +-
>  examples/ipsec-secgw/sa.c                          |  16 +-
>  examples/ipv4_multicast/main.c                     |  60 ++--
>  examples/kni/main.c                                |  14 +-
>  examples/l2fwd-cat/l2fwd-cat.c                     |   4 +-
>  examples/l2fwd-crypto/main.c                       |  26 +-
>  examples/l2fwd-jobstats/main.c                     |   8 +-
>  examples/l2fwd-keepalive/main.c                    |   8 +-
>  examples/l2fwd/main.c                              |   8 +-
>  examples/l3fwd-acl/main.c                          | 106 ++++---
>  examples/l3fwd-power/main.c                        | 102 +++---
>  examples/l3fwd-vf/main.c                           |  68 ++--
>  examples/l3fwd/l3fwd.h                             |   8 +-
>  examples/l3fwd/l3fwd_altivec.h                     |  26 +-
>  examples/l3fwd/l3fwd_common.h                      |   4 +-
>  examples/l3fwd/l3fwd_em.c                          |  46 +--
>  examples/l3fwd/l3fwd_em.h                          |  22 +-
>  examples/l3fwd/l3fwd_em_hlm.h                      |  19 +-
>  examples/l3fwd/l3fwd_em_hlm_neon.h                 |  20 +-
>  examples/l3fwd/l3fwd_em_hlm_sse.h                  |  16 +-
>  examples/l3fwd/l3fwd_em_sequential.h               |  19 +-
>  examples/l3fwd/l3fwd_lpm.c                         |  50 +--
>  examples/l3fwd/l3fwd_lpm.h                         |  22 +-
>  examples/l3fwd/l3fwd_lpm_altivec.h                 |  20 +-
>  examples/l3fwd/l3fwd_lpm_neon.h                    |  30 +-
>  examples/l3fwd/l3fwd_lpm_sse.h                     |  20 +-
>  examples/l3fwd/l3fwd_neon.h                        |  26 +-
>  examples/l3fwd/l3fwd_sse.h                         |  26 +-
>  examples/l3fwd/main.c                              |  20 +-
>  examples/link_status_interrupt/main.c              |   8 +-
>  examples/load_balancer/runtime.c                   |   8 +-
>  .../client_server_mp/mp_server/main.c              |   2 +-
>  examples/packet_ordering/main.c                    |   2 +-
>  examples/performance-thread/l3fwd-thread/main.c    | 337 ++++++++++----------
>  examples/ptpclient/ptpclient.c                     |  32 +-
>  examples/qos_meter/main.c                          |   5 +-
>  examples/qos_sched/init.c                          |   2 +-
>  examples/quota_watermark/qw/main.c                 |   8 +-
>  examples/rxtx_callbacks/main.c                     |   4 +-
>  examples/server_node_efd/node/node.c               |   6 +-
>  examples/server_node_efd/server/main.c             |   8 +-
>  examples/skeleton/basicfwd.c                       |   4 +-
>  examples/tep_termination/main.c                    |   2 +-
>  examples/tep_termination/main.h                    |   2 +-
>  examples/tep_termination/vxlan.c                   | 115 +++----
>  examples/tep_termination/vxlan.h                   |   8 +-
>  examples/tep_termination/vxlan_setup.c             |  32 +-
>  examples/tep_termination/vxlan_setup.h             |   2 +-
>  examples/vhost/main.c                              |  42 +--
>  examples/vhost/main.h                              |   2 +-
>  examples/vm_power_manager/channel_monitor.c        |  12 +-
>  .../guest_cli/vm_power_cli_guest.c                 |   2 +-
>  examples/vm_power_manager/main.c                   |   6 +-
>  examples/vmdq/main.c                               |  12 +-
>  examples/vmdq_dcb/main.c                           |  12 +-
>  lib/librte_ethdev/rte_class_eth.c                  |   4 +-
>  lib/librte_ethdev/rte_eth_ctrl.h                   |  12 +-
>  lib/librte_ethdev/rte_ethdev.c                     |  59 ++--
>  lib/librte_ethdev/rte_ethdev.h                     |  15 +-
>  lib/librte_ethdev/rte_ethdev_core.h                |  12 +-
>  lib/librte_ethdev/rte_flow.h                       |  34 +-
>  lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  33 +-
>  lib/librte_gro/gro_tcp4.c                          |  26 +-
>  lib/librte_gro/gro_tcp4.h                          |  22 +-
>  lib/librte_gro/gro_vxlan_tcp4.c                    |  66 ++--
>  lib/librte_gro/gro_vxlan_tcp4.h                    |   6 +-
>  lib/librte_gso/gso_common.h                        |  16 +-
>  lib/librte_gso/gso_tcp4.c                          |  12 +-
>  lib/librte_gso/gso_tunnel_tcp4.c                   |  14 +-
>  lib/librte_gso/gso_udp4.c                          |  10 +-
>  lib/librte_gso/rte_gso.h                           |   8 +-
>  lib/librte_hash/rte_thash.h                        |   3 +-
>  lib/librte_ip_frag/rte_ip_frag.h                   |  13 +-
>  lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  42 +--
>  lib/librte_ip_frag/rte_ipv4_reassembly.c           |  14 +-
>  lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  28 +-
>  lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
>  lib/librte_ipsec/crypto.h                          |   2 +-
>  lib/librte_ipsec/esp_inb.c                         |  10 +-
>  lib/librte_ipsec/esp_outb.c                        |   8 +-
>  lib/librte_ipsec/iph.h                             |   8 +-
>  lib/librte_ipsec/sa.c                              |  10 +-
>  lib/librte_kni/rte_kni.c                           |   4 +-
>  lib/librte_kni/rte_kni.h                           |   2 +-
>  lib/librte_net/rte_arp.c                           |  33 +-
>  lib/librte_net/rte_arp.h                           |  36 +--
>  lib/librte_net/rte_esp.h                           |   2 +-
>  lib/librte_net/rte_ether.h                         | 189 ++++++------
>  lib/librte_net/rte_gre.h                           |   2 +-
>  lib/librte_net/rte_icmp.h                          |   6 +-
>  lib/librte_net/rte_ip.h                            |  75 ++---
>  lib/librte_net/rte_net.c                           |  94 +++---
>  lib/librte_net/rte_net.h                           |  28 +-
>  lib/librte_net/rte_sctp.h                          |   2 +-
>  lib/librte_net/rte_tcp.h                           |   2 +-
>  lib/librte_net/rte_udp.h                           |   2 +-
>  lib/librte_pipeline/rte_table_action.c             | 242 ++++++++-------
>  lib/librte_pipeline/rte_table_action.h             |   4 +-
>  lib/librte_port/rte_port_ras.c                     |  10 +-
>  lib/librte_port/rte_port_source_sink.c             |   6 +-
>  lib/librte_vhost/vhost.h                           |   2 +-
>  lib/librte_vhost/virtio_net.c                      |  43 +--
>  385 files changed, 4563 insertions(+), 4234 deletions(-)
> 

Looks good

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
  
Maxime Coquelin May 23, 2019, 11:41 a.m. UTC | #2
On 5/21/19 6:13 PM, Olivier Matz wrote:
> The rte_net headers conflict with the libc headers, because
> some definitions are duplicated, sometimes with few differences.
> 
> This patchset adds the rte_ (or RTE_) prefix to all structures, functions
> and defines in rte_net library. This is a big changeset, that will
> break the API of many functions, but not the ABI.
> 
> This was discussed in [1], and requested by the techboard [2].
> 
> patch-v1:
> * rease on top of v19.05
> * remove uneeded renames in drivers/net/bonding/rte_eth_bond_pmd.c
>    and app/test-pmd/icmpecho.c (arp-related variables)
> * do not modify base drivers, except cxgbe, thunderx, enetc, qede:
>    only files that already contain dpdk definitions are modified.
> * fix checkpatch issues when it does not impact the code style too
>    much. Big warnings remain about the RTE_IPv4() macros because
>    arguments are separated by ',' instead of ', '.
> * add a release note patch
> * tested compilation on x86_64-linux and x86_64-freebsd.
> 
> rfc-v2:
> * rebase on top of v19.05-rc1
> 
> 
> [1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
> [2] http://mails.dpdk.org/archives/dev/2019-February/125033.html
> 
> 
> Olivier Matz (15):
>    net: add rte prefix to arp structures
>    net: add rte prefix to arp defines
>    net: add rte prefix to ether structures
>    net: add rte prefix to ether functions
>    net: add rte prefix to ether defines
>    net: add rte prefix to esp structure
>    net: add rte prefix to gre structure
>    net: add rte prefix to icmp structure
>    net: add rte prefix to icmp defines
>    net: add rte prefix to ip structure
>    net: add rte prefix to ip defines
>    net: add rte prefix to sctp structure
>    net: add rte prefix to tcp structure
>    net: add rte prefix to udp structure
>    doc: announce network api change
> 
>   app/pdump/main.c                                   |   2 +-
>   app/test-acl/main.c                                |   2 +-
>   app/test-eventdev/test_perf_common.c               |   2 +-
>   app/test-eventdev/test_pipeline_common.c           |   2 +-
>   app/test-pipeline/pipeline_acl.c                   |  19 +-
>   app/test-pipeline/pipeline_hash.c                  |  12 +-
>   app/test-pmd/cmdline.c                             |  90 +++---
>   app/test-pmd/cmdline_flow.c                        |  86 +++---
>   app/test-pmd/config.c                              |  35 ++-
>   app/test-pmd/csumonly.c                            | 169 +++++-----
>   app/test-pmd/flowgen.c                             |  30 +-
>   app/test-pmd/icmpecho.c                            | 117 +++----
>   app/test-pmd/ieee1588fwd.c                         |  18 +-
>   app/test-pmd/macfwd.c                              |  12 +-
>   app/test-pmd/macswap.h                             |  12 +-
>   app/test-pmd/macswap_common.h                      |   4 +-
>   app/test-pmd/macswap_neon.h                        |  12 +-
>   app/test-pmd/macswap_sse.h                         |  12 +-
>   app/test-pmd/parameters.c                          |   6 +-
>   app/test-pmd/testpmd.c                             |  23 +-
>   app/test-pmd/testpmd.h                             |  30 +-
>   app/test-pmd/txonly.c                              |  45 +--
>   app/test-pmd/util.c                                |  34 +-
>   app/test/packet_burst_generator.c                  | 150 ++++-----
>   app/test/packet_burst_generator.h                  |  33 +-
>   app/test/test_acl.c                                |   8 +-
>   app/test/test_acl.h                                | 122 ++++----
>   app/test/test_cmdline_etheraddr.c                  |  16 +-
>   app/test/test_efd.c                                |  20 +-
>   app/test/test_event_eth_rx_adapter.c               |   2 +-
>   app/test/test_event_eth_tx_adapter.c               |   2 +-
>   app/test/test_flow_classify.c                      |  70 +++--
>   app/test/test_hash.c                               |  20 +-
>   app/test/test_ipsec.c                              |  13 +-
>   app/test/test_link_bonding.c                       | 342 ++++++++++++---------
>   app/test/test_link_bonding_mode4.c                 | 124 ++++----
>   app/test/test_link_bonding_rssconf.c               |   6 +-
>   app/test/test_lpm.c                                |  76 ++---
>   app/test/test_lpm_perf.c                           |  10 +-
>   app/test/test_member.c                             |  20 +-
>   app/test/test_pmd_perf.c                           |  20 +-
>   app/test/test_sched.c                              |  24 +-
>   app/test/test_table_acl.c                          |   8 +-
>   app/test/test_thash.c                              |  12 +-
>   app/test/virtual_pmd.c                             |   6 +-
>   app/test/virtual_pmd.h                             |   2 +-
>   doc/guides/nics/kni.rst                            |   2 +-
>   doc/guides/prog_guide/bbdev.rst                    |   6 +-
>   .../prog_guide/packet_classif_access_ctrl.rst      |  18 +-
>   doc/guides/prog_guide/rte_flow.rst                 |   4 +-
>   doc/guides/rel_notes/deprecation.rst               |   4 -
>   doc/guides/rel_notes/release_19_08.rst             |   3 +
>   doc/guides/sample_app_ug/flow_classify.rst         |  28 +-
>   doc/guides/sample_app_ug/flow_filtering.rst        |   6 +-
>   doc/guides/sample_app_ug/ip_frag.rst               |  16 +-
>   doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +-
>   doc/guides/sample_app_ug/ipv4_multicast.rst        |  16 +-
>   doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   6 +-
>   .../sample_app_ug/l2_forward_real_virtual.rst      |   6 +-
>   doc/guides/sample_app_ug/l3_forward.rst            |  12 +-
>   doc/guides/sample_app_ug/link_status_intr.rst      |   6 +-
>   doc/guides/sample_app_ug/ptpclient.rst             |   6 +-
>   doc/guides/sample_app_ug/rxtx_callbacks.rst        |   2 +-
>   doc/guides/sample_app_ug/server_node_efd.rst       |  12 +-
>   doc/guides/sample_app_ug/skeleton.rst              |   4 +-
>   doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   4 +-
>   drivers/bus/dpaa/include/compat.h                  |   2 +
>   drivers/bus/dpaa/include/fman.h                    |   2 +-
>   drivers/bus/dpaa/include/netcfg.h                  |   4 +-
>   drivers/net/af_packet/rte_eth_af_packet.c          |   2 +-
>   drivers/net/af_xdp/rte_eth_af_xdp.c                |   8 +-
>   drivers/net/ark/ark_ethdev.c                       |  19 +-
>   drivers/net/ark/ark_ext.h                          |   4 +-
>   drivers/net/ark/ark_global.h                       |   5 +-
>   drivers/net/atlantic/atl_ethdev.c                  |  27 +-
>   drivers/net/atlantic/hw_atl/hw_atl_utils.c         |   8 +-
>   drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c    |   4 +-
>   drivers/net/avp/avp_ethdev.c                       |  21 +-
>   drivers/net/avp/rte_avp_common.h                   |   2 +-
>   drivers/net/axgbe/axgbe_dev.c                      |   4 +-
>   drivers/net/axgbe/axgbe_ethdev.c                   |  10 +-
>   drivers/net/axgbe/axgbe_ethdev.h                   |   4 +-
>   drivers/net/axgbe/axgbe_rxtx.c                     |   2 +-
>   drivers/net/bnx2x/bnx2x.c                          |  16 +-
>   drivers/net/bnx2x/bnx2x_ethdev.c                   |   5 +-
>   drivers/net/bnx2x/bnx2x_ethdev.h                   |   3 +-
>   drivers/net/bnx2x/bnx2x_vfpf.c                     |   8 +-
>   drivers/net/bnx2x/bnx2x_vfpf.h                     |   2 +-
>   drivers/net/bnx2x/ecore_sp.h                       |   2 +-
>   drivers/net/bnxt/bnxt.h                            |   4 +-
>   drivers/net/bnxt/bnxt_ethdev.c                     |  80 ++---
>   drivers/net/bnxt/bnxt_filter.c                     |   4 +-
>   drivers/net/bnxt/bnxt_filter.h                     |   8 +-
>   drivers/net/bnxt/bnxt_flow.c                       |  27 +-
>   drivers/net/bnxt/bnxt_hwrm.c                       |  41 +--
>   drivers/net/bnxt/bnxt_hwrm.h                       |   2 +-
>   drivers/net/bnxt/bnxt_ring.c                       |   8 +-
>   drivers/net/bnxt/bnxt_rxq.c                        |   2 +-
>   drivers/net/bnxt/bnxt_rxr.c                        |   4 +-
>   drivers/net/bnxt/bnxt_vnic.c                       |   2 +-
>   drivers/net/bnxt/rte_pmd_bnxt.c                    |  14 +-
>   drivers/net/bnxt/rte_pmd_bnxt.h                    |   4 +-
>   drivers/net/bonding/rte_eth_bond.h                 |   2 +-
>   drivers/net/bonding/rte_eth_bond_8023ad.c          |  30 +-
>   drivers/net/bonding/rte_eth_bond_8023ad.h          |  10 +-
>   drivers/net/bonding/rte_eth_bond_8023ad_private.h  |   2 +-
>   drivers/net/bonding/rte_eth_bond_alb.c             |  98 +++---
>   drivers/net/bonding/rte_eth_bond_alb.h             |  10 +-
>   drivers/net/bonding/rte_eth_bond_api.c             |   2 +-
>   drivers/net/bonding/rte_eth_bond_args.c            |   2 +-
>   drivers/net/bonding/rte_eth_bond_pmd.c             | 203 ++++++------
>   drivers/net/bonding/rte_eth_bond_private.h         |   8 +-
>   drivers/net/cxgbe/base/adapter.h                   |   2 +-
>   drivers/net/cxgbe/cxgbe.h                          |   5 +-
>   drivers/net/cxgbe/cxgbe_compat.h                   |   1 +
>   drivers/net/cxgbe/cxgbe_ethdev.c                   |  14 +-
>   drivers/net/cxgbe/cxgbe_filter.h                   |   2 +-
>   drivers/net/cxgbe/cxgbe_flow.c                     |  10 +-
>   drivers/net/cxgbe/cxgbe_main.c                     |   4 +-
>   drivers/net/cxgbe/cxgbe_pfvf.h                     |   2 +-
>   drivers/net/cxgbe/cxgbevf_main.c                   |   2 +-
>   drivers/net/cxgbe/l2t.c                            |   8 +-
>   drivers/net/cxgbe/l2t.h                            |   2 +-
>   drivers/net/cxgbe/mps_tcam.c                       |  14 +-
>   drivers/net/cxgbe/mps_tcam.h                       |   4 +-
>   drivers/net/cxgbe/sge.c                            |   9 +-
>   drivers/net/dpaa/dpaa_ethdev.c                     |  20 +-
>   drivers/net/dpaa/dpaa_rxtx.c                       |  23 +-
>   drivers/net/dpaa2/dpaa2_ethdev.c                   |  37 +--
>   drivers/net/dpaa2/dpaa2_flow.c                     |  18 +-
>   drivers/net/e1000/e1000_ethdev.h                   |   5 +-
>   drivers/net/e1000/em_ethdev.c                      |  39 +--
>   drivers/net/e1000/em_rxtx.c                        |  24 +-
>   drivers/net/e1000/igb_ethdev.c                     |  76 ++---
>   drivers/net/e1000/igb_flow.c                       |  12 +-
>   drivers/net/e1000/igb_pf.c                         |  17 +-
>   drivers/net/e1000/igb_rxtx.c                       |  23 +-
>   drivers/net/ena/ena_ethdev.c                       |  17 +-
>   drivers/net/ena/ena_ethdev.h                       |   2 +-
>   drivers/net/enetc/base/enetc_hw.h                  |   4 +-
>   drivers/net/enetc/enetc_ethdev.c                   |  21 +-
>   drivers/net/enic/enic.h                            |   4 +-
>   drivers/net/enic/enic_clsf.c                       |  40 +--
>   drivers/net/enic/enic_ethdev.c                     |  29 +-
>   drivers/net/enic/enic_flow.c                       | 114 +++----
>   drivers/net/enic/enic_main.c                       |   4 +-
>   drivers/net/enic/enic_res.c                        |   5 +-
>   drivers/net/failsafe/failsafe.c                    |   8 +-
>   drivers/net/failsafe/failsafe_args.c               |   4 +-
>   drivers/net/failsafe/failsafe_ether.c              |   7 +-
>   drivers/net/failsafe/failsafe_ops.c                |   6 +-
>   drivers/net/failsafe/failsafe_private.h            |   4 +-
>   drivers/net/fm10k/fm10k.h                          |   2 +-
>   drivers/net/fm10k/fm10k_ethdev.c                   |  18 +-
>   drivers/net/i40e/i40e_ethdev.c                     | 143 +++++----
>   drivers/net/i40e/i40e_ethdev.h                     |  23 +-
>   drivers/net/i40e/i40e_ethdev_vf.c                  |  68 ++--
>   drivers/net/i40e/i40e_fdir.c                       | 127 ++++----
>   drivers/net/i40e/i40e_flow.c                       |  58 ++--
>   drivers/net/i40e/i40e_pf.c                         |  18 +-
>   drivers/net/i40e/i40e_rxtx.c                       |  28 +-
>   drivers/net/i40e/i40e_vf_representor.c             |   2 +-
>   drivers/net/i40e/rte_pmd_i40e.c                    |  31 +-
>   drivers/net/i40e/rte_pmd_i40e.h                    |   8 +-
>   drivers/net/iavf/iavf.h                            |   4 +-
>   drivers/net/iavf/iavf_ethdev.c                     |  53 ++--
>   drivers/net/iavf/iavf_rxtx.c                       |  14 +-
>   drivers/net/iavf/iavf_vchnl.c                      |   8 +-
>   drivers/net/ice/ice_ethdev.c                       |  64 ++--
>   drivers/net/ice/ice_ethdev.h                       |   6 +-
>   drivers/net/ice/ice_rxtx.c                         |  28 +-
>   drivers/net/ipn3ke/ipn3ke_ethdev.h                 |   6 +-
>   drivers/net/ipn3ke/ipn3ke_flow.c                   |   4 +-
>   drivers/net/ipn3ke/ipn3ke_representor.c            |  21 +-
>   drivers/net/ixgbe/ixgbe_ethdev.c                   | 107 ++++---
>   drivers/net/ixgbe/ixgbe_ethdev.h                   |   4 +-
>   drivers/net/ixgbe/ixgbe_flow.c                     |  22 +-
>   drivers/net/ixgbe/ixgbe_pf.c                       |  16 +-
>   drivers/net/ixgbe/ixgbe_rxtx.c                     |  18 +-
>   drivers/net/ixgbe/ixgbe_vf_representor.c           |   4 +-
>   drivers/net/ixgbe/rte_pmd_ixgbe.c                  |  11 +-
>   drivers/net/ixgbe/rte_pmd_ixgbe.h                  |   2 +-
>   drivers/net/kni/rte_eth_kni.c                      |   6 +-
>   drivers/net/liquidio/lio_ethdev.c                  |  23 +-
>   drivers/net/mlx4/mlx4.c                            |   4 +-
>   drivers/net/mlx4/mlx4.h                            |  10 +-
>   drivers/net/mlx4/mlx4_ethdev.c                     |  12 +-
>   drivers/net/mlx4/mlx4_flow.c                       |  16 +-
>   drivers/net/mlx4/mlx4_rxtx.c                       |   2 +-
>   drivers/net/mlx5/mlx5.c                            |   4 +-
>   drivers/net/mlx5/mlx5.h                            |  15 +-
>   drivers/net/mlx5/mlx5_flow.c                       |  22 +-
>   drivers/net/mlx5/mlx5_flow_dv.c                    |  44 +--
>   drivers/net/mlx5/mlx5_flow_tcf.c                   |  66 ++--
>   drivers/net/mlx5/mlx5_flow_verbs.c                 |  30 +-
>   drivers/net/mlx5/mlx5_mac.c                        |  18 +-
>   drivers/net/mlx5/mlx5_nl.c                         |  28 +-
>   drivers/net/mlx5/mlx5_rxtx.c                       |   6 +-
>   drivers/net/mlx5/mlx5_rxtx.h                       |   2 +-
>   drivers/net/mlx5/mlx5_rxtx_vec_neon.h              |   8 +-
>   drivers/net/mlx5/mlx5_rxtx_vec_sse.h               |  10 +-
>   drivers/net/mlx5/mlx5_trigger.c                    |   6 +-
>   drivers/net/mvneta/mvneta_ethdev.c                 |  22 +-
>   drivers/net/mvneta/mvneta_ethdev.h                 |   6 +-
>   drivers/net/mvpp2/mrvl_ethdev.c                    |  22 +-
>   drivers/net/mvpp2/mrvl_ethdev.h                    |   6 +-
>   drivers/net/mvpp2/mrvl_flow.c                      |   4 +-
>   drivers/net/netvsc/hn_ethdev.c                     |   4 +-
>   drivers/net/netvsc/hn_nvs.c                        |   2 +-
>   drivers/net/netvsc/hn_rndis.c                      |   2 +-
>   drivers/net/netvsc/hn_rxtx.c                       |  12 +-
>   drivers/net/netvsc/hn_var.h                        |   4 +-
>   drivers/net/netvsc/hn_vf.c                         |   8 +-
>   drivers/net/nfb/nfb_ethdev.c                       |  16 +-
>   drivers/net/nfp/nfp_net.c                          |  22 +-
>   drivers/net/nfp/nfp_net_pmd.h                      |   2 +-
>   drivers/net/null/rte_eth_null.c                    |   6 +-
>   drivers/net/octeontx/octeontx_ethdev.c             |   9 +-
>   drivers/net/octeontx/octeontx_ethdev.h             |   2 +-
>   drivers/net/pcap/rte_eth_pcap.c                    |  22 +-
>   drivers/net/qede/base/bcm_osal.h                   |   4 +-
>   drivers/net/qede/qede_ethdev.c                     |  71 +++--
>   drivers/net/qede/qede_ethdev.h                     |   6 +-
>   drivers/net/qede/qede_filter.c                     |  68 ++--
>   drivers/net/qede/qede_if.h                         |   4 +-
>   drivers/net/qede/qede_main.c                       |   6 +-
>   drivers/net/qede/qede_rxtx.c                       |  34 +-
>   drivers/net/qede/qede_rxtx.h                       |   2 +-
>   drivers/net/ring/rte_eth_ring.c                    |   4 +-
>   drivers/net/sfc/sfc.h                              |   2 +-
>   drivers/net/sfc/sfc_ef10_tx.c                      |   4 +-
>   drivers/net/sfc/sfc_ethdev.c                       |  24 +-
>   drivers/net/sfc/sfc_flow.c                         |  12 +-
>   drivers/net/sfc/sfc_port.c                         |   8 +-
>   drivers/net/sfc/sfc_tso.c                          |   4 +-
>   drivers/net/sfc/sfc_tso.h                          |   4 +-
>   drivers/net/softnic/parser.c                       |  18 +-
>   drivers/net/softnic/parser.h                       |   2 +-
>   drivers/net/softnic/rte_eth_softnic.c              |   2 +-
>   drivers/net/softnic/rte_eth_softnic_flow.c         |   4 +-
>   drivers/net/softnic/rte_eth_softnic_pipeline.c     |  40 +--
>   drivers/net/szedata2/rte_eth_szedata2.c            |   8 +-
>   drivers/net/tap/rte_eth_tap.c                      |  68 ++--
>   drivers/net/tap/rte_eth_tap.h                      |   4 +-
>   drivers/net/tap/tap_bpf_program.c                  |  14 +-
>   drivers/net/tap/tap_flow.c                         |  16 +-
>   drivers/net/thunderx/base/nicvf_plat.h             |   5 +-
>   drivers/net/thunderx/nicvf_ethdev.c                |  19 +-
>   drivers/net/thunderx/nicvf_struct.h                |   2 +-
>   drivers/net/vdev_netvsc/vdev_netvsc.c              |  16 +-
>   drivers/net/vhost/rte_eth_vhost.c                  |  12 +-
>   drivers/net/virtio/virtio_ethdev.c                 |  78 ++---
>   drivers/net/virtio/virtio_pci.h                    |   4 +-
>   drivers/net/virtio/virtio_rxtx.c                   |  33 +-
>   drivers/net/virtio/virtio_user/vhost_kernel_tap.c  |   2 +-
>   drivers/net/virtio/virtio_user/virtio_user_dev.c   |   6 +-
>   drivers/net/virtio/virtio_user/virtio_user_dev.h   |   2 +-
>   drivers/net/virtio/virtio_user_ethdev.c            |   8 +-
>   drivers/net/virtio/virtqueue.h                     |   2 +-
>   drivers/net/vmxnet3/vmxnet3_ethdev.c               |  12 +-
>   drivers/net/vmxnet3/vmxnet3_ethdev.h               |   2 +-
>   drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  47 +--
>   examples/bbdev_app/main.c                          |  41 +--
>   examples/bond/main.c                               |  83 ++---
>   examples/distributor/main.c                        |   4 +-
>   examples/ethtool/ethtool-app/ethapp.c              |   8 +-
>   examples/ethtool/ethtool-app/main.c                |  10 +-
>   examples/ethtool/lib/rte_ethtool.c                 |   8 +-
>   examples/ethtool/lib/rte_ethtool.h                 |   7 +-
>   examples/eventdev_pipeline/main.c                  |   4 +-
>   examples/eventdev_pipeline/pipeline_common.h       |  10 +-
>   examples/flow_classify/flow_classify.c             |  30 +-
>   examples/flow_filtering/main.c                     |  10 +-
>   examples/ip_fragmentation/main.c                   |  69 +++--
>   examples/ip_pipeline/cli.c                         |   4 +-
>   examples/ip_pipeline/kni.c                         |   2 +-
>   examples/ip_pipeline/parser.c                      |  18 +-
>   examples/ip_pipeline/parser.h                      |   2 +-
>   examples/ip_pipeline/pipeline.c                    |  40 +--
>   examples/ip_reassembly/main.c                      |  51 +--
>   examples/ipsec-secgw/esp.c                         |  47 +--
>   examples/ipsec-secgw/ipsec-secgw.c                 |  43 +--
>   examples/ipsec-secgw/ipsec.h                       |   2 +-
>   examples/ipsec-secgw/parser.c                      |   4 +-
>   examples/ipsec-secgw/sa.c                          |  16 +-
>   examples/ipv4_multicast/main.c                     |  60 ++--
>   examples/kni/main.c                                |  14 +-
>   examples/l2fwd-cat/l2fwd-cat.c                     |   4 +-
>   examples/l2fwd-crypto/main.c                       |  26 +-
>   examples/l2fwd-jobstats/main.c                     |   8 +-
>   examples/l2fwd-keepalive/main.c                    |   8 +-
>   examples/l2fwd/main.c                              |   8 +-
>   examples/l3fwd-acl/main.c                          | 106 ++++---
>   examples/l3fwd-power/main.c                        | 102 +++---
>   examples/l3fwd-vf/main.c                           |  68 ++--
>   examples/l3fwd/l3fwd.h                             |   8 +-
>   examples/l3fwd/l3fwd_altivec.h                     |  26 +-
>   examples/l3fwd/l3fwd_common.h                      |   4 +-
>   examples/l3fwd/l3fwd_em.c                          |  46 +--
>   examples/l3fwd/l3fwd_em.h                          |  22 +-
>   examples/l3fwd/l3fwd_em_hlm.h                      |  19 +-
>   examples/l3fwd/l3fwd_em_hlm_neon.h                 |  20 +-
>   examples/l3fwd/l3fwd_em_hlm_sse.h                  |  16 +-
>   examples/l3fwd/l3fwd_em_sequential.h               |  19 +-
>   examples/l3fwd/l3fwd_lpm.c                         |  50 +--
>   examples/l3fwd/l3fwd_lpm.h                         |  22 +-
>   examples/l3fwd/l3fwd_lpm_altivec.h                 |  20 +-
>   examples/l3fwd/l3fwd_lpm_neon.h                    |  30 +-
>   examples/l3fwd/l3fwd_lpm_sse.h                     |  20 +-
>   examples/l3fwd/l3fwd_neon.h                        |  26 +-
>   examples/l3fwd/l3fwd_sse.h                         |  26 +-
>   examples/l3fwd/main.c                              |  20 +-
>   examples/link_status_interrupt/main.c              |   8 +-
>   examples/load_balancer/runtime.c                   |   8 +-
>   .../client_server_mp/mp_server/main.c              |   2 +-
>   examples/packet_ordering/main.c                    |   2 +-
>   examples/performance-thread/l3fwd-thread/main.c    | 337 ++++++++++----------
>   examples/ptpclient/ptpclient.c                     |  32 +-
>   examples/qos_meter/main.c                          |   5 +-
>   examples/qos_sched/init.c                          |   2 +-
>   examples/quota_watermark/qw/main.c                 |   8 +-
>   examples/rxtx_callbacks/main.c                     |   4 +-
>   examples/server_node_efd/node/node.c               |   6 +-
>   examples/server_node_efd/server/main.c             |   8 +-
>   examples/skeleton/basicfwd.c                       |   4 +-
>   examples/tep_termination/main.c                    |   2 +-
>   examples/tep_termination/main.h                    |   2 +-
>   examples/tep_termination/vxlan.c                   | 115 +++----
>   examples/tep_termination/vxlan.h                   |   8 +-
>   examples/tep_termination/vxlan_setup.c             |  32 +-
>   examples/tep_termination/vxlan_setup.h             |   2 +-
>   examples/vhost/main.c                              |  42 +--
>   examples/vhost/main.h                              |   2 +-
>   examples/vm_power_manager/channel_monitor.c        |  12 +-
>   .../guest_cli/vm_power_cli_guest.c                 |   2 +-
>   examples/vm_power_manager/main.c                   |   6 +-
>   examples/vmdq/main.c                               |  12 +-
>   examples/vmdq_dcb/main.c                           |  12 +-
>   lib/librte_ethdev/rte_class_eth.c                  |   4 +-
>   lib/librte_ethdev/rte_eth_ctrl.h                   |  12 +-
>   lib/librte_ethdev/rte_ethdev.c                     |  59 ++--
>   lib/librte_ethdev/rte_ethdev.h                     |  15 +-
>   lib/librte_ethdev/rte_ethdev_core.h                |  12 +-
>   lib/librte_ethdev/rte_flow.h                       |  34 +-
>   lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  33 +-
>   lib/librte_gro/gro_tcp4.c                          |  26 +-
>   lib/librte_gro/gro_tcp4.h                          |  22 +-
>   lib/librte_gro/gro_vxlan_tcp4.c                    |  66 ++--
>   lib/librte_gro/gro_vxlan_tcp4.h                    |   6 +-
>   lib/librte_gso/gso_common.h                        |  16 +-
>   lib/librte_gso/gso_tcp4.c                          |  12 +-
>   lib/librte_gso/gso_tunnel_tcp4.c                   |  14 +-
>   lib/librte_gso/gso_udp4.c                          |  10 +-
>   lib/librte_gso/rte_gso.h                           |   8 +-
>   lib/librte_hash/rte_thash.h                        |   3 +-
>   lib/librte_ip_frag/rte_ip_frag.h                   |  13 +-
>   lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  42 +--
>   lib/librte_ip_frag/rte_ipv4_reassembly.c           |  14 +-
>   lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  28 +-
>   lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
>   lib/librte_ipsec/crypto.h                          |   2 +-
>   lib/librte_ipsec/esp_inb.c                         |  10 +-
>   lib/librte_ipsec/esp_outb.c                        |   8 +-
>   lib/librte_ipsec/iph.h                             |   8 +-
>   lib/librte_ipsec/sa.c                              |  10 +-
>   lib/librte_kni/rte_kni.c                           |   4 +-
>   lib/librte_kni/rte_kni.h                           |   2 +-
>   lib/librte_net/rte_arp.c                           |  33 +-
>   lib/librte_net/rte_arp.h                           |  36 +--
>   lib/librte_net/rte_esp.h                           |   2 +-
>   lib/librte_net/rte_ether.h                         | 189 ++++++------
>   lib/librte_net/rte_gre.h                           |   2 +-
>   lib/librte_net/rte_icmp.h                          |   6 +-
>   lib/librte_net/rte_ip.h                            |  75 ++---
>   lib/librte_net/rte_net.c                           |  94 +++---
>   lib/librte_net/rte_net.h                           |  28 +-
>   lib/librte_net/rte_sctp.h                          |   2 +-
>   lib/librte_net/rte_tcp.h                           |   2 +-
>   lib/librte_net/rte_udp.h                           |   2 +-
>   lib/librte_pipeline/rte_table_action.c             | 242 ++++++++-------
>   lib/librte_pipeline/rte_table_action.h             |   4 +-
>   lib/librte_port/rte_port_ras.c                     |  10 +-
>   lib/librte_port/rte_port_source_sink.c             |   6 +-
>   lib/librte_vhost/vhost.h                           |   2 +-
>   lib/librte_vhost/virtio_net.c                      |  43 +--
>   385 files changed, 4563 insertions(+), 4234 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Ferruh Yigit May 24, 2019, 11:38 a.m. UTC | #3
On 5/21/2019 5:13 PM, Olivier Matz wrote:
> The rte_net headers conflict with the libc headers, because
> some definitions are duplicated, sometimes with few differences.
> 
> This patchset adds the rte_ (or RTE_) prefix to all structures, functions
> and defines in rte_net library. This is a big changeset, that will
> break the API of many functions, but not the ABI.
> 
> This was discussed in [1], and requested by the techboard [2].
> 
> patch-v1:
> * rease on top of v19.05
> * remove uneeded renames in drivers/net/bonding/rte_eth_bond_pmd.c
>   and app/test-pmd/icmpecho.c (arp-related variables)
> * do not modify base drivers, except cxgbe, thunderx, enetc, qede:
>   only files that already contain dpdk definitions are modified.
> * fix checkpatch issues when it does not impact the code style too
>   much. Big warnings remain about the RTE_IPv4() macros because
>   arguments are separated by ',' instead of ', '.
> * add a release note patch
> * tested compilation on x86_64-linux and x86_64-freebsd.
> 
> rfc-v2:
> * rebase on top of v19.05-rc1
> 
> 
> [1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
> [2] http://mails.dpdk.org/archives/dev/2019-February/125033.html
> 
> 
> Olivier Matz (15):
>   net: add rte prefix to arp structures
>   net: add rte prefix to arp defines
>   net: add rte prefix to ether structures
>   net: add rte prefix to ether functions
>   net: add rte prefix to ether defines
>   net: add rte prefix to esp structure
>   net: add rte prefix to gre structure
>   net: add rte prefix to icmp structure
>   net: add rte prefix to icmp defines
>   net: add rte prefix to ip structure
>   net: add rte prefix to ip defines
>   net: add rte prefix to sctp structure
>   net: add rte prefix to tcp structure
>   net: add rte prefix to udp structure
>   doc: announce network api change

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

For series,
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Series applied to dpdk-next-net/master, thanks.
  
David Marchand May 29, 2019, 7:59 a.m. UTC | #4
On Fri, May 24, 2019 at 1:38 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:

> On 5/21/2019 5:13 PM, Olivier Matz wrote:
> > The rte_net headers conflict with the libc headers, because
> > some definitions are duplicated, sometimes with few differences.
> >
> > This patchset adds the rte_ (or RTE_) prefix to all structures, functions
> > and defines in rte_net library. This is a big changeset, that will
> > break the API of many functions, but not the ABI.
> >
> > This was discussed in [1], and requested by the techboard [2].
> >
> > patch-v1:
> > * rease on top of v19.05
> > * remove uneeded renames in drivers/net/bonding/rte_eth_bond_pmd.c
> >   and app/test-pmd/icmpecho.c (arp-related variables)
> > * do not modify base drivers, except cxgbe, thunderx, enetc, qede:
> >   only files that already contain dpdk definitions are modified.
> > * fix checkpatch issues when it does not impact the code style too
> >   much. Big warnings remain about the RTE_IPv4() macros because
> >   arguments are separated by ',' instead of ', '.
> > * add a release note patch
> > * tested compilation on x86_64-linux and x86_64-freebsd.
> >
> > rfc-v2:
> > * rebase on top of v19.05-rc1
> >
> >
> > [1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
> > [2] http://mails.dpdk.org/archives/dev/2019-February/125033.html
> >
> >
> > Olivier Matz (15):
> >   net: add rte prefix to arp structures
> >   net: add rte prefix to arp defines
> >   net: add rte prefix to ether structures
> >   net: add rte prefix to ether functions
> >   net: add rte prefix to ether defines
> >   net: add rte prefix to esp structure
> >   net: add rte prefix to gre structure
> >   net: add rte prefix to icmp structure
> >   net: add rte prefix to icmp defines
> >   net: add rte prefix to ip structure
> >   net: add rte prefix to ip defines
> >   net: add rte prefix to sctp structure
> >   net: add rte prefix to tcp structure
> >   net: add rte prefix to udp structure
> >   doc: announce network api change
>
> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> For series,
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
>
> Series applied to dpdk-next-net/master, thanks.
>

Sorry, late to the party...

Since we change those defines, we might as well avoid these warnings:
CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv4>
CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv6>

I can send a patch.
  
Olivier Matz May 29, 2019, 2:46 p.m. UTC | #5
On Wed, May 29, 2019 at 09:59:11AM +0200, David Marchand wrote:
> On Fri, May 24, 2019 at 1:38 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
> 
> > On 5/21/2019 5:13 PM, Olivier Matz wrote:
> > > The rte_net headers conflict with the libc headers, because
> > > some definitions are duplicated, sometimes with few differences.
> > >
> > > This patchset adds the rte_ (or RTE_) prefix to all structures, functions
> > > and defines in rte_net library. This is a big changeset, that will
> > > break the API of many functions, but not the ABI.
> > >
> > > This was discussed in [1], and requested by the techboard [2].
> > >
> > > patch-v1:
> > > * rease on top of v19.05
> > > * remove uneeded renames in drivers/net/bonding/rte_eth_bond_pmd.c
> > >   and app/test-pmd/icmpecho.c (arp-related variables)
> > > * do not modify base drivers, except cxgbe, thunderx, enetc, qede:
> > >   only files that already contain dpdk definitions are modified.
> > > * fix checkpatch issues when it does not impact the code style too
> > >   much. Big warnings remain about the RTE_IPv4() macros because
> > >   arguments are separated by ',' instead of ', '.
> > > * add a release note patch
> > > * tested compilation on x86_64-linux and x86_64-freebsd.
> > >
> > > rfc-v2:
> > > * rebase on top of v19.05-rc1
> > >
> > >
> > > [1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
> > > [2] http://mails.dpdk.org/archives/dev/2019-February/125033.html
> > >
> > >
> > > Olivier Matz (15):
> > >   net: add rte prefix to arp structures
> > >   net: add rte prefix to arp defines
> > >   net: add rte prefix to ether structures
> > >   net: add rte prefix to ether functions
> > >   net: add rte prefix to ether defines
> > >   net: add rte prefix to esp structure
> > >   net: add rte prefix to gre structure
> > >   net: add rte prefix to icmp structure
> > >   net: add rte prefix to icmp defines
> > >   net: add rte prefix to ip structure
> > >   net: add rte prefix to ip defines
> > >   net: add rte prefix to sctp structure
> > >   net: add rte prefix to tcp structure
> > >   net: add rte prefix to udp structure
> > >   doc: announce network api change
> >
> > Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
> > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> >
> > For series,
> > Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> >
> > Series applied to dpdk-next-net/master, thanks.
> >
> 
> Sorry, late to the party...
> 
> Since we change those defines, we might as well avoid these warnings:
> CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv4>
> CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv6>
> 
> I can send a patch.

Thanks.

By the way, here is below a script that can be used to ease the
porting of an application. It includes modifications proposed by
David [1].

It is probably not 100% reliable, but it will do most of the job.


Olivier

[1] https://mails.dpdk.org/archives/dev/2019-May/133060.html

-----------------------
#!/bin/bash

# Prefix network structure/defines/functions with "rte_".

set -e

if [ $# = 0 ]; then
	echo 'usage: $0 <files>'
	exit 1
fi

files="$@"

# $1: pattern
# $2: replacement
replace()
{
	local pattern="$1"
	local replace="$2"

	sed -i -e "s,${pattern},${replace},g" ${files}
}

# $*: function names
replace_function()
{
	for i in $*; do
		replace "\<$i\>(" "rte_$i("
	done
}

# $*: define names
replace_define()
{
	for i in $*; do
		local pattern
		case "$i" in
			*'(')
				pattern="\<${i%(}\>("
				;;
			*)
				pattern="\<${i}\>"
				;;
		esac
		replace "$pattern" "RTE_${i^^}"
	done
}

# $*: struct names
replace_struct()
{
	for i in $*; do
		replace "struct\([ 	][ 	]*\)\<$i\>" "struct\1rte_$i"
	done
}

replace arp_hrd arp_hardware
replace arp_pro arp_protocol
replace arp_hln arp_hlen
replace arp_pln arp_plen
replace arp_op arp_opcode
replace_struct arp_hdr arp_ipv4
replace_define ARP_HRD_ETHER ARP_OP_REQUEST ARP_OP_REPLY ARP_OP_REVREQUEST \
	       ARP_OP_REVREPLY ARP_OP_INVREQUEST ARP_OP_INVREPLY
replace_struct ether_addr ether_hdr vlan_hdr vxlan_hdr vxlan_gpe_hdr
replace_function is_same_ether_addr is_zero_ether_addr is_unicast_ether_addr \
		 is_multicast_ether_addr is_broadcast_ether_addr \
		 is_universal_ether_addr is_local_admin_ether_addr \
		 is_valid_assigned_ether_addr eth_random_addr ether_addr_copy \
		 ether_format_addr
replace_define ETHER_ADDR_LEN ETHER_TYPE_LEN ETHER_CRC_LEN ETHER_HDR_LEN \
	       ETHER_MIN_LEN ETHER_MAX_LEN ETHER_MTU ETHER_MAX_VLAN_FRAME_LEN \
	       ETHER_MAX_VLAN_ID ETHER_MAX_JUMBO_FRAME_LEN ETHER_MIN_MTU \
	       ETHER_LOCAL_ADMIN_ADDR ETHER_GROUP_ADDR ETHER_TYPE_IPv4 \
	       ETHER_TYPE_IPv6 ETHER_TYPE_ARP ETHER_TYPE_VLAN ETHER_TYPE_RARP \
	       ETHER_TYPE_QINQ ETHER_TYPE_ETAG ETHER_TYPE_1588 ETHER_TYPE_SLOW \
	       ETHER_TYPE_TEB ETHER_TYPE_LLDP ETHER_TYPE_MPLS ETHER_TYPE_MPLSM \
	       ETHER_VXLAN_HLEN ETHER_ADDR_FMT_SIZE VXLAN_GPE_TYPE_IPV4 \
	       VXLAN_GPE_TYPE_IPV6 VXLAN_GPE_TYPE_ETH VXLAN_GPE_TYPE_NSH \
	       VXLAN_GPE_TYPE_MPLS VXLAN_GPE_TYPE_GBP VXLAN_GPE_TYPE_VBNG \
	       ETHER_VXLAN_GPE_HLEN
replace_struct esp_hdr
replace_struct gre_hdr
replace_struct icmp_hdr
replace_define IP_ICMP_ECHO_REPLY IP_ICMP_ECHO_REQUEST
replace_struct ipv4_hdr ipv6_hdr
replace_define "IPv4(" IPV4_MAX_PKT_LEN IPV4_HDR_IHL_MASK IPV4_IHL_MULTIPLIER \
	       IPV4_HDR_DF_SHIFT IPV4_HDR_MF_SHIFT IPV4_HDR_FO_SHIFT \
	       IPV4_HDR_DF_FLAG IPV4_HDR_MF_FLAG IPV4_HDR_OFFSET_MASK \
	       IPV4_HDR_OFFSET_UNITS IPV4_ANY IPV4_LOOPBACK IPV4_BROADCAST \
	       IPV4_ALLHOSTS_GROUP IPV4_ALLRTRS_GROUP IPV4_MAX_LOCAL_GROUP \
	       IPV4_MIN_MCAST IPV4_MAX_MCAST IS_IPV4_MCAST IPV6_HDR_FL_SHIFT \
	       IPV6_HDR_TC_SHIFT IPV6_HDR_FL_MASK IPV6_HDR_TC_MASK
replace_struct sctp_hdr
replace_struct tcp_hdr
replace_struct udp_hdr
  
David Marchand May 29, 2019, 5:29 p.m. UTC | #6
On Wed, May 29, 2019 at 6:50 PM Olivier Matz <olivier.matz@6wind.com> wrote:

> On Wed, May 29, 2019 at 09:59:11AM +0200, David Marchand wrote:
> > On Fri, May 24, 2019 at 1:38 PM Ferruh Yigit <ferruh.yigit@intel.com>
> wrote:
> >
> > > On 5/21/2019 5:13 PM, Olivier Matz wrote:
> > > > The rte_net headers conflict with the libc headers, because
> > > > some definitions are duplicated, sometimes with few differences.
> > > >
> > > > This patchset adds the rte_ (or RTE_) prefix to all structures,
> functions
> > > > and defines in rte_net library. This is a big changeset, that will
> > > > break the API of many functions, but not the ABI.
> > > >
> > > > This was discussed in [1], and requested by the techboard [2].
> > > >
> > > > patch-v1:
> > > > * rease on top of v19.05
> > > > * remove uneeded renames in drivers/net/bonding/rte_eth_bond_pmd.c
> > > >   and app/test-pmd/icmpecho.c (arp-related variables)
> > > > * do not modify base drivers, except cxgbe, thunderx, enetc, qede:
> > > >   only files that already contain dpdk definitions are modified.
> > > > * fix checkpatch issues when it does not impact the code style too
> > > >   much. Big warnings remain about the RTE_IPv4() macros because
> > > >   arguments are separated by ',' instead of ', '.
> > > > * add a release note patch
> > > > * tested compilation on x86_64-linux and x86_64-freebsd.
> > > >
> > > > rfc-v2:
> > > > * rebase on top of v19.05-rc1
> > > >
> > > >
> > > > [1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
> > > > [2] http://mails.dpdk.org/archives/dev/2019-February/125033.html
> > > >
> > > >
> > > > Olivier Matz (15):
> > > >   net: add rte prefix to arp structures
> > > >   net: add rte prefix to arp defines
> > > >   net: add rte prefix to ether structures
> > > >   net: add rte prefix to ether functions
> > > >   net: add rte prefix to ether defines
> > > >   net: add rte prefix to esp structure
> > > >   net: add rte prefix to gre structure
> > > >   net: add rte prefix to icmp structure
> > > >   net: add rte prefix to icmp defines
> > > >   net: add rte prefix to ip structure
> > > >   net: add rte prefix to ip defines
> > > >   net: add rte prefix to sctp structure
> > > >   net: add rte prefix to tcp structure
> > > >   net: add rte prefix to udp structure
> > > >   doc: announce network api change
> > >
> > > Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
> > > Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> > >
> > > For series,
> > > Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > >
> > > Series applied to dpdk-next-net/master, thanks.
> > >
> >
> > Sorry, late to the party...
> >
> > Since we change those defines, we might as well avoid these warnings:
> > CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv4>
> > CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv6>
> >
> > I can send a patch.
>
> Thanks.
>
> By the way, here is below a script that can be used to ease the
> porting of an application. It includes modifications proposed by
> David [1].
>
> It is probably not 100% reliable, but it will do most of the job.
>
>
> Olivier
>
> [1] https://mails.dpdk.org/archives/dev/2019-May/133060.html
>
> -----------------------
> #!/bin/bash
>
> # Prefix network structure/defines/functions with "rte_".
>
> set -e
>
> if [ $# = 0 ]; then
>         echo 'usage: $0 <files>'
>         exit 1
> fi
>
> files="$@"
>
> # $1: pattern
> # $2: replacement
> replace()
> {
>         local pattern="$1"
>         local replace="$2"
>
>         sed -i -e "s,${pattern},${replace},g" ${files}
> }
>
> # $*: function names
> replace_function()
> {
>         for i in $*; do
>                 replace "\<$i\>(" "rte_$i("
>         done
> }
>
> # $*: define names
> replace_define()
> {
>         for i in $*; do
>                 local pattern
>                 case "$i" in
>                         *'(')
>                                 pattern="\<${i%(}\>("
>                                 ;;
>                         *)
>                                 pattern="\<${i}\>"
>                                 ;;
>                 esac
>                 replace "$pattern" "RTE_${i^^}"
>         done
> }
>
> # $*: struct names
> replace_struct()
> {
>         for i in $*; do
>                 replace "struct\([      ][      ]*\)\<$i\>"
> "struct\1rte_$i"
>         done
> }
>
> replace arp_hrd arp_hardware
> replace arp_pro arp_protocol
> replace arp_hln arp_hlen
> replace arp_pln arp_plen
> replace arp_op arp_opcode
> replace_struct arp_hdr arp_ipv4
> replace_define ARP_HRD_ETHER ARP_OP_REQUEST ARP_OP_REPLY ARP_OP_REVREQUEST
> \
>                ARP_OP_REVREPLY ARP_OP_INVREQUEST ARP_OP_INVREPLY
> replace_struct ether_addr ether_hdr vlan_hdr vxlan_hdr vxlan_gpe_hdr
> replace_function is_same_ether_addr is_zero_ether_addr
> is_unicast_ether_addr \
>                  is_multicast_ether_addr is_broadcast_ether_addr \
>                  is_universal_ether_addr is_local_admin_ether_addr \
>                  is_valid_assigned_ether_addr eth_random_addr
> ether_addr_copy \
>                  ether_format_addr
> replace_define ETHER_ADDR_LEN ETHER_TYPE_LEN ETHER_CRC_LEN ETHER_HDR_LEN \
>                ETHER_MIN_LEN ETHER_MAX_LEN ETHER_MTU
> ETHER_MAX_VLAN_FRAME_LEN \
>                ETHER_MAX_VLAN_ID ETHER_MAX_JUMBO_FRAME_LEN ETHER_MIN_MTU \
>                ETHER_LOCAL_ADMIN_ADDR ETHER_GROUP_ADDR ETHER_TYPE_IPv4 \
>                ETHER_TYPE_IPv6 ETHER_TYPE_ARP ETHER_TYPE_VLAN
> ETHER_TYPE_RARP \
>                ETHER_TYPE_QINQ ETHER_TYPE_ETAG ETHER_TYPE_1588
> ETHER_TYPE_SLOW \
>                ETHER_TYPE_TEB ETHER_TYPE_LLDP ETHER_TYPE_MPLS
> ETHER_TYPE_MPLSM \
>                ETHER_VXLAN_HLEN ETHER_ADDR_FMT_SIZE VXLAN_GPE_TYPE_IPV4 \
>                VXLAN_GPE_TYPE_IPV6 VXLAN_GPE_TYPE_ETH VXLAN_GPE_TYPE_NSH \
>                VXLAN_GPE_TYPE_MPLS VXLAN_GPE_TYPE_GBP VXLAN_GPE_TYPE_VBNG \
>                ETHER_VXLAN_GPE_HLEN
> replace_struct esp_hdr
> replace_struct gre_hdr
> replace_struct icmp_hdr
> replace_define IP_ICMP_ECHO_REPLY IP_ICMP_ECHO_REQUEST
> replace_struct ipv4_hdr ipv6_hdr
> replace_define "IPv4(" IPV4_MAX_PKT_LEN IPV4_HDR_IHL_MASK
> IPV4_IHL_MULTIPLIER \
>                IPV4_HDR_DF_SHIFT IPV4_HDR_MF_SHIFT IPV4_HDR_FO_SHIFT \
>                IPV4_HDR_DF_FLAG IPV4_HDR_MF_FLAG IPV4_HDR_OFFSET_MASK \
>                IPV4_HDR_OFFSET_UNITS IPV4_ANY IPV4_LOOPBACK IPV4_BROADCAST
> \
>                IPV4_ALLHOSTS_GROUP IPV4_ALLRTRS_GROUP IPV4_MAX_LOCAL_GROUP
> \
>                IPV4_MIN_MCAST IPV4_MAX_MCAST IS_IPV4_MCAST
> IPV6_HDR_FL_SHIFT \
>                IPV6_HDR_TC_SHIFT IPV6_HDR_FL_MASK IPV6_HDR_TC_MASK
> replace_struct sctp_hdr
> replace_struct tcp_hdr
> replace_struct udp_hdr
>

Thanks Olivier.

I tested this script against OVS dpdk-latest branch and did not catch any
false positive, so I will submit the changes to OVS ml once my latest
changes are in.
  
Thomas Monjalon May 29, 2019, 9:15 p.m. UTC | #7
29/05/2019 19:29, David Marchand:
> On Wed, May 29, 2019 at 6:50 PM Olivier Matz <olivier.matz@6wind.com> wrote:
> > By the way, here is below a script that can be used to ease the
> > porting of an application. It includes modifications proposed by
> > David [1].
> >
> > It is probably not 100% reliable, but it will do most of the job.
> 
> Thanks Olivier.
> 
> I tested this script against OVS dpdk-latest branch and did not catch any
> false positive, so I will submit the changes to OVS ml once my latest
> changes are in.

Should we get this script in DPDK?