prefix network structures
Subsystems (3)
RFC v2 3/14 net: add rte prefix to ether structures
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct ether_addr as struct rte_ether_addr.
- rename struct ether_hdr as struct rte_ether_hdr.
- rename struct vlan_hdr as struct rte_vlan_hdr.
- rename struct vxlan_hdr as struct rte_vxlan_hdr.
- rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr.
Do not update the command line library to avoid adding a dependency to librte_net.
--- app/pdump/main.c | 2 +- app/test-pipeline/pipeline_acl.c | 10 +- app/test-pipeline/pipeline_hash.c | 4 +- app/test-pmd/cmdline.c | 50 +++---- app/test-pmd/cmdline_flow.c | 2 +- app/test-pmd/config.c | 24 ++-- app/test-pmd/csumonly.c | 30 ++--- app/test-pmd/flowgen.c | 10 +- app/test-pmd/icmpecho.c | 18 +-- app/test-pmd/ieee1588fwd.c | 8 +- app/test-pmd/macfwd.c | 6 +- app/test-pmd/macswap.h | 6 +- app/test-pmd/macswap_common.h | 2 +- app/test-pmd/macswap_neon.h | 12 +- app/test-pmd/macswap_sse.h | 12 +- app/test-pmd/testpmd.c | 4 +- app/test-pmd/testpmd.h | 10 +- app/test-pmd/txonly.c | 14 +- app/test-pmd/util.c | 12 +- app/test/packet_burst_generator.c | 26 ++-- app/test/packet_burst_generator.h | 12 +- app/test/test_cmdline_etheraddr.c | 14 +- app/test/test_event_eth_rx_adapter.c | 2 +- app/test/test_event_eth_tx_adapter.c | 2 +- app/test/test_flow_classify.c | 34 ++--- app/test/test_link_bonding.c | 146 ++++++++++----------- app/test/test_link_bonding_mode4.c | 52 ++++---- app/test/test_link_bonding_rssconf.c | 2 +- app/test/test_pmd_perf.c | 10 +- app/test/test_sched.c | 12 +- app/test/virtual_pmd.c | 4 +- app/test/virtual_pmd.h | 2 +- doc/guides/prog_guide/bbdev.rst | 6 +- doc/guides/sample_app_ug/flow_classify.rst | 12 +- doc/guides/sample_app_ug/flow_filtering.rst | 6 +- doc/guides/sample_app_ug/ipv4_multicast.rst | 8 +- doc/guides/sample_app_ug/l2_forward_job_stats.rst | 4 +- .../sample_app_ug/l2_forward_real_virtual.rst | 4 +- doc/guides/sample_app_ug/l3_forward.rst | 8 +- doc/guides/sample_app_ug/link_status_intr.rst | 4 +- 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 | 4 +- doc/guides/sample_app_ug/skeleton.rst | 2 +- doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst | 4 +- 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 | 4 +- drivers/net/ark/ark_ethdev.c | 12 +- drivers/net/ark/ark_ext.h | 4 +- drivers/net/ark/ark_global.h | 4 +- drivers/net/atlantic/atl_ethdev.c | 12 +- 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 | 6 +- drivers/net/axgbe/axgbe_ethdev.h | 2 +- drivers/net/bnx2x/bnx2x.c | 8 +- drivers/net/bnx2x/bnx2x_ethdev.c | 4 +- drivers/net/bnx2x/bnx2x_ethdev.h | 2 +- drivers/net/bnx2x/bnx2x_vfpf.c | 2 +- drivers/net/bnx2x/bnx2x_vfpf.h | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 6 +- drivers/net/bnxt/bnxt_hwrm.c | 4 +- drivers/net/bnxt/bnxt_hwrm.h | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 6 +- drivers/net/bnxt/rte_pmd_bnxt.h | 4 +- drivers/net/bonding/rte_eth_bond.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 6 +- 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 | 24 ++-- 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 | 80 +++++------ drivers/net/bonding/rte_eth_bond_private.h | 6 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/cxgbe/cxgbe_pfvf.h | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 4 +- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 18 +-- drivers/net/dpaa2/dpaa2_flow.c | 18 +-- drivers/net/e1000/em_ethdev.c | 14 +- drivers/net/e1000/igb_ethdev.c | 24 ++-- drivers/net/e1000/igb_pf.c | 4 +- drivers/net/ena/ena_ethdev.c | 8 +- drivers/net/enetc/enetc_ethdev.c | 2 +- drivers/net/enic/enic.h | 2 +- drivers/net/enic/enic_ethdev.c | 12 +- drivers/net/enic/enic_flow.c | 28 ++-- drivers/net/enic/enic_main.c | 4 +- drivers/net/failsafe/failsafe.c | 2 +- drivers/net/failsafe/failsafe_args.c | 2 +- drivers/net/failsafe/failsafe_ether.c | 2 +- drivers/net/failsafe/failsafe_ops.c | 6 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k_ethdev.c | 8 +- drivers/net/i40e/i40e_ethdev.c | 58 ++++---- drivers/net/i40e/i40e_ethdev.h | 20 +-- drivers/net/i40e/i40e_ethdev_vf.c | 30 ++--- drivers/net/i40e/i40e_fdir.c | 8 +- drivers/net/i40e/i40e_flow.c | 8 +- drivers/net/i40e/i40e_pf.c | 10 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 14 +- drivers/net/i40e/rte_pmd_i40e.h | 8 +- drivers/net/iavf/iavf.h | 2 +- drivers/net/iavf/iavf_ethdev.c | 22 ++-- drivers/net/iavf/iavf_vchnl.c | 4 +- drivers/net/ice/ice_ethdev.c | 30 ++--- drivers/net/ice/ice_ethdev.h | 4 +- drivers/net/ixgbe/ixgbe_ethdev.c | 42 +++--- drivers/net/ixgbe/ixgbe_pf.c | 2 +- drivers/net/ixgbe/ixgbe_vf_representor.c | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +- drivers/net/kni/rte_eth_kni.c | 2 +- drivers/net/liquidio/lio_ethdev.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4.h | 6 +- drivers/net/mlx4/mlx4_ethdev.c | 4 +- drivers/net/mlx4/mlx4_flow.c | 4 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5.h | 12 +- drivers/net/mlx5/mlx5_flow_dv.c | 16 +-- drivers/net/mlx5/mlx5_flow_tcf.c | 10 +- drivers/net/mlx5/mlx5_mac.c | 10 +- drivers/net/mlx5/mlx5_nl.c | 14 +- drivers/net/mlx5/mlx5_rxtx.h | 2 +- drivers/net/mlx5/mlx5_trigger.c | 4 +- drivers/net/mvneta/mvneta_ethdev.c | 4 +- drivers/net/mvpp2/mrvl_ethdev.c | 4 +- drivers/net/mvpp2/mrvl_flow.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/netvsc/hn_rxtx.c | 4 +- drivers/net/netvsc/hn_var.h | 4 +- drivers/net/netvsc/hn_vf.c | 6 +- drivers/net/nfp/nfp_net.c | 8 +- drivers/net/null/rte_eth_null.c | 4 +- drivers/net/octeontx/octeontx_ethdev.c | 2 +- drivers/net/pcap/rte_eth_pcap.c | 4 +- drivers/net/qede/qede_ethdev.c | 24 ++-- drivers/net/qede/qede_ethdev.h | 6 +- drivers/net/qede/qede_filter.c | 4 +- drivers/net/qede/qede_if.h | 2 +- drivers/net/qede/qede_rxtx.c | 14 +- drivers/net/ring/rte_eth_ring.c | 4 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 10 +- drivers/net/sfc/sfc_port.c | 6 +- drivers/net/softnic/parser.c | 12 +- drivers/net/softnic/parser.h | 2 +- drivers/net/softnic/rte_eth_softnic.c | 2 +- drivers/net/szedata2/rte_eth_szedata2.c | 6 +- drivers/net/tap/rte_eth_tap.c | 18 +-- drivers/net/tap/rte_eth_tap.h | 2 +- drivers/net/tap/tap_bpf_program.c | 8 +- drivers/net/thunderx/base/nicvf_mbox.c | 4 +- drivers/net/thunderx/nicvf_ethdev.c | 4 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 12 +- drivers/net/vhost/rte_eth_vhost.c | 8 +- drivers/net/virtio/virtio_ethdev.c | 18 +-- drivers/net/virtio/virtio_rxtx.c | 4 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 8 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 6 +- examples/bbdev_app/main.c | 38 +++--- examples/bond/main.c | 28 ++-- examples/distributor/main.c | 2 +- examples/ethtool/ethtool-app/ethapp.c | 4 +- examples/ethtool/ethtool-app/main.c | 6 +- examples/ethtool/lib/rte_ethtool.c | 6 +- examples/ethtool/lib/rte_ethtool.h | 6 +- examples/eventdev_pipeline/main.c | 2 +- examples/eventdev_pipeline/pipeline_common.h | 6 +- examples/flow_classify/flow_classify.c | 12 +- examples/flow_filtering/main.c | 6 +- examples/ip_fragmentation/main.c | 18 +-- examples/ip_pipeline/cli.c | 4 +- examples/ip_pipeline/parser.c | 12 +- examples/ip_pipeline/parser.h | 2 +- examples/ip_reassembly/main.c | 12 +- examples/ipsec-secgw/ipsec-secgw.c | 18 +-- examples/ipsec-secgw/ipsec.h | 2 +- examples/ipsec-secgw/parser.c | 4 +- examples/ipv4_multicast/main.c | 14 +- examples/kni/main.c | 8 +- examples/l2fwd-cat/l2fwd-cat.c | 2 +- examples/l2fwd-crypto/main.c | 12 +- examples/l2fwd-jobstats/main.c | 6 +- examples/l2fwd-keepalive/main.c | 6 +- examples/l2fwd/main.c | 6 +- examples/l3fwd-acl/main.c | 12 +- examples/l3fwd-power/main.c | 16 +-- examples/l3fwd-vf/main.c | 10 +- examples/l3fwd/l3fwd.h | 2 +- examples/l3fwd/l3fwd_altivec.h | 12 +- examples/l3fwd/l3fwd_em.c | 6 +- examples/l3fwd/l3fwd_em.h | 8 +- examples/l3fwd/l3fwd_em_hlm.h | 8 +- examples/l3fwd/l3fwd_em_hlm_neon.h | 8 +- examples/l3fwd/l3fwd_em_hlm_sse.h | 8 +- examples/l3fwd/l3fwd_em_sequential.h | 8 +- examples/l3fwd/l3fwd_lpm.c | 14 +- examples/l3fwd/l3fwd_lpm.h | 8 +- examples/l3fwd/l3fwd_lpm_altivec.h | 10 +- examples/l3fwd/l3fwd_lpm_neon.h | 20 +-- examples/l3fwd/l3fwd_lpm_sse.h | 10 +- examples/l3fwd/l3fwd_neon.h | 12 +- examples/l3fwd/l3fwd_sse.h | 12 +- examples/l3fwd/main.c | 8 +- examples/link_status_interrupt/main.c | 6 +- examples/load_balancer/runtime.c | 2 +- .../client_server_mp/mp_server/main.c | 2 +- examples/packet_ordering/main.c | 2 +- examples/performance-thread/l3fwd-thread/main.c | 136 +++++++++---------- examples/ptpclient/ptpclient.c | 28 ++-- examples/qos_meter/main.c | 2 +- examples/quota_watermark/qw/main.c | 6 +- examples/rxtx_callbacks/main.c | 2 +- examples/server_node_efd/node/node.c | 2 +- examples/server_node_efd/server/main.c | 4 +- examples/skeleton/basicfwd.c | 2 +- examples/tep_termination/main.c | 2 +- examples/tep_termination/main.h | 2 +- examples/tep_termination/vxlan.c | 38 +++--- examples/tep_termination/vxlan.h | 6 +- examples/tep_termination/vxlan_setup.c | 6 +- examples/tep_termination/vxlan_setup.h | 2 +- examples/vhost/main.c | 24 ++-- examples/vhost/main.h | 2 +- examples/vm_power_manager/channel_monitor.c | 6 +- .../guest_cli/vm_power_cli_guest.c | 2 +- examples/vm_power_manager/main.c | 4 +- examples/vmdq/main.c | 10 +- examples/vmdq_dcb/main.c | 10 +- lib/librte_ethdev/rte_class_eth.c | 2 +- lib/librte_ethdev/rte_eth_ctrl.h | 12 +- lib/librte_ethdev/rte_ethdev.c | 20 +-- lib/librte_ethdev/rte_ethdev.h | 12 +- lib/librte_ethdev/rte_ethdev_core.h | 12 +- lib/librte_ethdev/rte_flow.h | 12 +- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 6 +- lib/librte_gro/gro_tcp4.c | 4 +- lib/librte_gro/gro_tcp4.h | 4 +- lib/librte_gro/gro_vxlan_tcp4.c | 12 +- lib/librte_gro/gro_vxlan_tcp4.h | 6 +- lib/librte_gso/rte_gso.h | 4 +- lib/librte_kni/rte_kni.c | 2 +- lib/librte_net/rte_arp.c | 6 +- lib/librte_net/rte_arp.h | 6 +- lib/librte_net/rte_ether.h | 64 ++++----- lib/librte_net/rte_net.c | 20 +-- lib/librte_pipeline/rte_table_action.c | 60 ++++----- lib/librte_pipeline/rte_table_action.h | 4 +- lib/librte_vhost/vhost.h | 2 +- lib/librte_vhost/virtio_net.c | 10 +- 258 files changed, 1329 insertions(+), 1329 deletions(-)
app/pdump/main.c +1 -1
@@ -543,7 +543,7 @@ signal_handler(int sig_num)static inline int configure_vdev (uint16_t port_id) { -struct ether_addr addr; +struct rte_ether_addr addr;const uint16_t rxRings =0 , txRings =1 ;int ret;uint16_t q;
app/test-pipeline/pipeline_acl.c +5 -5
@@ -39,7 +39,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint8_t), .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, next_proto_id), }, {
@@ -47,7 +47,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = SRC_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, src_addr), }, {
@@ -55,7 +55,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = DST_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, dst_addr), }, {
@@ -63,14 +63,14 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr), + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr), }, { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + sizeof(uint16_t), }, };
app/test-pipeline/pipeline_hash.c +2 -2
@@ -441,14 +441,14 @@ app_main_loop_rx_metadata(void) {if (RTE_ETH_IS_IPV4_HDR (m->packet_type)) { ip_hdr = (struct ipv4_hdr *) - &m_data[sizeof (struct ether_hdr )]; + &m_data[sizeof (struct rte_ether_hdr )]; ip_dst = ip_hdr->dst_addr; k32 = (uint32_t *) key; k32[0 ] = ip_dst &0xFFFFFF00 ; }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) { ipv6_hdr = (struct ipv6_hdr *) - &m_data[sizeof (struct ether_hdr )]; + &m_data[sizeof (struct rte_ether_hdr )]; ipv6_dst = ipv6_hdr->dst_addr;memcpy (key, ipv6_dst,16 );
app/test-pmd/cmdline.c +25 -25
162 lines not on this page · raw message
app/test-pmd/cmdline_flow.c +1 -1
@@ -4488,7 +4488,7 @@ parse_mac_addr(struct context *ctx, const struct token *token, void *buf, unsigned int size) {const struct arg *arg =pop_args (ctx); -struct ether_addr tmp; +struct rte_ether_addr tmp;int ret; (void )token;
app/test-pmd/config.c +12 -12
@@ -108,7 +108,7 @@ const struct rss_type_info rss_type_table[] = { };static void -print_ethaddr (const char *name,struct ether_addr *eth_addr) +print_ethaddr (const char *name,struct rte_ether_addr *eth_addr) {char buf[ETHER_ADDR_FMT_SIZE ];ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);
@@ -391,7 +391,7 @@ void port_infos_display(portid_t port_id) {struct rte_port *port; -struct ether_addr mac_addr; +struct rte_ether_addr mac_addr;struct rte_eth_link link;struct rte_eth_dev_info dev_info;int vlan_offload;
@@ -538,7 +538,7 @@ port_summary_header_display(void)void port_summary_display (portid_t port_id) { -struct ether_addr mac_addr; +struct rte_ether_addr mac_addr;struct rte_eth_link link;struct rte_eth_dev_info dev_info;char name[RTE_ETH_NAME_MAX_LEN ];
@@ -2519,7 +2519,7 @@ set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs)* Check that each segment length is greater or equal than * the mbuf data sise. * Check also that the total packet length is greater or equal than the -* size of an empty UDP/IP packet (sizeof(struct ether_hdr) + 20 + 8). +* size of an empty UDP/IP packet (sizeof(struct rte_ether_hdr) + 20 + 8). */ tx_pkt_len =0 ;for (i =0 ; i < nb_segs; i++) {
@@ -2530,10 +2530,10 @@ set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) } tx_pkt_len = (uint16_t )(tx_pkt_len + seg_lengths[i]); } -if (tx_pkt_len < (sizeof (struct ether_hdr ) +20 +8 )) { +if (tx_pkt_len < (sizeof (struct rte_ether_hdr ) +20 +8 )) {printf ("total packet length=%u < %d - give up\n" , (unsigned ) tx_pkt_len, - (int )(sizeof (struct ether_hdr ) +20 +8 )); + (int )(sizeof (struct rte_ether_hdr ) +20 +8 ));return ; }
@@ -3453,7 +3453,7 @@ set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)static int mcast_addr_pool_extend (struct rte_port *port) { -struct ether_addr *mc_pool; +struct rte_ether_addr *mc_pool;size_t mc_pool_size;/*
@@ -3470,9 +3470,9 @@ mcast_addr_pool_extend(struct rte_port *port)* The previous test guarantees that port->mc_addr_nb is a multiple * of MCAST_POOL_INC. */ - mc_pool_size =sizeof (struct ether_addr ) * (port->mc_addr_nb + + mc_pool_size =sizeof (struct rte_ether_addr ) * (port->mc_addr_nb +MCAST_POOL_INC ); - mc_pool = (struct ether_addr *)realloc (port->mc_addr_pool, + mc_pool = (struct rte_ether_addr *)realloc (port->mc_addr_pool, mc_pool_size);if (mc_pool ==NULL ) { printf("allocation of pool of %u multicast addresses failed\n",
@@ -3501,7 +3501,7 @@ mcast_addr_pool_remove(struct rte_port *port, uint32_t addr_idx) }memmove (&port->mc_addr_pool[addr_idx], &port->mc_addr_pool[addr_idx +1 ], -sizeof (struct ether_addr ) * (port->mc_addr_nb - addr_idx)); +sizeof (struct rte_ether_addr ) * (port->mc_addr_nb - addr_idx)); } static void
@@ -3520,7 +3520,7 @@ eth_port_multicast_addr_list_set(portid_t port_id) }void -mcast_addr_add (portid_t port_id,struct ether_addr *mc_addr) +mcast_addr_add (portid_t port_id,struct rte_ether_addr *mc_addr) {struct rte_port *port;uint32_t i;
@@ -3548,7 +3548,7 @@ mcast_addr_add(portid_t port_id, struct ether_addr *mc_addr) }void -mcast_addr_remove (portid_t port_id,struct ether_addr *mc_addr) +mcast_addr_remove (portid_t port_id,struct rte_ether_addr *mc_addr) {struct rte_port *port;uint32_t i;
app/test-pmd/csumonly.c +15 -15
@@ -142,18 +142,18 @@ parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)* header. The l4_len argument is only set in case of TCP (useful for TSO). */ static void -parse_ethernet (struct ether_hdr *eth_hdr,struct testpmd_offload_info *info) +parse_ethernet (struct rte_ether_hdr *eth_hdr,struct testpmd_offload_info *info) {struct ipv4_hdr *ipv4_hdr;struct ipv6_hdr *ipv6_hdr; - info->l2_len =sizeof (struct ether_hdr ); + info->l2_len =sizeof (struct rte_ether_hdr ); info->ethertype = eth_hdr->ether_type;if (info->ethertype ==_htons (ETHER_TYPE_VLAN )) { -struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr +1 ); +struct rte_vlan_hdr *vlan_hdr = (struct rte_vlan_hdr *)(eth_hdr +1 ); - info->l2_len +=sizeof (struct vlan_hdr ); + info->l2_len +=sizeof (struct rte_vlan_hdr ); info->ethertype = vlan_hdr->eth_proto; }
@@ -180,7 +180,7 @@ parse_vxlan(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info, uint32_t pkt_type) { -struct ether_hdr *eth_hdr; +struct rte_ether_hdr *eth_hdr;/* check udp destination port, 4789 is the default vxlan port * (rfc7348) or that the rx offload flag is set (i40e only
@@ -195,9 +195,9 @@ parse_vxlan(struct udp_hdr *udp_hdr, info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - eth_hdr = (struct ether_hdr *)((char *)udp_hdr + + eth_hdr = (struct rte_ether_hdr *)((char *)udp_hdr +sizeof (struct udp_hdr ) + -sizeof (struct vxlan_hdr )); +sizeof (struct rte_vxlan_hdr ));parse_ethernet (eth_hdr, info); info->l2_len +=ETHER_VXLAN_HLEN ;/* add udp + vxlan */
@@ -208,17 +208,17 @@ static void parse_vxlan_gpe(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr;struct ipv4_hdr *ipv4_hdr;struct ipv6_hdr *ipv6_hdr; -struct vxlan_gpe_hdr *vxlan_gpe_hdr; +struct rte_vxlan_gpe_hdr *vxlan_gpe_hdr;uint8_t vxlan_gpe_len =sizeof (*vxlan_gpe_hdr);/* Check udp destination port. */ if (udp_hdr->dst_port !=_htons (vxlan_gpe_udp_port))return ; - vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr + + vxlan_gpe_hdr = (struct rte_vxlan_gpe_hdr *)((char *)udp_hdr +sizeof (struct udp_hdr )); if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
@@ -257,7 +257,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr, info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr + + eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_gpe_hdr + vxlan_gpe_len);parse_ethernet (eth_hdr, info);
@@ -271,7 +271,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,static void parse_gre (struct simple_gre_hdr *gre_hdr,struct testpmd_offload_info *info) { -struct ether_hdr *eth_hdr; +struct rte_ether_hdr *eth_hdr;struct ipv4_hdr *ipv4_hdr;struct ipv6_hdr *ipv6_hdr;uint8_t gre_len =0 ;
@@ -318,7 +318,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info) info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - eth_hdr = (struct ether_hdr *)((char *)gre_hdr + gre_len); + eth_hdr = (struct rte_ether_hdr *)((char *)gre_hdr + gre_len);parse_ethernet (eth_hdr, info); }else
@@ -691,7 +691,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)struct rte_mbuf **tx_pkts_burst;struct rte_port *txp;struct rte_mbuf *m, *p; -struct ether_hdr *eth_hdr; +struct rte_ether_hdr *eth_hdr;void *l3_hdr =NULL , *outer_l3_hdr =NULL ;/* can be IPv4 or IPv6 */ void **gro_ctx;uint16_t gro_pkts_num;
@@ -765,7 +765,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)/* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan * and inner headers */ - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);ether_addr_copy (&peer_eth_addrs[fs->peer_addr], ð_hdr->d_addr); ether_addr_copy(&ports[fs->tx_port].eth_addr,
app/test-pmd/flowgen.c +5 -5
@@ -76,9 +76,9 @@ static uint32_t cfg_ip_src = IPv4(10, 254, 0, 0);static uint32_t cfg_ip_dst =IPv4 (10 ,253 ,0 ,0 );static uint16_t cfg_udp_src =1000 ;static uint16_t cfg_udp_dst =1001 ; -static struct ether_addr cfg_ether_src = +static struct rte_ether_addr cfg_ether_src = {{0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x00 }}; -static struct ether_addr cfg_ether_dst = +static struct rte_ether_addr cfg_ether_dst = {{0x00 ,0x01 ,0x02 ,0x03 ,0x04 ,0x01 }};#define IP_DEFTTL 64/* from RFC 1340. */
@@ -119,7 +119,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)struct rte_mbuf *pkts_burst[MAX_PKT_BURST ];struct rte_mempool *mbp;struct rte_mbuf *pkt; -struct ether_hdr *eth_hdr; +struct rte_ether_hdr *eth_hdr;struct ipv4_hdr *ip_hdr;struct udp_hdr *udp_hdr;uint16_t vlan_tci, vlan_tci_outer;
@@ -170,7 +170,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) pkt->next =NULL ;/* Initialize Ethernet header. */ - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);ether_addr_copy (&cfg_ether_dst, ð_hdr->d_addr);ether_addr_copy (&cfg_ether_src, ð_hdr->s_addr); eth_hdr->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_IPv4);
@@ -205,7 +205,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) pkt->ol_flags = ol_flags; pkt->vlan_tci = vlan_tci; pkt->vlan_tci_outer = vlan_tci_outer; - pkt->l2_len =sizeof (struct ether_hdr ); + pkt->l2_len =sizeof (struct rte_ether_hdr ); pkt->l3_len =sizeof (struct ipv4_hdr ); pkts_burst[nb_pkt] = pkt;
app/test-pmd/icmpecho.c +9 -9
@@ -221,7 +221,7 @@ ipv4_addr_to_dot(uint32_t be_ipv4_addr, char *buf) }static void -ether_addr_dump (const char *what,const struct ether_addr *ea) +ether_addr_dump (const char *what,const struct rte_ether_addr *ea) {char buf[ETHER_ADDR_FMT_SIZE ];
@@ -275,12 +275,12 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) {struct rte_mbuf *pkts_burst[MAX_PKT_BURST ];struct rte_mbuf *pkt; -struct ether_hdr *eth_h; -struct vlan_hdr *vlan_h; +struct rte_ether_hdr *eth_h; +struct rte_vlan_hdr *vlan_h;struct rte_arp_hdr *arp_h;struct ipv4_hdr *ip_h;struct icmp_hdr *icmp_h; -struct ether_addr eth_addr; +struct rte_ether_addr eth_addr;uint32_t retry;uint32_t ip_addr;uint16_t nb_rx;
@@ -321,9 +321,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)rte_prefetch0 (rte_pktmbuf_mtod(pkts_burst [i +1 ],void *)); pkt = pkts_burst[i]; - eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); eth_type =RTE_BE_TO_CPU_16 (eth_h->ether_type); - l2_len =sizeof (struct ether_hdr ); + l2_len =sizeof (struct rte_ether_hdr );if (verbose_level >0 ) {printf ("\nPort %d pkt-len=%u nb-segs=%u\n" , fs->rx_port, pkt->pkt_len, pkt->nb_segs);
@@ -331,9 +331,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)ether_addr_dump (" dst=" , ð_h->d_addr); }if (eth_type ==ETHER_TYPE_VLAN ) { - vlan_h = (struct vlan_hdr *) - ((char *)eth_h +sizeof (struct ether_hdr )); - l2_len +=sizeof (struct vlan_hdr ); + vlan_h = (struct rte_vlan_hdr *) + ((char *)eth_h +sizeof (struct rte_ether_hdr )); + l2_len +=sizeof (struct rte_vlan_hdr ); eth_type =rte_be_to_cpu_16 (vlan_h->eth_proto);if (verbose_level >0 ) { vlan_id =rte_be_to_cpu_16 (vlan_h->vlan_tci)
app/test-pmd/ieee1588fwd.c +4 -4
@@ -93,8 +93,8 @@ static void ieee1588_packet_fwd(struct fwd_stream *fs) {struct rte_mbuf *mb; -struct ether_hdr *eth_hdr; -struct ether_addr addr; +struct rte_ether_hdr *eth_hdr; +struct rte_ether_addr addr;struct ptpv2_msg *ptp_hdr;uint16_t eth_type;uint32_t timesync_index;
@@ -111,7 +111,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)* Check that the received packet is a PTP packet that was detected * by the hardware. */ - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); eth_type =rte_be_to_cpu_16 (eth_hdr->ether_type);if (! (mb->ol_flags &PKT_RX_IEEE1588_PTP )) {
@@ -141,7 +141,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)* PTP_SYNC_MESSAGE. */ ptp_hdr = (struct ptpv2_msg *) (rte_pktmbuf_mtod(mb, char *) + -sizeof (struct ether_hdr )); +sizeof (struct rte_ether_hdr ));if (ptp_hdr->version !=0x02 ) { printf("Port %u Received PTP V2 Ethernet frame with wrong PTP" " protocol version 0x%x (should be 0x02)\n",
app/test-pmd/macfwd.c +3 -3
@@ -49,7 +49,7 @@ pkt_burst_mac_forward(struct fwd_stream *fs)struct rte_mbuf *pkts_burst[MAX_PKT_BURST ];struct rte_port *txp;struct rte_mbuf *mb; -struct ether_hdr *eth_hdr; +struct rte_ether_hdr *eth_hdr;uint32_t retry;uint16_t nb_rx;uint16_t nb_tx;
@@ -91,14 +91,14 @@ pkt_burst_mac_forward(struct fwd_stream *fs)rte_prefetch0 (rte_pktmbuf_mtod(pkts_burst [i +1 ],void *)); mb = pkts_burst[i]; - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *);ether_addr_copy (&peer_eth_addrs[fs->peer_addr], ð_hdr->d_addr);ether_addr_copy (&ports[fs->tx_port].eth_addr, ð_hdr->s_addr); mb->ol_flags &=IND_ATTACHED_MBUF |EXT_ATTACHED_MBUF ; mb->ol_flags |= ol_flags; - mb->l2_len =sizeof (struct ether_hdr ); + mb->l2_len =sizeof (struct rte_ether_hdr ); mb->l3_len =sizeof (struct ipv4_hdr ); mb->vlan_tci = txp->tx_vlan_id; mb->vlan_tci_outer = txp->tx_vlan_id_outer;
app/test-pmd/macswap.h +3 -3
@@ -11,9 +11,9 @@ static inline void do_macswap(struct rte_mbuf *pkts[], uint16_t nb, struct rte_port *txp) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr;struct rte_mbuf *mb; -struct ether_addr addr; +struct rte_ether_addr addr;uint64_t ol_flags;int i;
@@ -26,7 +26,7 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,rte_prefetch0 (rte_pktmbuf_mtod(pkts [i+1 ],void *)); mb = pkts[i]; - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *);/* Swap dest and src mac addresses. */ ether_addr_copy (ð_hdr->d_addr, &addr);
app/test-pmd/macswap_common.h +1 -1
@@ -39,7 +39,7 @@ mbuf_field_set(struct rte_mbuf *mb, uint64_t ol_flags) { mb->ol_flags &=IND_ATTACHED_MBUF |EXT_ATTACHED_MBUF ; mb->ol_flags |= ol_flags; - mb->l2_len =sizeof (struct ether_hdr ); + mb->l2_len =sizeof (struct rte_ether_hdr ); mb->l3_len =sizeof (struct ipv4_hdr ); }
app/test-pmd/macswap_neon.h +6 -6
@@ -16,7 +16,7 @@ static inline void do_macswap(struct rte_mbuf *pkts[], uint16_t nb, struct rte_port *txp) { - struct ether_hdr *eth_hdr[4]; + struct rte_ether_hdr *eth_hdr[4];struct rte_mbuf *mb[4 ];uint64_t ol_flags;int i;
@@ -46,16 +46,16 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, } mb[0 ] = pkts[i++]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *); mb[1 ] = pkts[i++]; - eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct ether_hdr *); + eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct rte_ether_hdr *); mb[2 ] = pkts[i++]; - eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct ether_hdr *); + eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct rte_ether_hdr *); mb[3 ] = pkts[i++]; - eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct ether_hdr *); + eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct rte_ether_hdr *); v0 =vld1q_u8 ((uint8_t const *)eth_hdr[0 ]); v1 =vld1q_u8 ((uint8_t const *)eth_hdr[1 ]);
@@ -83,7 +83,7 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,if (i < nb -1 ) rte_prefetch0(rte_pktmbuf_mtod(pkts[i+1], void *)); mb[0 ] = pkts[i]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *);/* Swap dest and src mac addresses. */ v0 =vld1q_u8 ((uint8_t const *)eth_hdr[0 ]);
app/test-pmd/macswap_sse.h +6 -6
@@ -11,7 +11,7 @@ static inline void do_macswap(struct rte_mbuf *pkts[], uint16_t nb, struct rte_port *txp) { - struct ether_hdr *eth_hdr[4]; + struct rte_ether_hdr *eth_hdr[4];struct rte_mbuf *mb[4 ];uint64_t ol_flags;int i;
@@ -43,20 +43,20 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, } mb[0 ] = pkts[i++]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *); addr0 =_mm_loadu_si128 ((__m128i *)eth_hdr[0 ]); mb[1 ] = pkts[i++]; - eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct ether_hdr *); + eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct rte_ether_hdr *); addr1 =_mm_loadu_si128 ((__m128i *)eth_hdr[1 ]); mb[2 ] = pkts[i++]; - eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct ether_hdr *); + eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct rte_ether_hdr *); addr2 =_mm_loadu_si128 ((__m128i *)eth_hdr[2 ]); mb[3 ] = pkts[i++]; - eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct ether_hdr *); + eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct rte_ether_hdr *); addr3 =_mm_loadu_si128 ((__m128i *)eth_hdr[3 ]); addr0 =_mm_shuffle_epi8 (addr0, shfl_msk);
@@ -80,7 +80,7 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,if (i < nb -1 ) rte_prefetch0(rte_pktmbuf_mtod(pkts[i+1], void *)); mb[0 ] = pkts[i]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *);/* Swap dest and src mac addresses. */ addr0 =_mm_loadu_si128 ((__m128i *)eth_hdr[0 ]);
app/test-pmd/testpmd.c +2 -2
@@ -137,7 +137,7 @@ uint8_t txring_numa[RTE_MAX_ETHPORTS];* Must be instantiated with the ethernet addresses of peer traffic generator * ports. */ -struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS ]; +struct rte_ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS ];portid_t nb_peer_eth_addrs =0 ;/*
@@ -1953,7 +1953,7 @@ start_port(portid_t pid)portid_t pi;queueid_t qi;struct rte_port *port; -struct ether_addr mac_addr; +struct rte_ether_addr mac_addr;if (port_id_is_invalid (pid,ENABLED_WARN ))return 0 ;
app/test-pmd/testpmd.h +5 -5
@@ -162,7 +162,7 @@ struct softnic_port {struct rte_port {struct rte_eth_dev_info dev_info;/**< PCI info + driver name */ struct rte_eth_conf dev_conf;/**< Port configuration. */ -struct ether_addr eth_addr;/**< Port ethernet address */ +struct rte_ether_addr eth_addr;/**< Port ethernet address */ struct rte_eth_stats stats;/**< Last port statistics */ unsigned int socket_id;/**< For NUMA support */ uint16_t parse_tunnel:1 ;/**< Parse internal headers */
@@ -182,7 +182,7 @@ struct rte_port {uint16_t nb_tx_desc[MAX_QUEUE_ID +1 ];/**< per queue tx desc number */ struct rte_eth_rxconf rx_conf[MAX_QUEUE_ID +1 ];/**< per queue rx configuration */ struct rte_eth_txconf tx_conf[MAX_QUEUE_ID +1 ];/**< per queue tx configuration */ -struct ether_addr *mc_addr_pool;/**< pool of multicast addrs */ +struct rte_ether_addr *mc_addr_pool;/**< pool of multicast addrs */ uint32_t mc_addr_nb;/**< nb. of addr. in mc_addr_pool */ uint8_t slave_flag;/**< bonding slave port */ struct port_flow *flow_list;/**< Associated flows. */
@@ -452,7 +452,7 @@ extern struct fwd_stream **fwd_streams;extern uint16_t vxlan_gpe_udp_port;/**< UDP port of tunnel VXLAN-GPE. */ extern portid_t nb_peer_eth_addrs;/**< Number of peer ethernet addresses. */ -extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS ]; +extern struct rte_ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS ];extern uint32_t burst_tx_delay_time;/**< Burst tx delay time(us) for mac-retry. */ extern uint32_t burst_tx_retry_num;/**< Burst tx retry number for mac-retry. */
@@ -811,8 +811,8 @@ void show_gro(portid_t port_id);void setup_gso (const char *mode,portid_t port_id);/* Functions to manage the set of filtered Multicast MAC addresses */ -void mcast_addr_add (portid_t port_id,struct ether_addr *mc_addr); -void mcast_addr_remove (portid_t port_id,struct ether_addr *mc_addr); +void mcast_addr_add (portid_t port_id,struct rte_ether_addr *mc_addr); +void mcast_addr_remove (portid_t port_id,struct rte_ether_addr *mc_addr);void port_dcb_info_display (portid_t port_id);uint8_t *open_file (const char *file_path,uint32_t *size);
app/test-pmd/txonly.c +7 -7
@@ -150,7 +150,7 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,static inline bool pkt_burst_prepare (struct rte_mbuf *pkt,struct rte_mempool *mbp, -struct ether_hdr *eth_hdr,const uint16_t vlan_tci, +struct rte_ether_hdr *eth_hdr,const uint16_t vlan_tci,const uint16_t vlan_tci_outer,const uint64_t ol_flags) {struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT ];
@@ -174,7 +174,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, pkt->ol_flags = ol_flags; pkt->vlan_tci = vlan_tci; pkt->vlan_tci_outer = vlan_tci_outer; - pkt->l2_len =sizeof (struct ether_hdr ); + pkt->l2_len =sizeof (struct rte_ether_hdr ); pkt->l3_len =sizeof (struct ipv4_hdr ); pkt_len = pkt->data_len;
@@ -191,14 +191,14 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,*/ copy_buf_to_pkt (eth_hdr,sizeof (eth_hdr), pkt,0 );copy_buf_to_pkt (&pkt_ip_hdr,sizeof (pkt_ip_hdr), pkt, -sizeof (struct ether_hdr )); +sizeof (struct rte_ether_hdr ));if (txonly_multi_flow) {struct ipv4_hdr *ip_hdr;uint32_t addr; ip_hdr =rte_pktmbuf_mtod_offset (pkt, struct ipv4_hdr *, -sizeof (struct ether_hdr )); +sizeof (struct rte_ether_hdr ));/* * Generate multiple flows by varying IP src addr. This * enables packets are well distributed by RSS in
@@ -210,7 +210,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, ip_hdr->src_addr =rte_cpu_to_be_32 (addr); }copy_buf_to_pkt (&pkt_udp_hdr,sizeof (pkt_udp_hdr), pkt, -sizeof (struct ether_hdr ) + +sizeof (struct rte_ether_hdr ) +sizeof (struct ipv4_hdr ));/* * Complete first mbuf of packet and append it to the
@@ -232,7 +232,7 @@ pkt_burst_transmit(struct fwd_stream *fs)struct rte_port *txp;struct rte_mbuf *pkt;struct rte_mempool *mbp; -struct ether_hdr eth_hdr; +struct rte_ether_hdr eth_hdr;uint16_t nb_tx;uint16_t nb_pkt;uint16_t vlan_tci, vlan_tci_outer;
@@ -345,7 +345,7 @@ tx_only_begin(__attribute__((unused)) portid_t pi) {uint16_t pkt_data_len; - pkt_data_len = (uint16_t ) (tx_pkt_length - (sizeof (struct ether_hdr ) + + pkt_data_len = (uint16_t ) (tx_pkt_length - (sizeof (struct rte_ether_hdr ) +sizeof (struct ipv4_hdr ) +sizeof (struct udp_hdr )));setup_pkt_udp_ip_headers (&pkt_ip_hdr, &pkt_udp_hdr, pkt_data_len);
app/test-pmd/util.c +6 -6
@@ -14,7 +14,7 @@#include "testpmd.h" static inline void -print_ether_addr (const char *what,struct ether_addr *eth_addr) +print_ether_addr (const char *what,struct rte_ether_addr *eth_addr) {char buf[ETHER_ADDR_FMT_SIZE ];ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);
@@ -26,7 +26,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, int is_rx) {struct rte_mbuf *mb; -struct ether_hdr *eth_hdr; +struct rte_ether_hdr *eth_hdr;uint16_t eth_type;uint64_t ol_flags;uint16_t i, packet_type;
@@ -46,7 +46,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], (unsigned int) nb_pkts);for (i =0 ; i < nb_pkts; i++) { mb = pkts[i]; - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); eth_type =RTE_BE_TO_CPU_16 (eth_hdr->ether_type); ol_flags = mb->ol_flags; packet_type = mb->packet_type;
@@ -110,9 +110,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],uint8_t l3_len;uint8_t l4_len;uint8_t l4_proto; -struct vxlan_hdr *vxlan_hdr; +struct rte_vxlan_hdr *vxlan_hdr; - l2_len =sizeof (struct ether_hdr ); + l2_len =sizeof (struct rte_ether_hdr );/* Do not support ipv4 option field */ if (RTE_ETH_IS_IPV4_HDR (packet_type)) {
@@ -134,7 +134,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], l2_len + l3_len); l4_len =sizeof (struct udp_hdr ); vxlan_hdr =rte_pktmbuf_mtod_offset (mb, - struct vxlan_hdr *, + struct rte_vxlan_hdr *, l2_len + l3_len + l4_len); udp_port =RTE_BE_TO_CPU_16 (udp_hdr->dst_port); vx_vni =rte_be_to_cpu_32 (vxlan_hdr->vx_vni);
app/test/packet_burst_generator.c +13 -13
@@ -53,16 +53,16 @@ copy_buf_to_pkt(void *buf, unsigned len, struct rte_mbuf *pkt, unsigned offset) }void -initialize_eth_header (struct ether_hdr *eth_hdr,struct ether_addr *src_mac, -struct ether_addr *dst_mac,uint16_t ether_type, +initialize_eth_header (struct rte_ether_hdr *eth_hdr,struct rte_ether_addr *src_mac, +struct rte_ether_addr *dst_mac,uint16_t ether_type,uint8_t vlan_enabled,uint16_t van_id) {ether_addr_copy (dst_mac, ð_hdr->d_addr);ether_addr_copy (src_mac, ð_hdr->s_addr);if (vlan_enabled) { -struct vlan_hdr *vhdr = (struct vlan_hdr *)((uint8_t *)eth_hdr + -sizeof (struct ether_hdr )); +struct rte_vlan_hdr *vhdr = (struct rte_vlan_hdr *)((uint8_t *)eth_hdr + +sizeof (struct rte_ether_hdr )); eth_hdr->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_VLAN );
@@ -74,8 +74,8 @@ initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac, }void -initialize_arp_header (struct rte_arp_hdr *arp_hdr,struct ether_addr *src_mac, -struct ether_addr *dst_mac,uint32_t src_ip,uint32_t dst_ip, +initialize_arp_header (struct rte_arp_hdr *arp_hdr,struct rte_ether_addr *src_mac, +struct rte_ether_addr *dst_mac,uint32_t src_ip,uint32_t dst_ip,uint32_t opcode) { arp_hdr->arp_hardware =rte_cpu_to_be_16 (RTE_ARP_HRD_ETHER );
@@ -256,7 +256,7 @@ initialize_ipv4_header_proto(struct ipv4_hdr *ip_hdr, uint32_t src_addr,int generate_packet_burst (struct rte_mempool *mp,struct rte_mbuf **pkts_burst, -struct ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr, +struct rte_ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr,uint8_t ipv4,struct udp_hdr *udp_hdr,int nb_pkt_per_burst,uint8_t pkt_len,uint8_t nb_pkt_segs) {
@@ -293,9 +293,9 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,* Copy headers in first packet segment(s). */ if (vlan_enabled) - eth_hdr_size =sizeof (struct ether_hdr ) +sizeof (struct vlan_hdr ); + eth_hdr_size =sizeof (struct rte_ether_hdr ) +sizeof (struct rte_vlan_hdr );else - eth_hdr_size =sizeof (struct ether_hdr ); + eth_hdr_size =sizeof (struct rte_ether_hdr );copy_buf_to_pkt (eth_hdr, eth_hdr_size, pkt,0 );
@@ -334,7 +334,7 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,int generate_packet_burst_proto (struct rte_mempool *mp,struct rte_mbuf **pkts_burst, -struct ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr, +struct rte_ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr,uint8_t ipv4,uint8_t proto,void *proto_hdr,int nb_pkt_per_burst,uint8_t pkt_len,uint8_t nb_pkt_segs) {
@@ -371,10 +371,10 @@ generate_packet_burst_proto(struct rte_mempool *mp,* Copy headers in first packet segment(s). */ if (vlan_enabled) - eth_hdr_size =sizeof (struct ether_hdr ) + -sizeof (struct vlan_hdr ); + eth_hdr_size =sizeof (struct rte_ether_hdr ) + +sizeof (struct rte_vlan_hdr );else - eth_hdr_size =sizeof (struct ether_hdr ); + eth_hdr_size =sizeof (struct rte_ether_hdr );copy_buf_to_pkt (eth_hdr, eth_hdr_size, pkt,0 );
app/test/packet_burst_generator.h +6 -6
@@ -24,13 +24,13 @@ extern "C" {#define PACKET_BURST_GEN_PKT_LEN_128 128void -initialize_eth_header (struct ether_hdr *eth_hdr,struct ether_addr *src_mac, -struct ether_addr *dst_mac,uint16_t ether_type, +initialize_eth_header (struct rte_ether_hdr *eth_hdr,struct rte_ether_addr *src_mac, +struct rte_ether_addr *dst_mac,uint16_t ether_type,uint8_t vlan_enabled,uint16_t van_id);void -initialize_arp_header (struct rte_arp_hdr *arp_hdr,struct ether_addr *src_mac, -struct ether_addr *dst_mac,uint32_t src_ip,uint32_t dst_ip, +initialize_arp_header (struct rte_arp_hdr *arp_hdr,struct rte_ether_addr *src_mac, +struct rte_ether_addr *dst_mac,uint32_t src_ip,uint32_t dst_ip,uint32_t opcode);uint16_t
@@ -59,14 +59,14 @@ initialize_ipv4_header_proto(struct ipv4_hdr *ip_hdr, uint32_t src_addr,int generate_packet_burst (struct rte_mempool *mp,struct rte_mbuf **pkts_burst, -struct ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr, +struct rte_ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr,uint8_t ipv4,struct udp_hdr *udp_hdr,int nb_pkt_per_burst,uint8_t pkt_len,uint8_t nb_pkt_segs);int generate_packet_burst_proto (struct rte_mempool *mp,struct rte_mbuf **pkts_burst, -struct ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr, +struct rte_ether_hdr *eth_hdr,uint8_t vlan_enabled,void *ip_hdr,uint8_t ipv4,uint8_t proto,void *proto_hdr,int nb_pkt_per_burst,uint8_t pkt_len,uint8_t nb_pkt_segs);
app/test/test_cmdline_etheraddr.c +7 -7
@@ -82,7 +82,7 @@ const char * ether_addr_invalid_strs[] = {static int -is_addr_different (const struct ether_addr addr,uint64_t num) +is_addr_different (const struct rte_ether_addr addr,uint64_t num) {int i;for (i =0 ; i <ETHER_ADDR_LEN ; i++, num >>=8 )
@@ -97,7 +97,7 @@ inttest_parse_etheraddr_invalid_param (void) {char buf[CMDLINE_TEST_BUFSIZE ]; -struct ether_addr result; +struct rte_ether_addr result;int ret =0 ;/* try all null */
@@ -148,12 +148,12 @@ test_parse_etheraddr_invalid_data(void) {int ret =0 ;unsigned i; -struct ether_addr result; +struct rte_ether_addr result;/* test full strings */ for (i =0 ; i <ETHERADDR_INVALID_STRS_SIZE ; i++) { -memset (&result,0 ,sizeof (struct ether_addr )); +memset (&result,0 ,sizeof (struct rte_ether_addr )); ret =cmdline_parse_etheraddr (NULL , ether_addr_invalid_strs[i], (void *)&result,sizeof (result));
@@ -173,12 +173,12 @@ test_parse_etheraddr_valid(void) {int ret =0 ;unsigned i; -struct ether_addr result; +struct rte_ether_addr result;/* test full strings */ for (i =0 ; i <ETHERADDR_VALID_STRS_SIZE ; i++) { -memset (&result,0 ,sizeof (struct ether_addr )); +memset (&result,0 ,sizeof (struct rte_ether_addr )); ret =cmdline_parse_etheraddr (NULL , ether_addr_valid_strs[i].str, (void *)&result,sizeof (result));
@@ -197,7 +197,7 @@ test_parse_etheraddr_valid(void)/* test garbage strings */ for (i =0 ; i <ETHERADDR_GARBAGE_STRS_SIZE ; i++) { -memset (&result,0 ,sizeof (struct ether_addr )); +memset (&result,0 ,sizeof (struct rte_ether_addr )); ret =cmdline_parse_etheraddr (NULL , ether_addr_garbage_strs[i], (void *)&result,sizeof (result));
app/test/test_event_eth_rx_adapter.c +1 -1
@@ -78,7 +78,7 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf,return retval;/* Display the port MAC address. */ -struct ether_addr addr; +struct rte_ether_addr addr;rte_eth_macaddr_get (port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
app/test/test_event_eth_tx_adapter.c +1 -1
@@ -84,7 +84,7 @@ port_init_common(uint8_t port, const struct rte_eth_conf *port_conf,return retval;/* Display the port MAC address. */ -struct ether_addr addr; +struct rte_ether_addr addr;rte_eth_macaddr_get (port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
app/test/test_flow_classify.c +17 -17
@@ -39,7 +39,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint8_t), .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, - .offset =sizeof (struct ether_hdr ) + + .offset =sizeof (struct rte_ether_hdr ) + offsetof(struct ipv4_hdr, next_proto_id), },/* next input field (IPv4 source address) - 4 consecutive bytes. */
@@ -49,7 +49,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, - .offset =sizeof (struct ether_hdr ) + + .offset =sizeof (struct rte_ether_hdr ) + offsetof(struct ipv4_hdr, src_addr), },/* next input field (IPv4 destination address) - 4 consecutive bytes. */
@@ -59,7 +59,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, - .offset =sizeof (struct ether_hdr ) + + .offset =sizeof (struct rte_ether_hdr ) + offsetof(struct ipv4_hdr, dst_addr), },/*
@@ -72,7 +72,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset =sizeof (struct ether_hdr ) + + .offset =sizeof (struct rte_ether_hdr ) +sizeof (struct ipv4_hdr ) + offsetof(struct tcp_hdr, src_port), },
@@ -82,7 +82,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset =sizeof (struct ether_hdr ) + + .offset =sizeof (struct rte_ether_hdr ) +sizeof (struct ipv4_hdr ) + offsetof(struct tcp_hdr, dst_port), },
@@ -489,7 +489,7 @@ static int init_ipv4_udp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr;struct ipv4_hdr pkt_ipv4_hdr;struct udp_hdr pkt_udp_hdr;uint32_t src_addr =IPV4_ADDR (2 ,2 ,2 ,3 );
@@ -503,9 +503,9 @@ init_ipv4_udp_traffic(struct rte_mempool *mp,printf ("Set up IPv4 UDP traffic\n" );initialize_eth_header (&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); - pktlen = (uint16_t )(sizeof (struct ether_hdr )); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + pktlen = (uint16_t )(sizeof (struct rte_ether_hdr ));printf ("ETH pktlen %u\n" , pktlen); pktlen = initialize_ipv4_header(&pkt_ipv4_hdr, src_addr, dst_addr,
@@ -526,7 +526,7 @@ static int init_ipv4_tcp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr;struct ipv4_hdr pkt_ipv4_hdr;struct tcp_hdr pkt_tcp_hdr;uint32_t src_addr =IPV4_ADDR (1 ,2 ,3 ,4 );
@@ -540,9 +540,9 @@ init_ipv4_tcp_traffic(struct rte_mempool *mp,printf ("Set up IPv4 TCP traffic\n" );initialize_eth_header (&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); - pktlen = (uint16_t )(sizeof (struct ether_hdr )); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + pktlen = (uint16_t )(sizeof (struct rte_ether_hdr ));printf ("ETH pktlen %u\n" , pktlen); pktlen = initialize_ipv4_header_proto(&pkt_ipv4_hdr, src_addr,
@@ -563,7 +563,7 @@ static int init_ipv4_sctp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr;struct ipv4_hdr pkt_ipv4_hdr;struct sctp_hdr pkt_sctp_hdr;uint32_t src_addr =IPV4_ADDR (11 ,12 ,13 ,14 );
@@ -577,9 +577,9 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp,printf ("Set up IPv4 SCTP traffic\n" );initialize_eth_header (&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); - pktlen = (uint16_t )(sizeof (struct ether_hdr )); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + pktlen = (uint16_t )(sizeof (struct rte_ether_hdr ));printf ("ETH pktlen %u\n" , pktlen); pktlen = initialize_ipv4_header_proto(&pkt_ipv4_hdr, src_addr,
app/test/test_link_bonding.c +73 -73
442 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +26 -26
154 lines not on this page · raw message
app/test/test_link_bonding_rssconf.c +1 -1
@@ -495,7 +495,7 @@ test_setup(void)int port_id;char name[256 ];struct slave_conf *port; -struct ether_addr mac_addr = { .addr_bytes = {0 } }; +struct rte_ether_addr mac_addr = { .addr_bytes = {0 } };if (test_params.mbuf_pool ==NULL ) {
app/test/test_pmd_perf.c +5 -5
@@ -58,7 +58,7 @@static struct rte_mempool *mbufpool[NB_SOCKETS ];/* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS ]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS ];static struct rte_eth_conf port_conf = { .rxmode = {
@@ -171,7 +171,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) }static void -print_ethaddr (const char *name,const struct ether_addr *eth_addr) +print_ethaddr (const char *name,const struct rte_ether_addr *eth_addr) {char buf[ETHER_ADDR_FMT_SIZE ];ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);
@@ -182,7 +182,7 @@ static int init_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr;struct ipv4_hdr pkt_ipv4_hdr;struct udp_hdr pkt_udp_hdr;uint32_t pktlen;
@@ -191,8 +191,8 @@ init_traffic(struct rte_mempool *mp,initialize_eth_header (&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); pktlen = initialize_ipv4_header(&pkt_ipv4_hdr, IPV4_ADDR(10, 0, 0, 1),
app/test/test_sched.c +6 -6
@@ -78,15 +78,15 @@ create_mempool(void)static void prepare_pkt (struct rte_sched_port *port,struct rte_mbuf *mbuf) { -struct ether_hdr *eth_hdr; -struct vlan_hdr *vlan1, *vlan2; +struct rte_ether_hdr *eth_hdr; +struct rte_vlan_hdr *vlan1, *vlan2;struct ipv4_hdr *ip_hdr;/* Simulate a classifier */ - eth_hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr *); - vlan1 = (struct vlan_hdr *)(ð_hdr->ether_type ); - vlan2 = (struct vlan_hdr *)((uintptr_t )ð_hdr->ether_type +sizeof (struct vlan_hdr )); - eth_hdr = (struct ether_hdr *)((uintptr_t )ð_hdr->ether_type +2 *sizeof (struct vlan_hdr )); + eth_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *); + vlan1 = (struct rte_vlan_hdr *)(ð_hdr->ether_type ); + vlan2 = (struct rte_vlan_hdr *)((uintptr_t )ð_hdr->ether_type +sizeof (struct rte_vlan_hdr )); + eth_hdr = (struct rte_ether_hdr *)((uintptr_t )ð_hdr->ether_type +2 *sizeof (struct rte_vlan_hdr )); ip_hdr = (struct ipv4_hdr *)((uintptr_t )eth_hdr +sizeof (eth_hdr->ether_type)); vlan1->vlan_tci =rte_cpu_to_be_16 (SUBPORT );
app/test/virtual_pmd.c +2 -2
@@ -218,7 +218,7 @@ virtual_ethdev_promiscuous_mode_disable(struct rte_eth_dev *dev __rte_unused)static int virtual_ethdev_mac_address_set(__rte_unused struct rte_eth_dev *dev, - __rte_unused struct ether_addr *addr) + __rte_unused struct rte_ether_addr *addr) {return 0 ; }
@@ -496,7 +496,7 @@ virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id,int -virtual_ethdev_create (const char *name,struct ether_addr *mac_addr, +virtual_ethdev_create (const char *name,struct rte_ether_addr *mac_addr,uint8_t socket_id,uint8_t isr_support) {struct rte_pci_device *pci_dev =NULL ;
app/test/virtual_pmd.h +1 -1
@@ -15,7 +15,7 @@ intvirtual_ethdev_init (void);int -virtual_ethdev_create (const char *name,struct ether_addr *mac_addr, +virtual_ethdev_create (const char *name,struct rte_ether_addr *mac_addr,uint8_t socket_id,uint8_t isr_support);void
doc/guides/prog_guide/bbdev.rst +3 -3
@@ -752,12 +752,12 @@ buffers using (**sw_trubo**) bbdev PMD. for (j = 0; j < op_num; j++) { /* Append the size of the ethernet header */ rte_pktmbuf_append(input_pkts_burst[j], - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); /* set op */ ops_burst[j]->turbo_enc.input.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); ops_burst[j]->turbo_enc->input.length = rte_pktmbuf_pkt_len(bbdev_pkts[j]);
@@ -766,7 +766,7 @@ buffers using (**sw_trubo**) bbdev PMD. input_pkts_burst[j]; ops_burst[j]->turbo_enc->output.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); ops_burst[j]->turbo_enc->output.data = output_pkts_burst[j];
doc/guides/sample_app_ug/flow_classify.rst +6 -6
@@ -91,7 +91,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint8_t), .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, next_proto_id), }, /* next input field (IPv4 source address) - 4 consecutive bytes. */
@@ -101,7 +101,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, src_addr), }, /* next input field (IPv4 destination address) - 4 consecutive bytes. */
@@ -111,7 +111,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, dst_addr), }, /*
@@ -124,7 +124,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, src_port), },
@@ -134,7 +134,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), },
@@ -275,7 +275,7 @@ Forwarding application is shown below: { struct rte_eth_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; - struct ether_addr addr; + struct rte_ether_addr addr; int retval; uint16_t q;
doc/guides/sample_app_ug/flow_filtering.rst +3 -3
@@ -304,7 +304,7 @@ looks like the following: main_loop(void) { struct rte_mbuf *mbufs[32]; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t nb_rx; uint16_t i; uint16_t j;
@@ -318,7 +318,7 @@ looks like the following: struct rte_mbuf *m = mbufs[j]; eth_hdr = rte_pktmbuf_mtod(m, - struct ether_hdr *); + struct rte_ether_hdr *); print_ether_addr("src=", ð_hdr->s_addr); print_ether_addr(" - dst=",
@@ -348,7 +348,7 @@ queues and printing for each packet the destination queue: if (nb_rx) { for (j = 0; j < nb_rx; j++) { struct rte_mbuf *m = mbufs[j]; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); print_ether_addr("src=", ð_hdr->s_addr); print_ether_addr(" - dst=", ð_hdr->d_addr); printf(" - queue=0x%x", (unsigned int)i);
doc/guides/sample_app_ug/ipv4_multicast.rst +4 -4
@@ -146,7 +146,7 @@ Firstly, the Ethernet* header is removed from the packet and the IPv4 address is /* Remove the Ethernet header from the input packet */ - iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct ether_hdr)); + iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct rte_ether_hdr)); RTE_ASSERT(iphdr != NULL); dest_addr = rte_be_to_cpu_32(iphdr->dst_addr);
@@ -216,14 +216,14 @@ The actual packet transmission is done in the mcast_send_pkt() function: .. code-block:: c - static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port) + static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port) { - struct ether_hdr *ethdr; + struct rte_ether_hdr *ethdr; uint16_t len; /* Construct Ethernet header. */ - ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t) sizeof(*ethdr)); + ethdr = (struct rte_ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t) sizeof(*ethdr)); RTE_ASSERT(ethdr != NULL);
doc/guides/sample_app_ug/l2_forward_job_stats.rst +2 -2
@@ -451,13 +451,13 @@ Naturally, the number of ports in the portmask must be even, otherwise, the appl static void l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; unsigned dst_port; dst_port = l2fwd_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */
doc/guides/sample_app_ug/l2_forward_real_virtual.rst +2 -2
@@ -367,13 +367,13 @@ Naturally, the number of ports in the portmask must be even, otherwise, the appl static void l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; unsigned dst_port; dst_port = l2fwd_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */
doc/guides/sample_app_ug/l3_forward.rst +4 -4
@@ -270,10 +270,10 @@ The key code snippet of simple_ipv4_fwd_4pkts() is shown below: { // ... - data[0] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[0], unsigned char *) + sizeof(struct ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[0] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[0], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); key[0].xmm = _mm_and_si128(data[0], mask0); key[1].xmm = _mm_and_si128(data[1], mask0);
doc/guides/sample_app_ug/link_status_intr.rst +2 -2
@@ -311,11 +311,11 @@ The processing is very simple: processes the TX port from the RX port and then r static void lsi_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; unsigned dst_port = lsi_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */
doc/guides/sample_app_ug/ptpclient.rst +3 -3
@@ -212,17 +212,17 @@ PTP IEEE1588 L2 functionality. void parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) { struct ptp_header *ptp_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t eth_type; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); eth_type = rte_be_to_cpu_16(eth_hdr->ether_type); if (eth_type == PTP_PROTOCOL) { ptp_data.m = m; ptp_data.portid = portid; ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(m, char *) - + sizeof(struct ether_hdr)); + + sizeof(struct rte_ether_hdr)); switch (ptp_hdr->msgtype) { case SYNC:
doc/guides/sample_app_ug/rxtx_callbacks.rst +1 -1
@@ -79,7 +79,7 @@ comments: { struct rte_eth_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; - struct ether_addr addr; + struct rte_ether_addr addr; int retval; uint16_t q;
doc/guides/sample_app_ug/server_node_efd.rst +2 -2
@@ -197,7 +197,7 @@ which tells the node where the packet has to be distributed. for (i = 0; i < rx_count; i++) { /* Handle IPv4 header.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = (void *)&ipv4_dst_ip[i]; }
@@ -357,7 +357,7 @@ flow is not handled by the node. for (i = 0; i < num_packets; i++) { /* Handle IPv4 header.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = &ipv4_dst_ip[i]; }
doc/guides/sample_app_ug/skeleton.rst +1 -1
@@ -115,7 +115,7 @@ Forwarding application is shown below: { struct rte_eth_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; - struct ether_addr addr; + struct rte_ether_addr addr; int retval; uint16_t q;
doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst +2 -2
@@ -165,7 +165,7 @@ the MAC of VMDQ pool 2 on port 1 is 52:54:00:12:01:02. }; /* pool mac addr template, pool mac addr is like: 52 54 00 12 port# pool# */ - static struct ether_addr pool_addr_template = { + static struct rte_ether_addr pool_addr_template = { .addr_bytes = {0x52, 0x54, 0x00, 0x12, 0x00, 0x00} };
@@ -225,7 +225,7 @@ the MAC of VMDQ pool 2 on port 1 is 52:54:00:12:01:02. /* Set mac for each pool.*/ for (q = 0; q < num_pools; q++) { - struct ether_addr mac; + struct rte_ether_addr mac; mac = pool_addr_template; mac.addr_bytes[4] = port; mac.addr_bytes[5] = q;
drivers/bus/dpaa/include/fman.h +1 -1
@@ -314,7 +314,7 @@ struct fman_if {/* The index of this MAC (within the Fman it belongs to) */ uint8_t mac_idx;/* The MAC address */ -struct ether_addr mac_addr; +struct rte_ether_addr mac_addr;/* The Qman channel to schedule Tx FQs to */ u16 tx_channel_id;/* The hard-coded FQIDs for this interface. Note: this doesn't cover
drivers/bus/dpaa/include/netcfg.h +2 -2
@@ -30,8 +30,8 @@ struct netcfg_info {struct interface_info {char *name; -struct ether_addr mac_addr; -struct ether_addr peer_mac; +struct rte_ether_addr mac_addr; +struct rte_ether_addr peer_mac;int mac_present;int fman_enabled_mac_interface; };
drivers/net/af_packet/rte_eth_af_packet.c +1 -1
@@ -73,7 +73,7 @@ struct pmd_internals {int if_index;char *if_name; -struct ether_addr eth_addr; +struct rte_ether_addr eth_addr;struct tpacket_req req;
drivers/net/af_xdp/rte_eth_af_xdp.c +2 -2
@@ -109,7 +109,7 @@ struct pmd_internals {int if_index;char if_name[IFNAMSIZ ];uint16_t queue_idx; -struct ether_addr eth_addr; +struct rte_ether_addr eth_addr;struct xsk_umem_info *umem;struct rte_mempool *mb_pool_share;
@@ -778,7 +778,7 @@ parse_parameters(struct rte_kvargs *kvlist,static int get_iface_info (const char *if_name, -struct ether_addr *eth_addr, +struct rte_ether_addr *eth_addr,int *if_index) {struct ifreq ifr;
drivers/net/ark/ark_ethdev.c +6 -6
@@ -41,9 +41,9 @@ static int eth_ark_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats);static void eth_ark_dev_stats_reset (struct rte_eth_dev *dev);static int eth_ark_set_default_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *mac_addr); +struct rte_ether_addr *mac_addr);static int eth_ark_macaddr_add (struct rte_eth_dev *dev, -struct ether_addr *mac_addr, +struct rte_ether_addr *mac_addr,uint32_t index,uint32_t pool); static void eth_ark_macaddr_remove(struct rte_eth_dev *dev,
@@ -220,14 +220,14 @@ check_for_ext(struct ark_adapter *ark) (void (*)(struct rte_eth_dev *,void *))dlsym (ark->d_handle,"stats_reset" ); ark->user_ext.mac_addr_add = - (void (*)(struct rte_eth_dev *,struct ether_addr *,uint32_t , + (void (*)(struct rte_eth_dev *,struct rte_ether_addr *,uint32_t ,uint32_t ,void *))dlsym (ark->d_handle,"mac_addr_add" ); ark->user_ext.mac_addr_remove = (void (*)(struct rte_eth_dev *,uint32_t ,void *))dlsym (ark->d_handle,"mac_addr_remove" ); ark->user_ext.mac_addr_set = - (void (*)(struct rte_eth_dev *,struct ether_addr *, + (void (*)(struct rte_eth_dev *,struct rte_ether_addr *,void *))dlsym (ark->d_handle,"mac_addr_set" ); ark->user_ext.set_mtu =
@@ -833,7 +833,7 @@ eth_ark_dev_stats_reset(struct rte_eth_dev *dev)static int eth_ark_macaddr_add (struct rte_eth_dev *dev, -struct ether_addr *mac_addr, +struct rte_ether_addr *mac_addr,uint32_t index,uint32_t pool) {
@@ -864,7 +864,7 @@ eth_ark_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)static int eth_ark_set_default_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *mac_addr) +struct rte_ether_addr *mac_addr) {struct ark_adapter *ark = (struct ark_adapter *)dev->data->dev_private;
drivers/net/ark/ark_ext.h +2 -2
@@ -70,7 +70,7 @@ void stats_reset(struct rte_eth_dev *dev, void *user_data);void mac_addr_add (struct rte_eth_dev *dev, -struct ether_addr *macadr, +struct rte_ether_addr *macadr,uint32_t index,uint32_t pool,void *user_data);
@@ -80,7 +80,7 @@ void mac_addr_remove(struct rte_eth_dev *dev, void *user_data);void mac_addr_set (struct rte_eth_dev *dev, -struct ether_addr *mac_addr, +struct rte_ether_addr *mac_addr,void *user_data); int set_mtu(struct rte_eth_dev *dev,
drivers/net/ark/ark_global.h +2 -2
@@ -71,12 +71,12 @@ struct ark_user_ext {int (*stats_get)(struct rte_eth_dev *,struct rte_eth_stats *,void *);void (*stats_reset)(struct rte_eth_dev *,void *);void (*mac_addr_add)(struct rte_eth_dev *, -struct ether_addr *, +struct rte_ether_addr *,uint32_t ,uint32_t ,void *);void (*mac_addr_remove)(struct rte_eth_dev *,uint32_t ,void *); -void (*mac_addr_set)(struct rte_eth_dev *,struct ether_addr *,void *); +void (*mac_addr_set)(struct rte_eth_dev *,struct rte_ether_addr *,void *);int (*set_mtu)(struct rte_eth_dev *,uint16_t ,void *); };
drivers/net/atlantic/atl_ethdev.c +6 -6
@@ -92,14 +92,14 @@ static void atl_dev_interrupt_handler(void *param);static int atl_add_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *mac_addr, +struct rte_ether_addr *mac_addr,uint32_t index,uint32_t pool);static void atl_remove_mac_addr (struct rte_eth_dev *dev,uint32_t index);static int atl_set_default_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *mac_addr); +struct rte_ether_addr *mac_addr);static int atl_dev_set_mc_addr_list (struct rte_eth_dev *dev, -struct ether_addr *mc_addr_set, +struct rte_ether_addr *mc_addr_set,uint32_t nb_mc_addr);/* RSS */
@@ -1235,7 +1235,7 @@ atl_update_mac_addr(struct rte_eth_dev *dev, uint32_t index, }static int -atl_add_mac_addr (struct rte_eth_dev *dev,struct ether_addr *mac_addr, +atl_add_mac_addr (struct rte_eth_dev *dev,struct rte_ether_addr *mac_addr, uint32_t index __rte_unused, uint32_t pool __rte_unused) {if (is_zero_ether_addr (mac_addr)) {
@@ -1253,7 +1253,7 @@ atl_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index) }static int -atl_set_default_mac_addr (struct rte_eth_dev *dev,struct ether_addr *addr) +atl_set_default_mac_addr (struct rte_eth_dev *dev,struct rte_ether_addr *addr) {atl_remove_mac_addr (dev,0 );atl_add_mac_addr (dev, addr,0 ,0 );
@@ -1420,7 +1420,7 @@ atl_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue_id, int on)static int atl_dev_set_mc_addr_list (struct rte_eth_dev *dev, -struct ether_addr *mc_addr_set, +struct rte_ether_addr *mc_addr_set,uint32_t nb_mc_addr) {struct aq_hw_s *hw =ATL_DEV_PRIVATE_TO_HW (dev->data->dev_private);
drivers/net/atlantic/hw_atl/hw_atl_utils.c +4 -4
@@ -656,8 +656,8 @@ static int hw_atl_utils_get_mac_permanent(struct aq_hw_s *self, mac_addr[1 ] =rte_constant_bswap32 (mac_addr[1 ]); } -ether_addr_copy ((struct ether_addr *)mac_addr, - (struct ether_addr *)mac); +ether_addr_copy ((struct rte_ether_addr *)mac_addr, + (struct rte_ether_addr *)mac);if ((mac[0 ] &0x01U ) || ((mac[0 ] | mac[1 ] | mac[2 ]) ==0x00U )) {/* chip revision */
@@ -867,8 +867,8 @@ static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac) prpc->msg_wol.pattern_id =1U ; prpc->msg_wol.wol_packet_type =2U ;/* Magic Packet */ -ether_addr_copy ((struct ether_addr *)mac, - (struct ether_addr *)&prpc->msg_wol.wol_pattern); +ether_addr_copy ((struct rte_ether_addr *)mac, + (struct rte_ether_addr *)&prpc->msg_wol.wol_pattern); }else { rpc_size =sizeof (prpc->msg_id) +sizeof (prpc->msg_del_id);
drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +2 -2
@@ -222,8 +222,8 @@ int aq_fw2x_get_mac_permanent(struct aq_hw_s *self, u8 *mac) mac_addr[1 ] =rte_constant_bswap32 (mac_addr[1 ]); } -ether_addr_copy ((struct ether_addr *)mac_addr, - (struct ether_addr *)mac); +ether_addr_copy ((struct rte_ether_addr *)mac_addr, + (struct rte_ether_addr *)mac);if ((mac[0 ] &0x01U ) || ((mac[0 ] | mac[1 ] | mac[2 ]) ==0x00U )) {unsigned int rnd = (uint32_t )rte_rand ();
drivers/net/avp/avp_ethdev.c +3 -3
@@ -159,7 +159,7 @@ static const struct eth_dev_ops avp_eth_dev_ops = {struct avp_dev {uint32_t magic;/**< Memory validation marker */ uint64_t device_id;/**< Unique system identifier */ -struct ether_addr ethaddr;/**< Host specified MAC address */ +struct rte_ether_addr ethaddr;/**< Host specified MAC address */ struct rte_eth_dev_data *dev_data;/**< Back pointer to ethernet device data */ volatile uint32_t flags;/**< Device operational flags */
@@ -1199,7 +1199,7 @@ avp_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, }static inline int -_avp_cmp_ether_addr (struct ether_addr *a,struct ether_addr *b) +_avp_cmp_ether_addr (struct rte_ether_addr *a,struct rte_ether_addr *b) {uint16_t *_a = (uint16_t *)&a->addr_bytes[0 ];uint16_t *_b = (uint16_t *)&b->addr_bytes[0 ];
@@ -1209,7 +1209,7 @@ _avp_cmp_ether_addr(struct ether_addr *a, struct ether_addr *b)static inline int _avp_mac_filter (struct avp_dev *avp,struct rte_mbuf *m) { - struct ether_hdr *eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + struct rte_ether_hdr *eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);if (likely (_avp_cmp_ether_addr (&avp->ethaddr, ð->d_addr) ==0 )) {/* allow all packets destined to our address */
drivers/net/axgbe/axgbe_ethdev.h +1 -1
@@ -539,7 +539,7 @@ struct axgbe_port {/* Hardware features of the device */ struct axgbe_hw_features hw_feat; -struct ether_addr mac_addr; +struct rte_ether_addr mac_addr;/* Software Tx/Rx structure pointers*/ void **rx_queues;
drivers/net/bnx2x/bnx2x.c +4 -4
@@ -2177,8 +2177,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) tx_start_bd->vlan_or_ethertype =rte_cpu_to_le_16 (pkt_prod); else { -struct ether_hdr *eh = - rte_pktmbuf_mtod(m0, struct ether_hdr *); +struct rte_ether_hdr *eh = + rte_pktmbuf_mtod(m0, struct rte_ether_hdr *); tx_start_bd->vlan_or_ethertype =rte_cpu_to_le_16 (rte_be_to_cpu_16 (eh->ether_type));
@@ -2188,8 +2188,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) bd_prod =NEXT_TX_BD (bd_prod);if (IS_VF (sc)) {struct eth_tx_parse_bd_e2 *tx_parse_bd; -const struct ether_hdr *eh = - rte_pktmbuf_mtod(m0, struct ether_hdr *); +const struct rte_ether_hdr *eh = + rte_pktmbuf_mtod(m0, struct rte_ether_hdr *);uint8_t mac_type =UNICAST_ADDRESS ; tx_parse_bd =
drivers/net/bnx2x/bnx2x_ethdev.c +2 -2
@@ -497,7 +497,7 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) }static int -bnx2x_mac_addr_add (struct rte_eth_dev *dev,struct ether_addr *mac_addr, +bnx2x_mac_addr_add (struct rte_eth_dev *dev,struct rte_ether_addr *mac_addr,uint32_t index,uint32_t pool) {struct bnx2x_softc *sc = dev->data->dev_private;
@@ -650,7 +650,7 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf) } } - eth_dev->data->mac_addrs = (struct ether_addr *)sc->link_params.mac_addr; + eth_dev->data->mac_addrs = (struct rte_ether_addr *)sc->link_params.mac_addr;if (IS_VF (sc)) {rte_spinlock_init (&sc->vf2pf_lock);
drivers/net/bnx2x/bnx2x_ethdev.h +1 -1
@@ -75,7 +75,7 @@ typedef int bool;/* MAC address operations */ struct bnx2x_mac_ops { -void (*mac_addr_add)(struct rte_eth_dev *dev,struct ether_addr *addr, +void (*mac_addr_add)(struct rte_eth_dev *dev,struct rte_ether_addr *addr,uint16_t index,uint32_t pool);/* not implemented yet */ void (*mac_addr_remove)(struct rte_eth_dev *dev,uint16_t index);/* not implemented yet */ };
drivers/net/bnx2x/bnx2x_vfpf.c +1 -1
@@ -302,7 +302,7 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_if (is_valid_assigned_ether_addr (&sc_resp.resc.current_mac_addr))ether_addr_copy (&sc_resp.resc.current_mac_addr, - (struct ether_addr *)sc->link_params.mac_addr); + (struct rte_ether_addr *)sc->link_params.mac_addr);else eth_random_addr (sc->link_params.mac_addr);
drivers/net/bnx2x/bnx2x_vfpf.h +1 -1
@@ -115,7 +115,7 @@ struct vf_resc {uint8_t num_vlan_filters;uint8_t num_mc_filters;uint8_t permanent_mac_addr[ETH_ALEN ]; -struct ether_addr current_mac_addr; +struct rte_ether_addr current_mac_addr;uint16_t pf_link_speed;uint32_t pf_link_supported; };
drivers/net/bnxt/bnxt_ethdev.c +3 -3
@@ -760,7 +760,7 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev, }static int bnxt_mac_addr_add_op (struct rte_eth_dev *eth_dev, -struct ether_addr *mac_addr, +struct rte_ether_addr *mac_addr,uint32_t index,uint32_t pool) {struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
@@ -1451,7 +1451,7 @@ bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask) }static int -bnxt_set_default_mac_addr_op (struct rte_eth_dev *dev,struct ether_addr *addr) +bnxt_set_default_mac_addr_op (struct rte_eth_dev *dev,struct rte_ether_addr *addr) {struct bnxt *bp = (struct bnxt *)dev->data->dev_private;/* Default Filter is tied to VNIC 0 */
@@ -1489,7 +1489,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, struct ether_addr *addr)static int bnxt_dev_set_mc_addr_list_op (struct rte_eth_dev *eth_dev, -struct ether_addr *mc_addr_set, +struct rte_ether_addr *mc_addr_set,uint32_t nb_mc_addr) {struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
drivers/net/bnxt/bnxt_hwrm.c +2 -2
@@ -2578,7 +2578,7 @@ static void add_random_mac_if_needed(struct bnxt *bp, struct hwrm_func_cfg_input *cfg_req, int vf) { -struct ether_addr mac; +struct rte_ether_addr mac;if (bnxt_hwrm_func_qcfg_vf_default_mac (bp, vf, &mac))return ;
@@ -3112,7 +3112,7 @@ int bnxt_hwrm_reject_fwd_resp(struct bnxt *bp, uint16_t target_id, }int bnxt_hwrm_func_qcfg_vf_default_mac (struct bnxt *bp,uint16_t vf, -struct ether_addr *mac) +struct rte_ether_addr *mac) {struct hwrm_func_qcfg_input req = {0 };struct hwrm_func_qcfg_output *resp = bp->hwrm_cmd_resp_addr;
drivers/net/bnxt/bnxt_hwrm.h +1 -1
@@ -130,7 +130,7 @@ int bnxt_hwrm_func_bw_cfg(struct bnxt *bp, uint16_t vf, uint16_t max_bw, uint16_t enables);int bnxt_hwrm_set_vf_vlan (struct bnxt *bp,int vf);int bnxt_hwrm_func_qcfg_vf_default_mac (struct bnxt *bp,uint16_t vf, -struct ether_addr *mac); +struct rte_ether_addr *mac);int bnxt_hwrm_func_qcfg_current_vf_vlan (struct bnxt *bp,int vf);int bnxt_hwrm_tunnel_dst_port_alloc (struct bnxt *bp,uint16_t port,uint8_t tunnel_type);
drivers/net/bnxt/rte_pmd_bnxt.c +3 -3
@@ -132,7 +132,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on) }int rte_pmd_bnxt_set_vf_mac_addr (uint16_t port,uint16_t vf, -struct ether_addr *mac_addr) +struct rte_ether_addr *mac_addr) {struct rte_eth_dev *dev;struct rte_eth_dev_info dev_info;
@@ -647,7 +647,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, count); } -int rte_pmd_bnxt_mac_addr_add (uint16_t port,struct ether_addr *addr, +int rte_pmd_bnxt_mac_addr_add (uint16_t port,struct rte_ether_addr *addr,uint32_t vf_id) {struct rte_eth_dev *dev;
@@ -655,7 +655,7 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr,struct bnxt *bp;struct bnxt_filter_info *filter;struct bnxt_vnic_info vnic; -struct ether_addr dflt_mac; +struct rte_ether_addr dflt_mac;int rc; dev = &rte_eth_devices[port];
drivers/net/bnxt/rte_pmd_bnxt.h +2 -2
@@ -67,7 +67,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on);* - (-EINVAL) if *vf* or *mac_addr* is invalid. */ int rte_pmd_bnxt_set_vf_mac_addr (uint16_t port,uint16_t vf, -struct ether_addr *mac_addr); +struct rte_ether_addr *mac_addr);/** * Enable/Disable vf vlan strip for all queues in a pool
@@ -303,7 +303,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id,* - (-ENOTSUP) Ethernet device is not a PF * - (-ENOMEM) on an allocation failure */ -int rte_pmd_bnxt_mac_addr_add (uint16_t port,struct ether_addr *mac_addr, +int rte_pmd_bnxt_mac_addr_add (uint16_t port,struct rte_ether_addr *mac_addr,uint32_t vf_id);/**
drivers/net/bonding/rte_eth_bond.h +1 -1
@@ -225,7 +225,7 @@ rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],*/ int rte_eth_bond_mac_address_set (uint16_t bonded_port_id, -struct ether_addr *mac_addr); +struct rte_ether_addr *mac_addr);/** * Reset bonded device to use MAC from primary slave on bonded device and it's
drivers/net/bonding/rte_eth_bond_8023ad.c +3 -3
@@ -126,7 +126,7 @@ bond_print_lacp(struct lacpdu *l)#define MODE4_DEBUG (fmt, ...) do { } while (0)#endif -static const struct ether_addr lacp_mac_addr = { +static const struct rte_ether_addr lacp_mac_addr = { .addr_bytes = {0x01 ,0x80 ,0xC2 ,0x00 ,0x00 ,0x02 } };
@@ -810,7 +810,7 @@ bond_mode_8023ad_periodic_cb(void *arg)struct bond_dev_private *internals = bond_dev->data->dev_private;struct port *port;struct rte_eth_link link_info; -struct ether_addr slave_addr; +struct rte_ether_addr slave_addr;struct rte_mbuf *lacp_pkt =NULL ;uint16_t slave_id;uint16_t i;
@@ -1044,7 +1044,7 @@ void bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) {struct bond_dev_private *internals = bond_dev->data->dev_private; -struct ether_addr slave_addr; +struct rte_ether_addr slave_addr;struct port *slave, *agg_slave;uint16_t slave_id, i, j;
drivers/net/bonding/rte_eth_bond_8023ad.h +5 -5
@@ -58,14 +58,14 @@ struct slow_protocol {/** Generic slow protocol frame type structure */ struct slow_protocol_frame { -struct ether_hdr eth_hdr; +struct rte_ether_hdr eth_hdr;struct slow_protocol slow_protocol; } __attribute__((__packed__ ));struct port_params {uint16_t system_priority;/**< System priority (unused in current implementation) */ -struct ether_addr system; +struct rte_ether_addr system;/**< System ID - Slave MAC address, same as bonding MAC address */ uint16_t key;/**< Speed information (implementation dependednt) and duplex. */
@@ -103,7 +103,7 @@ struct lacpdu {/** LACPDU frame: Contains ethernet header and LACPDU. */ struct lacpdu_header { -struct ether_hdr eth_hdr; +struct rte_ether_hdr eth_hdr;struct lacpdu lacpdu; } __attribute__((__packed__ ));
@@ -114,7 +114,7 @@ struct marker {uint8_t tlv_type_marker;uint8_t info_length;uint16_t requester_port; -struct ether_addr requester_system; +struct rte_ether_addr requester_system;uint32_t requester_transaction_id;uint8_t reserved_2[2 ];
@@ -124,7 +124,7 @@ struct marker { } __attribute__((__packed__));struct marker_header { -struct ether_hdr eth_hdr; +struct rte_ether_hdr eth_hdr;struct marker marker; } __attribute__((__packed__ ));
drivers/net/bonding/rte_eth_bond_8023ad_private.h +1 -1
@@ -150,7 +150,7 @@ struct mode8023ad_private {uint64_t update_timeout_us;rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb;uint8_t external_sm; -struct ether_addr mac_addr; +struct rte_ether_addr mac_addr;struct rte_eth_link slave_link;/***< slave link properties */
drivers/net/bonding/rte_eth_bond_alb.c +12 -12
@@ -72,7 +72,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev)return -ENOMEM ; } -void bond_mode_alb_arp_recv (struct ether_hdr *eth_h,uint16_t offset, +void bond_mode_alb_arp_recv (struct rte_ether_hdr *eth_h,uint16_t offset,struct bond_dev_private *internals) {struct rte_arp_hdr *arp;
@@ -102,7 +102,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, client_info->app_ip != arp->arp_data.arp_tip || client_info->cli_ip != arp->arp_data.arp_sip || !is_same_ether_addr (&client_info->cli_mac, &arp->arp_data.arp_sha) || - client_info->vlan_count != offset /sizeof (struct vlan_hdr ) || + client_info->vlan_count != offset /sizeof (struct rte_vlan_hdr ) ||memcmp (client_info->vlan, eth_h +1 , offset) !=0 ) { client_info->in_use = 1;
@@ -113,14 +113,14 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset,rte_eth_macaddr_get (client_info->slave_idx, &client_info->app_mac);ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_tha);memcpy (client_info->vlan, eth_h +1 , offset); - client_info->vlan_count = offset /sizeof (struct vlan_hdr ); + client_info->vlan_count = offset /sizeof (struct rte_vlan_hdr ); } internals->mode6.ntt =1 ;rte_spinlock_unlock (&internals->mode6.lock); }uint16_t -bond_mode_alb_arp_xmit (struct ether_hdr *eth_h,uint16_t offset, +bond_mode_alb_arp_xmit (struct rte_ether_hdr *eth_h,uint16_t offset,struct bond_dev_private *internals) {struct rte_arp_hdr *arp;
@@ -130,7 +130,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,uint8_t hash_index; -struct ether_addr bonding_mac; +struct rte_ether_addr bonding_mac; arp = (struct rte_arp_hdr *)((char *)(eth_h +1 ) + offset);
@@ -163,7 +163,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, &client_info->app_mac);ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_sha);memcpy (client_info->vlan, eth_h +1 , offset); - client_info->vlan_count = offset /sizeof (struct vlan_hdr ); + client_info->vlan_count = offset /sizeof (struct rte_vlan_hdr );rte_spinlock_unlock (&internals->mode6.lock);return client_info->slave_idx; }
@@ -179,7 +179,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,rte_eth_macaddr_get (client_info->slave_idx, &client_info->app_mac);ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_sha);memcpy (client_info->vlan, eth_h +1 , offset); - client_info->vlan_count = offset /sizeof (struct vlan_hdr ); + client_info->vlan_count = offset /sizeof (struct rte_vlan_hdr );rte_spinlock_unlock (&internals->mode6.lock);return client_info->slave_idx; }
@@ -195,12 +195,12 @@ uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals) { - struct ether_hdr *eth_h; + struct rte_ether_hdr *eth_h;struct rte_arp_hdr *arp_h;uint16_t slave_idx;rte_spinlock_lock (&internals->mode6.lock); - eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);ether_addr_copy (&client_info->app_mac, ð_h->s_addr);ether_addr_copy (&client_info->cli_mac, ð_h->d_addr);
@@ -209,11 +209,11 @@ bond_mode_alb_arp_upd(struct client_data *client_info,else eth_h->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_ARP ); - arp_h = (struct rte_arp_hdr *)((char *)eth_h +sizeof (struct ether_hdr ) - + client_info->vlan_count *sizeof (struct vlan_hdr )); + arp_h = (struct rte_arp_hdr *)((char *)eth_h +sizeof (struct rte_ether_hdr ) + + client_info->vlan_count *sizeof (struct rte_vlan_hdr ));memcpy (eth_h +1 , client_info->vlan, - client_info->vlan_count *sizeof (struct vlan_hdr )); + client_info->vlan_count *sizeof (struct rte_vlan_hdr ));ether_addr_copy (&client_info->app_mac, &arp_h->arp_data.arp_sha); arp_h->arp_data.arp_sip = client_info->app_ip;
drivers/net/bonding/rte_eth_bond_alb.h +5 -5
@@ -13,11 +13,11 @@struct client_data {/** ARP data of single client */ -struct ether_addr app_mac; +struct rte_ether_addr app_mac;/**< MAC address of application running DPDK */ uint32_t app_ip;/**< IP address of application running DPDK */ -struct ether_addr cli_mac; +struct rte_ether_addr cli_mac;/**< Client MAC address */ uint32_t cli_ip;/**< Client IP address */
@@ -29,7 +29,7 @@ struct client_data {uint8_t ntt;/**< Flag indicating if we need to send update to this client on next tx */ -struct vlan_hdr vlan[2 ]; +struct rte_vlan_hdr vlan[2 ];/**< Content of vlan headers */ uint8_t vlan_count;/**< Number of nested vlan headers */
@@ -68,7 +68,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev);* @param internals Bonding data. */ void -bond_mode_alb_arp_recv (struct ether_hdr *eth_h,uint16_t offset, +bond_mode_alb_arp_recv (struct rte_ether_hdr *eth_h,uint16_t offset,struct bond_dev_private *internals);/**
@@ -85,7 +85,7 @@ bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset,* Index of slave on which packet should be sent. */ uint16_t -bond_mode_alb_arp_xmit (struct ether_hdr *eth_h,uint16_t offset, +bond_mode_alb_arp_xmit (struct rte_ether_hdr *eth_h,uint16_t offset,struct bond_dev_private *internals);/**
drivers/net/bonding/rte_eth_bond_api.c +1 -1
@@ -840,7 +840,7 @@ rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[],int rte_eth_bond_mac_address_set (uint16_t bonded_port_id, -struct ether_addr *mac_addr) +struct rte_ether_addr *mac_addr) {struct rte_eth_dev *bonded_eth_dev;struct bond_dev_private *internals;
drivers/net/bonding/rte_eth_bond_args.c +1 -1
@@ -282,7 +282,7 @@ bond_ethdev_parse_bond_mac_addr_kvarg(const char *key __rte_unused,/* Parse MAC */ return cmdline_parse_etheraddr (NULL , value, extra_args, -sizeof (struct ether_addr )); +sizeof (struct rte_ether_addr )); }int
drivers/net/bonding/rte_eth_bond_pmd.c +40 -40
276 lines not on this page · raw message
drivers/net/bonding/rte_eth_bond_private.h +3 -3
@@ -85,7 +85,7 @@ struct bond_slave_details {uint8_t link_status_wait_to_complete;uint8_t last_link_status;/**< Port Id of slave eth_dev */ -struct ether_addr persisted_mac_addr; +struct rte_ether_addr persisted_mac_addr;uint16_t reta_size; };
@@ -223,10 +223,10 @@ void activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id);int -mac_address_set (struct rte_eth_dev *eth_dev,struct ether_addr *new_mac_addr); +mac_address_set (struct rte_eth_dev *eth_dev,struct rte_ether_addr *new_mac_addr);int -mac_address_get (struct rte_eth_dev *eth_dev,struct ether_addr *dst_mac_addr); +mac_address_get (struct rte_eth_dev *eth_dev,struct rte_ether_addr *dst_mac_addr);int mac_address_slaves_update (struct rte_eth_dev *bonded_eth_dev);
drivers/net/cxgbe/base/adapter.h +1 -1
@@ -671,7 +671,7 @@ static inline void t4_os_set_hw_addr(struct adapter *adapter, int port_idx, {struct port_info *pi =adap2pinfo (adapter, port_idx); -ether_addr_copy ((struct ether_addr *)hw_addr, +ether_addr_copy ((struct rte_ether_addr *)hw_addr, &pi->eth_dev->data->mac_addrs[0 ]); }
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -1055,7 +1055,7 @@ static int cxgbe_get_regs(struct rte_eth_dev *eth_dev,return 0 ; } -int cxgbe_mac_addr_set (struct rte_eth_dev *dev,struct ether_addr *addr) +int cxgbe_mac_addr_set (struct rte_eth_dev *dev,struct rte_ether_addr *addr) {struct port_info *pi = (struct port_info *)(dev->data->dev_private);int ret;
drivers/net/cxgbe/cxgbe_pfvf.h +1 -1
@@ -16,7 +16,7 @@ void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev);void cxgbe_dev_promiscuous_disable (struct rte_eth_dev *eth_dev);void cxgbe_dev_allmulticast_enable (struct rte_eth_dev *eth_dev);void cxgbe_dev_allmulticast_disable (struct rte_eth_dev *eth_dev); -int cxgbe_mac_addr_set (struct rte_eth_dev *dev,struct ether_addr *addr); +int cxgbe_mac_addr_set (struct rte_eth_dev *dev,struct rte_ether_addr *addr);int cxgbe_dev_configure (struct rte_eth_dev *eth_dev); int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id,
drivers/net/dpaa/dpaa_ethdev.c +2 -2
@@ -934,7 +934,7 @@ dpaa_flow_ctrl_get(struct rte_eth_dev *dev,static int dpaa_dev_add_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *addr, +struct rte_ether_addr *addr,uint32_t index, __rte_unused uint32_t pool) {
@@ -964,7 +964,7 @@ dpaa_dev_remove_mac_addr(struct rte_eth_dev *dev,static int dpaa_dev_set_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *addr) +struct rte_ether_addr *addr) {int ret;struct dpaa_if *dpaa_intf = dev->data->dev_private;
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -198,7 +198,7 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr)static inline void dpaa_checksum (struct rte_mbuf *mbuf) { - struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr *); + struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *);char *l3_hdr = (char *)eth_hdr + mbuf->l2_len;struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)l3_hdr;struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)l3_hdr;
drivers/net/dpaa2/dpaa2_ethdev.c +9 -9
@@ -1124,7 +1124,7 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)static int dpaa2_dev_add_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *addr, +struct rte_ether_addr *addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) {
@@ -1155,7 +1155,7 @@ dpaa2_dev_remove_mac_addr(struct rte_eth_dev *dev,struct dpaa2_dev_priv *priv = dev->data->dev_private;struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw;struct rte_eth_dev_data *data = dev->data; -struct ether_addr *macaddr; +struct rte_ether_addr *macaddr;PMD_INIT_FUNC_TRACE ();
@@ -1175,7 +1175,7 @@ dpaa2_dev_remove_mac_addr(struct rte_eth_dev *dev,static int dpaa2_dev_set_mac_addr (struct rte_eth_dev *dev, -struct ether_addr *addr) +struct rte_ether_addr *addr) {int ret;struct dpaa2_dev_priv *priv = dev->data->dev_private;
@@ -1992,13 +1992,13 @@ static struct eth_dev_ops dpaa2_ethdev_ops = {*/ static int populate_mac_addr (struct fsl_mc_io *dpni_dev,struct dpaa2_dev_priv *priv, -struct ether_addr *mac_entry) +struct rte_ether_addr *mac_entry) {int ret; -struct ether_addr phy_mac, prime_mac; +struct rte_ether_addr phy_mac, prime_mac; -memset (&phy_mac,0 ,sizeof (struct ether_addr )); -memset (&prime_mac,0 ,sizeof (struct ether_addr )); +memset (&phy_mac,0 ,sizeof (struct rte_ether_addr )); +memset (&prime_mac,0 ,sizeof (struct rte_ether_addr ));/* Get the physical device MAC address */ ret = dpni_get_port_mac_addr(dpni_dev, CMD_PRI_LOW, priv->token,
@@ -2032,7 +2032,7 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, ret); goto cleanup; } -memcpy (&prime_mac, &phy_mac,sizeof (struct ether_addr )); +memcpy (&prime_mac, &phy_mac,sizeof (struct rte_ether_addr )); } }else if (is_zero_ether_addr (&prime_mac)) {/* In case phys and prime, both are zero, create random MAC */
@@ -2047,7 +2047,7 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, }/* prime_mac the final MAC address */ -memcpy (mac_entry, &prime_mac,sizeof (struct ether_addr )); +memcpy (mac_entry, &prime_mac,sizeof (struct rte_ether_addr ));return 0 ; cleanup:
drivers/net/dpaa2/dpaa2_flow.c +9 -9
@@ -215,27 +215,27 @@ dpaa2_configure_flow_eth(struct rte_flow *flow,/* Key rule */ key_iova = flow->rule.key_iova +DPAA2_CLS_RULE_OFFSET_ETH ;memcpy ((void *)key_iova, (const void *)(spec->src.addr_bytes), -sizeof (struct ether_addr )); - key_iova +=sizeof (struct ether_addr ); +sizeof (struct rte_ether_addr )); + key_iova +=sizeof (struct rte_ether_addr );memcpy ((void *)key_iova, (const void *)(spec->dst.addr_bytes), -sizeof (struct ether_addr )); - key_iova +=sizeof (struct ether_addr ); +sizeof (struct rte_ether_addr )); + key_iova +=sizeof (struct rte_ether_addr ); memcpy((void *)key_iova, (const void *)(&spec->type),
Lines of this file are not shown. View the raw message.
drivers/net/failsafe/failsafe_private.h +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/i40e/i40e_ethdev.c +29 -29
58 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +21 -21
42 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_vf_representor.c +2 -2
Lines of this file are not shown. View the raw message.
drivers/net/szedata2/rte_eth_szedata2.c +3 -3
Lines of this file are not shown. View the raw message.
examples/eventdev_pipeline/pipeline_common.h +3 -3
Lines of this file are not shown. View the raw message.
examples/multi_process/client_server_mp/mp_server/main.c +1 -1
Lines of this file are not shown. View the raw message.
examples/performance-thread/l3fwd-thread/main.c +68 -68
136 lines not on this page · raw message
examples/vm_power_manager/channel_monitor.c +3 -3
Lines of this file are not shown. View the raw message.
examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +1 -1
Lines of this file are not shown. View the raw message.
lib/librte_eventdev/rte_event_eth_rx_adapter.c +3 -3
Lines of this file are not shown. View the raw message.
lib/librte_net/rte_ether.h +32 -32
64 lines not on this page · raw message
lib/librte_pipeline/rte_table_action.c +30 -30
60 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.11.0
Part of the diff is not shown here. View the raw message.
RFC v2 4/14 net: add rte prefix to ether functions
In reply to Olivier MatzAdd 'rte_' prefix to functions:
- rename is_same_ether_addr() as rte_is_same_ether_addr().
- rename is_zero_ether_addr() as rte_is_zero_ether_addr().
- rename is_unicast_ether_addr() as rte_is_unicast_ether_addr().
- rename is_multicast_ether_addr() as rte_is_multicast_ether_addr().
- rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr().
- rename is_universal_ether_addr() as rte_is_universal_ether_addr().
- rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr().
- rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr().
- rename eth_random_addr() as rte_eth_random_addr().
- rename ether_addr_copy() as rte_ether_addr_copy().
- rename ether_format_addr() as rte_ether_format_addr().
--- app/test-pmd/cmdline.c | 6 ++-- app/test-pmd/config.c | 8 ++--- app/test-pmd/csumonly.c | 4 +-- app/test-pmd/flowgen.c | 4 +-- app/test-pmd/icmpecho.c | 22 ++++++------ app/test-pmd/ieee1588fwd.c | 6 ++-- app/test-pmd/macfwd.c | 4 +-- app/test-pmd/macswap.h | 6 ++-- app/test-pmd/txonly.c | 4 +-- app/test-pmd/util.c | 2 +- app/test/packet_burst_generator.c | 8 ++--- app/test/test_link_bonding.c | 14 ++++---- app/test/test_link_bonding_mode4.c | 26 +++++++------- app/test/test_pmd_perf.c | 2 +- doc/guides/sample_app_ug/ipv4_multicast.rst | 4 +-- doc/guides/sample_app_ug/l2_forward_job_stats.rst | 2 +- .../sample_app_ug/l2_forward_real_virtual.rst | 2 +- doc/guides/sample_app_ug/link_status_intr.rst | 2 +- drivers/net/atlantic/atl_ethdev.c | 2 +- drivers/net/atlantic/hw_atl/hw_atl_utils.c | 4 +-- drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 2 +- drivers/net/avp/avp_ethdev.c | 6 ++-- drivers/net/axgbe/axgbe_ethdev.c | 6 ++-- drivers/net/bnx2x/bnx2x.c | 4 +-- drivers/net/bnx2x/bnx2x_vfpf.c | 6 ++-- drivers/net/bnxt/bnxt_flow.c | 12 +++---- drivers/net/bnxt/bnxt_hwrm.c | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 20 +++++------ drivers/net/bonding/rte_eth_bond_alb.c | 26 +++++++------- drivers/net/bonding/rte_eth_bond_pmd.c | 16 ++++----- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_flow.c | 4 +-- drivers/net/dpaa/dpaa_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 8 ++--- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 8 ++--- drivers/net/e1000/igb_flow.c | 8 ++--- drivers/net/e1000/igb_pf.c | 6 ++-- drivers/net/ena/ena_ethdev.c | 2 +- drivers/net/enetc/enetc_ethdev.c | 2 +- drivers/net/enic/enic_ethdev.c | 12 +++---- drivers/net/enic/enic_main.c | 2 +- drivers/net/failsafe/failsafe.c | 4 +-- drivers/net/failsafe/failsafe_ether.c | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 12 +++---- drivers/net/i40e/i40e_ethdev.c | 38 ++++++++++---------- drivers/net/i40e/i40e_ethdev_vf.c | 16 ++++----- drivers/net/i40e/i40e_flow.c | 24 ++++++------- drivers/net/i40e/i40e_pf.c | 6 ++-- drivers/net/i40e/rte_pmd_i40e.c | 10 +++--- drivers/net/iavf/iavf_ethdev.c | 14 ++++---- drivers/net/iavf/iavf_vchnl.c | 4 +-- drivers/net/ice/ice_ethdev.c | 12 +++---- drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++--- drivers/net/ixgbe/ixgbe_flow.c | 8 ++--- drivers/net/ixgbe/ixgbe_pf.c | 4 +-- drivers/net/ixgbe/rte_pmd_ixgbe.c | 2 +- drivers/net/kni/rte_eth_kni.c | 2 +- drivers/net/liquidio/lio_ethdev.c | 2 +- drivers/net/mlx4/mlx4_flow.c | 2 +- drivers/net/mlx5/mlx5_flow_tcf.c | 4 +-- drivers/net/mlx5/mlx5_mac.c | 4 +-- drivers/net/mlx5/mlx5_nl.c | 6 ++-- drivers/net/mvneta/mvneta_ethdev.c | 6 ++-- drivers/net/mvpp2/mrvl_ethdev.c | 6 ++-- drivers/net/netvsc/hn_rxtx.c | 4 +-- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/nfp/nfp_net.c | 6 ++-- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/qede/qede_ethdev.c | 26 +++++++------- drivers/net/sfc/sfc_ethdev.c | 6 ++-- drivers/net/sfc/sfc_flow.c | 10 +++--- drivers/net/sfc/sfc_port.c | 2 +- drivers/net/softnic/rte_eth_softnic_flow.c | 4 +-- drivers/net/szedata2/rte_eth_szedata2.c | 2 +- drivers/net/tap/rte_eth_tap.c | 10 +++--- drivers/net/tap/tap_flow.c | 4 +-- drivers/net/thunderx/base/nicvf_mbox.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 6 ++-- drivers/net/vdev_netvsc/vdev_netvsc.c | 4 +-- drivers/net/vhost/rte_eth_vhost.c | 4 +-- drivers/net/virtio/virtio_ethdev.c | 10 +++--- drivers/net/virtio/virtio_rxtx.c | 4 +-- drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 +-- examples/bond/main.c | 8 ++--- examples/ethtool/ethtool-app/main.c | 4 +-- examples/ethtool/lib/rte_ethtool.c | 2 +- examples/eventdev_pipeline/pipeline_common.h | 4 +-- examples/flow_filtering/main.c | 2 +- examples/ip_fragmentation/main.c | 4 +-- examples/ip_reassembly/main.c | 4 +-- examples/ipsec-secgw/ipsec-secgw.c | 2 +- examples/ipv4_multicast/main.c | 6 ++-- examples/kni/main.c | 2 +- examples/l2fwd-crypto/main.c | 2 +- examples/l2fwd-jobstats/main.c | 2 +- examples/l2fwd-keepalive/main.c | 2 +- examples/l2fwd/main.c | 2 +- examples/l3fwd-acl/main.c | 2 +- examples/l3fwd-power/main.c | 6 ++-- examples/l3fwd-vf/main.c | 4 +-- examples/l3fwd/l3fwd_em.h | 4 +-- examples/l3fwd/l3fwd_lpm.h | 4 +-- examples/l3fwd/main.c | 4 +-- examples/link_status_interrupt/main.c | 2 +- examples/performance-thread/l3fwd-thread/main.c | 40 +++++++++++----------- examples/ptpclient/ptpclient.c | 2 +- examples/quota_watermark/qw/main.c | 2 +- examples/tep_termination/vxlan_setup.c | 14 ++++---- examples/vhost/main.c | 4 +-- examples/vmdq/main.c | 2 +- examples/vmdq_dcb/main.c | 2 +- lib/librte_ethdev/rte_class_eth.c | 2 +- lib/librte_ethdev/rte_ethdev.c | 20 +++++------ lib/librte_gro/gro_tcp4.c | 8 ++--- lib/librte_gro/gro_tcp4.h | 4 +-- lib/librte_gro/gro_vxlan_tcp4.c | 20 +++++------ lib/librte_net/rte_arp.c | 6 ++-- lib/librte_net/rte_ether.h | 24 ++++++------- lib/librte_pipeline/rte_table_action.c | 40 +++++++++++----------- 120 files changed, 430 insertions(+), 430 deletions(-)
app/test-pmd/cmdline.c +3 -3
@@ -8720,8 +8720,8 @@ cmd_tunnel_filter_parsed(void *parsed_result,memset (&tunnel_filter_conf,0 ,sizeof (tunnel_filter_conf)); -ether_addr_copy (&res->outer_mac, &tunnel_filter_conf.outer_mac); -ether_addr_copy (&res->inner_mac, &tunnel_filter_conf.inner_mac); +rte_ether_addr_copy (&res->outer_mac, &tunnel_filter_conf.outer_mac); +rte_ether_addr_copy (&res->inner_mac, &tunnel_filter_conf.inner_mac); tunnel_filter_conf.inner_vlan = res->inner_vlan;if (res->ip_value.family ==AF_INET ) {
@@ -12379,7 +12379,7 @@ static void cmd_mcast_addr_parsed(void *parsed_result, {struct cmd_mcast_addr_result *res = parsed_result; -if (!is_multicast_ether_addr (&res->mc_addr)) { +if (!rte_is_multicast_ether_addr (&res->mc_addr)) { printf("Invalid multicast addr %02X:%02X:%02X:%02X:%02X:%02X\n", res->mc_addr.addr_bytes[0], res->mc_addr.addr_bytes[1], res->mc_addr.addr_bytes[2], res->mc_addr.addr_bytes[3],
app/test-pmd/config.c +4 -4
@@ -111,7 +111,7 @@ static void print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
@@ -3535,7 +3535,7 @@ mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr)* in the pool of multicast addresses. */ for (i =0 ; i < port->mc_addr_nb; i++) { -if (is_same_ether_addr (mc_addr, &port->mc_addr_pool[i])) { +if (rte_is_same_ether_addr (mc_addr, &port->mc_addr_pool[i])) {printf ("multicast address already filtered by port\n" );return ; }
@@ -3543,7 +3543,7 @@ mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr)if (mcast_addr_pool_extend (port) !=0 )return ; -ether_addr_copy (mc_addr, &port->mc_addr_pool[i]); +rte_ether_addr_copy (mc_addr, &port->mc_addr_pool[i]);eth_port_multicast_addr_list_set (port_id); }
@@ -3562,7 +3562,7 @@ mcast_addr_remove(portid_t port_id, struct rte_ether_addr *mc_addr)* Search the pool of multicast MAC addresses for the removed address. */ for (i =0 ; i < port->mc_addr_nb; i++) { -if (is_same_ether_addr (mc_addr, &port->mc_addr_pool[i])) +if (rte_is_same_ether_addr (mc_addr, &port->mc_addr_pool[i]))break ; }if (i == port->mc_addr_nb) {
app/test-pmd/csumonly.c +2 -2
@@ -766,9 +766,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)* and inner headers */ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); -ether_addr_copy (&peer_eth_addrs[fs->peer_addr], +rte_ether_addr_copy (&peer_eth_addrs[fs->peer_addr], ð_hdr->d_addr); -ether_addr_copy (&ports[fs->tx_port].eth_addr, +rte_ether_addr_copy (&ports[fs->tx_port].eth_addr, ð_hdr->s_addr);parse_ethernet (eth_hdr, &info); l3_hdr = (char *)eth_hdr + info.l2_len;
app/test-pmd/flowgen.c +2 -2
@@ -171,8 +171,8 @@ pkt_burst_flow_gen(struct fwd_stream *fs)/* Initialize Ethernet header. */ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); -ether_addr_copy (&cfg_ether_dst, ð_hdr->d_addr); -ether_addr_copy (&cfg_ether_src, ð_hdr->s_addr); +rte_ether_addr_copy (&cfg_ether_dst, ð_hdr->d_addr); +rte_ether_addr_copy (&cfg_ether_src, ð_hdr->s_addr); eth_hdr->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_IPv4);/* Initialize IP header. */
app/test-pmd/icmpecho.c +11 -11
@@ -225,7 +225,7 @@ ether_addr_dump(const char *what, const struct rte_ether_addr *ea) {char buf[ETHER_ADDR_FMT_SIZE ]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , ea); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , ea);if (what)printf ("%s" , what);printf ("%s" , buf);
@@ -370,12 +370,12 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)continue ; }if (verbose_level >0 ) { -ether_addr_copy (&arp_h->arp_data.arp_sha, ð_addr); +rte_ether_addr_copy (&arp_h->arp_data.arp_sha, ð_addr);ether_addr_dump (" sha=" , ð_addr); ip_addr = arp_h->arp_data.arp_sip;ipv4_addr_dump (" sip=" , ip_addr);printf ("\n" ); -ether_addr_copy (&arp_h->arp_data.arp_tha, ð_addr); +rte_ether_addr_copy (&arp_h->arp_data.arp_tha, ð_addr);ether_addr_dump (" tha=" , ð_addr); ip_addr = arp_h->arp_data.arp_tip;ipv4_addr_dump (" tip=" , ip_addr);
@@ -391,15 +391,15 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)*/ /* Use source MAC address as destination MAC address. */ -ether_addr_copy (ð_h->s_addr, ð_h->d_addr); +rte_ether_addr_copy (ð_h->s_addr, ð_h->d_addr);/* Set source MAC address with MAC address of TX port */ -ether_addr_copy (&ports[fs->tx_port].eth_addr, +rte_ether_addr_copy (&ports[fs->tx_port].eth_addr, ð_h->s_addr); arp_h->arp_opcode =rte_cpu_to_be_16 (RTE_ARP_OP_REPLY ); -ether_addr_copy (&arp_h->arp_data.arp_tha, ð_addr); -ether_addr_copy (&arp_h->arp_data.arp_sha, &arp_h->arp_data.arp_tha); -ether_addr_copy (ð_h->s_addr, &arp_h->arp_data.arp_sha); +rte_ether_addr_copy (&arp_h->arp_data.arp_tha, ð_addr); +rte_ether_addr_copy (&arp_h->arp_data.arp_sha, &arp_h->arp_data.arp_tha); +rte_ether_addr_copy (ð_h->s_addr, &arp_h->arp_data.arp_sha);/* Swap IP addresses in ARP payload */ ip_addr = arp_h->arp_data.arp_sip;
@@ -456,9 +456,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)* ICMP checksum is computed by assuming it is valid in the * echo request and not verified. */ -ether_addr_copy (ð_h->s_addr, ð_addr); -ether_addr_copy (ð_h->d_addr, ð_h->s_addr); -ether_addr_copy (ð_addr, ð_h->d_addr); +rte_ether_addr_copy (ð_h->s_addr, ð_addr); +rte_ether_addr_copy (ð_h->d_addr, ð_h->s_addr); +rte_ether_addr_copy (ð_addr, ð_h->d_addr); ip_addr = ip_h->src_addr;if (is_multicast_ipv4_addr (ip_h->dst_addr)) {uint32_t ip_src;
app/test-pmd/ieee1588fwd.c +3 -3
@@ -178,9 +178,9 @@ ieee1588_packet_fwd(struct fwd_stream *fs)port_ieee1588_rx_timestamp_check (fs->rx_port, timesync_index);/* Swap dest and src mac addresses. */ -ether_addr_copy (ð_hdr->d_addr, &addr); -ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr); -ether_addr_copy (&addr, ð_hdr->s_addr); +rte_ether_addr_copy (ð_hdr->d_addr, &addr); +rte_ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr); +rte_ether_addr_copy (&addr, ð_hdr->s_addr);/* Forward PTP packet with hardware TX timestamp */ mb->ol_flags |=PKT_TX_IEEE1588_TMST ;
app/test-pmd/macfwd.c +2 -2
@@ -92,9 +92,9 @@ pkt_burst_mac_forward(struct fwd_stream *fs) void *)); mb = pkts_burst[i]; eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); -ether_addr_copy (&peer_eth_addrs[fs->peer_addr], +rte_ether_addr_copy (&peer_eth_addrs[fs->peer_addr], ð_hdr->d_addr); -ether_addr_copy (&ports[fs->tx_port].eth_addr, +rte_ether_addr_copy (&ports[fs->tx_port].eth_addr, ð_hdr->s_addr); mb->ol_flags &=IND_ATTACHED_MBUF |EXT_ATTACHED_MBUF ; mb->ol_flags |= ol_flags;
app/test-pmd/macswap.h +3 -3
@@ -29,9 +29,9 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *);/* Swap dest and src mac addresses. */ -ether_addr_copy (ð_hdr->d_addr, &addr); -ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr); -ether_addr_copy (&addr, ð_hdr->s_addr); +rte_ether_addr_copy (ð_hdr->d_addr, &addr); +rte_ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr); +rte_ether_addr_copy (&addr, ð_hdr->s_addr);mbuf_field_set (mb, ol_flags); }
app/test-pmd/txonly.c +2 -2
@@ -264,8 +264,8 @@ pkt_burst_transmit(struct fwd_stream *fs)/* * Initialize Ethernet header. */ -ether_addr_copy (&peer_eth_addrs[fs->peer_addr], ð_hdr.d_addr); -ether_addr_copy (&ports[fs->tx_port].eth_addr, ð_hdr.s_addr); +rte_ether_addr_copy (&peer_eth_addrs[fs->peer_addr], ð_hdr.d_addr); +rte_ether_addr_copy (&ports[fs->tx_port].eth_addr, ð_hdr.s_addr); eth_hdr.ether_type =rte_cpu_to_be_16 (ETHER_TYPE_IPv4); if (rte_mempool_get_bulk(mbp, (void **)pkts_burst,
app/test-pmd/util.c +1 -1
@@ -17,7 +17,7 @@ static inline void print_ether_addr(const char *what, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , what, buf); }
app/test/packet_burst_generator.c +4 -4
@@ -57,8 +57,8 @@ initialize_eth_header(struct rte_ether_hdr *eth_hdr, struct rte_ether_addr *src_ struct rte_ether_addr *dst_mac, uint16_t ether_type, uint8_t vlan_enabled, uint16_t van_id) { - ether_addr_copy(dst_mac, ð_hdr->d_addr); -ether_addr_copy (src_mac, ð_hdr->s_addr); + rte_ether_addr_copy(dst_mac, ð_hdr->d_addr); +rte_ether_addr_copy (src_mac, ð_hdr->s_addr);if (vlan_enabled) { struct rte_vlan_hdr *vhdr = (struct rte_vlan_hdr *)((uint8_t *)eth_hdr +
@@ -83,9 +83,9 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct rte_ether_addr *src_ma arp_hdr->arp_hlen =ETHER_ADDR_LEN ; arp_hdr->arp_plen =sizeof (uint32_t ); arp_hdr->arp_opcode =rte_cpu_to_be_16 (opcode); -ether_addr_copy (src_mac, &arp_hdr->arp_data.arp_sha); +rte_ether_addr_copy (src_mac, &arp_hdr->arp_data.arp_sha); arp_hdr->arp_data.arp_sip = src_ip; -ether_addr_copy (dst_mac, &arp_hdr->arp_data.arp_tha); +rte_ether_addr_copy (dst_mac, &arp_hdr->arp_data.arp_tha); arp_hdr->arp_data.arp_tip = dst_ip; }
app/test/test_link_bonding.c +7 -7
@@ -4482,7 +4482,7 @@ test_alb_change_mac_in_reply_sent(void) MAX_PKT_BURST); } -ether_addr_copy ( +rte_ether_addr_copy ( rte_eth_devices[test_params->bonded_port_id].data->mac_addrs, &bond_mac);
@@ -4549,12 +4549,12 @@ test_alb_change_mac_in_reply_sent(void) arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +sizeof (struct rte_ether_hdr ));if (slave_idx%2 ==0 ) { -if (!is_same_ether_addr (slave_mac1, &arp_pkt->arp_data.arp_sha)) { +if (!rte_is_same_ether_addr (slave_mac1, &arp_pkt->arp_data.arp_sha)) { retval =-1 ; goto test_end; } }else { -if (!is_same_ether_addr (slave_mac2, &arp_pkt->arp_data.arp_sha)) { +if (!rte_is_same_ether_addr (slave_mac2, &arp_pkt->arp_data.arp_sha)) { retval =-1 ; goto test_end; }
@@ -4595,7 +4595,7 @@ test_alb_reply_from_client(void) MAX_PKT_BURST); } -ether_addr_copy ( +rte_ether_addr_copy ( rte_eth_devices[test_params->bonded_port_id].data->mac_addrs, &bond_mac);
@@ -4670,12 +4670,12 @@ test_alb_reply_from_client(void) arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +sizeof (struct rte_ether_hdr ));if (slave_idx%2 ==0 ) { -if (!is_same_ether_addr (slave_mac1, &arp_pkt->arp_data.arp_sha)) { +if (!rte_is_same_ether_addr (slave_mac1, &arp_pkt->arp_data.arp_sha)) { retval =-1 ; goto test_end; } }else { -if (!is_same_ether_addr (slave_mac2, &arp_pkt->arp_data.arp_sha)) { +if (!rte_is_same_ether_addr (slave_mac2, &arp_pkt->arp_data.arp_sha)) { retval =-1 ; goto test_end; }
@@ -4722,7 +4722,7 @@ test_alb_receive_vlan_reply(void) MAX_PKT_BURST); } -ether_addr_copy ( +rte_ether_addr_copy ( rte_eth_devices[test_params->bonded_port_id].data->mac_addrs, &bond_mac);
app/test/test_link_bonding_mode4.c +13 -13
@@ -232,7 +232,7 @@ add_slave(struct slave_conf *slave, uint8_t start)RTE_VERIFY (slave->bonded ==0 );RTE_VERIFY (slave->port_id !=INVALID_PORT_ID ); -ether_addr_copy (&slave_mac_default, &addr); +rte_ether_addr_copy (&slave_mac_default, &addr); addr.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id;rte_eth_dev_mac_addr_remove (slave->port_id, &addr);
@@ -253,7 +253,7 @@ add_slave(struct slave_conf *slave, uint8_t start) }rte_eth_macaddr_get (slave->port_id, &addr_check); -TEST_ASSERT_EQUAL (is_same_ether_addr (&addr, &addr_check),1 , +TEST_ASSERT_EQUAL (rte_is_same_ether_addr (&addr, &addr_check),1 ,"Slave MAC address is not as expected" );RTE_VERIFY (slave->lacp_parnter_state ==0 );
@@ -491,7 +491,7 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt) slow_hdr = rte_pktmbuf_mtod(pkt, struct slow_protocol_frame *);/* Change source address to partner address */ -ether_addr_copy (&parnter_mac_default, &slow_hdr->eth_hdr.s_addr); +rte_ether_addr_copy (&parnter_mac_default, &slow_hdr->eth_hdr.s_addr); slow_hdr->eth_hdr.s_addr.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id; lacp = (struct lacpdu *) &slow_hdr->slow_protocol;
@@ -503,7 +503,7 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt) lacp->partner.state = lacp->actor.state; -ether_addr_copy (&parnter_system, &lacp->actor.port_params.system); +rte_ether_addr_copy (&parnter_system, &lacp->actor.port_params.system); lacp->actor.state =STATE_LACP_ACTIVE |STATE_SYNCHRONIZATION | STATE_AGGREGATION |
@@ -810,7 +810,7 @@ test_mode4_rx(void)TEST_ASSERT_SUCCESS (retval,"Initial handshake failed" );rte_eth_macaddr_get (test_params.bonded_port_id, &bonded_mac); -ether_addr_copy (&bonded_mac, &dst_mac); +rte_ether_addr_copy (&bonded_mac, &dst_mac);/* Assert that dst address is not bonding address. Do not set the * least significant bit of the zero byte as this would create a
@@ -845,7 +845,7 @@ test_mode4_rx(void)for (i =0 ; i < expected_pkts_cnt; i++) { hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); - cnt[is_same_ether_addr (&hdr->d_addr, &bonded_mac)]++; + cnt[rte_is_same_ether_addr (&hdr->d_addr, &bonded_mac)]++; }free_pkts (pkts, expected_pkts_cnt);
@@ -889,7 +889,7 @@ test_mode4_rx(void)for (i =0 ; i < expected_pkts_cnt; i++) { hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); - eq_cnt +=is_same_ether_addr (&hdr->d_addr, &bonded_mac); + eq_cnt +=rte_is_same_ether_addr (&hdr->d_addr, &bonded_mac); }free_pkts (pkts, expected_pkts_cnt);
@@ -1130,10 +1130,10 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave) struct marker_header *);/* Copy multicast destination address */ -ether_addr_copy (&slow_protocol_mac_addr, &marker_hdr->eth_hdr.d_addr); +rte_ether_addr_copy (&slow_protocol_mac_addr, &marker_hdr->eth_hdr.d_addr);/* Init source address */ -ether_addr_copy (&parnter_mac_default, &marker_hdr->eth_hdr.s_addr); +rte_ether_addr_copy (&parnter_mac_default, &marker_hdr->eth_hdr.s_addr); marker_hdr->eth_hdr.s_addr.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id; marker_hdr->eth_hdr.ether_type =rte_cpu_to_be_16 (ETHER_TYPE_SLOW );
@@ -1358,8 +1358,8 @@ test_mode4_ext_ctrl(void) }, }; -ether_addr_copy (&parnter_system, &src_mac); -ether_addr_copy (&slow_protocol_mac_addr, &dst_mac); +rte_ether_addr_copy (&parnter_system, &src_mac); +rte_ether_addr_copy (&slow_protocol_mac_addr, &dst_mac);initialize_eth_header (&lacpdu.eth_hdr, &src_mac, &dst_mac,ETHER_TYPE_SLOW ,0 ,0 );
@@ -1412,8 +1412,8 @@ test_mode4_ext_lacp(void) }, }; -ether_addr_copy (&parnter_system, &src_mac); -ether_addr_copy (&slow_protocol_mac_addr, &dst_mac); +rte_ether_addr_copy (&parnter_system, &src_mac); +rte_ether_addr_copy (&slow_protocol_mac_addr, &dst_mac);initialize_eth_header (&lacpdu.eth_hdr, &src_mac, &dst_mac,ETHER_TYPE_SLOW ,0 ,0 );
app/test/test_pmd_perf.c +1 -1
@@ -174,7 +174,7 @@ static void print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
doc/guides/sample_app_ug/ipv4_multicast.rst +2 -2
@@ -227,8 +227,8 @@ The actual packet transmission is done in the mcast_send_pkt() function: RTE_ASSERT(ethdr != NULL); - ether_addr_copy(dest_addr, ðdr->d_addr); - ether_addr_copy(&ports_eth_addr[port], ðdr->s_addr); + rte_ether_addr_copy(dest_addr, ðdr->d_addr); + rte_ether_addr_copy(&ports_eth_addr[port], ðdr->s_addr); ethdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4); /* Put new packet into the output queue */
doc/guides/sample_app_ug/l2_forward_job_stats.rst +1 -1
@@ -467,7 +467,7 @@ Naturally, the number of ports in the portmask must be even, otherwise, the appl /* src addr */ - ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], ð->s_addr); + rte_ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], ð->s_addr); l2fwd_send_packet(m, (uint8_t) dst_port); }
doc/guides/sample_app_ug/l2_forward_real_virtual.rst +1 -1
@@ -383,7 +383,7 @@ Naturally, the number of ports in the portmask must be even, otherwise, the appl /* src addr */ - ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], ð->s_addr); + rte_ether_addr_copy(&l2fwd_ports_eth_addr[dst_port], ð->s_addr); l2fwd_send_packet(m, (uint8_t) dst_port); }
doc/guides/sample_app_ug/link_status_intr.rst +1 -1
@@ -324,7 +324,7 @@ The processing is very simple: processes the TX port from the RX port and then r *((uint64_t *)tmp) = 0x000000000002 + (dst_port << 40); /* src addr */ - ether_addr_copy(&lsi_ports_eth_addr[dst_port], ð->s_addr); + rte_ether_addr_copy(&lsi_ports_eth_addr[dst_port], ð->s_addr); lsi_send_packet(m, dst_port); }
drivers/net/atlantic/atl_ethdev.c +1 -1
@@ -1238,7 +1238,7 @@ static int atl_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index __rte_unused, uint32_t pool __rte_unused) { - if (is_zero_ether_addr(mac_addr)) { + if (rte_is_zero_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Invalid Ethernet Address");return -EINVAL ; }
drivers/net/atlantic/hw_atl/hw_atl_utils.c +2 -2
@@ -656,7 +656,7 @@ static int hw_atl_utils_get_mac_permanent(struct aq_hw_s *self, mac_addr[1 ] =rte_constant_bswap32 (mac_addr[1 ]); } -ether_addr_copy ((struct rte_ether_addr *)mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)mac_addr, (struct rte_ether_addr *)mac);if ((mac[0 ] &0x01U ) || ((mac[0 ] | mac[1 ] | mac[2 ]) ==0x00U )) {
@@ -867,7 +867,7 @@ static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac) prpc->msg_wol.pattern_id =1U ; prpc->msg_wol.wol_packet_type =2U ;/* Magic Packet */ -ether_addr_copy ((struct rte_ether_addr *)mac, +rte_ether_addr_copy ((struct rte_ether_addr *)mac, (struct rte_ether_addr *)&prpc->msg_wol.wol_pattern); }else { rpc_size =sizeof (prpc->msg_id) +sizeof (prpc->msg_del_id);
drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +1 -1
@@ -222,7 +222,7 @@ int aq_fw2x_get_mac_permanent(struct aq_hw_s *self, u8 *mac) mac_addr[1 ] =rte_constant_bswap32 (mac_addr[1 ]); } -ether_addr_copy ((struct rte_ether_addr *)mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)mac_addr, (struct rte_ether_addr *)mac);if ((mac[0 ] &0x01U ) || ((mac[0 ] | mac[1 ] | mac[2 ]) ==0x00U )) {
drivers/net/avp/avp_ethdev.c +3 -3
@@ -1014,7 +1014,7 @@ eth_avp_dev_init(struct rte_eth_dev *eth_dev) }/* Get a mac from device config */ -ether_addr_copy (&avp->ethaddr, ð_dev->data->mac_addrs[0 ]); +rte_ether_addr_copy (&avp->ethaddr, ð_dev->data->mac_addrs[0 ]);return 0 ; }
@@ -1216,12 +1216,12 @@ _avp_mac_filter(struct avp_dev *avp, struct rte_mbuf *m)return 0 ; } -if (likely (is_broadcast_ether_addr (ð->d_addr))) { +if (likely (rte_is_broadcast_ether_addr (ð->d_addr))) {/* allow all broadcast packets */ return 0 ; } -if (likely (is_multicast_ether_addr (ð->d_addr))) { +if (likely (rte_is_multicast_ether_addr (ð->d_addr))) {/* allow all multicast packets */ return 0 ; }
drivers/net/axgbe/axgbe_ethdev.c +3 -3
@@ -634,11 +634,11 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)return -ENOMEM ; } -if (!is_valid_assigned_ether_addr (&pdata->mac_addr)) -eth_random_addr (pdata->mac_addr.addr_bytes); +if (!rte_is_valid_assigned_ether_addr (&pdata->mac_addr)) +rte_eth_random_addr (pdata->mac_addr.addr_bytes);/* Copy the permanent MAC address */ -ether_addr_copy (&pdata->mac_addr, ð_dev->data->mac_addrs[0 ]); +rte_ether_addr_copy (&pdata->mac_addr, ð_dev->data->mac_addrs[0 ]);/* Clock settings */ pdata->sysclk_rate =AXGBE_V2_DMA_CLOCK_FREQ ;
drivers/net/bnx2x/bnx2x.c +2 -2
@@ -2194,8 +2194,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) tx_parse_bd = &txq->tx_ring[TX_BD (bd_prod, txq)].parse_bd_e2; -if (is_multicast_ether_addr (&eh->d_addr)) { -if (is_broadcast_ether_addr (&eh->d_addr)) +if (rte_is_multicast_ether_addr (&eh->d_addr)) { +if (rte_is_broadcast_ether_addr (&eh->d_addr)) mac_type =BROADCAST_ADDRESS ;else mac_type =MULTICAST_ADDRESS ;
drivers/net/bnx2x/bnx2x_vfpf.c +3 -3
@@ -300,11 +300,11 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_ sc->igu_sb_cnt, sc->igu_base_sb);strncpy (sc->fw_ver, sc_resp.fw_ver,sizeof (sc->fw_ver)); -if (is_valid_assigned_ether_addr (&sc_resp.resc.current_mac_addr)) -ether_addr_copy (&sc_resp.resc.current_mac_addr, +if (rte_is_valid_assigned_ether_addr (&sc_resp.resc.current_mac_addr)) +rte_ether_addr_copy (&sc_resp.resc.current_mac_addr, (struct rte_ether_addr *)sc->link_params.mac_addr);else -eth_random_addr (sc->link_params.mac_addr); +rte_eth_random_addr (sc->link_params.mac_addr); out:bnx2x_vf_finalize (sc, &acq->first_tlv);
drivers/net/bnxt/bnxt_flow.c +6 -6
@@ -187,10 +187,10 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,* Destination MAC address mask must not be partially * set. Should be all 1's or all 0's. */ -if ((!is_zero_ether_addr (ð_mask->src) && - !is_broadcast_ether_addr (ð_mask->src)) || - (!is_zero_ether_addr (ð_mask->dst) && - !is_broadcast_ether_addr (ð_mask->dst))) { +if ((!rte_is_zero_ether_addr (ð_mask->src) && + !rte_is_broadcast_ether_addr (ð_mask->src)) || + (!rte_is_zero_ether_addr (ð_mask->dst) && + !rte_is_broadcast_ether_addr (ð_mask->dst))) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
@@ -209,7 +209,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,return -rte_errno; } -if (is_broadcast_ether_addr (ð_mask->dst)) { +if (rte_is_broadcast_ether_addr (ð_mask->dst)) {rte_memcpy (filter->dst_macaddr, ð_spec->dst,6 ); en |= use_ntuple ?
@@ -217,7 +217,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,EM_FLOW_ALLOC_INPUT_EN_DST_MACADDR ; } -if (is_broadcast_ether_addr (ð_mask->src)) { +if (rte_is_broadcast_ether_addr (ð_mask->src)) {rte_memcpy (filter->src_macaddr, ð_spec->src,6 ); en |= use_ntuple ?
drivers/net/bnxt/bnxt_hwrm.c +1 -1
@@ -2586,7 +2586,7 @@ static void add_random_mac_if_needed(struct bnxt *bp,if (memcmp (mac.addr_bytes,"\x00\x00\x00\x00\x00" ,6 ) ==0 ) { cfg_req->enables |=rte_cpu_to_le_32 (HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR ); -eth_random_addr (cfg_req->dflt_mac_addr); +rte_eth_random_addr (cfg_req->dflt_mac_addr); bp->pf.vf_info[vf].random_mac = true; }else {memcpy (cfg_req->dflt_mac_addr, mac.addr_bytes,ETHER_ADDR_LEN );
drivers/net/bonding/rte_eth_bond_8023ad.c +10 -10
@@ -322,7 +322,7 @@ rx_machine(struct bond_dev_private *internals, uint16_t slave_id, agg = &bond_mode_8023ad_ports[port->aggregator_port_id];bool match = port->actor.system_priority == lacp->partner.port_params.system_priority && -is_same_ether_addr (&agg->actor.system, +rte_is_same_ether_addr (&agg->actor.system, &lacp->partner.port_params.system) && port->actor.port_priority == lacp->partner.port_params.port_priority &&
@@ -575,7 +575,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id) hdr = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *);/* Source and destination MAC */ -ether_addr_copy (&lacp_mac_addr, &hdr->eth_hdr.d_addr); +rte_ether_addr_copy (&lacp_mac_addr, &hdr->eth_hdr.d_addr);rte_eth_macaddr_get (slave_id, &hdr->eth_hdr.s_addr); hdr->eth_hdr.ether_type =rte_cpu_to_be_16 (ETHER_TYPE_SLOW );
@@ -592,7 +592,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id)memcpy (&hdr->lacpdu.actor.port_params, &port->actor,sizeof (port->actor)); agg = &bond_mode_8023ad_ports[port->aggregator_port_id]; -ether_addr_copy (&agg->actor.system, &hdr->lacpdu.actor.port_params.system); +rte_ether_addr_copy (&agg->actor.system, &hdr->lacpdu.actor.port_params.system); lacpdu->actor.state = port->actor_state;/* PARTNER */
@@ -694,9 +694,9 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id)* ID (MAC address). */ if ((agg->actor.key == port->actor.key && agg->partner.system_priority == port->partner.system_priority && -is_same_ether_addr (&agg->partner.system, &port->partner.system) ==1 +rte_is_same_ether_addr (&agg->partner.system, &port->partner.system) ==1 && (agg->partner.key == port->partner.key)) && -is_zero_ether_addr (&port->partner.system) !=1 && +rte_is_zero_ether_addr (&port->partner.system) !=1 && (agg->actor.key &rte_cpu_to_be_16 (BOND_LINK_FULL_DUPLEX_KEY )) !=0 ) {
@@ -791,7 +791,7 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id,RTE_ASSERT (lacp->lacpdu.subtype ==SLOW_SUBTYPE_LACP ); partner = &lacp->lacpdu.partner; -if (is_same_ether_addr (&partner->port_params.system, +if (rte_is_same_ether_addr (&partner->port_params.system, &internals->mode4.mac_addr)) {/* This LACP frame is sending to the bonding port * so pass it to rx_machine.
@@ -842,8 +842,8 @@ bond_mode_8023ad_periodic_cb(void *arg)SM_FLAG_SET (port,NTT ); } -if (!is_same_ether_addr (&port->actor.system, &slave_addr)) { -ether_addr_copy (&slave_addr, &port->actor.system); +if (!rte_is_same_ether_addr (&port->actor.system, &slave_addr)) { +rte_ether_addr_copy (&slave_addr, &port->actor.system);if (port->aggregator_port_id == slave_id)SM_FLAG_SET (port,NTT ); }
@@ -1055,10 +1055,10 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) slave = &bond_mode_8023ad_ports[slave_id];rte_eth_macaddr_get (slave_id, &slave_addr); -if (is_same_ether_addr (&slave_addr, &slave->actor.system)) +if (rte_is_same_ether_addr (&slave_addr, &slave->actor.system))continue ; -ether_addr_copy (&slave_addr, &slave->actor.system); +rte_ether_addr_copy (&slave_addr, &slave->actor.system);/* Do nothing if this port is not an aggregator. In other case * Set NTT flag on every port that use this aggregator. */ if (slave->aggregator_port_id != slave_id)
drivers/net/bonding/rte_eth_bond_alb.c +13 -13
@@ -101,17 +101,17 @@ void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset,if (client_info->in_use ==0 || client_info->app_ip != arp->arp_data.arp_tip || client_info->cli_ip != arp->arp_data.arp_sip || - !is_same_ether_addr (&client_info->cli_mac, &arp->arp_data.arp_sha) || + !rte_is_same_ether_addr (&client_info->cli_mac, &arp->arp_data.arp_sha) || client_info->vlan_count != offset /sizeof (struct rte_vlan_hdr ) ||memcmp (client_info->vlan, eth_h +1 , offset) !=0 ) { client_info->in_use =1 ; client_info->app_ip = arp->arp_data.arp_tip; client_info->cli_ip = arp->arp_data.arp_sip; -ether_addr_copy (&arp->arp_data.arp_sha, &client_info->cli_mac); +rte_ether_addr_copy (&arp->arp_data.arp_sha, &client_info->cli_mac); client_info->slave_idx =calculate_slave (internals);rte_eth_macaddr_get (client_info->slave_idx, &client_info->app_mac); -ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_tha); +rte_ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_tha);memcpy (client_info->vlan, eth_h +1 , offset); client_info->vlan_count = offset /sizeof (struct rte_vlan_hdr ); }
@@ -139,7 +139,7 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset,* current primary port. */ rte_eth_macaddr_get (internals->port_id, &bonding_mac); -if (!is_same_ether_addr (&bonding_mac, &arp->arp_data.arp_sha)) { +if (!rte_is_same_ether_addr (&bonding_mac, &arp->arp_data.arp_sha)) {rte_eth_macaddr_get (internals->current_primary_port, &arp->arp_data.arp_sha);return internals->current_primary_port;
@@ -155,13 +155,13 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset,if (client_info->app_ip == arp->arp_data.arp_sip && client_info->cli_ip == arp->arp_data.arp_tip) {/* Entry is already assigned to this client */ -if (!is_broadcast_ether_addr (&arp->arp_data.arp_tha)) { -ether_addr_copy (&arp->arp_data.arp_tha, +if (!rte_is_broadcast_ether_addr (&arp->arp_data.arp_tha)) { +rte_ether_addr_copy (&arp->arp_data.arp_tha, &client_info->cli_mac); }rte_eth_macaddr_get (client_info->slave_idx, &client_info->app_mac); -ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_sha); +rte_ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_sha);memcpy (client_info->vlan, eth_h +1 , offset); client_info->vlan_count = offset /sizeof (struct rte_vlan_hdr );rte_spinlock_unlock (&internals->mode6.lock);
@@ -173,11 +173,11 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, client_info->in_use =1 ; client_info->ntt =0 ; client_info->app_ip = arp->arp_data.arp_sip; -ether_addr_copy (&arp->arp_data.arp_tha, &client_info->cli_mac); +rte_ether_addr_copy (&arp->arp_data.arp_tha, &client_info->cli_mac); client_info->cli_ip = arp->arp_data.arp_tip; client_info->slave_idx =calculate_slave (internals);rte_eth_macaddr_get (client_info->slave_idx, &client_info->app_mac); -ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_sha); +rte_ether_addr_copy (&client_info->app_mac, &arp->arp_data.arp_sha);memcpy (client_info->vlan, eth_h +1 , offset); client_info->vlan_count = offset /sizeof (struct rte_vlan_hdr );rte_spinlock_unlock (&internals->mode6.lock);
@@ -202,8 +202,8 @@ bond_mode_alb_arp_upd(struct client_data *client_info,rte_spinlock_lock (&internals->mode6.lock); eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); -ether_addr_copy (&client_info->app_mac, ð_h->s_addr); -ether_addr_copy (&client_info->cli_mac, ð_h->d_addr); +rte_ether_addr_copy (&client_info->app_mac, ð_h->s_addr); +rte_ether_addr_copy (&client_info->cli_mac, ð_h->d_addr);if (client_info->vlan_count >0 ) eth_h->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_VLAN );else
@@ -215,9 +215,9 @@ bond_mode_alb_arp_upd(struct client_data *client_info,memcpy (eth_h +1 , client_info->vlan, client_info->vlan_count *sizeof (struct rte_vlan_hdr )); -ether_addr_copy (&client_info->app_mac, &arp_h->arp_data.arp_sha); +rte_ether_addr_copy (&client_info->app_mac, &arp_h->arp_data.arp_sha); arp_h->arp_data.arp_sip = client_info->app_ip; -ether_addr_copy (&client_info->cli_mac, &arp_h->arp_data.arp_tha); +rte_ether_addr_copy (&client_info->cli_mac, &arp_h->arp_data.arp_tha); arp_h->arp_data.arp_tip = client_info->cli_ip; arp_h->arp_hardware =rte_cpu_to_be_16 (RTE_ARP_HRD_ETHER );
drivers/net/bonding/rte_eth_bond_pmd.c +8 -8
@@ -453,8 +453,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,if (unlikely (is_lacp_packets (hdr->ether_type, subtype, bufs[j]) || !collecting || (!promisc && - !is_multicast_ether_addr (&hdr->d_addr) && - !is_same_ether_addr (bond_mac, + !rte_is_multicast_ether_addr (&hdr->d_addr) && + !rte_is_same_ether_addr (bond_mac, &hdr->d_addr)))) {if (hdr->ether_type == ether_type_slow_be) {
@@ -1014,7 +1014,7 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) sizeof(internals->tlb_slaves_order[0]) * num_of_slaves); -ether_addr_copy (primary_port->data->mac_addrs, &primary_slave_addr); +rte_ether_addr_copy (primary_port->data->mac_addrs, &primary_slave_addr);if (nb_pkts >3 ) {for (i =0 ; i <3 ; i++)
@@ -1028,8 +1028,8 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)rte_prefetch0 (rte_pktmbuf_mtod(bufs [j+3 ],void *)); ether_hdr = rte_pktmbuf_mtod(bufs[j], struct rte_ether_hdr *); -if (is_same_ether_addr (ðer_hdr->s_addr, &primary_slave_addr)) -ether_addr_copy (&active_slave_addr, ðer_hdr->s_addr); +if (rte_is_same_ether_addr (ðer_hdr->s_addr, &primary_slave_addr)) +rte_ether_addr_copy (&active_slave_addr, ðer_hdr->s_addr);#if defined(RTE_LIBRTE_BOND_DEBUG_ALB ) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1 )mode6_debug ("TX IPv4:" , ether_hdr, slaves[i], &burstnumberTX);#endif
@@ -1510,7 +1510,7 @@ mac_address_get(struct rte_eth_dev *eth_dev, struct rte_ether_addr *dst_mac_addr mac_addr = eth_dev->data->mac_addrs; -ether_addr_copy (mac_addr, dst_mac_addr); +rte_ether_addr_copy (mac_addr, dst_mac_addr);return 0 ; }
@@ -1552,7 +1552,7 @@ slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev,for (i =1 ; i <BOND_MAX_MAC_ADDRS ; i++) { mac_addr = &bonded_eth_dev->data->mac_addrs[i]; -if (is_same_ether_addr (mac_addr, &null_mac_addr)) +if (rte_is_same_ether_addr (mac_addr, &null_mac_addr))break ; ret =rte_eth_dev_mac_addr_add (slave_port_id, mac_addr,0 );
@@ -1581,7 +1581,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, rc =0 ;for (i =1 ; i <BOND_MAX_MAC_ADDRS ; i++) { mac_addr = &bonded_eth_dev->data->mac_addrs[i]; -if (is_same_ether_addr (mac_addr, &null_mac_addr)) +if (rte_is_same_ether_addr (mac_addr, &null_mac_addr))break ; ret =rte_eth_dev_mac_addr_remove (slave_port_id, mac_addr);
drivers/net/cxgbe/base/adapter.h +1 -1
@@ -671,7 +671,7 @@ static inline void t4_os_set_hw_addr(struct adapter *adapter, int port_idx, {struct port_info *pi =adap2pinfo (adapter, port_idx); -ether_addr_copy ((struct rte_ether_addr *)hw_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)hw_addr, &pi->eth_dev->data->mac_addrs[0 ]); }
drivers/net/cxgbe/cxgbe_flow.c +2 -2
@@ -115,12 +115,12 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item, mask = umask ? umask : (const struct rte_flow_item_eth *)dmask;/* we don't support SRC_MAC filtering*/ -if (!is_zero_ether_addr (&mask->src)) +if (!rte_is_zero_ether_addr (&mask->src))return rte_flow_error_set (e,ENOTSUP ,RTE_FLOW_ERROR_TYPE_ITEM , item,"src mac filtering not supported" ); -if (!is_zero_ether_addr (&mask->dst)) { +if (!rte_is_zero_ether_addr (&mask->dst)) {const u8 *addr = (const u8 *)&spec->dst.addr_bytes[0 ];const u8 *m = (const u8 *)&mask->dst.addr_bytes[0 ];struct rte_flow *flow = (struct rte_flow *)fs->private;
drivers/net/dpaa/dpaa_ethdev.c +1 -1
@@ -1374,7 +1374,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) }/* copy the primary mac address */ -ether_addr_copy (&fman_intf->mac_addr, ð_dev->data->mac_addrs[0 ]); +rte_ether_addr_copy (&fman_intf->mac_addr, ð_dev->data->mac_addrs[0 ]); RTE_LOG(INFO, PMD, "net: dpaa: %s: %02x:%02x:%02x:%02x:%02x:%02x\n", dpaa_device->name,
drivers/net/dpaa2/dpaa2_ethdev.c +4 -4
@@ -2021,9 +2021,9 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv,* If empty_mac(phy), return prime. * if both are empty, create random MAC, set as prime and return */ -if (!is_zero_ether_addr (&phy_mac)) { +if (!rte_is_zero_ether_addr (&phy_mac)) {/* If the addresses are not same, overwrite prime */ -if (!is_same_ether_addr (&phy_mac, &prime_mac)) { +if (!rte_is_same_ether_addr (&phy_mac, &prime_mac)) { ret =dpni_set_primary_mac_addr (dpni_dev,CMD_PRI_LOW , priv->token, phy_mac.addr_bytes);
@@ -2034,9 +2034,9 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, }memcpy (&prime_mac, &phy_mac,sizeof (struct rte_ether_addr )); } - }else if (is_zero_ether_addr (&prime_mac)) { + }else if (rte_is_zero_ether_addr (&prime_mac)) {/* In case phys and prime, both are zero, create random MAC */ -eth_random_addr (prime_mac.addr_bytes); +rte_eth_random_addr (prime_mac.addr_bytes); ret =dpni_set_primary_mac_addr (dpni_dev,CMD_PRI_LOW , priv->token, prime_mac.addr_bytes);
drivers/net/e1000/em_ethdev.c +1 -1
@@ -293,7 +293,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev) }/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *) hw->mac.addr, +rte_ether_addr_copy ((struct rte_ether_addr *) hw->mac.addr, eth_dev->data->mac_addrs);/* initialize the vfta */
drivers/net/e1000/igb_ethdev.c +4 -4
@@ -840,7 +840,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev) }/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0 ]); +rte_ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0 ]);/* initialize the vfta */ memset (shadow_vfta,0 ,sizeof (*shadow_vfta));
@@ -1037,8 +1037,8 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) }/* Generate a random MAC address, if none was assigned by PF. */ -if (is_zero_ether_addr (perm_addr)) { -eth_random_addr (perm_addr->addr_bytes); +if (rte_is_zero_ether_addr (perm_addr)) { +rte_eth_random_addr (perm_addr->addr_bytes);PMD_INIT_LOG (INFO ,"\tVF MAC address not assigned by Host PF" ); PMD_INIT_LOG(INFO, "\tAssign randomly generated MAC address " "%02x:%02x:%02x:%02x:%02x:%02x",
@@ -1057,7 +1057,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)return diag; }/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *) hw->mac.perm_addr, +rte_ether_addr_copy ((struct rte_ether_addr *) hw->mac.perm_addr, ð_dev->data->mac_addrs[0 ]); PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x "
drivers/net/e1000/igb_flow.c +4 -4
@@ -548,9 +548,9 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr,* Mask bits of destination MAC address must be full * of 1 or full of 0. */ -if (!is_zero_ether_addr (ð_mask->src) || - (!is_zero_ether_addr (ð_mask->dst) && - !is_broadcast_ether_addr (ð_mask->dst))) { +if (!rte_is_zero_ether_addr (ð_mask->src) || + (!rte_is_zero_ether_addr (ð_mask->dst) && + !rte_is_broadcast_ether_addr (ð_mask->dst))) {rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ITEM , item,"Invalid ether address mask" );
@@ -567,7 +567,7 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr,/* If mask bits of destination MAC address * are full of 1, set RTE_ETHTYPE_FLAGS_MAC. */ -if (is_broadcast_ether_addr (ð_mask->dst)) { +if (rte_is_broadcast_ether_addr (ð_mask->dst)) { filter->mac_addr = eth_spec->dst; filter->flags |=RTE_ETHTYPE_FLAGS_MAC ; }else {
drivers/net/e1000/igb_pf.c +3 -3
@@ -43,7 +43,7 @@ int igb_vf_perm_addr_gen(struct rte_eth_dev *dev, uint16_t vf_num)uint16_t vfn;for (vfn =0 ; vfn < vf_num; vfn++) { -eth_random_addr (vf_mac_addr); +rte_eth_random_addr (vf_mac_addr);/* keep the random address as default */ memcpy (vfinfo[vfn].vf_mac_addresses, vf_mac_addr,ETHER_ADDR_LEN );
@@ -306,8 +306,8 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)uint8_t *new_mac = (uint8_t *)(&msgbuf[1 ]);int rah; -if (is_unicast_ether_addr ((struct rte_ether_addr *)new_mac)) { -if (!is_zero_ether_addr ((struct rte_ether_addr *)new_mac)) +if (rte_is_unicast_ether_addr ((struct rte_ether_addr *)new_mac)) { +if (!rte_is_zero_ether_addr ((struct rte_ether_addr *)new_mac))rte_memcpy (vfinfo[vf].vf_mac_addresses, new_mac,sizeof (vfinfo[vf].vf_mac_addresses)); hw->mac.ops.rar_set (hw, new_mac, rar_entry);
drivers/net/ena/ena_ethdev.c +1 -1
@@ -1814,7 +1814,7 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)/* Copy MAC address and point DPDK to it */ eth_dev->data->mac_addrs = (struct rte_ether_addr *)adapter->mac_addr; -ether_addr_copy ((struct rte_ether_addr *)get_feat_ctx.dev_attr.mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)get_feat_ctx.dev_attr.mac_addr, (struct rte_ether_addr *)adapter->mac_addr);/*
drivers/net/enetc/enetc_ethdev.c +1 -1
@@ -98,7 +98,7 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) }/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, +rte_ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0 ]); ENETC_PMD_DEBUG("port_id %d vendorID=0x%x deviceID=0x%x",
drivers/net/enic/enic_ethdev.c +6 -6
@@ -648,7 +648,7 @@ static void debug_log_add_del_addr(struct rte_ether_addr *addr, bool add) {char mac_str[ETHER_ADDR_FMT_SIZE ]; -ether_format_addr (mac_str,ETHER_ADDR_FMT_SIZE , addr); +rte_ether_format_addr (mac_str,ETHER_ADDR_FMT_SIZE , addr);PMD_INIT_LOG (DEBUG ," %s address %s\n" , add ?"add" :"remove" , mac_str); }
@@ -668,9 +668,9 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev,/* Validate the given addresses first */ for (i =0 ; i < nb_mc_addr && mc_addr_set !=NULL ; i++) { addr = &mc_addr_set[i]; -if (!is_multicast_ether_addr (addr) || -is_broadcast_ether_addr (addr)) { -ether_format_addr (mac_str,ETHER_ADDR_FMT_SIZE , addr); +if (!rte_is_multicast_ether_addr (addr) || +rte_is_broadcast_ether_addr (addr)) { +rte_ether_format_addr (mac_str,ETHER_ADDR_FMT_SIZE , addr);PMD_INIT_LOG (ERR ," invalid multicast address %s\n" , mac_str);return -EINVAL ;
@@ -704,7 +704,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev,for (i =0 ; i < enic->mc_count; i++) { addr = &enic->mc_addrs[i];for (j =0 ; j < nb_mc_addr; j++) { -if (is_same_ether_addr (addr, &mc_addr_set[j])) +if (rte_is_same_ether_addr (addr, &mc_addr_set[j]))break ; }if (j < nb_mc_addr)
@@ -718,7 +718,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev,for (i =0 ; i < nb_mc_addr; i++) { addr = &mc_addr_set[i];for (j =0 ; j < enic->mc_count; j++) { -if (is_same_ether_addr (addr, &enic->mc_addrs[j])) +if (rte_is_same_ether_addr (addr, &enic->mc_addrs[j]))break ; }if (j < enic->mc_count)
drivers/net/enic/enic_main.c +1 -1
@@ -1673,7 +1673,7 @@ static int enic_dev_init(struct enic *enic)dev_err (enic,"mac addr storage alloc failed, aborting.\n" );return -1 ; } -ether_addr_copy ((struct rte_ether_addr *) enic->mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *) enic->mac_addr, eth_dev->data->mac_addrs);vnic_dev_set_reset_flag (enic->vdev,0 );
drivers/net/failsafe/failsafe.c +2 -2
@@ -253,7 +253,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)*/ FOREACH_SUBDEV(sdev, i, dev)if (sdev->state >=DEV_PROBED ) { -ether_addr_copy (Ð (sdev)->data->mac_addrs[0 ], +rte_ether_addr_copy (Ð (sdev)->data->mac_addrs[0 ], mac);break ; }
@@ -265,7 +265,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)* probed slaves. */ if (i == priv->subs_tail) -eth_random_addr (&mac->addr_bytes[0 ]); +rte_eth_random_addr (&mac->addr_bytes[0 ]); } INFO("MAC address is %02x:%02x:%02x:%02x:%02x:%02x", mac->addr_bytes[0], mac->addr_bytes[1],
drivers/net/failsafe/failsafe_ether.c +1 -1
@@ -174,7 +174,7 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev,if (ret) {char ea_fmt[ETHER_ADDR_FMT_SIZE ]; -ether_format_addr (ea_fmt,ETHER_ADDR_FMT_SIZE , ea); +rte_ether_format_addr (ea_fmt,ETHER_ADDR_FMT_SIZE , ea);ERROR ("Adding MAC address %s failed" , ea_fmt);return ret; }
drivers/net/fm10k/fm10k_ethdev.c +6 -6
@@ -614,7 +614,7 @@ fm10k_dev_mq_rx_configure(struct rte_eth_dev *dev)/* reset MAC/VLAN as it's based on VMDQ or PF main VSI */ memset (dev->data->mac_addrs,0 ,ETHER_ADDR_LEN *FM10K_MAX_MACADDR_NUM ); -ether_addr_copy ((const struct rte_ether_addr *)hw->mac.addr, +rte_ether_addr_copy ((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0 ]);memset (macvlan,0 ,sizeof (*macvlan)); macvlan->nb_queue_pools = nb_queue_pools;
@@ -1525,7 +1525,7 @@ fm10k_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on)for (mac_index =0 ; (mac_index <FM10K_MAX_MACADDR_NUM ) && (result ==FM10K_SUCCESS ); mac_index++) { -if (is_zero_ether_addr (&data->mac_addrs[mac_index])) +if (rte_is_zero_ether_addr (&data->mac_addrs[mac_index]))continue ;if (mac_num > macvlan->mac_num -1 ) { PMD_INIT_LOG(ERR, "MAC address number "
@@ -3080,16 +3080,16 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) diag =fm10k_read_mac_addr (hw); -ether_addr_copy ((const struct rte_ether_addr *)hw->mac.addr, +rte_ether_addr_copy ((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0 ]);if (diag !=FM10K_SUCCESS || - !is_valid_assigned_ether_addr (dev->data->mac_addrs)) { + !rte_is_valid_assigned_ether_addr (dev->data->mac_addrs)) {/* Generate a random addr */ -eth_random_addr (hw->mac.addr); +rte_eth_random_addr (hw->mac.addr);memcpy (hw->mac.perm_addr, hw->mac.addr,ETH_ALEN ); -ether_addr_copy ((const struct rte_ether_addr *)hw->mac.addr, +rte_ether_addr_copy ((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0 ]); }
drivers/net/i40e/i40e_ethdev.c +19 -19
@@ -1467,7 +1467,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) goto err_get_mac_addr; }/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *) hw->mac.addr, +rte_ether_addr_copy ((struct rte_ether_addr *) hw->mac.addr, (struct rte_ether_addr *) hw->mac.perm_addr);/* Disable flow control */
@@ -1519,7 +1519,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) "Failed to allocated memory for storing mac address"); goto err_mac_alloc; } -ether_addr_copy ((struct rte_ether_addr *)hw->mac.perm_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)hw->mac.perm_addr, &dev->data->mac_addrs[0 ]);/* Init dcb to sw mode by default */
@@ -4112,7 +4112,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, new_mac = &filter->mac_addr; -if (is_zero_ether_addr (new_mac)) { +if (rte_is_zero_ether_addr (new_mac)) {PMD_DRV_LOG (ERR ,"Invalid ethernet address." );return -EINVAL ; }
@@ -4125,7 +4125,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, } vf = &pf->vfs[vf_id]; -if (add &&is_same_ether_addr (new_mac, &(pf->dev_addr))) { +if (add &&rte_is_same_ether_addr (new_mac, &(pf->dev_addr))) {PMD_DRV_LOG (INFO ,"Ignore adding permanent MAC address." );return -EINVAL ; }
@@ -4143,7 +4143,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf,PMD_DRV_LOG (ERR ,"Failed to add MAC filter." );return -1 ; } -ether_addr_copy (new_mac, &pf->dev_addr); +rte_ether_addr_copy (new_mac, &pf->dev_addr); }else {rte_memcpy (hw->mac.addr, hw->mac.perm_addr,ETHER_ADDR_LEN );
@@ -4154,7 +4154,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, }/* Clear device address as it has been removed */ -if (is_same_ether_addr (&(pf->dev_addr), new_mac)) +if (rte_is_same_ether_addr (&(pf->dev_addr), new_mac))memset (&pf->dev_addr,0 ,sizeof (struct rte_ether_addr )); }
@@ -6902,7 +6902,7 @@ i40e_find_mac_filter(struct i40e_vsi *vsi,struct i40e_mac_filter *f; TAILQ_FOREACH(f, &vsi->mac_list, next) { -if (is_same_ether_addr (macaddr, &f->mac_info.mac_addr)) +if (rte_is_same_ether_addr (macaddr, &f->mac_info.mac_addr))return f; }
@@ -7575,9 +7575,9 @@ i40e_tunnel_filter_convert(struct i40e_aqc_cloud_filters_element_bb *cld_filter, struct i40e_tunnel_filter *tunnel_filter) { - ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.outer_mac, + rte_ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.outer_mac, (struct rte_ether_addr *)&tunnel_filter->input.outer_mac); -ether_addr_copy ((struct rte_ether_addr *)&cld_filter->element.inner_mac, +rte_ether_addr_copy ((struct rte_ether_addr *)&cld_filter->element.inner_mac, (struct rte_ether_addr *)&tunnel_filter->input.inner_mac); tunnel_filter->input.inner_vlan = cld_filter->element.inner_vlan; if ((rte_le_to_cpu_16(cld_filter->element.flags) &
@@ -7686,9 +7686,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; -ether_addr_copy (&tunnel_filter->outer_mac, +rte_ether_addr_copy (&tunnel_filter->outer_mac, (struct rte_ether_addr *)&pfilter->element.outer_mac); -ether_addr_copy (&tunnel_filter->inner_mac, +rte_ether_addr_copy (&tunnel_filter->inner_mac, (struct rte_ether_addr *)&pfilter->element.inner_mac); pfilter->element.inner_vlan =
@@ -8133,9 +8133,9 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; -ether_addr_copy (&tunnel_filter->outer_mac, +rte_ether_addr_copy (&tunnel_filter->outer_mac, (struct rte_ether_addr *)&pfilter->element.outer_mac); -ether_addr_copy (&tunnel_filter->inner_mac, +rte_ether_addr_copy (&tunnel_filter->inner_mac, (struct rte_ether_addr *)&pfilter->element.inner_mac); pfilter->element.inner_vlan =
@@ -8616,13 +8616,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, }if ((filter->filter_type Ð_TUNNEL_FILTER_OMAC ) && - (is_zero_ether_addr (&filter->outer_mac))) { + (rte_is_zero_ether_addr (&filter->outer_mac))) {PMD_DRV_LOG (ERR ,"Cannot add NULL outer MAC address" );return -EINVAL ; }if ((filter->filter_type Ð_TUNNEL_FILTER_IMAC ) && - (is_zero_ether_addr (&filter->inner_mac))) { + (rte_is_zero_ether_addr (&filter->inner_mac))) {PMD_DRV_LOG (ERR ,"Cannot add NULL inner MAC address" );return -EINVAL ; }
@@ -11948,13 +11948,13 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev,struct i40e_mac_filter *f;int ret; -if (!is_valid_assigned_ether_addr (mac_addr)) { +if (!rte_is_valid_assigned_ether_addr (mac_addr)) {PMD_DRV_LOG (ERR ,"Tried to set invalid MAC address." );return -EINVAL ; } TAILQ_FOREACH(f, &vsi->mac_list, next) { -if (is_same_ether_addr (&pf->dev_addr, &f->mac_info.mac_addr)) +if (rte_is_same_ether_addr (&pf->dev_addr, &f->mac_info.mac_addr))break ; }
@@ -12072,9 +12072,9 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf) vsi = vf->vsi; }memset (&cld_filter,0 ,sizeof (cld_filter)); -ether_addr_copy ((struct rte_ether_addr *)&f->input.outer_mac, +rte_ether_addr_copy ((struct rte_ether_addr *)&f->input.outer_mac, (struct rte_ether_addr *)&cld_filter.element.outer_mac); -ether_addr_copy ((struct rte_ether_addr *)&f->input.inner_mac, +rte_ether_addr_copy ((struct rte_ether_addr *)&f->input.inner_mac, (struct rte_ether_addr *)&cld_filter.element.inner_mac); cld_filter.element.inner_vlan = f->input.inner_vlan; cld_filter.element.flags = f->input.flags;
drivers/net/i40e/i40e_ethdev_vf.c +8 -8
@@ -787,7 +787,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev,int err;struct vf_cmd_info args; -if (is_zero_ether_addr (addr)) { +if (rte_is_zero_ether_addr (addr)) { PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x", addr->addr_bytes[0], addr->addr_bytes[1], addr->addr_bytes[2], addr->addr_bytes[3],
@@ -1273,10 +1273,10 @@ i40evf_init_vf(struct rte_eth_dev *dev) vf->vsi.adapter =I40E_DEV_PRIVATE_TO_ADAPTER (dev->data->dev_private);/* Store the MAC address configured by host, or generate random one */ -if (is_valid_assigned_ether_addr ((struct rte_ether_addr *)hw->mac.addr)) +if (rte_is_valid_assigned_ether_addr ((struct rte_ether_addr *)hw->mac.addr)) vf->flags |=I40E_FLAG_VF_MAC_BY_PF ;else -eth_random_addr (hw->mac.addr);/* Generate a random one */ +rte_eth_random_addr (hw->mac.addr);/* Generate a random one */ I40E_WRITE_REG(hw, I40E_VFINT_DYN_CTL01, (I40E_ITR_INDEX_DEFAULT <<
@@ -1511,7 +1511,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX);return -ENOMEM ; } -ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, +rte_ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0 ]);return 0 ;
@@ -1937,7 +1937,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) j =0 ; len =sizeof (struct virtchnl_ether_addr_list );for (i = begin; i <I40E_NUM_MACADDR_MAX ; i++, next_begin++) { -if (is_zero_ether_addr (&dev->data->mac_addrs[i])) +if (rte_is_zero_ether_addr (&dev->data->mac_addrs[i]))continue ; len +=sizeof (struct virtchnl_ether_addr );if (len >=I40E_AQ_BUF_SZ ) {
@@ -1954,7 +1954,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add)for (i = begin; i < next_begin; i++) { addr = &dev->data->mac_addrs[i]; -if (is_zero_ether_addr (addr)) +if (rte_is_zero_ether_addr (addr))continue ;rte_memcpy (list->list[j].addr, addr->addr_bytes,sizeof (addr->addr_bytes));
@@ -2707,7 +2707,7 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev,struct i40e_vf *vf =I40EVF_DEV_PRIVATE_TO_VF (dev->data->dev_private);struct i40e_hw *hw =I40E_DEV_PRIVATE_TO_HW (dev->data->dev_private); -if (!is_valid_assigned_ether_addr (mac_addr)) { +if (!rte_is_valid_assigned_ether_addr (mac_addr)) {PMD_DRV_LOG (ERR ,"Tried to set invalid MAC address." );return -EINVAL ; }
@@ -2720,7 +2720,7 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev,if (i40evf_add_mac_addr (dev, mac_addr,0 ,0 ) !=0 )return -EIO ; -ether_addr_copy (mac_addr, (struct rte_ether_addr *)hw->mac.addr); +rte_ether_addr_copy (mac_addr, (struct rte_ether_addr *)hw->mac.addr);return 0 ; }
drivers/net/i40e/i40e_flow.c +12 -12
@@ -2007,9 +2007,9 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,* Mask bits of destination MAC address must be full * of 1 or full of 0. */ -if (!is_zero_ether_addr (ð_mask->src) || - (!is_zero_ether_addr (ð_mask->dst) && - !is_broadcast_ether_addr (ð_mask->dst))) { +if (!rte_is_zero_ether_addr (ð_mask->src) || + (!rte_is_zero_ether_addr (ð_mask->dst) && + !rte_is_broadcast_ether_addr (ð_mask->dst))) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item,
@@ -2028,7 +2028,7 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev,/* If mask bits of destination MAC address * are full of 1, set RTE_ETHTYPE_FLAGS_MAC. */ -if (is_broadcast_ether_addr (ð_mask->dst)) { +if (rte_is_broadcast_ether_addr (ð_mask->dst)) { filter->mac_addr = eth_spec->dst; filter->flags |=RTE_ETHTYPE_FLAGS_MAC ; }else {
@@ -2485,8 +2485,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, eth_mask = item->mask;if (eth_spec && eth_mask) { -if (!is_zero_ether_addr (ð_mask->src) || - !is_zero_ether_addr (ð_mask->dst)) { +if (!rte_is_zero_ether_addr (ð_mask->src) || + !rte_is_zero_ether_addr (ð_mask->dst)) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item,
@@ -3326,8 +3326,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev,/* DST address of inner MAC shouldn't be masked. * SRC address of Inner MAC should be masked. */ -if (!is_broadcast_ether_addr (ð_mask->dst) || - !is_zero_ether_addr (ð_mask->src) || +if (!rte_is_broadcast_ether_addr (ð_mask->dst) || + !rte_is_zero_ether_addr (ð_mask->src) || eth_mask->type) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
@@ -3556,8 +3556,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev,/* DST address of inner MAC shouldn't be masked. * SRC address of Inner MAC should be masked. */ -if (!is_broadcast_ether_addr (ð_mask->dst) || - !is_zero_ether_addr (ð_mask->src) || +if (!rte_is_broadcast_ether_addr (ð_mask->dst) || + !rte_is_zero_ether_addr (ð_mask->src) || eth_mask->type) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
@@ -4803,9 +4803,9 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,int ret =0 ;memset (&cld_filter,0 ,sizeof (cld_filter)); -ether_addr_copy ((struct rte_ether_addr *)&filter->input.outer_mac, +rte_ether_addr_copy ((struct rte_ether_addr *)&filter->input.outer_mac, (struct rte_ether_addr *)&cld_filter.element.outer_mac); -ether_addr_copy ((struct rte_ether_addr *)&filter->input.inner_mac, +rte_ether_addr_copy ((struct rte_ether_addr *)&filter->input.inner_mac, (struct rte_ether_addr *)&cld_filter.element.inner_mac); cld_filter.element.inner_vlan = filter->input.inner_vlan; cld_filter.element.flags = filter->input.flags;
drivers/net/i40e/i40e_pf.c +3 -3
@@ -348,7 +348,7 @@ i40e_pf_host_process_cmd_get_vf_resource(struct i40e_pf_vf *vf, uint8_t *msg, vf_res->vsi_res[0 ].vsi_type =VIRTCHNL_VSI_SRIOV ; vf_res->vsi_res[0 ].vsi_id = vf->vsi->vsi_id; vf_res->vsi_res[0 ].num_queue_pairs = vf->vsi->nb_qps; -ether_addr_copy (&vf->mac_addr, +rte_ether_addr_copy (&vf->mac_addr, (struct rte_ether_addr *)vf_res->vsi_res[0 ].default_mac_addr); send_msg:
@@ -845,7 +845,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf, mac = (struct rte_ether_addr *)(addr_list->list[i].addr);rte_memcpy (&filter.mac_addr, mac,ETHER_ADDR_LEN ); filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; -if (is_zero_ether_addr (mac) || +if (rte_is_zero_ether_addr (mac) ||i40e_vsi_add_mac (vf->vsi, &filter)) { ret =I40E_ERR_INVALID_MAC_ADDR ; goto send_msg;
@@ -887,7 +887,7 @@ i40e_pf_host_process_cmd_del_ether_address(struct i40e_pf_vf *vf,for (i =0 ; i < addr_list->num_elements; i++) { mac = (struct rte_ether_addr *)(addr_list->list[i].addr); -if (is_zero_ether_addr (mac) || +if (rte_is_zero_ether_addr (mac) ||i40e_vsi_delete_mac (vf->vsi, mac)) { ret =I40E_ERR_INVALID_MAC_ADDR ; goto send_msg;
drivers/net/i40e/rte_pmd_i40e.c +5 -5
@@ -560,7 +560,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,return -EINVAL ; } -ether_addr_copy (mac_addr, &vf->mac_addr); +rte_ether_addr_copy (mac_addr, &vf->mac_addr);/* Remove all existing mac */ TAILQ_FOREACH_SAFE (f, &vsi->mac_list, next, temp)
@@ -604,9 +604,9 @@ rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id,return -EINVAL ; } -if (is_same_ether_addr (mac_addr, &vf->mac_addr)) +if (rte_is_same_ether_addr (mac_addr, &vf->mac_addr))/* Reset the mac with NULL address */ -ether_addr_copy (&null_mac_addr, &vf->mac_addr); +rte_ether_addr_copy (&null_mac_addr, &vf->mac_addr);/* Remove the mac */ i40e_vsi_delete_mac (vsi, mac_addr);
@@ -2387,7 +2387,7 @@ rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id, } mac_filter.filter_type =RTE_MACVLAN_PERFECT_MATCH ; -ether_addr_copy (mac_addr, &mac_filter.mac_addr); +rte_ether_addr_copy (mac_addr, &mac_filter.mac_addr); ret =i40e_vsi_add_mac (vsi, &mac_filter);if (ret !=I40E_SUCCESS ) {PMD_DRV_LOG (ERR ,"Failed to add MAC filter." );
@@ -2514,7 +2514,7 @@ rte_pmd_i40e_query_vfid_by_mac(uint16_t port, const struct rte_ether_addr *vf_ma vf = &pf->vfs[vf_id]; mac = &vf->mac_addr; -if (is_same_ether_addr (mac, vf_mac)) +if (rte_is_same_ether_addr (mac, vf_mac))return vf_id; }
drivers/net/iavf/iavf_ethdev.c +7 -7
@@ -696,7 +696,7 @@ iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr,struct iavf_info *vf =IAVF_DEV_PRIVATE_TO_VF (adapter);int err; -if (is_zero_ether_addr (addr)) { +if (rte_is_zero_ether_addr (addr)) {PMD_DRV_LOG (ERR ,"Invalid Ethernet Address" );return -EINVAL ; }
@@ -941,11 +941,11 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, old_addr = (struct rte_ether_addr *)hw->mac.addr; perm_addr = (struct rte_ether_addr *)hw->mac.perm_addr; -if (is_same_ether_addr (mac_addr, old_addr)) +if (rte_is_same_ether_addr (mac_addr, old_addr))return 0 ;/* If the MAC address is configured by host, skip the setting */ -if (is_valid_assigned_ether_addr (perm_addr)) +if (rte_is_valid_assigned_ether_addr (perm_addr))return -EPERM ; ret =iavf_add_del_eth_addr (adapter, old_addr, FALSE);
@@ -973,7 +973,7 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev,if (ret)return -EIO ; -ether_addr_copy (mac_addr, (struct rte_ether_addr *)hw->mac.addr); +rte_ether_addr_copy (mac_addr, (struct rte_ether_addr *)hw->mac.addr);return 0 ; }
@@ -1244,9 +1244,9 @@ iavf_dev_init(struct rte_eth_dev *eth_dev)/* If the MAC address is not configured by host, * generate a random one. */ -if (!is_valid_assigned_ether_addr ((struct rte_ether_addr *)hw->mac.addr)) -eth_random_addr (hw->mac.addr); -ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, +if (!rte_is_valid_assigned_ether_addr ((struct rte_ether_addr *)hw->mac.addr)) +rte_eth_random_addr (hw->mac.addr); +rte_ether_addr_copy ((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0 ]);/* register callback func to eal lib */
drivers/net/iavf/iavf_vchnl.c +2 -2
@@ -647,7 +647,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) len =sizeof (struct virtchnl_ether_addr_list );for (i = begin; i <IAVF_NUM_MACADDR_MAX ; i++, next_begin++) { addr = &adapter->eth_dev->data->mac_addrs[i]; -if (is_zero_ether_addr (addr)) +if (rte_is_zero_ether_addr (addr))continue ; len +=sizeof (struct virtchnl_ether_addr );if (len >=IAVF_AQ_BUF_SZ ) {
@@ -664,7 +664,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add)for (i = begin; i < next_begin; i++) { addr = &adapter->eth_dev->data->mac_addrs[i]; -if (is_zero_ether_addr (addr)) +if (rte_is_zero_ether_addr (addr))continue ;rte_memcpy (list->list[j].addr, addr->addr_bytes,sizeof (addr->addr_bytes));
drivers/net/ice/ice_ethdev.c +6 -6
@@ -479,13 +479,13 @@ ice_init_mac_address(struct rte_eth_dev *dev) {struct ice_hw *hw =ICE_DEV_PRIVATE_TO_HW (dev->data->dev_private); -if (!is_unicast_ether_addr +if (!rte_is_unicast_ether_addr ((struct rte_ether_addr *)hw->port_info[0 ].mac.lan_addr)) {PMD_INIT_LOG (ERR ,"Invalid MAC address" );return -EINVAL ; } -ether_addr_copy ((struct rte_ether_addr *)hw->port_info[0 ].mac.lan_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)hw->port_info[0 ].mac.lan_addr, (struct rte_ether_addr *)hw->port_info[0 ].mac.perm_addr); dev->data->mac_addrs =rte_zmalloc (NULL ,sizeof (struct rte_ether_addr ),0 );
@@ -495,7 +495,7 @@ ice_init_mac_address(struct rte_eth_dev *dev)return -ENOMEM ; }/* store it to dev data */ -ether_addr_copy ((struct rte_ether_addr *)hw->port_info[0 ].mac.perm_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)hw->port_info[0 ].mac.perm_addr, &dev->data->mac_addrs[0 ]);return 0 ; }
@@ -507,7 +507,7 @@ ice_find_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *macaddr)struct ice_mac_filter *f; TAILQ_FOREACH(f, &vsi->mac_list, next) { -if (is_same_ether_addr (macaddr, &f->mac_info.mac_addr)) +if (rte_is_same_ether_addr (macaddr, &f->mac_info.mac_addr))return f; }
@@ -2243,13 +2243,13 @@ static int ice_macaddr_set(struct rte_eth_dev *dev,uint8_t flags =0 ;int ret; -if (!is_valid_assigned_ether_addr (mac_addr)) { +if (!rte_is_valid_assigned_ether_addr (mac_addr)) {PMD_DRV_LOG (ERR ,"Tried to set invalid MAC address." );return -EINVAL ; } TAILQ_FOREACH(f, &vsi->mac_list, next) { -if (is_same_ether_addr (&pf->dev_addr, &f->mac_info.mac_addr)) +if (rte_is_same_ether_addr (&pf->dev_addr, &f->mac_info.mac_addr))break ; }
drivers/net/ixgbe/ixgbe_ethdev.c +4 -4
@@ -1222,7 +1222,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused)return -ENOMEM ; }/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *) hw->mac.perm_addr, +rte_ether_addr_copy ((struct rte_ether_addr *) hw->mac.perm_addr, ð_dev->data->mac_addrs[0 ]);/* Allocate memory for storing hash filter MAC addresses */
@@ -1656,7 +1656,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) }/* Generate a random MAC address, if none was assigned by PF. */ -if (is_zero_ether_addr (perm_addr)) { +if (rte_is_zero_ether_addr (perm_addr)) {generate_random_mac_addr (perm_addr); diag =ixgbe_set_rar_vf (hw,1 , perm_addr->addr_bytes,0 ,1 );if (diag) {
@@ -1676,7 +1676,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) }/* Copy the permanent MAC address */ -ether_addr_copy (perm_addr, ð_dev->data->mac_addrs[0 ]); +rte_ether_addr_copy (perm_addr, ð_dev->data->mac_addrs[0 ]);/* reset the hardware with the new settings */ diag = hw->mac.ops.start_hw (hw);
@@ -6085,7 +6085,7 @@ ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index)if (i == index)continue ;/* Skip NULL MAC addresses */ -if (is_zero_ether_addr (mac_addr)) +if (rte_is_zero_ether_addr (mac_addr))continue ;/* Skip the permanent MAC address */ if (memcmp (perm_addr, mac_addr,sizeof (struct rte_ether_addr )) ==0 )
drivers/net/ixgbe/ixgbe_flow.c +4 -4
@@ -744,9 +744,9 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr,* Mask bits of destination MAC address must be full * of 1 or full of 0. */ -if (!is_zero_ether_addr (ð_mask->src) || - (!is_zero_ether_addr (ð_mask->dst) && - !is_broadcast_ether_addr (ð_mask->dst))) { +if (!rte_is_zero_ether_addr (ð_mask->src) || + (!rte_is_zero_ether_addr (ð_mask->dst) && + !rte_is_broadcast_ether_addr (ð_mask->dst))) {rte_flow_error_set (error,EINVAL ,RTE_FLOW_ERROR_TYPE_ITEM , item,"Invalid ether address mask" );
@@ -763,7 +763,7 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr,/* If mask bits of destination MAC address * are full of 1, set RTE_ETHTYPE_FLAGS_MAC. */ -if (is_broadcast_ether_addr (ð_mask->dst)) { +if (rte_is_broadcast_ether_addr (ð_mask->dst)) { filter->mac_addr = eth_spec->dst; filter->flags |=RTE_ETHTYPE_FLAGS_MAC ; }else {
drivers/net/ixgbe/ixgbe_pf.c +2 -2
@@ -46,7 +46,7 @@ int ixgbe_vf_perm_addr_gen(struct rte_eth_dev *dev, uint16_t vf_num)uint16_t vfn;for (vfn =0 ; vfn < vf_num; vfn++) { -eth_random_addr (vf_mac_addr); +rte_eth_random_addr (vf_mac_addr);/* keep the random address as default */ memcpy (vfinfo[vfn].vf_mac_addresses, vf_mac_addr,ETHER_ADDR_LEN );
@@ -463,7 +463,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)int rar_entry = hw->mac.num_rar_entries - (vf +1 );uint8_t *new_mac = (uint8_t *)(&msgbuf[1 ]); -if (is_valid_assigned_ether_addr ((struct rte_ether_addr *)new_mac)) { +if (rte_is_valid_assigned_ether_addr ((struct rte_ether_addr *)new_mac)) {rte_memcpy (vfinfo[vf].vf_mac_addresses, new_mac,6 );return hw->mac.ops.set_rar (hw, rar_entry, new_mac, vf,IXGBE_RAH_AV ); }
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -1
@@ -35,7 +35,7 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA (dev->data->dev_private)); rar_entry = hw->mac.num_rar_entries - (vf +1 ); -if (is_valid_assigned_ether_addr ((struct rte_ether_addr *)new_mac)) { +if (rte_is_valid_assigned_ether_addr ((struct rte_ether_addr *)new_mac)) {rte_memcpy (vfinfo[vf].vf_mac_addresses, new_mac,ETHER_ADDR_LEN ); return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf,
drivers/net/kni/rte_eth_kni.c +1 -1
@@ -363,7 +363,7 @@ eth_kni_create(struct rte_vdev_device *vdev, data->dev_link = pmd_link; data->mac_addrs = &internals->eth_addr; -eth_random_addr (internals->eth_addr.addr_bytes); +rte_eth_random_addr (internals->eth_addr.addr_bytes); eth_dev->dev_ops = ð_kni_ops;
drivers/net/liquidio/lio_ethdev.c +1 -1
@@ -1835,7 +1835,7 @@ lio_dev_configure(struct rte_eth_dev *eth_dev) 2 + i));/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *)mac, ð_dev->data->mac_addrs[0 ]); +rte_ether_addr_copy ((struct rte_ether_addr *)mac, ð_dev->data->mac_addrs[0 ]);/* enable firmware checksum support for tunnel packets */ lio_enable_hw_tunnel_rx_checksum (eth_dev);
drivers/net/mlx4/mlx4_flow.c +1 -1
@@ -1399,7 +1399,7 @@ mlx4_flow_internal(struct mlx4_priv *priv, struct rte_flow_error *error) mac = &priv->mac[i]; else mac = ð_mask.dst; -if (is_zero_ether_addr (mac)) +if (rte_is_zero_ether_addr (mac))continue ;/* Check if MAC flow rule is already present. */ for (flow = LIST_FIRST(&priv->flows);
drivers/net/mlx5/mlx5_flow_tcf.c +2 -2
@@ -3334,7 +3334,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, " parameter is ignored");break ; } -if (!is_zero_ether_addr (&mask.eth->dst)) { +if (!rte_is_zero_ether_addr (&mask.eth->dst)) {mnl_attr_put (nlh,TCA_FLOWER_KEY_ETH_DST ,ETHER_ADDR_LEN , spec.eth->dst.addr_bytes);
@@ -3342,7 +3342,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow,ETHER_ADDR_LEN , mask.eth->dst.addr_bytes); } -if (!is_zero_ether_addr (&mask.eth->src)) { +if (!rte_is_zero_ether_addr (&mask.eth->src)) {mnl_attr_put (nlh,TCA_FLOWER_KEY_ETH_SRC ,ETHER_ADDR_LEN , spec.eth->src.addr_bytes);
drivers/net/mlx5/mlx5_mac.c +2 -2
@@ -71,7 +71,7 @@ mlx5_internal_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)const int vf = priv->config.vf;assert (index <MLX5_MAX_MAC_ADDRESSES ); -if (is_zero_ether_addr (&dev->data->mac_addrs[index])) +if (rte_is_zero_ether_addr (&dev->data->mac_addrs[index]))return ;if (vf) mlx5_nl_mac_addr_remove(dev, &dev->data->mac_addrs[index],
@@ -101,7 +101,7 @@ mlx5_internal_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac,unsigned int i;assert (index <MLX5_MAX_MAC_ADDRESSES ); -if (is_zero_ether_addr (mac)) { +if (rte_is_zero_ether_addr (mac)) { rte_errno =EINVAL ;return -rte_errno; }
drivers/net/mlx5/mlx5_nl.c +3 -3
@@ -340,7 +340,7 @@ mlx5_nl_mac_addr_cb(struct nlmsghdr *nh, void *arg)#ifndef NDEBUG char m[18 ]; -ether_format_addr (m,18 ,RTA_DATA (attribute)); +rte_ether_format_addr (m,18 ,RTA_DATA (attribute));DRV_LOG (DEBUG ,"bridge MAC address %s" , m);#endif memcpy(&(*data->mac)[data->mac_n++],
@@ -555,14 +555,14 @@ mlx5_nl_mac_addr_sync(struct rte_eth_dev *dev)/* Verify the address is not in the array yet. */ for (j =0 ; j !=MLX5_MAX_MAC_ADDRESSES ; ++j) -if (is_same_ether_addr (&macs[i], +if (rte_is_same_ether_addr (&macs[i], &dev->data->mac_addrs[j]))break ;if (j !=MLX5_MAX_MAC_ADDRESSES )continue ;/* Find the first entry available. */ for (j =0 ; j !=MLX5_MAX_MAC_ADDRESSES ; ++j) { -if (is_zero_ether_addr (&dev->data->mac_addrs[j])) { +if (rte_is_zero_ether_addr (&dev->data->mac_addrs[j])) { dev->data->mac_addrs[j] = macs[i];break ; }
drivers/net/mvneta/mvneta_ethdev.c +3 -3
@@ -595,7 +595,7 @@ mvneta_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) ret =neta_ppio_remove_mac_addr (priv->ppio, dev->data->mac_addrs[index].addr_bytes);if (ret) { -ether_format_addr (buf,sizeof (buf), +rte_ether_format_addr (buf,sizeof (buf), &dev->data->mac_addrs[index]);MVNETA_LOG (ERR ,"Failed to remove mac %s" , buf); }
@@ -633,7 +633,7 @@ mvneta_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, ret =neta_ppio_add_mac_addr (priv->ppio, mac_addr->addr_bytes);if (ret) { -ether_format_addr (buf,sizeof (buf), mac_addr); +rte_ether_format_addr (buf,sizeof (buf), mac_addr);MVNETA_LOG (ERR ,"Failed to add mac %s" , buf);return -1 ; }
@@ -661,7 +661,7 @@ mvneta_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) ret =neta_ppio_set_mac_addr (priv->ppio, mac_addr->addr_bytes);if (ret) {char buf[ETHER_ADDR_FMT_SIZE ]; -ether_format_addr (buf,sizeof (buf), mac_addr); +rte_ether_format_addr (buf,sizeof (buf), mac_addr);MVNETA_LOG (ERR ,"Failed to set mac to %s" , buf); }return 0 ;
drivers/net/mvpp2/mrvl_ethdev.c +3 -3
@@ -1080,7 +1080,7 @@ mrvl_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) ret =pp2_ppio_remove_mac_addr (priv->ppio, dev->data->mac_addrs[index].addr_bytes);if (ret) { -ether_format_addr (buf,sizeof (buf), +rte_ether_format_addr (buf,sizeof (buf), &dev->data->mac_addrs[index]);MRVL_LOG (ERR ,"Failed to remove mac %s" , buf); }
@@ -1134,7 +1134,7 @@ mrvl_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,*/ ret =pp2_ppio_add_mac_addr (priv->ppio, mac_addr->addr_bytes);if (ret) { -ether_format_addr (buf,sizeof (buf), mac_addr); +rte_ether_format_addr (buf,sizeof (buf), mac_addr);MRVL_LOG (ERR ,"Failed to add mac %s" , buf);return -1 ; }
@@ -1168,7 +1168,7 @@ mrvl_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) ret =pp2_ppio_set_mac_addr (priv->ppio, mac_addr->addr_bytes);if (ret) {char buf[ETHER_ADDR_FMT_SIZE ]; -ether_format_addr (buf,sizeof (buf), mac_addr); +rte_ether_format_addr (buf,sizeof (buf), mac_addr);MRVL_LOG (ERR ,"Failed to set mac to %s" , buf); }
drivers/net/netvsc/hn_rxtx.c +2 -2
@@ -128,8 +128,8 @@ hn_update_packet_stats(struct hn_stats *stats, const struct rte_mbuf *m) } ea = rte_pktmbuf_mtod(m, const struct rte_ether_addr *); -if (is_multicast_ether_addr (ea)) { -if (is_broadcast_ether_addr (ea)) +if (rte_is_multicast_ether_addr (ea)) { +if (rte_is_broadcast_ether_addr (ea)) stats->broadcast++;else stats->multicast++;
drivers/net/netvsc/hn_vf.c +1 -1
@@ -42,7 +42,7 @@ static int hn_vf_match(const struct rte_eth_dev *dev)if (vf_dev == dev)continue ; -if (is_same_ether_addr (mac, vf_mac)) +if (rte_is_same_ether_addr (mac, vf_mac))return i; }return -ENOENT ;
drivers/net/nfp/nfp_net.c +3 -3
@@ -2962,16 +2962,16 @@ nfp_net_init(struct rte_eth_dev *eth_dev)nfp_net_vf_read_mac (hw); } -if (!is_valid_assigned_ether_addr ((struct rte_ether_addr *)&hw->mac_addr)) { +if (!rte_is_valid_assigned_ether_addr ((struct rte_ether_addr *)&hw->mac_addr)) {PMD_INIT_LOG (INFO ,"Using random mac address for port %d" , port);/* Using random mac addresses for VFs */ -eth_random_addr (&hw->mac_addr[0 ]); +rte_eth_random_addr (&hw->mac_addr[0 ]);nfp_net_write_mac (hw, (uint8_t *)&hw->mac_addr); }/* Copying mac address to DPDK eth_dev struct */ -ether_addr_copy ((struct rte_ether_addr *)hw->mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)hw->mac_addr, ð_dev->data->mac_addrs[0 ]);if (!(hw->cap &NFP_NET_CFG_CTRL_LIVE_ADDR ))
drivers/net/null/rte_eth_null.c +1 -1
@@ -535,7 +535,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, internals->packet_size = packet_size; internals->packet_copy = packet_copy; internals->port_id = eth_dev->data->port_id; -eth_random_addr (internals->eth_addr.addr_bytes); +rte_eth_random_addr (internals->eth_addr.addr_bytes); internals->flow_type_rss_offloads =ETH_RSS_PROTO_MASK ; internals->reta_size =RTE_DIM (internals->reta_conf) *RTE_RETA_GROUP_SIZE ;
drivers/net/qede/qede_ethdev.c +13 -13
@@ -580,7 +580,7 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast,DP_ERR (edev,"Did not allocate memory for ucast\n" );return -ENOMEM ; } -ether_addr_copy (mac_addr, &u->mac); +rte_ether_addr_copy (mac_addr, &u->mac); u->vlan = ucast->vlan; u->vni = ucast->vni;SLIST_INSERT_HEAD (&qdev->uc_list_head, u, list);
@@ -622,14 +622,14 @@ qede_add_mcast_filters(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mc_adDP_ERR (edev,"Did not allocate memory for mcast\n" );return -ENOMEM ; } -ether_addr_copy (&mc_addrs[i], &m->mac); +rte_ether_addr_copy (&mc_addrs[i], &m->mac);SLIST_INSERT_HEAD (&qdev->mc_list_head, m, list); }memset (&mcast,0 ,sizeof (mcast)); mcast.num_mc_addrs = mc_addrs_num; mcast.opcode =ECORE_FILTER_ADD ;for (i =0 ; i < mc_addrs_num; i++) -ether_addr_copy (&mc_addrs[i], (struct rte_ether_addr *) +rte_ether_addr_copy (&mc_addrs[i], (struct rte_ether_addr *) &mcast.mac[i]); rc =ecore_filter_mcast_cmd (edev, &mcast,ECORE_SPQ_MODE_CB ,NULL );if (rc !=ECORE_SUCCESS ) {
@@ -654,7 +654,7 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev) mcast.opcode =ECORE_FILTER_REMOVE ; j =0 ; SLIST_FOREACH(tmp, &qdev->mc_list_head, list) { -ether_addr_copy (&tmp->mac, (struct rte_ether_addr *)&mcast.mac[j]); +rte_ether_addr_copy (&tmp->mac, (struct rte_ether_addr *)&mcast.mac[j]); j++; } rc =ecore_filter_mcast_cmd (edev, &mcast,ECORE_SPQ_MODE_CB ,NULL );
@@ -707,13 +707,13 @@ qede_mac_addr_add(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr,struct ecore_filter_ucast ucast;int re; -if (!is_valid_assigned_ether_addr (mac_addr)) +if (!rte_is_valid_assigned_ether_addr (mac_addr))return -EINVAL ;qede_set_ucast_cmn_params (&ucast); ucast.opcode =ECORE_FILTER_ADD ; ucast.type =ECORE_FILTER_MAC ; -ether_addr_copy (mac_addr, (struct rte_ether_addr *)&ucast.mac); +rte_ether_addr_copy (mac_addr, (struct rte_ether_addr *)&ucast.mac); re = (int )qede_mac_int_ops (eth_dev, &ucast,1 );return re; }
@@ -733,7 +733,7 @@ qede_mac_addr_remove(struct rte_eth_dev *eth_dev, uint32_t index)return ; } -if (!is_valid_assigned_ether_addr (ð_dev->data->mac_addrs[index])) +if (!rte_is_valid_assigned_ether_addr (ð_dev->data->mac_addrs[index]))return ;qede_set_ucast_cmn_params (&ucast);
@@ -741,7 +741,7 @@ qede_mac_addr_remove(struct rte_eth_dev *eth_dev, uint32_t index) ucast.type =ECORE_FILTER_MAC ;/* Use the index maintained by rte */ -ether_addr_copy (ð_dev->data->mac_addrs[index], +rte_ether_addr_copy (ð_dev->data->mac_addrs[index], (struct rte_ether_addr *)&ucast.mac);qede_mac_int_ops (eth_dev, &ucast, false);
@@ -1771,7 +1771,7 @@ qede_set_mc_addr_list(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mc_add }for (i =0 ; i < mc_addrs_num; i++) { -if (!is_multicast_ether_addr (&mc_addrs[i])) { +if (!rte_is_multicast_ether_addr (&mc_addrs[i])) {DP_ERR (edev,"Not a valid multicast MAC\n" );return -EINVAL ; }
@@ -2549,10 +2549,10 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) }if (!is_vf) { -ether_addr_copy ((struct rte_ether_addr *)edev->hwfns[0 ]. +rte_ether_addr_copy ((struct rte_ether_addr *)edev->hwfns[0 ]. hw_info.hw_mac_addr, ð_dev->data->mac_addrs[0 ]); -ether_addr_copy (ð_dev->data->mac_addrs[0 ], +rte_ether_addr_copy (ð_dev->data->mac_addrs[0 ], &adapter->primary_mac); }else { ecore_vf_read_bulletin(ECORE_LEADING_HWFN(edev),
@@ -2565,9 +2565,9 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) &is_mac_forced);if (is_mac_exist) {DP_INFO (edev,"VF macaddr received from PF\n" ); -ether_addr_copy ((struct rte_ether_addr *)&vf_mac, +rte_ether_addr_copy ((struct rte_ether_addr *)&vf_mac, ð_dev->data->mac_addrs[0 ]); -ether_addr_copy (ð_dev->data->mac_addrs[0 ], +rte_ether_addr_copy (ð_dev->data->mac_addrs[0 ], &adapter->primary_mac); }else {DP_ERR (edev,"No VF macaddr assigned\n" );
drivers/net/sfc/sfc_ethdev.c +3 -3
@@ -945,7 +945,7 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)* Copy the address to the device private data so that * it could be recalled in the case of adapter restart. */ -ether_addr_copy (mac_addr, &port->default_mac_addr); +rte_ether_addr_copy (mac_addr, &port->default_mac_addr);/* * Neither of the two following checks can return
@@ -1005,7 +1005,7 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) unlock:if (rc !=0 ) -ether_addr_copy (old_addr, &port->default_mac_addr); +rte_ether_addr_copy (old_addr, &port->default_mac_addr);sfc_adapter_unlock (sa);
@@ -2088,7 +2088,7 @@ sfc_eth_dev_init(struct rte_eth_dev *dev)* Linux kernel. Copy from NIC config to Ethernet device data. */ from = (const struct rte_ether_addr *)(encp->enc_mac_addr); -ether_addr_copy (from, &dev->data->mac_addrs[0 ]); +rte_ether_addr_copy (from, &dev->data->mac_addrs[0 ]);sfc_adapter_unlock (sa);
drivers/net/sfc/sfc_flow.c +5 -5
@@ -278,7 +278,7 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,if (spec ==NULL )return 0 ; -if (is_same_ether_addr (&mask->dst, &supp_mask.dst)) { +if (rte_is_same_ether_addr (&mask->dst, &supp_mask.dst)) { efx_spec->efs_match_flags |= is_ifrm ?EFX_FILTER_MATCH_IFRM_LOC_MAC :EFX_FILTER_MATCH_LOC_MAC ;
@@ -286,7 +286,7 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, EFX_MAC_ADDR_LEN); }else if (memcmp (mask->dst.addr_bytes, ig_mask,EFX_MAC_ADDR_LEN ) ==0 ) { -if (is_unicast_ether_addr (&spec->dst)) +if (rte_is_unicast_ether_addr (&spec->dst)) efx_spec->efs_match_flags |= is_ifrm ?EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST :EFX_FILTER_MATCH_UNKNOWN_UCAST_DST ;
@@ -294,7 +294,7 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, efx_spec->efs_match_flags |= is_ifrm ?EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST :EFX_FILTER_MATCH_UNKNOWN_MCAST_DST ; - }else if (!is_zero_ether_addr (&mask->dst)) { + }else if (!rte_is_zero_ether_addr (&mask->dst)) { goto fail_bad_mask; }
@@ -303,11 +303,11 @@ sfc_flow_parse_eth(const struct rte_flow_item *item,* ethertype masks are equal to zero in inner frame, * so these fields are filled in only for the outer frame */ -if (is_same_ether_addr (&mask->src, &supp_mask.src)) { +if (rte_is_same_ether_addr (&mask->src, &supp_mask.src)) { efx_spec->efs_match_flags |=EFX_FILTER_MATCH_REM_MAC ;rte_memcpy (efx_spec->efs_rem_mac, spec->src.addr_bytes,EFX_MAC_ADDR_LEN ); - }else if (!is_zero_ether_addr (&mask->src)) { + }else if (!rte_is_zero_ether_addr (&mask->src)) { goto fail_bad_mask; }
drivers/net/sfc/sfc_port.c +1 -1
@@ -402,7 +402,7 @@ sfc_port_attach(struct sfc_adapter *sa)RTE_BUILD_BUG_ON (sizeof (encp->enc_mac_addr) !=sizeof (*from)); from = (const struct rte_ether_addr *)(encp->enc_mac_addr); -ether_addr_copy (from, &port->default_mac_addr); +rte_ether_addr_copy (from, &port->default_mac_addr); port->max_mcast_addrs =EFX_MAC_MULTICAST_LIST_MAX ; port->nb_mcast_addrs =0 ;
drivers/net/softnic/rte_eth_softnic_flow.c +2 -2
@@ -1681,9 +1681,9 @@ flow_rule_action_get(struct pmd_internals *softnic, item, "VXLAN ENCAP: first encap item should be ether"); } -ether_addr_copy (&spec.eth.dst, +rte_ether_addr_copy (&spec.eth.dst, &rule_action->encap.vxlan.ether.da); -ether_addr_copy (&spec.eth.src, +rte_ether_addr_copy (&spec.eth.src, &rule_action->encap.vxlan.ether.sa); item++;
drivers/net/szedata2/rte_eth_szedata2.c +1 -1
@@ -1522,7 +1522,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi)return -ENOMEM ; } -ether_addr_copy (ð_addr, data->mac_addrs); +rte_ether_addr_copy (ð_addr, data->mac_addrs);PMD_INIT_LOG (INFO ,"%s device %s successfully initialized" ,RTE_STR (RTE_SZEDATA2_DRIVER_NAME ), data->name);
drivers/net/tap/rte_eth_tap.c +5 -5
@@ -1163,7 +1163,7 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr)return -ENOTSUP ; } -if (is_zero_ether_addr (mac_addr)) { +if (rte_is_zero_ether_addr (mac_addr)) {TAP_LOG (ERR ,"%s: can't set an empty MAC address" , dev->device->name);return -EINVAL ;
@@ -1172,14 +1172,14 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) ret =tap_ioctl (pmd,SIOCGIFHWADDR , &ifr,0 ,LOCAL_ONLY );if (ret <0 )return ret; -if (is_same_ether_addr ((struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, +if (rte_is_same_ether_addr ((struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, mac_addr))return 0 ;/* Check the current MAC address on the remote */ ret =tap_ioctl (pmd,SIOCGIFHWADDR , &ifr,0 ,REMOTE_ONLY );if (ret <0 )return ret; -if (!is_same_ether_addr ((struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, +if (!rte_is_same_ether_addr ((struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, mac_addr)) mode =LOCAL_AND_REMOTE ; ifr.ifr_hwaddr.sa_family =AF_LOCAL ;
@@ -1753,8 +1753,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name, }if (pmd->type ==ETH_TUNTAP_TYPE_TAP ) { -if (is_zero_ether_addr (mac_addr)) -eth_random_addr ((uint8_t *)&pmd->eth_addr); +if (rte_is_zero_ether_addr (mac_addr)) +rte_eth_random_addr ((uint8_t *)&pmd->eth_addr);else rte_memcpy (&pmd->eth_addr, mac_addr,sizeof (*mac_addr)); }
drivers/net/tap/tap_flow.c +2 -2
@@ -537,14 +537,14 @@ tap_flow_create_eth(const struct rte_flow_item *item, void *data)if (!flow)return 0 ; msg = &flow->msg; -if (!is_zero_ether_addr (&mask->dst)) { +if (!rte_is_zero_ether_addr (&mask->dst)) {tap_nlattr_add (&msg->nh,TCA_FLOWER_KEY_ETH_DST ,ETHER_ADDR_LEN , &spec->dst.addr_bytes);tap_nlattr_add (&msg->nh,TCA_FLOWER_KEY_ETH_DST_MASK ,ETHER_ADDR_LEN , &mask->dst.addr_bytes); } -if (!is_zero_ether_addr (&mask->src)) { +if (!rte_is_zero_ether_addr (&mask->src)) {tap_nlattr_add (&msg->nh,TCA_FLOWER_KEY_ETH_SRC ,ETHER_ADDR_LEN , &spec->src.addr_bytes); tap_nlattr_add(&msg->nh,
drivers/net/thunderx/base/nicvf_mbox.c +1 -1
@@ -135,7 +135,7 @@ nicvf_handle_mbx_intr(struct nicvf *nic) nic->node = mbx.nic_cfg.node_id; nic->sqs_mode = mbx.nic_cfg.sqs_mode; nic->loopback_supported = mbx.nic_cfg.loopback_supported; -ether_addr_copy ((struct rte_ether_addr *)mbx.nic_cfg.mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)mbx.nic_cfg.mac_addr, (struct rte_ether_addr *)nic->mac_addr); nic->pf_acked = true;break ;
drivers/net/thunderx/nicvf_ethdev.c +3 -3
@@ -2179,10 +2179,10 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) ret = -ENOMEM ; goto alarm_fail; } -if (is_zero_ether_addr ((struct rte_ether_addr *)nic->mac_addr)) -eth_random_addr (&nic->mac_addr[0 ]); +if (rte_is_zero_ether_addr ((struct rte_ether_addr *)nic->mac_addr)) +rte_eth_random_addr (&nic->mac_addr[0 ]); -ether_addr_copy ((struct rte_ether_addr *)nic->mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *)nic->mac_addr, ð_dev->data->mac_addrs[0 ]); ret =nicvf_mbox_set_mac_addr (nic, nic->mac_addr);
drivers/net/vdev_netvsc/vdev_netvsc.c +2 -2
@@ -387,7 +387,7 @@ vdev_netvsc_device_probe(const struct if_nameindex *iface,strlcpy (ctx->if_name, iface->if_name,sizeof (ctx->if_name));return 0 ; } -if (!is_same_ether_addr (eth_addr, &ctx->if_addr)) +if (!rte_is_same_ether_addr (eth_addr, &ctx->if_addr))return 0 ;/* Look for associated PCI device. */ ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name,
@@ -544,7 +544,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface, pair->value);return -EINVAL ; } -if (is_same_ether_addr (eth_addr, &tmp)) +if (rte_is_same_ether_addr (eth_addr, &tmp))break ; } }
drivers/net/vhost/rte_eth_vhost.c +2 -2
@@ -329,8 +329,8 @@ vhost_count_multicast_broadcast(struct vhost_queue *vq,struct vhost_stats *pstats = &vq->stats; ea = rte_pktmbuf_mtod(mbuf, struct rte_ether_addr *); -if (is_multicast_ether_addr (ea)) { -if (is_broadcast_ether_addr (ea)) +if (rte_is_multicast_ether_addr (ea)) { +if (rte_is_broadcast_ether_addr (ea)) pstats->xstats[VHOST_BROADCAST_PKT ]++;else pstats->xstats[VHOST_MULTICAST_PKT ]++;
drivers/net/virtio/virtio_ethdev.c +5 -5
@@ -1108,7 +1108,7 @@ virtio_get_hwaddr(struct virtio_hw *hw) offsetof(struct virtio_net_config , mac), &hw->mac_addr, ETHER_ADDR_LEN); }else { -eth_random_addr (&hw->mac_addr[0 ]); +rte_eth_random_addr (&hw->mac_addr[0 ]);virtio_set_hwaddr (hw); } }
@@ -1164,7 +1164,7 @@ virtio_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,const struct rte_ether_addr *addr = (i == index) ? mac_addr : addrs + i;struct virtio_net_ctrl_mac *tbl - =is_multicast_ether_addr (addr) ? mc : uc; + =rte_is_multicast_ether_addr (addr) ? mc : uc;memcpy (&tbl->macs[tbl->entries++], addr,ETHER_ADDR_LEN ); }
@@ -1193,10 +1193,10 @@ virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)for (i =0 ; i <VIRTIO_MAX_MAC_ADDRS ; i++) {struct virtio_net_ctrl_mac *tbl; -if (i == index ||is_zero_ether_addr (addrs + i)) +if (i == index ||rte_is_zero_ether_addr (addrs + i))continue ; - tbl =is_multicast_ether_addr (addrs + i) ? mc : uc; + tbl =rte_is_multicast_ether_addr (addrs + i) ? mc : uc;memcpy (&tbl->macs[tbl->entries++], addrs + i,ETHER_ADDR_LEN ); }
@@ -1662,7 +1662,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)/* Copy the permanent MAC address to: virtio_hw */ virtio_get_hwaddr (hw); -ether_addr_copy ((struct rte_ether_addr *) hw->mac_addr, +rte_ether_addr_copy ((struct rte_ether_addr *) hw->mac_addr, ð_dev->data->mac_addrs[0 ]); PMD_INIT_LOG(DEBUG, "PORT MAC: %02X:%02X:%02X:%02X:%02X:%02X",
drivers/net/virtio/virtio_rxtx.c +2 -2
@@ -1114,8 +1114,8 @@ virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf) } ea = rte_pktmbuf_mtod(mbuf, struct rte_ether_addr *); -if (is_multicast_ether_addr (ea)) { -if (is_broadcast_ether_addr (ea)) +if (rte_is_multicast_ether_addr (ea)) { +if (rte_is_broadcast_ether_addr (ea)) stats->broadcast++;else stats->multicast++;
drivers/net/vmxnet3/vmxnet3_ethdev.c +2 -2
@@ -311,7 +311,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)return -ENOMEM ; }/* Copy the permanent MAC address */ -ether_addr_copy ((struct rte_ether_addr *) hw->perm_addr, +rte_ether_addr_copy ((struct rte_ether_addr *) hw->perm_addr, ð_dev->data->mac_addrs[0 ]); PMD_INIT_LOG(DEBUG, "MAC Address : %02x:%02x:%02x:%02x:%02x:%02x",
@@ -1189,7 +1189,7 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) {struct vmxnet3_hw *hw = dev->data->dev_private; -ether_addr_copy (mac_addr, (struct rte_ether_addr *)(hw->perm_addr)); +rte_ether_addr_copy (mac_addr, (struct rte_ether_addr *)(hw->perm_addr));vmxnet3_write_mac (hw, mac_addr->addr_bytes);return 0 ; }
examples/bond/main.c +4 -4
@@ -387,12 +387,12 @@ static int lcore_main(__attribute__((unused)) void *arg1)if (arp_hdr->arp_opcode ==rte_cpu_to_be_16 (RTE_ARP_OP_REQUEST )) { arp_hdr->arp_opcode =rte_cpu_to_be_16 (RTE_ARP_OP_REPLY );/* Switch src and dst data and set bonding MAC */ -ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr); +rte_ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr);rte_eth_macaddr_get (BOND_PORT , ð_hdr->s_addr); -ether_addr_copy (&arp_hdr->arp_data.arp_sha, &arp_hdr->arp_data.arp_tha); +rte_ether_addr_copy (&arp_hdr->arp_data.arp_sha, &arp_hdr->arp_data.arp_tha); arp_hdr->arp_data.arp_tip = arp_hdr->arp_data.arp_sip;rte_eth_macaddr_get (BOND_PORT , &d_addr); -ether_addr_copy (&d_addr, &arp_hdr->arp_data.arp_sha); +rte_ether_addr_copy (&d_addr, &arp_hdr->arp_data.arp_sha); arp_hdr->arp_data.arp_sip = bond_ip;rte_eth_tx_burst (BOND_PORT ,0 , &pkts[i],1 ); is_free =1 ;
@@ -407,7 +407,7 @@ static int lcore_main(__attribute__((unused)) void *arg1) } ipv4_hdr = (struct ipv4_hdr *)((char *)(eth_hdr +1 ) + offset);if (ipv4_hdr->dst_addr == bond_ip) { -ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr); +rte_ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr);rte_eth_macaddr_get (BOND_PORT , ð_hdr->s_addr); ipv4_hdr->dst_addr = ipv4_hdr->src_addr; ipv4_hdr->src_addr = bond_ip;
examples/ethtool/ethtool-app/main.c +2 -2
@@ -161,8 +161,8 @@ static void process_frame(struct app_port *ptr_port,struct rte_ether_hdr *ptr_mac_hdr; ptr_mac_hdr = rte_pktmbuf_mtod(ptr_frame, struct rte_ether_hdr *); -ether_addr_copy (&ptr_mac_hdr->s_addr, &ptr_mac_hdr->d_addr); -ether_addr_copy (&ptr_port->mac_addr, &ptr_mac_hdr->s_addr); +rte_ether_addr_copy (&ptr_mac_hdr->s_addr, &ptr_mac_hdr->d_addr); +rte_ether_addr_copy (&ptr_port->mac_addr, &ptr_mac_hdr->s_addr); }static int slave_main (__attribute__((unused))void *ptr_data)
examples/ethtool/lib/rte_ethtool.c +1 -1
@@ -327,7 +327,7 @@ rte_ethtool_net_validate_addr(uint16_t port_id __rte_unused, {if (addr ==NULL )return -EINVAL ; -return is_valid_assigned_ether_addr (addr); +return rte_is_valid_assigned_ether_addr (addr); }int
examples/eventdev_pipeline/pipeline_common.h +2 -2
@@ -104,8 +104,8 @@ exchange_mac(struct rte_mbuf *m)/* change mac addresses on packet (to use mbuf data) */ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); -ether_addr_copy (ð->d_addr, &addr); -ether_addr_copy (&addr, ð->d_addr); +rte_ether_addr_copy (ð->d_addr, &addr); +rte_ether_addr_copy (&addr, ð->d_addr); }static __rte_always_inline void
examples/flow_filtering/main.c +1 -1
@@ -48,7 +48,7 @@ static inline void print_ether_addr(const char *what, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , what, buf); }
examples/ip_fragmentation/main.c +2 -2
@@ -353,7 +353,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, *((uint64_t *)d_addr_bytes) =0x000000000002 + ((uint64_t )port_out <<40 );/* src addr */ -ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[port_out], ð_hdr->s_addr);if (ipv6) eth_hdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv6);else
@@ -571,7 +571,7 @@ static void print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
examples/ip_reassembly/main.c +2 -2
@@ -409,7 +409,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, *((uint64_t *)d_addr_bytes) =0x000000000002 + ((uint64_t )dst_port <<40 );/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (m, dst_port); }
@@ -694,7 +694,7 @@ static void print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
examples/ipsec-secgw/ipsec-secgw.c +1 -1
@@ -1429,7 +1429,7 @@ static void print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
examples/ipv4_multicast/main.c +3 -3
@@ -277,8 +277,8 @@ mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr, ethdr = (struct rte_ether_hdr *)rte_pktmbuf_prepend (pkt, (uint16_t )sizeof (*ethdr));RTE_ASSERT (ethdr !=NULL ); -ether_addr_copy (dest_addr, ðdr->d_addr); -ether_addr_copy (&ports_eth_addr[port], ðdr->s_addr); +rte_ether_addr_copy (dest_addr, ðdr->d_addr); +rte_ether_addr_copy (&ports_eth_addr[port], ðdr->s_addr); ethdr->ether_type =rte_be_to_cpu_16 (ETHER_TYPE_IPv4);/* Put new packet into the output queue */
@@ -538,7 +538,7 @@ static void print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
examples/kni/main.c +1 -1
@@ -835,7 +835,7 @@ static void print_ethaddr(const char *name, struct rte_ether_addr *mac_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , mac_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , mac_addr);RTE_LOG (INFO ,APP ,"\t%s%s\n" , name, buf); }
examples/l2fwd-crypto/main.c +1 -1
@@ -603,7 +603,7 @@ l2fwd_mac_updating(struct rte_mbuf *m, uint16_t dest_portid) *((uint64_t *)tmp) =0x000000000002 + ((uint64_t )dest_portid <<40 );/* src addr */ -ether_addr_copy (&l2fwd_ports_eth_addr[dest_portid], ð->s_addr); +rte_ether_addr_copy (&l2fwd_ports_eth_addr[dest_portid], ð->s_addr); } static void
examples/l2fwd-jobstats/main.c +1 -1
@@ -349,7 +349,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) *((uint64_t *)tmp) =0x000000000002 + ((uint64_t )dst_port <<40 );/* src addr */ -ether_addr_copy (&l2fwd_ports_eth_addr[dst_port], ð->s_addr); +rte_ether_addr_copy (&l2fwd_ports_eth_addr[dst_port], ð->s_addr); buffer = tx_buffer[dst_port]; sent =rte_eth_tx_buffer (dst_port,0 , buffer, m);
examples/l2fwd-keepalive/main.c +1 -1
@@ -179,7 +179,7 @@ l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) *((uint64_t *)tmp) =0x000000000002 + ((uint64_t )dst_port <<40 );/* src addr */ -ether_addr_copy (&l2fwd_ports_eth_addr[dst_port], ð->s_addr); +rte_ether_addr_copy (&l2fwd_ports_eth_addr[dst_port], ð->s_addr); buffer = tx_buffer[dst_port]; sent =rte_eth_tx_buffer (dst_port,0 , buffer, m);
examples/l2fwd/main.c +1 -1
@@ -161,7 +161,7 @@ l2fwd_mac_updating(struct rte_mbuf *m, unsigned dest_portid) *((uint64_t *)tmp) =0x000000000002 + ((uint64_t )dest_portid <<40 );/* src addr */ -ether_addr_copy (&l2fwd_ports_eth_addr[dest_portid], ð->s_addr); +rte_ether_addr_copy (&l2fwd_ports_eth_addr[dest_portid], ð->s_addr); } static void
examples/l3fwd-acl/main.c +1 -1
@@ -1757,7 +1757,7 @@ static void print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
examples/l3fwd-power/main.c +3 -3
@@ -700,7 +700,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,#endif /* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (m, dst_port); }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) {
@@ -725,7 +725,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,0x000000000002 + ((uint64_t )dst_port <<40 );/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (m, dst_port);#else
@@ -1580,7 +1580,7 @@ static void print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
examples/l3fwd-vf/main.c +2 -2
@@ -450,7 +450,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,#endif /* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (m, dst_port);
@@ -791,7 +791,7 @@ static void print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
examples/l3fwd/l3fwd_em.h +2 -2
@@ -47,7 +47,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, *(uint64_t *)ð_hdr->d_addr = dest_eth_addr[dst_port];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (qconf, m, dst_port); }else if (tcp_or_udp && (l3_ptypes ==RTE_PTYPE_L3_IPV6 )) {
@@ -68,7 +68,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, *(uint64_t *)ð_hdr->d_addr = dest_eth_addr[dst_port];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (qconf, m, dst_port); }else {
examples/l3fwd/l3fwd_lpm.h +2 -2
@@ -43,7 +43,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, *(uint64_t *)ð_hdr->d_addr = dest_eth_addr[dst_port];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (qconf, m, dst_port); }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) {
@@ -64,7 +64,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, *(uint64_t *)ð_hdr->d_addr = dest_eth_addr[dst_port];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (qconf, m, dst_port); }else {
examples/l3fwd/main.c +2 -2
@@ -637,7 +637,7 @@ static void print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
@@ -895,7 +895,7 @@ main(int argc, char **argv)/* * prepare src MACs for each port. */ -ether_addr_copy (&ports_eth_addr[portid], +rte_ether_addr_copy (&ports_eth_addr[portid], (struct rte_ether_addr *)(val_eth + portid) +1 );/* init memory */
examples/link_status_interrupt/main.c +1 -1
@@ -176,7 +176,7 @@ lsi_simple_forward(struct rte_mbuf *m, unsigned portid) *((uint64_t *)tmp) =0x000000000002 + ((uint64_t )dst_port <<40 );/* src addr */ -ether_addr_copy (&lsi_ports_eth_addr[dst_port], ð->s_addr); +rte_ether_addr_copy (&lsi_ports_eth_addr[dst_port], ð->s_addr); buffer = tx_buffer[dst_port]; sent =rte_eth_tx_buffer (dst_port,0 , buffer, m);
examples/performance-thread/l3fwd-thread/main.c +20 -20
@@ -1070,14 +1070,14 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) *(uint64_t *)ð_hdr[7 ]->d_addr = dest_eth_addr[dst_port[7 ]];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port[0 ]], ð_hdr[0 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[1 ]], ð_hdr[1 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[2 ]], ð_hdr[2 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[3 ]], ð_hdr[3 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[4 ]], ð_hdr[4 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[5 ]], ð_hdr[5 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[6 ]], ð_hdr[6 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[7 ]], ð_hdr[7 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[0 ]], ð_hdr[0 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[1 ]], ð_hdr[1 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[2 ]], ð_hdr[2 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[3 ]], ð_hdr[3 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[4 ]], ð_hdr[4 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[5 ]], ð_hdr[5 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[6 ]], ð_hdr[6 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[7 ]], ð_hdr[7 ]->s_addr);send_single_packet (m[0 ], (uint8_t )dst_port[0 ]);send_single_packet (m[1 ], (uint8_t )dst_port[1 ]);
@@ -1204,14 +1204,14 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) *(uint64_t *)ð_hdr[7 ]->d_addr = dest_eth_addr[dst_port[7 ]];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port[0 ]], ð_hdr[0 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[1 ]], ð_hdr[1 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[2 ]], ð_hdr[2 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[3 ]], ð_hdr[3 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[4 ]], ð_hdr[4 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[5 ]], ð_hdr[5 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[6 ]], ð_hdr[6 ]->s_addr); -ether_addr_copy (&ports_eth_addr[dst_port[7 ]], ð_hdr[7 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[0 ]], ð_hdr[0 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[1 ]], ð_hdr[1 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[2 ]], ð_hdr[2 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[3 ]], ð_hdr[3 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[4 ]], ð_hdr[4 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[5 ]], ð_hdr[5 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[6 ]], ð_hdr[6 ]->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port[7 ]], ð_hdr[7 ]->s_addr);send_single_packet (m[0 ], dst_port[0 ]);send_single_packet (m[1 ], dst_port[1 ]);
@@ -1262,7 +1262,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) *(uint64_t *)ð_hdr->d_addr = dest_eth_addr[dst_port];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (m, dst_port); }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) {
@@ -1283,7 +1283,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) *(uint64_t *)ð_hdr->d_addr = dest_eth_addr[dst_port];/* src addr */ -ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr); +rte_ether_addr_copy (&ports_eth_addr[dst_port], ð_hdr->s_addr);send_single_packet (m, dst_port); }else
@@ -3024,7 +3024,7 @@ print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) {char buf[ETHER_ADDR_FMT_SIZE ]; -ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
@@ -3582,7 +3582,7 @@ main(int argc, char **argv)/* * prepare src MACs for each port. */ -ether_addr_copy (&ports_eth_addr[portid], +rte_ether_addr_copy (&ports_eth_addr[portid], (struct rte_ether_addr *)(val_eth + portid) +1 );/* init memory */
examples/ptpclient/ptpclient.c +1 -1
@@ -401,7 +401,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)rte_eth_macaddr_get (ptp_data->portid, ð_hdr->s_addr);/* Set multicast address 01-1B-19-00-00-00. */ -ether_addr_copy (ð_multicast, ð_hdr->d_addr); +rte_ether_addr_copy (ð_multicast, ð_hdr->d_addr); eth_hdr->ether_type =htons (PTP_PROTOCOL ); ptp_msg = (struct ptp_message *)
examples/quota_watermark/qw/main.c +1 -1
@@ -67,7 +67,7 @@ static void send_pause_frame(uint16_t port_id, uint16_t duration) pause_frame = (struct ether_fc_frame *) &hdr[1 ];rte_eth_macaddr_get (port_id, &mac_addr); -ether_addr_copy (&mac_addr, &hdr->s_addr); +rte_ether_addr_copy (&mac_addr, &hdr->s_addr);void *tmp = &hdr->d_addr.addr_bytes[0 ]; *((uint64_t *)tmp) =0x010000C28001ULL ;
examples/tep_termination/vxlan_setup.c +7 -7
@@ -243,7 +243,7 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)/* Learn MAC address of guest device from packet */ pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); -if (is_same_ether_addr (&(pkt_hdr->s_addr), &vdev->mac_address)) { +if (rte_is_same_ether_addr (&(pkt_hdr->s_addr), &vdev->mac_address)) { RTE_LOG(INFO, VHOST_DATA, "(%d) WARNING: This device is using an existing" " MAC address and has not been registered.\n",
@@ -261,11 +261,11 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)memset (&tunnel_filter_conf,0 ,sizeof (struct rte_eth_tunnel_filter_conf )); -ether_addr_copy (&ports_eth_addr[0 ], &tunnel_filter_conf.outer_mac); +rte_ether_addr_copy (&ports_eth_addr[0 ], &tunnel_filter_conf.outer_mac); tunnel_filter_conf.filter_type = tep_filter_type[filter_idx];/* inner MAC */ -ether_addr_copy (&vdev->mac_address, &tunnel_filter_conf.inner_mac); +rte_ether_addr_copy (&vdev->mac_address, &tunnel_filter_conf.inner_mac); tunnel_filter_conf.queue_id = vdev->rx_q; tunnel_filter_conf.tenant_id = tenant_id_conf[vdev->rx_q];
@@ -309,9 +309,9 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m) } vxdev.out_key = tenant_id_conf[vdev->rx_q]; -ether_addr_copy (&vxdev.port[portid].peer_mac, +rte_ether_addr_copy (&vxdev.port[portid].peer_mac, &app_l2_hdr[portid].d_addr); -ether_addr_copy (&ports_eth_addr[0 ], +rte_ether_addr_copy (&ports_eth_addr[0 ], &app_l2_hdr[portid].s_addr); app_l2_hdr[portid].ether_type =rte_cpu_to_be_16 (ETHER_TYPE_IPv4);
@@ -349,8 +349,8 @@ vxlan_unlink(struct vhost_dev *vdev)memset (&tunnel_filter_conf,0 ,sizeof (struct rte_eth_tunnel_filter_conf )); -ether_addr_copy (&ports_eth_addr[0 ], &tunnel_filter_conf.outer_mac); -ether_addr_copy (&vdev->mac_address, &tunnel_filter_conf.inner_mac); +rte_ether_addr_copy (&ports_eth_addr[0 ], &tunnel_filter_conf.outer_mac); +rte_ether_addr_copy (&vdev->mac_address, &tunnel_filter_conf.inner_mac); tunnel_filter_conf.tenant_id = tenant_id_conf[vdev->rx_q]; tunnel_filter_conf.filter_type = tep_filter_type[filter_idx];
examples/vhost/main.c +2 -2
@@ -666,7 +666,7 @@ find_vhost_dev(struct rte_ether_addr *mac) TAILQ_FOREACH(vdev, &vhost_dev_list, global_vdev_entry) {if (vdev->ready ==DEVICE_RX && -is_same_ether_addr (mac, &vdev->mac_address)) +rte_is_same_ether_addr (mac, &vdev->mac_address))return vdev; }
@@ -914,7 +914,7 @@ virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag) nh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); -if (unlikely (is_broadcast_ether_addr (&nh->d_addr))) { +if (unlikely (rte_is_broadcast_ether_addr (&nh->d_addr))) {struct vhost_dev *vdev2; TAILQ_FOREACH(vdev2, &vhost_dev_list, global_vdev_entry) {
examples/vmdq/main.c +1 -1
@@ -417,7 +417,7 @@ update_mac_address(struct rte_mbuf *m, unsigned dst_port) *((uint64_t *)tmp) =0x000000000002 + ((uint64_t )dst_port <<40 );/* src addr */ -ether_addr_copy (&vmdq_ports_eth_addr[dst_port], ð->s_addr); +rte_ether_addr_copy (&vmdq_ports_eth_addr[dst_port], ð->s_addr); }/* When we receive a HUP signal, print out our stats */
examples/vmdq_dcb/main.c +1 -1
@@ -504,7 +504,7 @@ update_mac_address(struct rte_mbuf *m, unsigned dst_port) *((uint64_t *)tmp) =0x000000000002 + ((uint64_t )dst_port <<40 );/* src addr */ -ether_addr_copy (&vmdq_ports_eth_addr[dst_port], ð->s_addr); +rte_ether_addr_copy (&vmdq_ports_eth_addr[dst_port], ð->s_addr); }/* When we receive a HUP signal, print out our stats */
lib/librte_ethdev/rte_class_eth.c +1 -1
@@ -61,7 +61,7 @@ eth_mac_cmp(const char *key __rte_unused,/* Return 0 if devargs MAC is matching one of the device MACs. */ rte_eth_dev_info_get (data->port_id, &dev_info);for (index =0 ; index < dev_info.max_mac_addrs; index++) -if (is_same_ether_addr (&mac, &data->mac_addrs[index])) +if (rte_is_same_ether_addr (&mac, &data->mac_addrs[index]))return 0 ;return -1 ;/* no match */ }
lib/librte_ethdev/rte_ethdev.c +10 -10
@@ -1360,7 +1360,7 @@ rte_eth_dev_mac_restore(struct rte_eth_dev *dev, addr = &dev->data->mac_addrs[i];/* skip zero address */ -if (is_zero_ether_addr (addr)) +if (rte_is_zero_ether_addr (addr))continue ; pool =0 ;
@@ -2594,7 +2594,7 @@ rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr)RTE_ETH_VALID_PORTID_OR_RET (port_id); dev = &rte_eth_devices[port_id]; -ether_addr_copy (&dev->data->mac_addrs[0 ], mac_addr); +rte_ether_addr_copy (&dev->data->mac_addrs[0 ], mac_addr); }
@@ -3106,7 +3106,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, dev = &rte_eth_devices[port_id];RTE_FUNC_PTR_OR_ERR_RET (*dev->dev_ops->mac_addr_add, -ENOTSUP ); -if (is_zero_ether_addr (addr)) { +if (rte_is_zero_ether_addr (addr)) {RTE_ETHDEV_LOG (ERR ,"Port %u: Cannot add NULL MAC address\n" , port_id);return -EINVAL ;
@@ -3137,7 +3137,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr,if (ret ==0 ) {/* Update address in NIC data structure */ -ether_addr_copy (addr, &dev->data->mac_addrs[index]); +rte_ether_addr_copy (addr, &dev->data->mac_addrs[index]);/* Update pool bitmap in NIC data structure */ dev->data->mac_pool_sel[index] |= (1ULL << pool);
@@ -3169,7 +3169,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) (*dev->dev_ops->mac_addr_remove)(dev, index);/* Update address in NIC data structure */ -ether_addr_copy (&null_mac_addr, &dev->data->mac_addrs[index]); +rte_ether_addr_copy (&null_mac_addr, &dev->data->mac_addrs[index]);/* reset pool bitmap */ dev->data->mac_pool_sel[index] =0 ;
@@ -3185,7 +3185,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr)RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); -if (!is_valid_assigned_ether_addr (addr)) +if (!rte_is_valid_assigned_ether_addr (addr))return -EINVAL ; dev = &rte_eth_devices[port_id];
@@ -3196,7 +3196,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr)return ret;/* Update default address in NIC data structure */ -ether_addr_copy (addr, &dev->data->mac_addrs[0 ]); +rte_ether_addr_copy (addr, &dev->data->mac_addrs[0 ]);return 0 ; }
@@ -3236,7 +3236,7 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,RTE_ETH_VALID_PORTID_OR_ERR_RET (port_id, -ENODEV ); dev = &rte_eth_devices[port_id]; -if (is_zero_ether_addr (addr)) { +if (rte_is_zero_ether_addr (addr)) {RTE_ETHDEV_LOG (ERR ,"Port %u: Cannot add NULL MAC address\n" , port_id);return -EINVAL ;
@@ -3268,10 +3268,10 @@ rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,if (ret ==0 ) {/* Update address in NIC data structure */ if (on) -ether_addr_copy (addr, +rte_ether_addr_copy (addr, &dev->data->hash_mac_addrs[index]);else -ether_addr_copy (&null_mac_addr, +rte_ether_addr_copy (&null_mac_addr, &dev->data->hash_mac_addrs[index]); }
lib/librte_gro/gro_tcp4.c +4 -4
@@ -160,8 +160,8 @@ insert_new_flow(struct gro_tcp4_tbl *tbl, dst = &(tbl->flows[flow_idx].key); -ether_addr_copy (&(src->eth_saddr), &(dst->eth_saddr)); -ether_addr_copy (&(src->eth_daddr), &(dst->eth_daddr)); +rte_ether_addr_copy (&(src->eth_saddr), &(dst->eth_saddr)); +rte_ether_addr_copy (&(src->eth_daddr), &(dst->eth_daddr)); dst->ip_src_addr = src->ip_src_addr; dst->ip_dst_addr = src->ip_dst_addr; dst->recv_ack = src->recv_ack;
@@ -243,8 +243,8 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, ip_id = is_atomic ?0 :rte_be_to_cpu_16 (ipv4_hdr->packet_id); sent_seq =rte_be_to_cpu_32 (tcp_hdr->sent_seq); -ether_addr_copy (&(eth_hdr->s_addr), &(key.eth_saddr)); -ether_addr_copy (&(eth_hdr->d_addr), &(key.eth_daddr)); +rte_ether_addr_copy (&(eth_hdr->s_addr), &(key.eth_saddr)); +rte_ether_addr_copy (&(eth_hdr->d_addr), &(key.eth_daddr)); key.ip_src_addr = ipv4_hdr->src_addr; key.ip_dst_addr = ipv4_hdr->dst_addr; key.src_port = tcp_hdr->src_port;
lib/librte_gro/gro_tcp4.h +2 -2
@@ -187,8 +187,8 @@ uint32_t gro_tcp4_tbl_pkt_count(void *tbl);static inline int is_same_tcp4_flow (struct tcp4_flow_key k1,struct tcp4_flow_key k2) { - return (is_same_ether_addr(&k1.eth_saddr, &k2.eth_saddr) && - is_same_ether_addr(&k1.eth_daddr, &k2.eth_daddr) && + return (rte_is_same_ether_addr(&k1.eth_saddr, &k2.eth_saddr) && + rte_is_same_ether_addr(&k1.eth_daddr, &k2.eth_daddr) && (k1.ip_src_addr == k2.ip_src_addr) && (k1.ip_dst_addr == k2.ip_dst_addr) && (k1.recv_ack == k2.recv_ack) &&
lib/librte_gro/gro_vxlan_tcp4.c +10 -10
@@ -164,9 +164,9 @@ insert_new_flow(struct gro_vxlan_tcp4_tbl *tbl, dst = &(tbl->flows[flow_idx].key); -ether_addr_copy (&(src->inner_key.eth_saddr), +rte_ether_addr_copy (&(src->inner_key.eth_saddr), &(dst->inner_key.eth_saddr)); -ether_addr_copy (&(src->inner_key.eth_daddr), +rte_ether_addr_copy (&(src->inner_key.eth_daddr), &(dst->inner_key.eth_daddr)); dst->inner_key.ip_src_addr = src->inner_key.ip_src_addr; dst->inner_key.ip_dst_addr = src->inner_key.ip_dst_addr;
@@ -176,8 +176,8 @@ insert_new_flow(struct gro_vxlan_tcp4_tbl *tbl, dst->vxlan_hdr.vx_flags = src->vxlan_hdr.vx_flags; dst->vxlan_hdr.vx_vni = src->vxlan_hdr.vx_vni; -ether_addr_copy (&(src->outer_eth_saddr), &(dst->outer_eth_saddr)); -ether_addr_copy (&(src->outer_eth_daddr), &(dst->outer_eth_daddr)); +rte_ether_addr_copy (&(src->outer_eth_saddr), &(dst->outer_eth_saddr)); +rte_ether_addr_copy (&(src->outer_eth_daddr), &(dst->outer_eth_daddr)); dst->outer_ip_src_addr = src->outer_ip_src_addr; dst->outer_ip_dst_addr = src->outer_ip_dst_addr; dst->outer_src_port = src->outer_src_port;
@@ -193,8 +193,8 @@ static inline int is_same_vxlan_tcp4_flow(struct vxlan_tcp4_flow_key k1, struct vxlan_tcp4_flow_key k2) { - return (is_same_ether_addr(&k1.outer_eth_saddr, &k2.outer_eth_saddr) && - is_same_ether_addr(&k1.outer_eth_daddr, + return (rte_is_same_ether_addr(&k1.outer_eth_saddr, &k2.outer_eth_saddr) && + rte_is_same_ether_addr(&k1.outer_eth_daddr, &k2.outer_eth_daddr) && (k1.outer_ip_src_addr == k2.outer_ip_src_addr) && (k1.outer_ip_dst_addr == k2.outer_ip_dst_addr) &&
@@ -356,8 +356,8 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, sent_seq =rte_be_to_cpu_32 (tcp_hdr->sent_seq); -ether_addr_copy (&(eth_hdr->s_addr), &(key.inner_key.eth_saddr)); -ether_addr_copy (&(eth_hdr->d_addr), &(key.inner_key.eth_daddr)); +rte_ether_addr_copy (&(eth_hdr->s_addr), &(key.inner_key.eth_saddr)); +rte_ether_addr_copy (&(eth_hdr->d_addr), &(key.inner_key.eth_daddr)); key.inner_key.ip_src_addr = ipv4_hdr->src_addr; key.inner_key.ip_dst_addr = ipv4_hdr->dst_addr; key.inner_key.recv_ack = tcp_hdr->recv_ack;
@@ -366,8 +366,8 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, key.vxlan_hdr.vx_flags = vxlan_hdr->vx_flags; key.vxlan_hdr.vx_vni = vxlan_hdr->vx_vni; -ether_addr_copy (&(outer_eth_hdr->s_addr), &(key.outer_eth_saddr)); -ether_addr_copy (&(outer_eth_hdr->d_addr), &(key.outer_eth_daddr)); +rte_ether_addr_copy (&(outer_eth_hdr->s_addr), &(key.outer_eth_saddr)); +rte_ether_addr_copy (&(outer_eth_hdr->d_addr), &(key.outer_eth_daddr)); key.outer_ip_src_addr = outer_ipv4_hdr->src_addr; key.outer_ip_dst_addr = outer_ipv4_hdr->dst_addr; key.outer_src_port = udp_hdr->src_port;
lib/librte_net/rte_arp.c +3 -3
@@ -30,7 +30,7 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool,/* Ethernet header. */ memset (eth_hdr->d_addr.addr_bytes,0xff ,ETHER_ADDR_LEN ); -ether_addr_copy (mac, ð_hdr->s_addr); +rte_ether_addr_copy (mac, ð_hdr->s_addr); eth_hdr->ether_type =htons (ETHER_TYPE_RARP );/* RARP header. */
@@ -41,8 +41,8 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool, rarp->arp_plen =4 ; rarp->arp_opcode =htons (RTE_ARP_OP_REVREQUEST ); -ether_addr_copy (mac, &rarp->arp_data.arp_sha); -ether_addr_copy (mac, &rarp->arp_data.arp_tha); +rte_ether_addr_copy (mac, &rarp->arp_data.arp_sha); +rte_ether_addr_copy (mac, &rarp->arp_data.arp_tha);memset (&rarp->arp_data.arp_sip,0x00 ,4 );memset (&rarp->arp_data.arp_tip,0x00 ,4 );
lib/librte_net/rte_ether.h +12 -12
@@ -75,7 +75,7 @@ struct rte_ether_addr {* True (1) if the given two ethernet address are the same; * False (0) otherwise. */ -static inline int is_same_ether_addr (const struct rte_ether_addr *ea1, +static inline int rte_is_same_ether_addr (const struct rte_ether_addr *ea1,const struct rte_ether_addr *ea2) {int i;
@@ -95,7 +95,7 @@ static inline int is_same_ether_addr(const struct rte_ether_addr *ea1,* True (1) if the given ethernet address is filled with zeros; * false (0) otherwise. */ -static inline int is_zero_ether_addr (const struct rte_ether_addr *ea) +static inline int rte_is_zero_ether_addr (const struct rte_ether_addr *ea) {int i;for (i =0 ; i <ETHER_ADDR_LEN ; i++)
@@ -114,7 +114,7 @@ static inline int is_zero_ether_addr(const struct rte_ether_addr *ea)* True (1) if the given ethernet address is a unicast address; * false (0) otherwise. */ -static inline int is_unicast_ether_addr (const struct rte_ether_addr *ea) +static inline int rte_is_unicast_ether_addr (const struct rte_ether_addr *ea) {return (ea->addr_bytes[0 ] ÐER_GROUP_ADDR ) ==0 ; }
@@ -129,7 +129,7 @@ static inline int is_unicast_ether_addr(const struct rte_ether_addr *ea)* True (1) if the given ethernet address is a multicast address; * false (0) otherwise. */ -static inline int is_multicast_ether_addr (const struct rte_ether_addr *ea) +static inline int rte_is_multicast_ether_addr (const struct rte_ether_addr *ea) {return ea->addr_bytes[0 ] ÐER_GROUP_ADDR ; }
@@ -144,7 +144,7 @@ static inline int is_multicast_ether_addr(const struct rte_ether_addr *ea)* True (1) if the given ethernet address is a broadcast address; * false (0) otherwise. */ -static inline int is_broadcast_ether_addr (const struct rte_ether_addr *ea) +static inline int rte_is_broadcast_ether_addr (const struct rte_ether_addr *ea) {const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
@@ -162,7 +162,7 @@ static inline int is_broadcast_ether_addr(const struct rte_ether_addr *ea)* True (1) if the given ethernet address is a universally assigned address; * false (0) otherwise. */ -static inline int is_universal_ether_addr (const struct rte_ether_addr *ea) +static inline int rte_is_universal_ether_addr (const struct rte_ether_addr *ea) {return (ea->addr_bytes[0 ] ÐER_LOCAL_ADMIN_ADDR ) ==0 ; }
@@ -177,7 +177,7 @@ static inline int is_universal_ether_addr(const struct rte_ether_addr *ea)* True (1) if the given ethernet address is a locally assigned address; * false (0) otherwise. */ -static inline int is_local_admin_ether_addr (const struct rte_ether_addr *ea) +static inline int rte_is_local_admin_ether_addr (const struct rte_ether_addr *ea) {return (ea->addr_bytes[0 ] ÐER_LOCAL_ADMIN_ADDR ) !=0 ; }
@@ -193,9 +193,9 @@ static inline int is_local_admin_ether_addr(const struct rte_ether_addr *ea)* True (1) if the given ethernet address is valid; * false (0) otherwise. */ -static inline int is_valid_assigned_ether_addr (const struct rte_ether_addr *ea) +static inline int rte_is_valid_assigned_ether_addr (const struct rte_ether_addr *ea) { -return is_unicast_ether_addr (ea) && (!is_zero_ether_addr (ea)); +return rte_is_unicast_ether_addr (ea) && (!rte_is_zero_ether_addr (ea)); }/**
@@ -204,7 +204,7 @@ static inline int is_valid_assigned_ether_addr(const struct rte_ether_addr *ea)* @param addr * A pointer to Ethernet address. */ -static inline void eth_random_addr (uint8_t *addr) +static inline void rte_eth_random_addr (uint8_t *addr) {uint64_t rand =rte_rand ();uint8_t *p = (uint8_t *)&rand;
@@ -222,7 +222,7 @@ static inline void eth_random_addr(uint8_t *addr)* @param ea_to * A pointer to a ether_addr structure where to copy the Ethernet address. */ -static inline void ether_addr_copy (const struct rte_ether_addr *ea_from, +static inline void rte_ether_addr_copy (const struct rte_ether_addr *ea_from,struct rte_ether_addr *ea_to) {#ifdef __INTEL_COMPILER
@@ -252,7 +252,7 @@ static inline void ether_addr_copy(const struct rte_ether_addr *ea_from,* A pointer to a ether_addr structure. */ static inline void -ether_format_addr (char *buf,uint16_t size, +rte_ether_format_addr (char *buf,uint16_t size,const struct rte_ether_addr *eth_addr) { snprintf(buf, size, "%02X:%02X:%02X:%02X:%02X:%02X",
lib/librte_pipeline/rte_table_action.c +20 -20
@@ -615,8 +615,8 @@ encap_ether_apply(void *data, ETHER_TYPE_IPv6;/* Ethernet */ -ether_addr_copy (&p->ether.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->ether.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->ether.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->ether.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ethertype);return 0 ;
@@ -633,8 +633,8 @@ encap_vlan_apply(void *data, ETHER_TYPE_IPv6;/* Ethernet */ -ether_addr_copy (&p->vlan.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->vlan.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->vlan.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->vlan.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_VLAN );/* VLAN */
@@ -657,8 +657,8 @@ encap_qinq_apply(void *data, ETHER_TYPE_IPv6;/* Ethernet */ -ether_addr_copy (&p->qinq.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->qinq.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->qinq.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->qinq.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_QINQ );/* SVLAN */
@@ -683,8 +683,8 @@ encap_qinq_pppoe_apply(void *data,struct encap_qinq_pppoe_data *d = data;/* Ethernet */ -ether_addr_copy (&p->qinq.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->qinq.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->qinq.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->qinq.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_VLAN );/* SVLAN */
@@ -719,8 +719,8 @@ encap_mpls_apply(void *data,uint32_t i;/* Ethernet */ -ether_addr_copy (&p->mpls.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->mpls.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->mpls.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->mpls.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ethertype);/* MPLS */
@@ -746,8 +746,8 @@ encap_pppoe_apply(void *data,struct encap_pppoe_data *d = data;/* Ethernet */ -ether_addr_copy (&p->pppoe.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->pppoe.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->pppoe.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->pppoe.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_PPPOE_SESSION );/* PPPoE and PPP*/
@@ -776,8 +776,8 @@ encap_vxlan_apply(void *data,struct encap_vxlan_ipv4_vlan_data *d = data;/* Ethernet */ -ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_VLAN );/* VLAN */
@@ -815,8 +815,8 @@ encap_vxlan_apply(void *data,struct encap_vxlan_ipv4_data *d = data;/* Ethernet */ -ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_IPv4);/* IPv4*/
@@ -850,8 +850,8 @@ encap_vxlan_apply(void *data,struct encap_vxlan_ipv6_vlan_data *d = data;/* Ethernet */ -ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_VLAN );/* VLAN */
@@ -889,8 +889,8 @@ encap_vxlan_apply(void *data,struct encap_vxlan_ipv6_data *d = data;/* Ethernet */ -ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); -ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); +rte_ether_addr_copy (&p->vxlan.ether.da, &d->ether.d_addr); +rte_ether_addr_copy (&p->vxlan.ether.sa, &d->ether.s_addr); d->ether.ether_type =rte_htons (ETHER_TYPE_IPv6);/* IPv6*/
Signature · 1 line
2.11.0
RFC v2 5/14 net: add rte prefix to ether defines
In reply to Olivier MatzAdd 'RTE_' prefix to defines:
- rename ETHER_ADDR_LEN as RTE_ETHER_ADDR_LEN.
- rename ETHER_TYPE_LEN as RTE_ETHER_TYPE_LEN.
- rename ETHER_CRC_LEN as RTE_ETHER_CRC_LEN.
- rename ETHER_HDR_LEN as RTE_ETHER_HDR_LEN.
- rename ETHER_MIN_LEN as RTE_ETHER_MIN_LEN.
- rename ETHER_MAX_LEN as RTE_ETHER_MAX_LEN.
- rename ETHER_MTU as RTE_ETHER_MTU.
- rename ETHER_MAX_VLAN_FRAME_LEN as RTE_ETHER_MAX_VLAN_FRAME_LEN.
- rename ETHER_MAX_VLAN_ID as RTE_ETHER_MAX_VLAN_ID.
- rename ETHER_MAX_JUMBO_FRAME_LEN as RTE_ETHER_MAX_JUMBO_FRAME_LEN.
- rename ETHER_MIN_MTU as RTE_ETHER_MIN_MTU.
- rename ETHER_LOCAL_ADMIN_ADDR as RTE_ETHER_LOCAL_ADMIN_ADDR.
- rename ETHER_GROUP_ADDR as RTE_ETHER_GROUP_ADDR.
- rename ETHER_TYPE_IPv4 as RTE_ETHER_TYPE_IPv4.
- rename ETHER_TYPE_IPv6 as RTE_ETHER_TYPE_IPv6.
- rename ETHER_TYPE_ARP as RTE_ETHER_TYPE_ARP.
- rename ETHER_TYPE_VLAN as RTE_ETHER_TYPE_VLAN.
- rename ETHER_TYPE_RARP as RTE_ETHER_TYPE_RARP.
- rename ETHER_TYPE_QINQ as RTE_ETHER_TYPE_QINQ.
- rename ETHER_TYPE_ETAG as RTE_ETHER_TYPE_ETAG.
- rename ETHER_TYPE_1588 as RTE_ETHER_TYPE_1588.
- rename ETHER_TYPE_SLOW as RTE_ETHER_TYPE_SLOW.
- rename ETHER_TYPE_TEB as RTE_ETHER_TYPE_TEB.
- rename ETHER_TYPE_LLDP as RTE_ETHER_TYPE_LLDP.
- rename ETHER_TYPE_MPLS as RTE_ETHER_TYPE_MPLS.
- rename ETHER_TYPE_MPLSM as RTE_ETHER_TYPE_MPLSM.
- rename ETHER_VXLAN_HLEN as RTE_ETHER_VXLAN_HLEN.
- rename ETHER_ADDR_FMT_SIZE as RTE_ETHER_ADDR_FMT_SIZE.
- rename VXLAN_GPE_TYPE_IPV4 as RTE_VXLAN_GPE_TYPE_IPV4.
- rename VXLAN_GPE_TYPE_IPV6 as RTE_VXLAN_GPE_TYPE_IPV6.
- rename VXLAN_GPE_TYPE_ETH as RTE_VXLAN_GPE_TYPE_ETH.
- rename VXLAN_GPE_TYPE_NSH as RTE_VXLAN_GPE_TYPE_NSH.
- rename VXLAN_GPE_TYPE_MPLS as RTE_VXLAN_GPE_TYPE_MPLS.
- rename VXLAN_GPE_TYPE_GBP as RTE_VXLAN_GPE_TYPE_GBP.
- rename VXLAN_GPE_TYPE_VBNG as RTE_VXLAN_GPE_TYPE_VBNG.
- rename ETHER_VXLAN_GPE_HLEN as RTE_ETHER_VXLAN_GPE_HLEN.
Do not update the command line library to avoid adding a dependency to librte_net.
--- app/test-eventdev/test_perf_common.c | 2 +- app/test-eventdev/test_pipeline_common.c | 2 +- app/test-pmd/cmdline.c | 34 +++---- app/test-pmd/cmdline_flow.c | 80 +++++++-------- app/test-pmd/config.c | 4 +- app/test-pmd/csumonly.c | 46 ++++----- app/test-pmd/flowgen.c | 2 +- app/test-pmd/icmpecho.c | 12 +-- app/test-pmd/ieee1588fwd.c | 4 +- app/test-pmd/parameters.c | 6 +- app/test-pmd/testpmd.c | 10 +- app/test-pmd/testpmd.h | 20 ++-- app/test-pmd/txonly.c | 2 +- app/test-pmd/util.c | 4 +- app/test/packet_burst_generator.c | 14 +-- app/test/test_cmdline_etheraddr.c | 2 +- app/test/test_flow_classify.c | 6 +- app/test/test_link_bonding.c | 90 ++++++++--------- app/test/test_link_bonding_mode4.c | 28 +++--- app/test/test_link_bonding_rssconf.c | 4 +- app/test/test_pmd_perf.c | 8 +- app/test/test_sched.c | 2 +- app/test/virtual_pmd.c | 2 +- doc/guides/nics/kni.rst | 2 +- doc/guides/prog_guide/rte_flow.rst | 4 +- doc/guides/sample_app_ug/flow_classify.rst | 2 +- doc/guides/sample_app_ug/ipv4_multicast.rst | 2 +- doc/guides/sample_app_ug/skeleton.rst | 2 +- drivers/bus/dpaa/base/fman/fman.c | 2 +- drivers/bus/dpaa/base/fman/fman_hw.c | 2 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/ark/ark_ethdev.c | 4 +- drivers/net/atlantic/atl_ethdev.c | 6 +- drivers/net/avp/avp_ethdev.c | 8 +- drivers/net/avp/rte_avp_common.h | 2 +- drivers/net/axgbe/axgbe_dev.c | 4 +- drivers/net/axgbe/axgbe_ethdev.c | 4 +- drivers/net/axgbe/axgbe_ethdev.h | 2 +- drivers/net/axgbe/axgbe_rxtx.c | 2 +- drivers/net/bnx2x/bnx2x.c | 4 +- drivers/net/bnx2x/ecore_sp.h | 2 +- drivers/net/bnxt/bnxt.h | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 64 ++++++------ drivers/net/bnxt/bnxt_filter.c | 4 +- drivers/net/bnxt/bnxt_filter.h | 8 +- drivers/net/bnxt/bnxt_flow.c | 14 +-- drivers/net/bnxt/bnxt_hwrm.c | 34 +++---- drivers/net/bnxt/bnxt_ring.c | 8 +- drivers/net/bnxt/bnxt_rxq.c | 2 +- drivers/net/bnxt/bnxt_rxr.c | 2 +- drivers/net/bnxt/bnxt_vnic.c | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 8 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 2 +- drivers/net/bonding/rte_eth_bond_alb.c | 8 +- drivers/net/bonding/rte_eth_bond_pmd.c | 40 ++++---- drivers/net/cxgbe/base/adapter.h | 4 +- drivers/net/cxgbe/base/t4_hw.c | 8 +- drivers/net/cxgbe/cxgbe.h | 4 +- drivers/net/cxgbe/cxgbe_ethdev.c | 12 +-- drivers/net/cxgbe/cxgbe_filter.h | 2 +- drivers/net/cxgbe/cxgbe_flow.c | 6 +- drivers/net/cxgbe/cxgbe_main.c | 4 +- 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 | 8 +- drivers/net/dpaa/dpaa_ethdev.c | 14 +-- drivers/net/dpaa/dpaa_rxtx.c | 8 +- drivers/net/dpaa2/dpaa2_ethdev.c | 10 +- drivers/net/e1000/e1000_ethdev.h | 4 +- drivers/net/e1000/em_ethdev.c | 20 ++-- drivers/net/e1000/em_rxtx.c | 16 +-- drivers/net/e1000/igb_ethdev.c | 42 ++++---- drivers/net/e1000/igb_flow.c | 4 +- drivers/net/e1000/igb_pf.c | 10 +- drivers/net/e1000/igb_rxtx.c | 12 +-- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enetc/base/enetc_hw.h | 4 +- drivers/net/enetc/enetc_ethdev.c | 4 +- drivers/net/enic/enic.h | 2 +- drivers/net/enic/enic_ethdev.c | 8 +- drivers/net/enic/enic_flow.c | 14 +-- drivers/net/enic/enic_res.c | 4 +- drivers/net/failsafe/failsafe_args.c | 2 +- drivers/net/failsafe/failsafe_ether.c | 4 +- drivers/net/fm10k/fm10k.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 4 +- drivers/net/i40e/i40e_ethdev.c | 52 +++++----- drivers/net/i40e/i40e_ethdev.h | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 22 ++--- drivers/net/i40e/i40e_fdir.c | 14 +-- drivers/net/i40e/i40e_flow.c | 26 ++--- drivers/net/i40e/i40e_pf.c | 2 +- drivers/net/i40e/i40e_rxtx.c | 22 ++--- drivers/net/i40e/rte_pmd_i40e.c | 6 +- drivers/net/iavf/iavf.h | 2 +- drivers/net/iavf/iavf_ethdev.c | 20 ++-- drivers/net/iavf/iavf_rxtx.c | 8 +- drivers/net/ice/ice_ethdev.c | 24 ++--- drivers/net/ice/ice_rxtx.c | 22 ++--- drivers/net/ixgbe/ixgbe_ethdev.c | 44 ++++----- drivers/net/ixgbe/ixgbe_ethdev.h | 4 +- drivers/net/ixgbe/ixgbe_flow.c | 14 +-- drivers/net/ixgbe/ixgbe_pf.c | 10 +- drivers/net/ixgbe/ixgbe_rxtx.c | 6 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 6 +- drivers/net/kni/rte_eth_kni.c | 2 +- drivers/net/liquidio/lio_ethdev.c | 20 ++-- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/mlx4/mlx4.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 4 +- drivers/net/mlx4/mlx4_flow.c | 8 +- drivers/net/mlx4/mlx4_rxtx.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 12 +-- drivers/net/mlx5/mlx5_flow_tcf.c | 20 ++-- drivers/net/mlx5/mlx5_flow_verbs.c | 10 +- drivers/net/mlx5/mlx5_mac.c | 4 +- drivers/net/mlx5/mlx5_nl.c | 8 +- drivers/net/mlx5/mlx5_rxtx.c | 6 +- drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 8 +- drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 10 +- drivers/net/mlx5/mlx5_trigger.c | 2 +- drivers/net/mvneta/mvneta_ethdev.c | 12 +-- drivers/net/mvneta/mvneta_ethdev.h | 2 +- drivers/net/mvpp2/mrvl_ethdev.c | 12 +-- drivers/net/mvpp2/mrvl_ethdev.h | 2 +- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/netvsc/hn_nvs.c | 2 +- drivers/net/netvsc/hn_rndis.c | 2 +- drivers/net/netvsc/hn_rxtx.c | 4 +- drivers/net/nfp/nfp_net.c | 10 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 6 +- drivers/net/octeontx/octeontx_ethdev.h | 2 +- drivers/net/pcap/rte_eth_pcap.c | 18 ++-- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/qede/base/ecore_dev.c | 4 +- drivers/net/qede/qede_ethdev.c | 18 ++-- drivers/net/qede/qede_filter.c | 22 ++--- drivers/net/qede/qede_if.h | 2 +- drivers/net/qede/qede_main.c | 6 +- drivers/net/qede/qede_rxtx.c | 6 +- drivers/net/qede/qede_rxtx.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 4 +- drivers/net/sfc/sfc_flow.c | 2 +- drivers/net/softnic/parser.c | 6 +- drivers/net/tap/rte_eth_tap.c | 22 ++--- drivers/net/tap/tap_flow.c | 8 +- drivers/net/thunderx/base/nicvf_plat.h | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 12 +-- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/virtio/virtio_ethdev.c | 46 ++++----- drivers/net/virtio/virtio_pci.h | 4 +- drivers/net/virtio/virtio_rxtx.c | 10 +- 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 | 4 +- drivers/net/vmxnet3/vmxnet3_ethdev.h | 2 +- examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 22 ++--- examples/distributor/main.c | 2 +- examples/ethtool/ethtool-app/ethapp.c | 4 +- examples/eventdev_pipeline/main.c | 2 +- examples/flow_classify/flow_classify.c | 2 +- examples/flow_filtering/main.c | 4 +- examples/ip_fragmentation/main.c | 18 ++-- examples/ip_pipeline/kni.c | 2 +- examples/ip_pipeline/parser.c | 6 +- examples/ip_reassembly/main.c | 8 +- examples/ipsec-secgw/ipsec-secgw.c | 24 ++--- examples/ipv4_multicast/main.c | 6 +- examples/kni/main.c | 6 +- examples/l2fwd-cat/l2fwd-cat.c | 2 +- examples/l2fwd-crypto/main.c | 4 +- examples/l3fwd-acl/main.c | 8 +- examples/l3fwd-power/main.c | 12 +-- examples/l3fwd-vf/main.c | 6 +- examples/l3fwd/l3fwd_em.c | 4 +- examples/l3fwd/l3fwd_lpm.c | 4 +- examples/l3fwd/main.c | 10 +- examples/performance-thread/l3fwd-thread/main.c | 14 +-- examples/ptpclient/ptpclient.c | 2 +- examples/qos_meter/main.c | 2 +- examples/qos_sched/init.c | 2 +- examples/rxtx_callbacks/main.c | 2 +- examples/skeleton/basicfwd.c | 2 +- examples/tep_termination/vxlan.c | 20 ++-- examples/tep_termination/vxlan_setup.c | 6 +- examples/vhost/main.c | 6 +- examples/vm_power_manager/channel_monitor.c | 6 +- examples/vm_power_manager/main.c | 2 +- lib/librte_ethdev/rte_ethdev.c | 18 ++-- lib/librte_ethdev/rte_ethdev.h | 2 +- lib/librte_ethdev/rte_flow.h | 6 +- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 10 +- lib/librte_kni/rte_kni.c | 2 +- lib/librte_kni/rte_kni.h | 2 +- lib/librte_net/rte_arp.c | 8 +- lib/librte_net/rte_ether.h | 114 +++++++++++----------- lib/librte_net/rte_net.c | 30 +++--- lib/librte_pipeline/rte_table_action.c | 34 +++---- lib/librte_port/rte_port_source_sink.c | 6 +- lib/librte_vhost/virtio_net.c | 6 +- 210 files changed, 1040 insertions(+), 1040 deletions(-)
app/test-eventdev/test_perf_common.c +1 -1
@@ -658,7 +658,7 @@ perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)struct rte_eth_conf port_conf = { .rxmode = { .mq_mode =ETH_MQ_RX_RSS , - .max_rx_pkt_len =ETHER_MAX_LEN , + .max_rx_pkt_len =RTE_ETHER_MAX_LEN , .split_hdr_size =0 , }, .rx_adv_conf = {
app/test-eventdev/test_pipeline_common.c +1 -1
@@ -165,7 +165,7 @@ pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)struct rte_eth_conf port_conf = { .rxmode = { .mq_mode =ETH_MQ_RX_RSS , - .max_rx_pkt_len =ETHER_MAX_LEN , + .max_rx_pkt_len =RTE_ETHER_MAX_LEN , }, .rx_adv_conf = { .rss_conf = {
app/test-pmd/cmdline.c +17 -17
@@ -1832,16 +1832,16 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,uint64_t rx_offloads = port->dev_conf.rxmode.offloads;if (!strcmp (res->name,"max-pkt-len" )) { -if (res->value <ETHER_MIN_LEN ) { +if (res->value <RTE_ETHER_MIN_LEN ) {printf ("max-pkt-len can not be less than %d\n" , -ETHER_MIN_LEN ); +RTE_ETHER_MIN_LEN );return ; }if (res->value == port->dev_conf.rxmode.max_rx_pkt_len)return ; port->dev_conf.rxmode.max_rx_pkt_len = res->value; -if (res->value >ETHER_MAX_LEN ) +if (res->value >RTE_ETHER_MAX_LEN ) rx_offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ;else rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME ;
@@ -1903,8 +1903,8 @@ cmd_config_mtu_parsed(void *parsed_result, {struct cmd_config_mtu_result *res = parsed_result; -if (res->value <ETHER_MIN_LEN ) { -printf ("mtu cannot be less than %d\n" ,ETHER_MIN_LEN ); +if (res->value <RTE_ETHER_MIN_LEN ) { +printf ("mtu cannot be less than %d\n" ,RTE_ETHER_MIN_LEN );return ; }port_mtu_set (res->port_id, res->value);
@@ -8143,7 +8143,7 @@ cmd_set_vf_macvlan_parsed(void *parsed_result,memset (&filter,0 ,sizeof (struct rte_eth_mac_filter )); -rte_memcpy (&filter.mac_addr, &res->address,ETHER_ADDR_LEN ); +rte_memcpy (&filter.mac_addr, &res->address,RTE_ETHER_ADDR_LEN );/* set VF MAC filter */ filter.is_vf =1 ;
@@ -9117,7 +9117,7 @@ cmd_set_mirror_mask_parsed(void *parsed_result,return ;for (i =0 ; i < nb_item; i++) { -if (vlan_list[i] >ETHER_MAX_VLAN_ID ) { +if (vlan_list[i] >RTE_ETHER_MAX_VLAN_ID ) {printf ("Invalid vlan_id: must be < 4096\n" );return ; }
@@ -15208,9 +15208,9 @@ static void cmd_set_vxlan_parsed(void *parsed_result,if (vxlan_encap_conf.select_vlan) vxlan_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci);rte_memcpy (vxlan_encap_conf.eth_src, res->eth_src.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );rte_memcpy (vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); }cmdline_parse_inst_t cmd_set_vxlan = {
@@ -15399,9 +15399,9 @@ static void cmd_set_nvgre_parsed(void *parsed_result,if (nvgre_encap_conf.select_vlan) nvgre_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci);rte_memcpy (nvgre_encap_conf.eth_src, res->eth_src.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );rte_memcpy (nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); }cmdline_parse_inst_t cmd_set_nvgre = {
@@ -15516,9 +15516,9 @@ static void cmd_set_l2_encap_parsed(void *parsed_result,if (l2_encap_conf.select_vlan) l2_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci);rte_memcpy (l2_encap_conf.eth_src, res->eth_src.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );rte_memcpy (l2_encap_conf.eth_dst, res->eth_dst.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); }cmdline_parse_inst_t cmd_set_l2_encap = {
@@ -15708,9 +15708,9 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,if (mplsogre_encap_conf.select_vlan) mplsogre_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci);rte_memcpy (mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );rte_memcpy (mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); }cmdline_parse_inst_t cmd_set_mplsogre_encap = {
@@ -15946,9 +15946,9 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,if (mplsoudp_encap_conf.select_vlan) mplsoudp_encap_conf.vlan_tci =rte_cpu_to_be_16 (res->tci);rte_memcpy (mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );rte_memcpy (mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); }cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
app/test-pmd/cmdline_flow.c +40 -40
175 lines not on this page · raw message
app/test-pmd/config.c +2 -2
@@ -110,8 +110,8 @@ const struct rss_type_info rss_type_table[] = {static void print_ethaddr (const char *name,struct rte_ether_addr *eth_addr) { -char buf[ETHER_ADDR_FMT_SIZE ]; -rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +char buf[RTE_ETHER_ADDR_FMT_SIZE ]; +rte_ether_format_addr (buf,RTE_ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
app/test-pmd/csumonly.c +23 -23
158 lines not on this page · raw message
app/test-pmd/flowgen.c +1 -1
@@ -173,7 +173,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);rte_ether_addr_copy (&cfg_ether_dst, ð_hdr->d_addr);rte_ether_addr_copy (&cfg_ether_src, ð_hdr->s_addr); - eth_hdr->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_IPv4); + eth_hdr->ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4);/* Initialize IP header. */ ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 );
app/test-pmd/icmpecho.c +6 -6
@@ -223,9 +223,9 @@ ipv4_addr_to_dot(uint32_t be_ipv4_addr, char *buf)static void ether_addr_dump (const char *what,const struct rte_ether_addr *ea) { -char buf[ETHER_ADDR_FMT_SIZE ]; +char buf[RTE_ETHER_ADDR_FMT_SIZE ]; -rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , ea); +rte_ether_format_addr (buf,RTE_ETHER_ADDR_FMT_SIZE , ea);if (what)printf ("%s" , what);printf ("%s" , buf);
@@ -330,7 +330,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)ether_addr_dump (" ETH: src=" , ð_h->s_addr);ether_addr_dump (" dst=" , ð_h->d_addr); } -if (eth_type ==ETHER_TYPE_VLAN ) { +if (eth_type ==RTE_ETHER_TYPE_VLAN ) { vlan_h = (struct rte_vlan_hdr *) ((char *)eth_h +sizeof (struct rte_ether_hdr )); l2_len +=sizeof (struct rte_vlan_hdr );
@@ -346,7 +346,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) }/* Reply to ARP requests */ -if (eth_type ==ETHER_TYPE_ARP ) { +if (eth_type ==RTE_ETHER_TYPE_ARP ) { arp_h = (struct rte_arp_hdr *) ((char *)eth_h + l2_len); arp_opcode =RTE_BE_TO_CPU_16 (arp_h->arp_opcode); arp_protocol =RTE_BE_TO_CPU_16 (arp_h->arp_protocol);
@@ -360,7 +360,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) }if ((RTE_BE_TO_CPU_16 (arp_h->arp_hardware) !=RTE_ARP_HRD_ETHER ) || - (arp_protocol != ETHER_TYPE_IPv4) || + (arp_protocol != RTE_ETHER_TYPE_IPv4) || (arp_h->arp_hlen !=6 ) || (arp_h->arp_plen !=4 ) ) {
@@ -409,7 +409,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)continue ; } -if (eth_type != ETHER_TYPE_IPv4) { +if (eth_type != RTE_ETHER_TYPE_IPv4) {rte_pktmbuf_free (pkt);continue ; }
app/test-pmd/ieee1588fwd.c +2 -2
@@ -115,7 +115,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) eth_type =rte_be_to_cpu_16 (eth_hdr->ether_type);if (! (mb->ol_flags &PKT_RX_IEEE1588_PTP )) { -if (eth_type ==ETHER_TYPE_1588 ) { +if (eth_type ==RTE_ETHER_TYPE_1588 ) {printf ("Port %u Received PTP packet not filtered" " by hardware\n" , fs->rx_port);
@@ -128,7 +128,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)rte_pktmbuf_free (mb);return ; } -if (eth_type !=ETHER_TYPE_1588 ) { +if (eth_type !=RTE_ETHER_TYPE_1588 ) {printf ("Port %u Received NON PTP packet incorrectly" " detected by hardware\n" , fs->rx_port);
app/test-pmd/parameters.c +3 -3
@@ -823,15 +823,15 @@ launch_args_parse(int argc, char** argv) }if (!strcmp (lgopts[opt_idx].name,"max-pkt-len" )) { n =atoi (optarg); -if (n >=ETHER_MIN_LEN ) { +if (n >=RTE_ETHER_MIN_LEN ) { rx_mode.max_rx_pkt_len = (uint32_t ) n; -if (n >ETHER_MAX_LEN ) +if (n >RTE_ETHER_MAX_LEN ) rx_offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; }else rte_exit (EXIT_FAILURE ,"Invalid max-pkt-len=%d - should be > %d\n" , - n,ETHER_MIN_LEN ); + n,RTE_ETHER_MIN_LEN ); }if (!strcmp (lgopts[opt_idx].name,"pkt-filter-mode" )) {if (!strcmp (optarg,"signature" ))
app/test-pmd/testpmd.c +5 -5
@@ -410,7 +410,7 @@ lcoreid_t latencystats_lcore_id = -1;* Ethernet device configuration. */ struct rte_eth_rxmode rx_mode = { - .max_rx_pkt_len =ETHER_MAX_LEN ,/**< Default maximum frame length. */ + .max_rx_pkt_len =RTE_ETHER_MAX_LEN ,/**< Default maximum frame length. */ };struct rte_eth_txmode tx_mode = {
@@ -523,7 +523,7 @@ static void dev_event_callback(const char *device_name,static int all_ports_started (void );struct gso_status gso_ports[RTE_MAX_ETHPORTS ]; -uint16_t gso_max_segment_size =ETHER_MAX_LEN -ETHER_CRC_LEN ; +uint16_t gso_max_segment_size =RTE_ETHER_MAX_LEN -RTE_ETHER_CRC_LEN ;/* * Helper function to check if socket is already discovered.
@@ -579,7 +579,7 @@ set_def_peer_eth_addrs(void)portid_t i;for (i =0 ; i <RTE_MAX_ETHPORTS ; i++) { - peer_eth_addrs[i].addr_bytes[0 ] =ETHER_LOCAL_ADMIN_ADDR ; + peer_eth_addrs[i].addr_bytes[0 ] =RTE_ETHER_LOCAL_ADMIN_ADDR ; peer_eth_addrs[i].addr_bytes[5 ] = i; } }
@@ -1158,8 +1158,8 @@ init_config(void) fwd_lcores[lc_id]->gso_ctx.direct_pool = mbp; fwd_lcores[lc_id]->gso_ctx.indirect_pool = mbp; fwd_lcores[lc_id]->gso_ctx.gso_types = gso_types; - fwd_lcores[lc_id]->gso_ctx.gso_size =ETHER_MAX_LEN - -ETHER_CRC_LEN ; + fwd_lcores[lc_id]->gso_ctx.gso_size =RTE_ETHER_MAX_LEN - +RTE_ETHER_CRC_LEN ; fwd_lcores[lc_id]->gso_ctx.flag =0 ; }
app/test-pmd/testpmd.h +10 -10
@@ -493,8 +493,8 @@ struct vxlan_encap_conf {rte_be16_t vlan_tci;uint8_t ip_tos;uint8_t ip_ttl; -uint8_t eth_src[ETHER_ADDR_LEN ]; -uint8_t eth_dst[ETHER_ADDR_LEN ]; +uint8_t eth_src[RTE_ETHER_ADDR_LEN ]; +uint8_t eth_dst[RTE_ETHER_ADDR_LEN ]; };struct vxlan_encap_conf vxlan_encap_conf;
@@ -508,8 +508,8 @@ struct nvgre_encap_conf {uint8_t ipv6_src[16 ];uint8_t ipv6_dst[16 ];rte_be16_t vlan_tci; -uint8_t eth_src[ETHER_ADDR_LEN ]; -uint8_t eth_dst[ETHER_ADDR_LEN ]; +uint8_t eth_src[RTE_ETHER_ADDR_LEN ]; +uint8_t eth_dst[RTE_ETHER_ADDR_LEN ]; };struct nvgre_encap_conf nvgre_encap_conf;
@@ -518,8 +518,8 @@ struct l2_encap_conf { uint32_t select_ipv4:1; uint32_t select_vlan:1;rte_be16_t vlan_tci; -uint8_t eth_src[ETHER_ADDR_LEN ]; -uint8_t eth_dst[ETHER_ADDR_LEN ]; +uint8_t eth_src[RTE_ETHER_ADDR_LEN ]; +uint8_t eth_dst[RTE_ETHER_ADDR_LEN ]; };struct l2_encap_conf l2_encap_conf;
@@ -539,8 +539,8 @@ struct mplsogre_encap_conf {uint8_t ipv6_src[16 ];uint8_t ipv6_dst[16 ];rte_be16_t vlan_tci; -uint8_t eth_src[ETHER_ADDR_LEN ]; -uint8_t eth_dst[ETHER_ADDR_LEN ]; +uint8_t eth_src[RTE_ETHER_ADDR_LEN ]; +uint8_t eth_dst[RTE_ETHER_ADDR_LEN ]; };struct mplsogre_encap_conf mplsogre_encap_conf;
@@ -563,8 +563,8 @@ struct mplsoudp_encap_conf {uint8_t ipv6_src[16 ];uint8_t ipv6_dst[16 ];rte_be16_t vlan_tci; -uint8_t eth_src[ETHER_ADDR_LEN ]; -uint8_t eth_dst[ETHER_ADDR_LEN ]; +uint8_t eth_src[RTE_ETHER_ADDR_LEN ]; +uint8_t eth_dst[RTE_ETHER_ADDR_LEN ]; };struct mplsoudp_encap_conf mplsoudp_encap_conf;
app/test-pmd/txonly.c +1 -1
@@ -266,7 +266,7 @@ pkt_burst_transmit(struct fwd_stream *fs)*/ rte_ether_addr_copy (&peer_eth_addrs[fs->peer_addr], ð_hdr.d_addr);rte_ether_addr_copy (&ports[fs->tx_port].eth_addr, ð_hdr.s_addr); - eth_hdr.ether_type =rte_cpu_to_be_16 (ETHER_TYPE_IPv4); + eth_hdr.ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4);if (rte_mempool_get_bulk (mbp, (void **)pkts_burst, nb_pkt_per_burst) ==0 ) {
app/test-pmd/util.c +2 -2
@@ -16,8 +16,8 @@static inline void print_ether_addr (const char *what,struct rte_ether_addr *eth_addr) { -char buf[ETHER_ADDR_FMT_SIZE ]; -rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +char buf[RTE_ETHER_ADDR_FMT_SIZE ]; +rte_ether_format_addr (buf,RTE_ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , what, buf); }
app/test/packet_burst_generator.c +7 -7
@@ -64,7 +64,7 @@ initialize_eth_header(struct rte_ether_hdr *eth_hdr, struct rte_ether_addr *src_struct rte_vlan_hdr *vhdr = (struct rte_vlan_hdr *)((uint8_t *)eth_hdr +sizeof (struct rte_ether_hdr )); - eth_hdr->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_VLAN ); + eth_hdr->ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_VLAN ); vhdr->eth_proto =rte_cpu_to_be_16 (ether_type); vhdr->vlan_tci = van_id;
@@ -79,8 +79,8 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct rte_ether_addr *src_ma uint32_t opcode) { arp_hdr->arp_hardware =rte_cpu_to_be_16 (RTE_ARP_HRD_ETHER ); - arp_hdr->arp_protocol =rte_cpu_to_be_16 (ETHER_TYPE_IPv4); - arp_hdr->arp_hlen =ETHER_ADDR_LEN ; + arp_hdr->arp_protocol =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4); + arp_hdr->arp_hlen =RTE_ETHER_ADDR_LEN ; arp_hdr->arp_plen =sizeof (uint32_t ); arp_hdr->arp_opcode =rte_cpu_to_be_16 (opcode);rte_ether_addr_copy (src_mac, &arp_hdr->arp_data.arp_sha);
@@ -318,10 +318,10 @@ generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, pkt->l2_len = eth_hdr_size;if (ipv4) { - pkt->vlan_tci = ETHER_TYPE_IPv4; + pkt->vlan_tci = RTE_ETHER_TYPE_IPv4; pkt->l3_len =sizeof (struct ipv4_hdr ); }else { - pkt->vlan_tci = ETHER_TYPE_IPv6; + pkt->vlan_tci = RTE_ETHER_TYPE_IPv6; pkt->l3_len =sizeof (struct ipv6_hdr ); }
@@ -433,10 +433,10 @@ generate_packet_burst_proto(struct rte_mempool *mp, pkt->l2_len = eth_hdr_size;if (ipv4) { - pkt->vlan_tci = ETHER_TYPE_IPv4; + pkt->vlan_tci = RTE_ETHER_TYPE_IPv4; pkt->l3_len =sizeof (struct ipv4_hdr ); }else { - pkt->vlan_tci = ETHER_TYPE_IPv6; + pkt->vlan_tci = RTE_ETHER_TYPE_IPv6; pkt->l3_len =sizeof (struct ipv6_hdr ); }
app/test/test_cmdline_etheraddr.c +1 -1
@@ -85,7 +85,7 @@ static int is_addr_different(const struct rte_ether_addr addr, uint64_t num) { int i; -for (i =0 ; i <ETHER_ADDR_LEN ; i++, num >>=8 ) +for (i =0 ; i <RTE_ETHER_ADDR_LEN ; i++, num >>=8 )if (addr.addr_bytes[i] != (num &0xFF )) {return 1 ; }
app/test/test_flow_classify.c +3 -3
@@ -504,7 +504,7 @@ init_ipv4_udp_traffic(struct rte_mempool *mp,printf ("Set up IPv4 UDP traffic\n" );initialize_eth_header (&pkt_eth_hdr, (struct rte_ether_addr *)src_mac, - (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4,0 ,0 ); pktlen = (uint16_t )(sizeof (struct rte_ether_hdr ));printf ("ETH pktlen %u\n" , pktlen);
@@ -541,7 +541,7 @@ init_ipv4_tcp_traffic(struct rte_mempool *mp,printf ("Set up IPv4 TCP traffic\n" );initialize_eth_header (&pkt_eth_hdr, (struct rte_ether_addr *)src_mac, - (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4,0 ,0 ); pktlen = (uint16_t )(sizeof (struct rte_ether_hdr ));printf ("ETH pktlen %u\n" , pktlen);
@@ -578,7 +578,7 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp,printf ("Set up IPv4 SCTP traffic\n" );initialize_eth_header (&pkt_eth_hdr, (struct rte_ether_addr *)src_mac, - (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4,0 ,0 ); pktlen = (uint16_t )(sizeof (struct rte_ether_hdr ));printf ("ETH pktlen %u\n" , pktlen);
app/test/test_link_bonding.c +45 -45
290 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +14 -14
@@ -108,7 +108,7 @@ static struct link_bonding_unittest_params test_params = {static struct rte_eth_conf default_pmd_conf = { .rxmode = { .mq_mode =ETH_MQ_RX_NONE , - .max_rx_pkt_len =ETHER_MAX_LEN , + .max_rx_pkt_len =RTE_ETHER_MAX_LEN , .split_hdr_size =0 , }, .txmode = {
@@ -233,7 +233,7 @@ add_slave(struct slave_conf *slave, uint8_t start)RTE_VERIFY (slave->port_id !=INVALID_PORT_ID );rte_ether_addr_copy (&slave_mac_default, &addr); - addr.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id; + addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = slave->port_id;rte_eth_dev_mac_addr_remove (slave->port_id, &addr);
@@ -299,7 +299,7 @@ lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt)RTE_VERIFY (lacp_pkt !=NULL ); hdr = rte_pktmbuf_mtod(lacp_pkt, struct rte_ether_hdr *); -RTE_VERIFY (hdr->ether_type ==rte_cpu_to_be_16 (ETHER_TYPE_SLOW )); +RTE_VERIFY (hdr->ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_SLOW )); slow_hdr = rte_pktmbuf_mtod(lacp_pkt, struct slow_protocol_frame *);RTE_VERIFY (slow_hdr->slow_protocol.subtype ==SLOW_SUBTYPE_LACP );
@@ -480,7 +480,7 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)/* look for LACP */ hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); -if (hdr->ether_type !=rte_cpu_to_be_16 (ETHER_TYPE_SLOW )) +if (hdr->ether_type !=rte_cpu_to_be_16 (RTE_ETHER_TYPE_SLOW ))return 1 ; slow_hdr = rte_pktmbuf_mtod(pkt, struct slow_protocol_frame *);
@@ -492,7 +492,7 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)/* Change source address to partner address */ rte_ether_addr_copy (&parnter_mac_default, &slow_hdr->eth_hdr.s_addr); - slow_hdr->eth_hdr.s_addr.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id; + slow_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = slave->port_id; lacp = (struct lacpdu *) &slow_hdr->slow_protocol;/* Save last received state */
@@ -926,11 +926,11 @@ test_mode4_rx(void) FOR_EACH_SLAVE(i, slave) {void *pkt =NULL ; - dst_mac.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id; + dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = slave->port_id; retval =generate_and_put_packets (slave, &src_mac, &dst_mac,1 );TEST_ASSERT_SUCCESS (retval,"Failed to generate test packet burst." ); - src_mac.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id; + src_mac.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = slave->port_id; retval =generate_and_put_packets (slave, &src_mac, &bonded_mac,1 );TEST_ASSERT_SUCCESS (retval,"Failed to generate test packet burst." );
@@ -990,7 +990,7 @@ test_mode4_tx_burst(void)/* Prepare burst */ for (pkts_cnt =0 ; pkts_cnt <RTE_DIM (pkts); pkts_cnt++) { - dst_mac.addr_bytes[ETHER_ADDR_LEN -1 ] = pkts_cnt; + dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = pkts_cnt; retval =generate_packets (&bonded_mac, &dst_mac,1 , &pkts[pkts_cnt]);if (retval !=1 )
@@ -1063,7 +1063,7 @@ test_mode4_tx_burst(void)/* Prepare burst. */ for (pkts_cnt =0 ; pkts_cnt <RTE_DIM (pkts); pkts_cnt++) { - dst_mac.addr_bytes[ETHER_ADDR_LEN -1 ] = pkts_cnt; + dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = pkts_cnt; retval =generate_packets (&bonded_mac, &dst_mac,1 , &pkts[pkts_cnt]);if (retval !=1 )
@@ -1134,9 +1134,9 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave)/* Init source address */ rte_ether_addr_copy (&parnter_mac_default, &marker_hdr->eth_hdr.s_addr); - marker_hdr->eth_hdr.s_addr.addr_bytes[ETHER_ADDR_LEN -1 ] = slave->port_id; + marker_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN -1 ] = slave->port_id; - marker_hdr->eth_hdr.ether_type =rte_cpu_to_be_16 (ETHER_TYPE_SLOW ); + marker_hdr->eth_hdr.ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_SLOW ); marker_hdr->marker.subtype =SLOW_SUBTYPE_MARKER ; marker_hdr->marker.version_number =1 ;
@@ -1162,7 +1162,7 @@ test_mode4_marker(void)int retval;uint16_t nb_pkts;uint8_t i, j; -const uint16_t ethtype_slow_be =rte_be_to_cpu_16 (ETHER_TYPE_SLOW ); +const uint16_t ethtype_slow_be =rte_be_to_cpu_16 (RTE_ETHER_TYPE_SLOW ); retval =initialize_bonded_device_with_slaves (TEST_MARKER_SLAVE_COUT ,0 );
@@ -1362,7 +1362,7 @@ test_mode4_ext_ctrl(void)rte_ether_addr_copy (&slow_protocol_mac_addr, &dst_mac);initialize_eth_header (&lacpdu.eth_hdr, &src_mac, &dst_mac, -ETHER_TYPE_SLOW ,0 ,0 ); +RTE_ETHER_TYPE_SLOW ,0 ,0 );for (i =0 ; i <SLAVE_COUNT ; i++) { lacp_tx_buf[i] =rte_pktmbuf_alloc (test_params.mbuf_pool);
@@ -1416,7 +1416,7 @@ test_mode4_ext_lacp(void)rte_ether_addr_copy (&slow_protocol_mac_addr, &dst_mac);initialize_eth_header (&lacpdu.eth_hdr, &src_mac, &dst_mac, -ETHER_TYPE_SLOW ,0 ,0 ); +RTE_ETHER_TYPE_SLOW ,0 ,0 );for (i =0 ; i <SLAVE_COUNT ; i++) { lacp_tx_buf[i] =rte_pktmbuf_alloc (test_params.mbuf_pool);
app/test/test_link_bonding_rssconf.c +2 -2
@@ -81,7 +81,7 @@ static struct link_bonding_rssconf_unittest_params test_params = {static struct rte_eth_conf default_pmd_conf = { .rxmode = { .mq_mode =ETH_MQ_RX_NONE , - .max_rx_pkt_len =ETHER_MAX_LEN , + .max_rx_pkt_len =RTE_ETHER_MAX_LEN , .split_hdr_size =0 , }, .txmode = {
@@ -93,7 +93,7 @@ static struct rte_eth_conf default_pmd_conf = {static struct rte_eth_conf rss_pmd_conf = { .rxmode = { .mq_mode =ETH_MQ_RX_RSS , - .max_rx_pkt_len =ETHER_MAX_LEN , + .max_rx_pkt_len =RTE_ETHER_MAX_LEN , .split_hdr_size =0 , }, .txmode = {
app/test/test_pmd_perf.c +4 -4
@@ -63,7 +63,7 @@ static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];static struct rte_eth_conf port_conf = { .rxmode = { .mq_mode =ETH_MQ_RX_NONE , - .max_rx_pkt_len =ETHER_MAX_LEN , + .max_rx_pkt_len =RTE_ETHER_MAX_LEN , .split_hdr_size =0 , }, .txmode = {
@@ -173,8 +173,8 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)static void print_ethaddr (const char *name,const struct rte_ether_addr *eth_addr) { -char buf[ETHER_ADDR_FMT_SIZE ]; -rte_ether_format_addr (buf,ETHER_ADDR_FMT_SIZE , eth_addr); +char buf[RTE_ETHER_ADDR_FMT_SIZE ]; +rte_ether_format_addr (buf,RTE_ETHER_ADDR_FMT_SIZE , eth_addr);printf ("%s%s" , name, buf); }
@@ -192,7 +192,7 @@ init_traffic(struct rte_mempool *mp,initialize_eth_header (&pkt_eth_hdr, (struct rte_ether_addr *)src_mac, - (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4,0 ,0 ); + (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4,0 ,0 ); pktlen = initialize_ipv4_header(&pkt_ipv4_hdr, IPV4_ADDR(10, 0, 0, 1),
app/test/test_sched.c +1 -1
@@ -91,7 +91,7 @@ prepare_pkt(struct rte_sched_port *port, struct rte_mbuf *mbuf) vlan1->vlan_tci =rte_cpu_to_be_16 (SUBPORT ); vlan2->vlan_tci =rte_cpu_to_be_16 (PIPE ); - eth_hdr->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_IPv4); + eth_hdr->ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4); ip_hdr->dst_addr =IPv4 (0 ,0 ,TC ,QUEUE );
app/test/virtual_pmd.c +1 -1
@@ -566,7 +566,7 @@ virtual_ethdev_create(const char *name, struct rte_ether_addr *mac_addr, eth_dev->data->dev_link.link_speed =ETH_SPEED_NUM_10G ; eth_dev->data->dev_link.link_duplex =ETH_LINK_FULL_DUPLEX ; - eth_dev->data->mac_addrs =rte_zmalloc (name,ETHER_ADDR_LEN ,0 ); + eth_dev->data->mac_addrs =rte_zmalloc (name,RTE_ETHER_ADDR_LEN ,0 );if (eth_dev->data->mac_addrs ==NULL ) goto err;
doc/guides/nics/kni.rst +1 -1
@@ -56,7 +56,7 @@ configuration: Interface name: kni# force bind kernel thread to a core : NO mbuf size: (rte_pktmbuf_data_room_size(pktmbuf_pool) - RTE_PKTMBUF_HEADROOM) - mtu: (conf.mbuf_size - ETHER_HDR_LEN) + mtu: (conf.mbuf_size - RTE_ETHER_HDR_LEN) KNI control path is not supported with the PMD, since there is no physical backend device by default.
doc/guides/prog_guide/rte_flow.rst +2 -2
@@ -863,7 +863,7 @@ Item: ``VLAN`` Matches an 802.1Q/ad VLAN tag. The corresponding standard outer EtherType (TPID) values are -``ETHER_TYPE_VLAN`` or ``ETHER_TYPE_QINQ``. It can be overridden by the +``RTE_ETHER_TYPE_VLAN`` or ``RTE_ETHER_TYPE_QINQ``. It can be overridden by the preceding pattern item. - ``tci``: tag control information.
@@ -940,7 +940,7 @@ Item: ``E_TAG`` Matches an IEEE 802.1BR E-Tag header. The corresponding standard outer EtherType (TPID) value is -``ETHER_TYPE_ETAG``. It can be overridden by the preceding pattern item. +``RTE_ETHER_TYPE_ETAG``. It can be overridden by the preceding pattern item. - ``epcp_edei_in_ecid_b``: E-Tag control information (E-TCI), E-PCP (3b), E-DEI (1b), ingress E-CID base (12b).
doc/guides/sample_app_ug/flow_classify.rst +1 -1
@@ -326,7 +326,7 @@ The Ethernet ports are configured with default settings using the .. code-block:: c static const struct rte_eth_conf port_conf_default = { - .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN } + .rxmode = { .max_rx_pkt_len = RTE_ETHER_MAX_LEN } }; For this example the ports are set up with 1 RX and 1 TX queue using the
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
@@ -229,7 +229,7 @@ The actual packet transmission is done in the mcast_send_pkt() function: rte_ether_addr_copy(dest_addr, ðdr->d_addr); rte_ether_addr_copy(&ports_eth_addr[port], ðdr->s_addr); - ethdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4); + ethdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPv4); /* Put new packet into the output queue */
doc/guides/sample_app_ug/skeleton.rst +1 -1
@@ -160,7 +160,7 @@ The Ethernet ports are configured with default settings using the .. code-block:: c static const struct rte_eth_conf port_conf_default = { - .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN } + .rxmode = { .max_rx_pkt_len = RTE_ETHER_MAX_LEN } }; For this example the ports are set up with 1 RX and 1 TX queue using the
drivers/bus/dpaa/base/fman/fman.c +1 -1
@@ -315,7 +315,7 @@ fman_if_init(const struct device_node *dpa_node) mname); goto err; } -memcpy (&__if->__if.mac_addr, mac_addr,ETHER_ADDR_LEN ); +memcpy (&__if->__if.mac_addr, mac_addr,RTE_ETHER_ADDR_LEN );/* Extract the Tx port (it's the second of the two port handles) * and get its channel ID
drivers/bus/dpaa/base/fman/fman_hw.c +1 -1
@@ -153,7 +153,7 @@ fman_if_add_mac_addr(struct fman_if *p, uint8_t *eth, uint8_t addr_num)void *reg;u32 val; -memcpy (&m->__if.mac_addr, eth,ETHER_ADDR_LEN ); +memcpy (&m->__if.mac_addr, eth,RTE_ETHER_ADDR_LEN );if (addr_num) reg = &((struct memac_regs *)m->ccsr_map)->
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
@@ -796,7 +796,7 @@ get_iface_info(const char *if_name,if (ioctl (sock,SIOCGIFHWADDR , &ifr)) goto error; -rte_memcpy (eth_addr, ifr.ifr_hwaddr.sa_data,ETHER_ADDR_LEN ); +rte_memcpy (eth_addr, ifr.ifr_hwaddr.sa_data,RTE_ETHER_ADDR_LEN );close (sock);return 0 ;
drivers/net/ark/ark_ethdev.c +2 -2
@@ -318,7 +318,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev) dev->dev_ops = &ark_eth_dev_ops; - dev->data->mac_addrs =rte_zmalloc ("ark" ,ETHER_ADDR_LEN ,0 ); + dev->data->mac_addrs =rte_zmalloc ("ark" ,RTE_ETHER_ADDR_LEN ,0 );if (!dev->data->mac_addrs) {PMD_DRV_LOG (ERR , "Failed to allocated memory for storing mac address"
@@ -385,7 +385,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)rte_eth_copy_pci_info (eth_dev, pci_dev); - eth_dev->data->mac_addrs =rte_zmalloc (name,ETHER_ADDR_LEN ,0 ); + eth_dev->data->mac_addrs =rte_zmalloc (name,RTE_ETHER_ADDR_LEN ,0 );if (!eth_dev->data->mac_addrs) {PMD_DRV_LOG (ERR , "Memory allocation for MAC failed!"
drivers/net/atlantic/atl_ethdev.c +3 -3
@@ -366,7 +366,7 @@ eth_atl_dev_init(struct rte_eth_dev *eth_dev)atl_disable_intr (hw);/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc ("atlantic" ,ETHER_ADDR_LEN ,0 ); + eth_dev->data->mac_addrs =rte_zmalloc ("atlantic" ,RTE_ETHER_ADDR_LEN ,0 );if (eth_dev->data->mac_addrs ==NULL ) {PMD_INIT_LOG (ERR ,"MAC Malloc failed" );return -ENOMEM ;
@@ -1264,11 +1264,11 @@ static int atl_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {struct rte_eth_dev_info dev_info; -uint32_t frame_size = mtu +ETHER_HDR_LEN +ETHER_CRC_LEN ; +uint32_t frame_size = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ;atl_dev_info_get (dev, &dev_info); -if ((mtu <ETHER_MIN_MTU ) || (frame_size > dev_info.max_rx_pktlen)) +if ((mtu <RTE_ETHER_MIN_MTU ) || (frame_size > dev_info.max_rx_pktlen))return -EINVAL ;/* update max frame size */
drivers/net/avp/avp_ethdev.c +4 -4
@@ -88,7 +88,7 @@ static void avp_dev_stats_reset(struct rte_eth_dev *dev);#define AVP_MAX_RX_BURST 64#define AVP_MAX_TX_BURST 64#define AVP_MAX_MAC_ADDRS 1 -#define AVP_MIN_RX_BUFSIZE ETHER_MIN_LEN +#define AVP_MIN_RX_BUFSIZE RTE_ETHER_MIN_LEN/*
@@ -867,7 +867,7 @@ avp_dev_create(struct rte_pci_device *pci_dev, avp->host_features = host_info->features;rte_spinlock_init (&avp->lock);memcpy (&avp->ethaddr.addr_bytes[0 ], - host_info->ethaddr,ETHER_ADDR_LEN ); + host_info->ethaddr,RTE_ETHER_ADDR_LEN );/* adjust max values to not exceed our max */ avp->max_tx_queues =RTE_MIN (host_info->max_tx_queues,RTE_AVP_MAX_QUEUES );
@@ -1006,10 +1006,10 @@ eth_avp_dev_init(struct rte_eth_dev *eth_dev) }/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc ("avp_ethdev" ,ETHER_ADDR_LEN ,0 ); + eth_dev->data->mac_addrs =rte_zmalloc ("avp_ethdev" ,RTE_ETHER_ADDR_LEN ,0 );if (eth_dev->data->mac_addrs ==NULL ) {PMD_DRV_LOG (ERR ,"Failed to allocate %d bytes needed to store MAC addresses\n" , -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );return -ENOMEM ; }
drivers/net/avp/rte_avp_common.h +1 -1
@@ -345,7 +345,7 @@ struct rte_avp_device_info {/* Ethernet info */ char ethaddr[ETH_ALEN ];#else -char ethaddr[ETHER_ADDR_LEN ]; +char ethaddr[RTE_ETHER_ADDR_LEN ];#endif uint8_t mode;/**< device mode, i.e guest, host, trace */
drivers/net/axgbe/axgbe_dev.c +2 -2
@@ -10,8 +10,8 @@static inline unsigned int axgbe_get_max_frame (struct axgbe_port *pdata) { -return pdata->eth_dev->data->mtu +ETHER_HDR_LEN + -ETHER_CRC_LEN +VLAN_HLEN ; +return pdata->eth_dev->data->mtu +RTE_ETHER_HDR_LEN + +RTE_ETHER_CRC_LEN +VLAN_HLEN ; }/* query busy bit */
drivers/net/axgbe/axgbe_ethdev.c +2 -2
@@ -626,11 +626,11 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) pdata->mac_addr.addr_bytes[5 ] = (mac_hi >>8 ) &0xff ; eth_dev->data->mac_addrs =rte_zmalloc ("axgbe_mac_addr" , -ETHER_ADDR_LEN ,0 ); +RTE_ETHER_ADDR_LEN ,0 );if (!eth_dev->data->mac_addrs) {PMD_INIT_LOG (ERR ,"Failed to alloc %u bytes needed to store MAC addr tbl" , -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );return -ENOMEM ; }
drivers/net/axgbe/axgbe_ethdev.h +1 -1
@@ -15,7 +15,7 @@#define AXGBE_TX_MAX_BUF_SIZE (0x3fff & ~(64 - 1))#define AXGBE_RX_MAX_BUF_SIZE (0x3fff & ~(64 - 1)) -#define AXGBE_RX_MIN_BUF_SIZE (ETHER_MAX_LEN + VLAN_HLEN) +#define AXGBE_RX_MIN_BUF_SIZE (RTE_ETHER_MAX_LEN + VLAN_HLEN)#define AXGBE_MAX_MAC_ADDRS 1#define AXGBE_RX_BUF_ALIGN 64
drivers/net/axgbe/axgbe_rxtx.c +1 -1
@@ -75,7 +75,7 @@ int axgbe_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, rxq->dma_tail_reg = (volatile uint32_t *)((uint8_t *)rxq->dma_regs +DMA_CH_RDTR_LO );if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_KEEP_CRC ) - rxq->crc_len =ETHER_CRC_LEN ; + rxq->crc_len =RTE_ETHER_CRC_LEN ;else rxq->crc_len =0 ;
drivers/net/bnx2x/bnx2x.c +2 -2
@@ -9745,13 +9745,13 @@ int bnx2x_attach(struct bnx2x_softc *sc)bnx2x_get_phy_info (sc); }else {/* Left mac of VF unfilled, PF should set it for VF */ -memset (sc->link_params.mac_addr,0 ,ETHER_ADDR_LEN ); +memset (sc->link_params.mac_addr,0 ,RTE_ETHER_ADDR_LEN ); } sc->wol =0 ;/* set the default MTU (changed via ifconfig) */ - sc->mtu =ETHER_MTU ; + sc->mtu =RTE_ETHER_MTU ;bnx2x_set_modes_bitmap (sc);
drivers/net/bnx2x/ecore_sp.h +1 -1
@@ -38,7 +38,7 @@ typedef rte_iova_t ecore_dma_addr_t; /* expected to be 64 bit wide */typedef volatile int ecore_atomic_t ; -#define ETH_ALEN ETHER_ADDR_LEN/* 6 */ +#define ETH_ALEN RTE_ETHER_ADDR_LEN/* 6 */ #define ECORE_SWCID_SHIFT 17#define ECORE_SWCID_MASK ((0x1 << ECORE_SWCID_SHIFT) - 1)
drivers/net/bnxt/bnxt.h +2 -2
@@ -309,7 +309,7 @@ struct bnxt {struct bnxt_irq *irq_tbl;#define MAX_NUM_MAC_ADDR 32 -uint8_t mac_addr[ETHER_ADDR_LEN ]; +uint8_t mac_addr[RTE_ETHER_ADDR_LEN ];uint16_t hwrm_cmd_seq;uint16_t kong_cmd_seq;
@@ -326,7 +326,7 @@ struct bnxt {uint8_t tx_cosq_id;uint16_t fw_fid; -uint8_t dflt_mac_addr[ETHER_ADDR_LEN ]; +uint8_t dflt_mac_addr[RTE_ETHER_ADDR_LEN ];uint16_t max_rsscos_ctx;uint16_t max_cp_rings;uint16_t max_tx_rings;
drivers/net/bnxt/bnxt_ethdev.c +32 -32
199 lines not on this page · raw message
drivers/net/bnxt/bnxt_filter.c +2 -2
@@ -39,8 +39,8 @@ struct bnxt_filter_info *bnxt_alloc_filter(struct bnxt *bp) filter->enables =HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR |HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK ;memcpy (filter->l2_addr, bp->eth_dev->data->mac_addrs->addr_bytes, -ETHER_ADDR_LEN ); -memset (filter->l2_addr_mask,0xff ,ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); +memset (filter->l2_addr_mask,0xff ,RTE_ETHER_ADDR_LEN );return filter; }
drivers/net/bnxt/bnxt_filter.h +4 -4
@@ -25,14 +25,14 @@ struct bnxt_filter_info {/* Filter Characteristics */ uint32_t flags;uint32_t enables; -uint8_t l2_addr[ETHER_ADDR_LEN ]; -uint8_t l2_addr_mask[ETHER_ADDR_LEN ]; +uint8_t l2_addr[RTE_ETHER_ADDR_LEN ]; +uint8_t l2_addr_mask[RTE_ETHER_ADDR_LEN ];uint16_t l2_ovlan;uint16_t l2_ovlan_mask;uint16_t l2_ivlan;uint16_t l2_ivlan_mask; -uint8_t t_l2_addr[ETHER_ADDR_LEN ]; -uint8_t t_l2_addr_mask[ETHER_ADDR_LEN ]; +uint8_t t_l2_addr[RTE_ETHER_ADDR_LEN ]; +uint8_t t_l2_addr_mask[RTE_ETHER_ADDR_LEN ];uint16_t t_l2_ovlan;uint16_t t_l2_ovlan_mask;uint16_t t_l2_ivlan;
drivers/net/bnxt/bnxt_flow.c +7 -7
@@ -682,7 +682,7 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, f0 =STAILQ_FIRST (&vnic0->filter);/* This flow has same DST MAC as the port/l2 filter. */ -if (memcmp (f0->l2_addr, nf->dst_macaddr,ETHER_ADDR_LEN ) ==0 ) +if (memcmp (f0->l2_addr, nf->dst_macaddr,RTE_ETHER_ADDR_LEN ) ==0 )return f0;/* This flow needs DST MAC which is not same as port/l2 */
@@ -694,8 +694,8 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf, filter1->flags =HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX ; filter1->enables =HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR |L2_FILTER_ALLOC_INPUT_EN_L2_ADDR_MASK ; -memcpy (filter1->l2_addr, nf->dst_macaddr,ETHER_ADDR_LEN ); -memset (filter1->l2_addr_mask,0xff ,ETHER_ADDR_LEN ); +memcpy (filter1->l2_addr, nf->dst_macaddr,RTE_ETHER_ADDR_LEN ); +memset (filter1->l2_addr_mask,0xff ,RTE_ETHER_ADDR_LEN ); rc =bnxt_hwrm_set_l2_filter (bp, vnic->fw_vnic_id, filter1);if (rc) {
@@ -951,13 +951,13 @@ bnxt_match_filter(struct bnxt *bp, struct bnxt_filter_info *nf) mf->l2_ovlan_mask == nf->l2_ovlan_mask && mf->l2_ivlan == nf->l2_ivlan && mf->l2_ivlan_mask == nf->l2_ivlan_mask && - !memcmp (mf->l2_addr, nf->l2_addr,ETHER_ADDR_LEN ) && + !memcmp (mf->l2_addr, nf->l2_addr,RTE_ETHER_ADDR_LEN ) && !memcmp (mf->l2_addr_mask, nf->l2_addr_mask, -ETHER_ADDR_LEN ) && +RTE_ETHER_ADDR_LEN ) && !memcmp (mf->src_macaddr, nf->src_macaddr, -ETHER_ADDR_LEN ) && +RTE_ETHER_ADDR_LEN ) && !memcmp (mf->dst_macaddr, nf->dst_macaddr, -ETHER_ADDR_LEN ) && +RTE_ETHER_ADDR_LEN ) && !memcmp (mf->src_ipaddr, nf->src_ipaddr,sizeof (nf->src_ipaddr)) && !memcmp(mf->src_ipaddr_mask, nf->src_ipaddr_mask,
drivers/net/bnxt/bnxt_hwrm.c +17 -17
@@ -393,11 +393,11 @@ int bnxt_hwrm_set_l2_filter(struct bnxt *bp,if (enables &HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR )memcpy (req.l2_addr, filter->l2_addr, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );if (enables &HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK )memcpy (req.l2_addr_mask, filter->l2_addr_mask, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );if (enables &HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_OVLAN ) req.l2_ovlan = filter->l2_ovlan;
@@ -571,7 +571,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp) } bp->fw_fid =rte_le_to_cpu_32 (resp->fid); -memcpy (bp->dflt_mac_addr, &resp->mac_address,ETHER_ADDR_LEN ); +memcpy (bp->dflt_mac_addr, &resp->mac_address,RTE_ETHER_ADDR_LEN ); bp->max_rsscos_ctx =rte_le_to_cpu_16 (resp->max_rsscos_ctx); bp->max_cp_rings =rte_le_to_cpu_16 (resp->max_cmpl_rings); bp->max_tx_rings =rte_le_to_cpu_16 (resp->max_tx_rings);
@@ -1329,8 +1329,8 @@ int bnxt_hwrm_vnic_alloc(struct bnxt *bp, struct bnxt_vnic_info *vnic) vnic->rss_rule = (uint16_t )HWRM_NA_SIGNATURE ; vnic->cos_rule = (uint16_t )HWRM_NA_SIGNATURE ; vnic->lb_rule = (uint16_t )HWRM_NA_SIGNATURE ; - vnic->mru = bp->eth_dev->data->mtu +ETHER_HDR_LEN + -ETHER_CRC_LEN +VLAN_TAG_SIZE ; + vnic->mru = bp->eth_dev->data->mtu +RTE_ETHER_HDR_LEN + +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE ;HWRM_PREP (req,VNIC_ALLOC ,BNXT_USE_CHIMP_MB );if (vnic->func_default)
@@ -2516,8 +2516,8 @@ static int bnxt_hwrm_pf_func_cfg(struct bnxt *bp, int tx_rings) HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS); req.flags =rte_cpu_to_le_32 (bp->pf.func_cfg_flags); req.mtu =rte_cpu_to_le_16 (BNXT_MAX_MTU ); - req.mru =rte_cpu_to_le_16 (bp->eth_dev->data->mtu +ETHER_HDR_LEN + -ETHER_CRC_LEN +VLAN_TAG_SIZE * + req.mru =rte_cpu_to_le_16 (bp->eth_dev->data->mtu +RTE_ETHER_HDR_LEN + +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE *BNXT_NUM_VLANS ); req.num_rsscos_ctxs =rte_cpu_to_le_16 (bp->max_rsscos_ctx); req.num_stat_ctxs =rte_cpu_to_le_16 (bp->max_stat_ctx);
@@ -2554,11 +2554,11 @@ static void populate_vf_func_cfg_req(struct bnxt *bp,HWRM_FUNC_CFG_INPUT_ENABLES_NUM_VNICS | HWRM_FUNC_CFG_INPUT_ENABLES_NUM_HW_RING_GRPS); - req->mtu =rte_cpu_to_le_16 (bp->eth_dev->data->mtu +ETHER_HDR_LEN + -ETHER_CRC_LEN +VLAN_TAG_SIZE * + req->mtu =rte_cpu_to_le_16 (bp->eth_dev->data->mtu +RTE_ETHER_HDR_LEN + +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE *BNXT_NUM_VLANS ); - req->mru =rte_cpu_to_le_16 (bp->eth_dev->data->mtu +ETHER_HDR_LEN + -ETHER_CRC_LEN +VLAN_TAG_SIZE * + req->mru =rte_cpu_to_le_16 (bp->eth_dev->data->mtu +RTE_ETHER_HDR_LEN + +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE *BNXT_NUM_VLANS ); req->num_rsscos_ctxs =rte_cpu_to_le_16 (bp->max_rsscos_ctx / (num_vfs +1 ));
@@ -2589,7 +2589,7 @@ static void add_random_mac_if_needed(struct bnxt *bp,rte_eth_random_addr (cfg_req->dflt_mac_addr); bp->pf.vf_info[vf].random_mac = true; }else { -memcpy (cfg_req->dflt_mac_addr, mac.addr_bytes,ETHER_ADDR_LEN ); +memcpy (cfg_req->dflt_mac_addr, mac.addr_bytes,RTE_ETHER_ADDR_LEN ); } }
@@ -3125,7 +3125,7 @@ int bnxt_hwrm_func_qcfg_vf_default_mac(struct bnxt *bp, uint16_t vf,HWRM_CHECK_RESULT (); -memcpy (mac->addr_bytes, resp->mac_address,ETHER_ADDR_LEN ); +memcpy (mac->addr_bytes, resp->mac_address,RTE_ETHER_ADDR_LEN );HWRM_UNLOCK ();
@@ -3696,11 +3696,11 @@ int bnxt_hwrm_set_em_filter(struct bnxt *bp,if (enables &HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_SRC_MACADDR )memcpy (req.src_macaddr, filter->src_macaddr, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );if (enables &HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_DST_MACADDR )memcpy (req.dst_macaddr, filter->dst_macaddr, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );if (enables &HWRM_CFA_EM_FLOW_ALLOC_INPUT_ENABLES_OVLAN_VID ) req.ovlan_vid = filter->l2_ovlan;
@@ -3799,11 +3799,11 @@ int bnxt_hwrm_set_ntuple_filter(struct bnxt *bp,if (enables &HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_SRC_MACADDR )memcpy (req.src_macaddr, filter->src_macaddr, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );//if (enables & //HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_DST_MACADDR) //memcpy(req.dst_macaddr, filter->dst_macaddr, -//ETHER_ADDR_LEN); +//RTE_ETHER_ADDR_LEN); if (enables &HWRM_CFA_NTUPLE_FILTER_ALLOC_INPUT_ENABLES_ETHERTYPE ) req.ethertype =rte_cpu_to_be_16 (filter->ethertype);
drivers/net/bnxt/bnxt_ring.c +4 -4
@@ -344,8 +344,8 @@ int bnxt_alloc_hwrm_rx_ring(struct bnxt *bp, int queue_index) bp->grp_info[queue_index].ag_fw_ring_id = ring->fw_ring_id;B_RX_DB (rxr->ag_doorbell, rxr->ag_prod); - rxq->rx_buf_use_size =BNXT_MAX_MTU +ETHER_HDR_LEN + -ETHER_CRC_LEN + (2 *VLAN_TAG_SIZE ); + rxq->rx_buf_use_size =BNXT_MAX_MTU +RTE_ETHER_HDR_LEN + +RTE_ETHER_CRC_LEN + (2 *VLAN_TAG_SIZE );if (bp->eth_dev->data->rx_queue_state[queue_index] ==RTE_ETH_QUEUE_STATE_STARTED ) {
@@ -452,8 +452,8 @@ int bnxt_alloc_hwrm_rings(struct bnxt *bp) bp->grp_info[i].ag_fw_ring_id = ring->fw_ring_id;B_RX_DB (rxr->ag_doorbell, rxr->ag_prod); - rxq->rx_buf_use_size =BNXT_MAX_MTU +ETHER_HDR_LEN + -ETHER_CRC_LEN + (2 *VLAN_TAG_SIZE ); + rxq->rx_buf_use_size =BNXT_MAX_MTU +RTE_ETHER_HDR_LEN + +RTE_ETHER_CRC_LEN + (2 *VLAN_TAG_SIZE );if (bnxt_init_one_rx_ring (rxq)) {PMD_DRV_LOG (ERR ,"bnxt_init_one_rx_ring failed!\n" );bnxt_rx_queue_release_op (rxq);
drivers/net/bnxt/bnxt_rxq.c +1 -1
@@ -334,7 +334,7 @@ int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, rxq->queue_id = queue_idx; rxq->port_id = eth_dev->data->port_id;if (rx_offloads &DEV_RX_OFFLOAD_KEEP_CRC ) - rxq->crc_len =ETHER_CRC_LEN ; + rxq->crc_len =RTE_ETHER_CRC_LEN ;else rxq->crc_len =0 ;
drivers/net/bnxt/bnxt_rxr.c +1 -1
@@ -640,7 +640,7 @@ int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id)struct bnxt_rx_ring_info *rxr;struct bnxt_ring *ring; - rxq->rx_buf_use_size =BNXT_MAX_MTU +ETHER_HDR_LEN +ETHER_CRC_LEN + + rxq->rx_buf_use_size =BNXT_MAX_MTU +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN + (2 *VLAN_TAG_SIZE ); rxq->rx_buf_size = rxq->rx_buf_use_size +sizeof (struct rte_mbuf );
drivers/net/bnxt/bnxt_vnic.c +1 -1
@@ -116,7 +116,7 @@ int bnxt_alloc_vnic_attributes(struct bnxt *bp)uint32_t entry_length =RTE_CACHE_LINE_ROUNDUP (HW_HASH_INDEX_SIZE *sizeof (*vnic->rss_table) +HW_HASH_KEY_SIZE + -BNXT_MAX_MC_ADDRS *ETHER_ADDR_LEN ); +BNXT_MAX_MC_ADDRS *RTE_ETHER_ADDR_LEN );uint16_t max_vnics;int i;rte_iova_t mz_phys_addr;
drivers/net/bnxt/rte_pmd_bnxt.c +4 -4
@@ -698,7 +698,7 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr, filter->enables == (HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR | HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK) && - memcmp(addr, filter->l2_addr, ETHER_ADDR_LEN) == 0) { + memcmp(addr, filter->l2_addr, RTE_ETHER_ADDR_LEN) == 0) {bnxt_hwrm_clear_l2_filter (bp, filter);break ; }
@@ -711,12 +711,12 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr, filter->flags =HWRM_CFA_L2_FILTER_ALLOC_INPUT_FLAGS_PATH_RX ; filter->enables =HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR |HWRM_CFA_L2_FILTER_ALLOC_INPUT_ENABLES_L2_ADDR_MASK ; -memcpy (filter->l2_addr, addr,ETHER_ADDR_LEN ); -memset (filter->l2_addr_mask,0xff ,ETHER_ADDR_LEN ); +memcpy (filter->l2_addr, addr,RTE_ETHER_ADDR_LEN ); +memset (filter->l2_addr_mask,0xff ,RTE_ETHER_ADDR_LEN );/* Do not add a filter for the default MAC */ if (bnxt_hwrm_func_qcfg_vf_default_mac (bp, vf_id, &dflt_mac) || -memcmp (filter->l2_addr, dflt_mac.addr_bytes,ETHER_ADDR_LEN )) +memcmp (filter->l2_addr, dflt_mac.addr_bytes,RTE_ETHER_ADDR_LEN )) rc =bnxt_hwrm_set_l2_filter (bp, vnic.fw_vnic_id, filter); exit:
drivers/net/bonding/rte_eth_bond_8023ad.c +1 -1
@@ -577,7 +577,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id)/* Source and destination MAC */ rte_ether_addr_copy (&lacp_mac_addr, &hdr->eth_hdr.d_addr);rte_eth_macaddr_get (slave_id, &hdr->eth_hdr.s_addr); - hdr->eth_hdr.ether_type =rte_cpu_to_be_16 (ETHER_TYPE_SLOW ); + hdr->eth_hdr.ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_SLOW ); lacpdu = &hdr->lacpdu;memset (lacpdu,0 ,sizeof (*lacpdu));
drivers/net/bonding/rte_eth_bond_alb.c +4 -4
@@ -205,9 +205,9 @@ bond_mode_alb_arp_upd(struct client_data *client_info,rte_ether_addr_copy (&client_info->app_mac, ð_h->s_addr);rte_ether_addr_copy (&client_info->cli_mac, ð_h->d_addr);if (client_info->vlan_count >0 ) - eth_h->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_VLAN ); + eth_h->ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_VLAN );else - eth_h->ether_type =rte_cpu_to_be_16 (ETHER_TYPE_ARP ); + eth_h->ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP ); arp_h = (struct rte_arp_hdr *)((char *)eth_h +sizeof (struct rte_ether_hdr ) + client_info->vlan_count *sizeof (struct rte_vlan_hdr ));
@@ -221,8 +221,8 @@ bond_mode_alb_arp_upd(struct client_data *client_info, arp_h->arp_data.arp_tip = client_info->cli_ip; arp_h->arp_hardware =rte_cpu_to_be_16 (RTE_ARP_HRD_ETHER ); - arp_h->arp_protocol =rte_cpu_to_be_16 (ETHER_TYPE_IPv4); - arp_h->arp_hlen =ETHER_ADDR_LEN ; + arp_h->arp_protocol =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4); + arp_h->arp_hlen =RTE_ETHER_ADDR_LEN ; arp_h->arp_plen =sizeof (uint32_t ); arp_h->arp_opcode =rte_cpu_to_be_16 (RTE_ARP_OP_REPLY );
drivers/net/bonding/rte_eth_bond_pmd.c +20 -20
@@ -37,14 +37,14 @@ get_vlan_offset(struct rte_ether_hdr *eth_hdr, uint16_t *proto) {size_t vlan_offset =0 ; -if (rte_cpu_to_be_16 (ETHER_TYPE_VLAN ) == *proto || -rte_cpu_to_be_16 (ETHER_TYPE_QINQ ) == *proto) { +if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_VLAN ) == *proto || +rte_cpu_to_be_16 (RTE_ETHER_TYPE_QINQ ) == *proto) {struct rte_vlan_hdr *vlan_hdr = (struct rte_vlan_hdr *)(eth_hdr +1 ); vlan_offset =sizeof (struct rte_vlan_hdr ); *proto = vlan_hdr->eth_proto; -if (rte_cpu_to_be_16 (ETHER_TYPE_VLAN ) == *proto) { +if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_VLAN ) == *proto) { vlan_hdr = vlan_hdr +1 ; *proto = vlan_hdr->eth_proto; vlan_offset +=sizeof (struct rte_vlan_hdr );
@@ -107,7 +107,7 @@ bond_ethdev_rx_burst_active_backup(void *queue, struct rte_mbuf **bufs,static inline uint8_t is_lacp_packets (uint16_t ethertype,uint8_t subtype,struct rte_mbuf *mbuf) { -const uint16_t ether_type_slow_be =rte_be_to_cpu_16 (ETHER_TYPE_SLOW ); +const uint16_t ether_type_slow_be =rte_be_to_cpu_16 (RTE_ETHER_TYPE_SLOW ); return !((mbuf->ol_flags & PKT_RX_VLAN) ? mbuf->vlan_tci : 0) && (ethertype == ether_type_slow_be &&
@@ -121,7 +121,7 @@ is_lacp_packets(uint16_t ethertype, uint8_t subtype, struct rte_mbuf *mbuf)static struct rte_flow_item_eth flow_item_eth_type_8023ad = { .dst.addr_bytes = {0 }, .src.addr_bytes = {0 }, - .type =RTE_BE16 (ETHER_TYPE_SLOW ), + .type =RTE_BE16 (RTE_ETHER_TYPE_SLOW ), };static struct rte_flow_item_eth flow_item_eth_mask_type_8023ad = {
@@ -397,7 +397,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs,struct rte_ether_addr *bond_mac = bonded_eth_dev->data->mac_addrs;struct rte_ether_hdr *hdr; -const uint16_t ether_type_slow_be =rte_be_to_cpu_16 (ETHER_TYPE_SLOW ); +const uint16_t ether_type_slow_be =rte_be_to_cpu_16 (RTE_ETHER_TYPE_SLOW );uint16_t num_rx_total =0 ;/* Total number of received packets */ uint16_t slaves[RTE_MAX_ETHPORTS ];uint16_t slave_count, idx;
@@ -603,7 +603,7 @@ mode6_debug(const char __attribute__((unused)) *info, struct rte_ether_hdr *eth_strlcpy (buf, info,16 );#endif -if (ether_type ==rte_cpu_to_be_16 (ETHER_TYPE_IPv4)) { +if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4)) { ipv4_h = (struct ipv4_hdr *)((char *)(eth_h +1 ) + offset);ipv4_addr_to_dot (ipv4_h->src_addr, src_ip, MaxIPv4String);#ifdef RTE_LIBRTE_BOND_DEBUG_ALB
@@ -613,7 +613,7 @@ mode6_debug(const char __attribute__((unused)) *info, struct rte_ether_hdr *eth_update_client_stats (ipv4_h->src_addr, port, burstnumber); }#ifdef RTE_LIBRTE_BOND_DEBUG_ALB - else if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_ARP)) { + else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP)) { arp_h = (struct rte_arp_hdr *)((char *)(eth_h +1 ) + offset);ipv4_addr_to_dot (arp_h->arp_data.arp_sip, src_ip, MaxIPv4String);ipv4_addr_to_dot (arp_h->arp_data.arp_tip, dst_ip, MaxIPv4String);
@@ -642,14 +642,14 @@ bond_ethdev_rx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) ether_type = eth_h->ether_type; offset =get_vlan_offset (eth_h, ðer_type); -if (ether_type ==rte_cpu_to_be_16 (ETHER_TYPE_ARP )) { +if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) {#if defined(RTE_LIBRTE_BOND_DEBUG_ALB ) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1 )mode6_debug ("RX ARP:" , eth_h, bufs[i]->port, &burstnumberRX);#endif bond_mode_alb_arp_recv (eth_h, offset, internals); }#if defined(RTE_LIBRTE_BOND_DEBUG_ALB ) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1 ) - else if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) + else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4)) mode6_debug("RX IPv4:", eth_h, bufs[i]->port, &burstnumberRX);#endif }
@@ -807,12 +807,12 @@ burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, vlan_offset =get_vlan_offset (eth_hdr, &proto); -if (rte_cpu_to_be_16 (ETHER_TYPE_IPv4) == proto) { +if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4) == proto) {struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset); l3hash =ipv4_hash (ipv4_hdr); - }else if (rte_cpu_to_be_16 (ETHER_TYPE_IPv6) == proto) { + }else if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6) == proto) {struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset); l3hash =ipv6_hash (ipv6_hdr);
@@ -846,7 +846,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, l3hash =0 ; l4hash =0 ; -if (rte_cpu_to_be_16 (ETHER_TYPE_IPv4) == proto) { +if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4) == proto) {struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset);size_t ip_hdr_offset;
@@ -873,7 +873,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, l4hash =HASH_L4_PORTS (udp_hdr); } } - }else if (rte_cpu_to_be_16 (ETHER_TYPE_IPv6) == proto) { + }else if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6) == proto) {struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset); l3hash =ipv6_hash (ipv6_hdr);
@@ -1097,7 +1097,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) ether_type = eth_h->ether_type; offset =get_vlan_offset (eth_h, ðer_type); -if (ether_type ==rte_cpu_to_be_16 (ETHER_TYPE_ARP )) { +if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_ARP )) { slave_idx =bond_mode_alb_arp_xmit (eth_h, offset, internals);/* Change src mac in eth header */
@@ -2236,7 +2236,7 @@ bond_ethdev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_pktlen = internals->candidate_max_rx_pktlen ? internals->candidate_max_rx_pktlen : -ETHER_MAX_JUMBO_FRAME_LEN ; +RTE_ETHER_MAX_JUMBO_FRAME_LEN ;/* Max number of tx/rx queues that the bonded device can support is the * minimum values of the bonded slaves, as all slaves must be capable
@@ -3066,12 +3066,12 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) eth_dev->data->nb_tx_queues = (uint16_t )1 ;/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc_socket (name,ETHER_ADDR_LEN * + eth_dev->data->mac_addrs =rte_zmalloc_socket (name,RTE_ETHER_ADDR_LEN *BOND_MAX_MAC_ADDRS ,0 , socket_id);if (eth_dev->data->mac_addrs ==NULL ) {RTE_BOND_LOG (ERR ,"Failed to allocate %u bytes needed to store MAC addresses" , -ETHER_ADDR_LEN *BOND_MAX_MAC_ADDRS ); +RTE_ETHER_ADDR_LEN *BOND_MAX_MAC_ADDRS ); goto err; }
@@ -3130,7 +3130,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) } vlan_filter_bmp_size = -rte_bitmap_get_memory_footprint (ETHER_MAX_VLAN_ID +1 ); +rte_bitmap_get_memory_footprint (RTE_ETHER_MAX_VLAN_ID +1 ); internals->vlan_filter_bmpmem =rte_malloc (name, vlan_filter_bmp_size,RTE_CACHE_LINE_SIZE );if (internals->vlan_filter_bmpmem ==NULL ) {
@@ -3140,7 +3140,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode) goto err; } - internals->vlan_filter_bmp =rte_bitmap_init (ETHER_MAX_VLAN_ID +1 , + internals->vlan_filter_bmp =rte_bitmap_init (RTE_ETHER_MAX_VLAN_ID +1 , internals->vlan_filter_bmpmem, vlan_filter_bmp_size);if (internals->vlan_filter_bmp ==NULL ) { RTE_BOND_LOG(ERR,
drivers/net/cxgbe/base/adapter.h +2 -2
@@ -204,8 +204,8 @@ struct eth_coalesce {unsigned int len;unsigned int flits;unsigned int max; -__u8 ethmacdst[ETHER_ADDR_LEN ]; -__u8 ethmacsrc[ETHER_ADDR_LEN ]; +__u8 ethmacdst[RTE_ETHER_ADDR_LEN ]; +__u8 ethmacsrc[RTE_ETHER_ADDR_LEN ];__be16 ethtype;__be16 vlantci; };
drivers/net/cxgbe/base/t4_hw.c +4 -4
@@ -4204,8 +4204,8 @@ int t4_alloc_raw_mac_filt(struct adapter *adap, unsigned int viid, V_DATAPORTNUM(M_DATAPORTNUM));/* Copy the address and the mask */ -memcpy ((u8 *)&p->data1[0 ] +2 , addr,ETHER_ADDR_LEN ); -memcpy ((u8 *)&p->data1m[0 ] +2 , mask,ETHER_ADDR_LEN ); +memcpy ((u8 *)&p->data1[0 ] +2 , addr,RTE_ETHER_ADDR_LEN ); +memcpy ((u8 *)&p->data1m[0 ] +2 , mask,RTE_ETHER_ADDR_LEN ); ret =t4_wr_mbox_meat (adap, adap->mbox, &c,sizeof (c), &c, sleep_ok);if (ret ==0 ) {
@@ -4261,8 +4261,8 @@ int t4_free_raw_mac_filt(struct adapter *adap, unsigned int viid, V_DATAPORTNUM(M_DATAPORTNUM));/* Copy the address and the mask */ -memcpy ((u8 *)&p->data1[0 ] +2 , addr,ETHER_ADDR_LEN ); -memcpy ((u8 *)&p->data1m[0 ] +2 , mask,ETHER_ADDR_LEN ); +memcpy ((u8 *)&p->data1[0 ] +2 , addr,RTE_ETHER_ADDR_LEN ); +memcpy ((u8 *)&p->data1m[0 ] +2 , mask,RTE_ETHER_ADDR_LEN );return t4_wr_mbox_meat (adap, adap->mbox, &c,sizeof (c), &c, sleep_ok); }
drivers/net/cxgbe/cxgbe.h +2 -2
@@ -15,8 +15,8 @@#define CXGBE_DEFAULT_TX_DESC_SIZE 1024/* Default TX ring size */ #define CXGBE_DEFAULT_RX_DESC_SIZE 1024/* Default RX ring size */ -#define CXGBE_MIN_RX_BUFSIZE ETHER_MIN_MTU/* min buf size */ -#define CXGBE_MAX_RX_PKTLEN (9000 + ETHER_HDR_LEN + ETHER_CRC_LEN)/* max pkt */ +#define CXGBE_MIN_RX_BUFSIZE RTE_ETHER_MIN_MTU/* min buf size */ +#define CXGBE_MAX_RX_PKTLEN (9000 + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN)/* max pkt */ /* Max poll time is 100 * 100msec = 10 sec */ #define CXGBE_LINK_STATUS_POLL_MS 100/* 100ms */
drivers/net/cxgbe/cxgbe_ethdev.c +6 -6
@@ -276,16 +276,16 @@ int cxgbe_dev_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)struct adapter *adapter = pi->adapter;struct rte_eth_dev_info dev_info;int err; -uint16_t new_mtu = mtu +ETHER_HDR_LEN +ETHER_CRC_LEN ; +uint16_t new_mtu = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ;cxgbe_dev_info_get (eth_dev, &dev_info); -/* Must accommodate at least ETHER_MIN_MTU */ -if ((new_mtu <ETHER_MIN_MTU ) || (new_mtu > dev_info.max_rx_pktlen)) +/* Must accommodate at least RTE_ETHER_MIN_MTU */ +if ((new_mtu <RTE_ETHER_MIN_MTU ) || (new_mtu > dev_info.max_rx_pktlen))return -EINVAL ;/* set to jumbo mode if needed */ -if (new_mtu >ETHER_MAX_LEN ) +if (new_mtu >RTE_ETHER_MAX_LEN ) eth_dev->data->dev_conf.rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ;else
@@ -586,7 +586,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,cxgbe_dev_info_get (eth_dev, &dev_info); -/* Must accommodate at least ETHER_MIN_MTU */ +/* Must accommodate at least RTE_ETHER_MIN_MTU */ if ((pkt_len < dev_info.min_rx_bufsize) || (pkt_len > dev_info.max_rx_pktlen)) { dev_err(adap, "%s: max pkt len must be > %d and <= %d\n",
@@ -625,7 +625,7 @@ int cxgbe_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, rxq->fl.size = temp_nb_desc;/* Set to jumbo mode if necessary */ -if (pkt_len >ETHER_MAX_LEN ) +if (pkt_len >RTE_ETHER_MAX_LEN ) eth_dev->data->dev_conf.rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ;else
drivers/net/cxgbe/cxgbe_filter.h +1 -1
@@ -102,7 +102,7 @@ struct ch_filter_specification { uint32_t eport:2; /* egress port to switch packet out */ uint32_t swapmac:1; /* swap SMAC/DMAC for loopback packet */ uint32_t newvlan:2; /* rewrite VLAN Tag */ -uint8_t dmac[ETHER_ADDR_LEN ];/* new destination MAC address */ +uint8_t dmac[RTE_ETHER_ADDR_LEN ];/* new destination MAC address */ uint16_t vlan;/* VLAN Tag to insert */ /*
drivers/net/cxgbe/cxgbe_flow.c +3 -3
@@ -233,7 +233,7 @@ ch_rte_parsetype_ipv4(const void *dmask, const struct rte_flow_item *item, item, "ttl/tos are not supported"); fs->type =FILTER_TYPE_IPV4 ; -CXGBE_FILL_FS (ETHER_TYPE_IPv4,0xffff , ethtype); +CXGBE_FILL_FS (RTE_ETHER_TYPE_IPv4,0xffff , ethtype);if (!val)return 0 ;/* ipv4 wild card */
@@ -262,7 +262,7 @@ ch_rte_parsetype_ipv6(const void *dmask, const struct rte_flow_item *item, "tc/flow/hop are not supported"); fs->type =FILTER_TYPE_IPV6 ; -CXGBE_FILL_FS (ETHER_TYPE_IPv6,0xffff , ethtype); +CXGBE_FILL_FS (RTE_ETHER_TYPE_IPv6,0xffff , ethtype);if (!val)return 0 ;/* ipv6 wild card */
@@ -448,7 +448,7 @@ ch_rte_parse_atype_switch(const struct rte_flow_action *a,case RTE_FLOW_ACTION_TYPE_OF_PUSH_VLAN : pushvlan = (const struct rte_flow_action_of_push_vlan *) a->conf; -if (pushvlan->ethertype !=ETHER_TYPE_VLAN ) +if (pushvlan->ethertype !=RTE_ETHER_TYPE_VLAN )return rte_flow_error_set (e,EINVAL ,RTE_FLOW_ERROR_TYPE_ACTION , a, "only ethertype 0x8100 "
drivers/net/cxgbe/cxgbe_main.c +2 -2
@@ -1348,7 +1348,7 @@ int link_start(struct port_info *pi)int ret; mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len - - (ETHER_HDR_LEN +ETHER_CRC_LEN ); + (RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ); conf_offloads = pi->eth_dev->data->dev_conf.rxmode.offloads;
@@ -1841,7 +1841,7 @@ int cxgbe_probe(struct adapter *adapter)rte_eth_copy_pci_info (pi->eth_dev, adapter->pdev); pi->eth_dev->data->mac_addrs =rte_zmalloc (name, -ETHER_ADDR_LEN ,0 ); +RTE_ETHER_ADDR_LEN ,0 );if (!pi->eth_dev->data->mac_addrs) {dev_err (adapter,"%s: Mem allocation failed for storing mac addr, aborting\n" , __func__);
drivers/net/cxgbe/cxgbevf_main.c +1 -1
@@ -245,7 +245,7 @@ int cxgbevf_probe(struct adapter *adapter)rte_eth_copy_pci_info (pi->eth_dev, adapter->pdev); pi->eth_dev->data->mac_addrs =rte_zmalloc (name, -ETHER_ADDR_LEN ,0 ); +RTE_ETHER_ADDR_LEN ,0 );if (!pi->eth_dev->data->mac_addrs) {dev_err (adapter,"%s: Mem allocation failed for storing mac addr, aborting\n" , __func__);
drivers/net/cxgbe/l2t.c +4 -4
@@ -81,10 +81,10 @@ static int write_l2e(struct rte_eth_dev *dev, struct l2t_entry *e, int sync, V_L2T_W_NOREPLY(!sync)); req->l2t_idx =cpu_to_be16 (l2t_idx); req->vlan =cpu_to_be16 (e->vlan); -rte_memcpy (req->dst_mac, e->dmac,ETHER_ADDR_LEN ); +rte_memcpy (req->dst_mac, e->dmac,RTE_ETHER_ADDR_LEN );if (loopback) -memset (req->dst_mac,0 ,ETHER_ADDR_LEN ); +memset (req->dst_mac,0 ,RTE_ETHER_ADDR_LEN );t4_mgmt_tx (ctrlq, mbuf);
@@ -116,7 +116,7 @@ static struct l2t_entry *find_or_alloc_l2e(struct l2t_data *d, u16 vlan, first_free = e; }else {if (e->state ==L2T_STATE_SWITCHING ) { -if ((!memcmp (e->dmac, dmac,ETHER_ADDR_LEN )) && +if ((!memcmp (e->dmac, dmac,RTE_ETHER_ADDR_LEN )) && e->vlan == vlan && e->lport == port) goto exists; }
@@ -154,7 +154,7 @@ static struct l2t_entry *t4_l2t_alloc_switching(struct rte_eth_dev *dev, e->state =L2T_STATE_SWITCHING ; e->vlan = vlan; e->lport = port; -rte_memcpy (e->dmac, eth_addr,ETHER_ADDR_LEN ); +rte_memcpy (e->dmac, eth_addr,RTE_ETHER_ADDR_LEN );rte_atomic32_set (&e->refcnt,1 ); ret =write_l2e (dev, e,0 , !L2T_LPBK , !L2T_ARPMISS );if (ret <0 )
drivers/net/cxgbe/l2t.h +1 -1
@@ -28,7 +28,7 @@ struct l2t_entry {u16 idx;/* entry index within in-memory table */ u16 vlan;/* VLAN TCI (id: bits 0-11, prio: 13-15 */ u8 lport;/* destination port */ -u8 dmac[ETHER_ADDR_LEN ];/* destination MAC address */ +u8 dmac[RTE_ETHER_ADDR_LEN ];/* destination MAC address */ rte_spinlock_t lock;/* entry lock */ rte_atomic32_t refcnt;/* entry reference count */ };
drivers/net/cxgbe/mps_tcam.c +7 -7
@@ -8,8 +8,8 @@static inline bool match_entry (struct mps_tcam_entry *entry,const u8 *eth_addr,const u8 *mask) { -if (!memcmp (eth_addr, entry->eth_addr,ETHER_ADDR_LEN ) && - !memcmp (mask, entry->mask,ETHER_ADDR_LEN )) +if (!memcmp (eth_addr, entry->eth_addr,RTE_ETHER_ADDR_LEN ) && + !memcmp (mask, entry->mask,RTE_ETHER_ADDR_LEN ))return true;return false; }
@@ -95,8 +95,8 @@ int cxgbe_mpstcam_alloc(struct port_info *pi, const u8 *eth_addr,/* Fill in the new values */ entry = &mpstcam->entry[ret]; -memcpy (entry->eth_addr, eth_addr,ETHER_ADDR_LEN ); -memcpy (entry->mask, mask,ETHER_ADDR_LEN ); +memcpy (entry->eth_addr, eth_addr,RTE_ETHER_ADDR_LEN ); +memcpy (entry->mask, mask,RTE_ETHER_ADDR_LEN );rte_atomic32_set (&entry->refcnt,1 ); entry->state =MPS_ENTRY_USED ;
@@ -139,7 +139,7 @@ int cxgbe_mpstcam_modify(struct port_info *pi, int idx, const u8 *addr)/* idx can now be different from what user provided */ entry = &mpstcam->entry[idx]; -memcpy (entry->eth_addr, addr,ETHER_ADDR_LEN ); +memcpy (entry->eth_addr, addr,RTE_ETHER_ADDR_LEN );/* NOTE: we have considered the case that idx returned by t4_change_mac * will be different from the user provided value only if user * provided value is -1
@@ -161,8 +161,8 @@ int cxgbe_mpstcam_modify(struct port_info *pi, int idx, const u8 *addr)*/ static inline void reset_mpstcam_entry (struct mps_tcam_entry *entry) { -memset (entry->eth_addr,0 ,ETHER_ADDR_LEN ); -memset (entry->mask,0 ,ETHER_ADDR_LEN ); +memset (entry->eth_addr,0 ,RTE_ETHER_ADDR_LEN ); +memset (entry->mask,0 ,RTE_ETHER_ADDR_LEN );rte_atomic32_clear (&entry->refcnt); entry->state =MPS_ENTRY_UNUSED ; }
drivers/net/cxgbe/mps_tcam.h +2 -2
@@ -24,8 +24,8 @@ struct mps_tcam_entry {u16 idx;/* add data here which uniquely defines an entry */ -u8 eth_addr[ETHER_ADDR_LEN ]; -u8 mask[ETHER_ADDR_LEN ]; +u8 eth_addr[RTE_ETHER_ADDR_LEN ]; +u8 mask[RTE_ETHER_ADDR_LEN ];struct mpstcam_table *mpstcam;/* backptr */ rte_atomic32_t refcnt;
drivers/net/cxgbe/sge.c +4 -4
@@ -73,7 +73,7 @@ static inline unsigned int fl_mtu_bufsize(struct adapter *adapter, {struct sge *s = &adapter->sge; -return CXGBE_ALIGN (s->pktshift +ETHER_HDR_LEN +VLAN_HLEN + mtu, +return CXGBE_ALIGN (s->pktshift +RTE_ETHER_HDR_LEN +VLAN_HLEN + mtu, s->fl_align); }
@@ -1128,7 +1128,7 @@ int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,* The chip min packet length is 10 octets but play safe and reject * anything shorter than an Ethernet header. */ -if (unlikely (m->pkt_len <ETHER_HDR_LEN )) { +if (unlikely (m->pkt_len <RTE_ETHER_HDR_LEN )) { out_free:rte_pktmbuf_free (m);return 0 ;
@@ -1145,7 +1145,7 @@ int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf,/* align the end of coalesce WR to a 512 byte boundary */ txq->q.coalesce.max = (8 - (txq->q.pidx &7 )) *8 ; -if (!((m->ol_flags &PKT_TX_TCP_SEG ) || (m->pkt_len >ETHER_MAX_LEN ))) { +if (!((m->ol_flags &PKT_TX_TCP_SEG ) || (m->pkt_len >RTE_ETHER_MAX_LEN ))) {if (should_tx_packet_coalesce (txq, mbuf, &cflits, adap)) {if (unlikely (map_mbuf (mbuf, addr) <0 )) { dev_warn(adap, "%s: mapping err for coalesce\n",
@@ -1230,7 +1230,7 @@ int t4_eth_xmit(struct sge_eth_txq *txq, struct rte_mbuf *mbuf, v6 = (m->ol_flags &PKT_TX_IPV6 ) !=0 ; l3hdr_len = m->l3_len; l4hdr_len = m->l4_len; - eth_xtra_len = m->l2_len -ETHER_HDR_LEN ; + eth_xtra_len = m->l2_len -RTE_ETHER_HDR_LEN ; len +=sizeof (*lso); wr->op_immdlen = htonl(V_FW_WR_OP(is_pf4(adap) ? FW_ETH_TX_PKT_WR :
drivers/net/dpaa/dpaa_ethdev.c +7 -7
@@ -146,13 +146,13 @@ static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) {struct dpaa_if *dpaa_intf = dev->data->dev_private; -uint32_t frame_size = mtu +ETHER_HDR_LEN +ETHER_CRC_LEN +uint32_t frame_size = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE ;uint32_t buffsz = dev->data->min_rx_buf_size -RTE_PKTMBUF_HEADROOM ;PMD_INIT_FUNC_TRACE (); -if (mtu <ETHER_MIN_MTU || frame_size >DPAA_MAX_RX_PKT_LEN ) +if (mtu <RTE_ETHER_MIN_MTU || frame_size >DPAA_MAX_RX_PKT_LEN )return -EINVAL ;/* * Refuse mtu that requires the support of scattered packets
@@ -172,7 +172,7 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)return -EINVAL ; } -if (frame_size >ETHER_MAX_LEN ) +if (frame_size >RTE_ETHER_MAX_LEN ) dev->data->dev_conf.rxmode.offloads &=DEV_RX_OFFLOAD_JUMBO_FRAME ;else
@@ -230,7 +230,7 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)fman_if_set_maxfrm (dpaa_intf->fif, max_len); dev->data->mtu = max_len - -ETHER_HDR_LEN -ETHER_CRC_LEN -VLAN_TAG_SIZE ; + -RTE_ETHER_HDR_LEN -RTE_ETHER_CRC_LEN -VLAN_TAG_SIZE ; }if (rx_offloads &DEV_RX_OFFLOAD_SCATTER ) {
@@ -1364,11 +1364,11 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)/* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs =rte_zmalloc ("mac_addr" , -ETHER_ADDR_LEN *DPAA_MAX_MAC_FILTER ,0 ); +RTE_ETHER_ADDR_LEN *DPAA_MAX_MAC_FILTER ,0 );if (eth_dev->data->mac_addrs ==NULL ) {DPAA_PMD_ERR ("Failed to allocate %d bytes needed to " "store MAC addresses" , -ETHER_ADDR_LEN *DPAA_MAX_MAC_FILTER ); +RTE_ETHER_ADDR_LEN *DPAA_MAX_MAC_FILTER ); ret = -ENOMEM ; goto free_tx; }
@@ -1396,7 +1396,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)fman_if_stats_reset (fman_intf);/* Disable SG by default */ fman_if_set_sg (fman_intf,0 ); -fman_if_set_maxfrm (fman_intf,ETHER_MAX_LEN +VLAN_TAG_SIZE ); +fman_if_set_maxfrm (fman_intf,RTE_ETHER_MAX_LEN +VLAN_TAG_SIZE );return 0 ;
drivers/net/dpaa/dpaa_rxtx.c +4 -4
@@ -221,10 +221,10 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf)struct tcp_hdr *tcp_hdr = (struct tcp_hdr *)(l3_hdr + mbuf->l3_len); tcp_hdr->cksum =0 ; -if (eth_hdr->ether_type ==htons (ETHER_TYPE_IPv4)) +if (eth_hdr->ether_type ==htons (RTE_ETHER_TYPE_IPv4)) tcp_hdr->cksum =rte_ipv4_udptcp_cksum (ipv4_hdr, tcp_hdr); -else /* assume ethertype == ETHER_TYPE_IPv6 */ +else /* assume ethertype == RTE_ETHER_TYPE_IPv6 */ tcp_hdr->cksum =rte_ipv6_udptcp_cksum (ipv6_hdr, tcp_hdr); } else if ((mbuf->packet_type & RTE_PTYPE_L4_MASK) ==
@@ -232,10 +232,10 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf)struct udp_hdr *udp_hdr = (struct udp_hdr *)(l3_hdr + mbuf->l3_len); udp_hdr->dgram_cksum =0 ; -if (eth_hdr->ether_type ==htons (ETHER_TYPE_IPv4)) +if (eth_hdr->ether_type ==htons (RTE_ETHER_TYPE_IPv4)) udp_hdr->dgram_cksum =rte_ipv4_udptcp_cksum (ipv4_hdr, udp_hdr); -else /* assume ethertype == ETHER_TYPE_IPv6 */ +else /* assume ethertype == RTE_ETHER_TYPE_IPv6 */ udp_hdr->dgram_cksum =rte_ipv6_udptcp_cksum (ipv6_hdr, udp_hdr); }
drivers/net/dpaa2/dpaa2_ethdev.c +5 -5
@@ -1086,7 +1086,7 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)int ret;struct dpaa2_dev_priv *priv = dev->data->dev_private;struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; -uint32_t frame_size = mtu +ETHER_HDR_LEN +ETHER_CRC_LEN +uint32_t frame_size = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE ;PMD_INIT_FUNC_TRACE ();
@@ -1097,10 +1097,10 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) }/* check that mtu is within the allowed range */ -if ((mtu <ETHER_MIN_MTU ) || (frame_size >DPAA2_MAX_RX_PKT_LEN )) +if ((mtu <RTE_ETHER_MIN_MTU ) || (frame_size >DPAA2_MAX_RX_PKT_LEN ))return -EINVAL ; -if (frame_size >ETHER_MAX_LEN ) +if (frame_size >RTE_ETHER_MAX_LEN ) dev->data->dev_conf.rxmode.offloads &=DEV_RX_OFFLOAD_JUMBO_FRAME ;else
@@ -2185,11 +2185,11 @@ dpaa2_dev_init(struct rte_eth_dev *eth_dev)* can add MAC entries when rte_eth_dev_mac_addr_add is called. */ eth_dev->data->mac_addrs =rte_zmalloc ("dpni" , -ETHER_ADDR_LEN * attr.mac_filter_entries,0 ); +RTE_ETHER_ADDR_LEN * attr.mac_filter_entries,0 );if (eth_dev->data->mac_addrs ==NULL ) {DPAA2_PMD_ERR ("Failed to allocate %d bytes needed to store MAC addresses" , -ETHER_ADDR_LEN * attr.mac_filter_entries); +RTE_ETHER_ADDR_LEN * attr.mac_filter_entries); ret = -ENOMEM ; goto init_err; }
drivers/net/e1000/e1000_ethdev.h +2 -2
@@ -92,7 +92,7 @@* The overhead from MTU to max frame size. * Considering VLAN so a tag needs to be counted. */ -#define E1000_ETH_OVERHEAD (ETHER_HDR_LEN + ETHER_CRC_LEN + VLAN_TAG_SIZE) +#define E1000_ETH_OVERHEAD (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE)/* * Maximum number of Ring Descriptors.
@@ -155,7 +155,7 @@ struct e1000_vfta {*/ #define E1000_MAX_VF_MC_ENTRIES 30struct e1000_vf_info { -uint8_t vf_mac_addresses[ETHER_ADDR_LEN ]; +uint8_t vf_mac_addresses[RTE_ETHER_ADDR_LEN ];uint16_t vf_mc_hashes[E1000_MAX_VF_MC_ENTRIES ];uint16_t num_vf_mc_hashes;uint16_t default_vf_vlan_id;
drivers/net/e1000/em_ethdev.c +10 -10
@@ -283,12 +283,12 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev) }/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc ("e1000" ,ETHER_ADDR_LEN * + eth_dev->data->mac_addrs =rte_zmalloc ("e1000" ,RTE_ETHER_ADDR_LEN * hw->mac.rar_entry_count,0 );if (eth_dev->data->mac_addrs ==NULL ) {PMD_INIT_LOG (ERR ,"Failed to allocate %d bytes needed to " "store MAC addresses" , -ETHER_ADDR_LEN * hw->mac.rar_entry_count); +RTE_ETHER_ADDR_LEN * hw->mac.rar_entry_count);return -ENOMEM ; }
@@ -575,7 +575,7 @@ eth_em_start(struct rte_eth_dev *dev)return -EIO ; } -E1000_WRITE_REG (hw,E1000_VET ,ETHER_TYPE_VLAN ); +E1000_WRITE_REG (hw,E1000_VET ,RTE_ETHER_TYPE_VLAN );/* Configure for OS presence */ em_init_manageability (hw);
@@ -820,7 +820,7 @@ em_hardware_init(struct e1000_hw *hw)*/ rx_buf_size =em_get_rx_buffer_size (hw); - hw->fc.high_water = rx_buf_size -PMD_ROUNDUP (ETHER_MAX_LEN *2 ,1024 ); + hw->fc.high_water = rx_buf_size -PMD_ROUNDUP (RTE_ETHER_MAX_LEN *2 ,1024 ); hw->fc.low_water = hw->fc.high_water -1500 ;if (hw->mac.type == e1000_80003es2lan)
@@ -1036,7 +1036,7 @@ em_get_max_pktlen(struct rte_eth_dev *dev)return 0x1000 ;/* Adapters that do not support jumbo frames */ case e1000_ich8lan: -return ETHER_MAX_LEN ; +return RTE_ETHER_MAX_LEN ;default :return MAX_JUMBO_FRAME_SIZE ; }
@@ -1696,7 +1696,7 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf)PMD_INIT_LOG (DEBUG ,"Rx packet buffer size = 0x%x" , rx_buf_size);/* At least reserve one Ethernet frame for watermark */ - max_high_water = rx_buf_size -ETHER_MAX_LEN ; + max_high_water = rx_buf_size -RTE_ETHER_MAX_LEN ;if ((fc_conf->high_water > max_high_water) || (fc_conf->high_water < fc_conf->low_water)) {PMD_INIT_LOG (ERR ,"e1000 incorrect high/low water value" );
@@ -1746,7 +1746,7 @@ eth_em_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,static void eth_em_rar_clear (struct rte_eth_dev *dev,uint32_t index) { -uint8_t addr[ETHER_ADDR_LEN ]; +uint8_t addr[RTE_ETHER_ADDR_LEN ];struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private);memset (addr,0 ,sizeof (addr));
@@ -1772,10 +1772,10 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)uint32_t rctl;eth_em_infos_get (dev, &dev_info); - frame_size = mtu +ETHER_HDR_LEN +ETHER_CRC_LEN +VLAN_TAG_SIZE ; + frame_size = mtu +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN +VLAN_TAG_SIZE ;/* check that mtu is within the allowed range */ -if ((mtu <ETHER_MIN_MTU ) || (frame_size > dev_info.max_rx_pktlen)) +if ((mtu <RTE_ETHER_MIN_MTU ) || (frame_size > dev_info.max_rx_pktlen))return -EINVAL ;/* refuse mtu that requires the support of scattered packets when this
@@ -1788,7 +1788,7 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) rctl =E1000_READ_REG (hw,E1000_RCTL );/* switch to jumbo mode if needed */ -if (frame_size >ETHER_MAX_LEN ) { +if (frame_size >RTE_ETHER_MAX_LEN ) { dev->data->dev_conf.rxmode.offloads |=DEV_RX_OFFLOAD_JUMBO_FRAME ; rctl |=E1000_RCTL_LPE ;
drivers/net/e1000/em_rxtx.c +8 -8
@@ -1005,17 +1005,17 @@ eth_em_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,*/ rxm->next =NULL ;if (unlikely (rxq->crc_len >0 )) { - first_seg->pkt_len -=ETHER_CRC_LEN ; -if (data_len <=ETHER_CRC_LEN ) { + first_seg->pkt_len -=RTE_ETHER_CRC_LEN ; +if (data_len <=RTE_ETHER_CRC_LEN ) {rte_pktmbuf_free_seg (rxm); first_seg->nb_segs--; last_seg->data_len = (uint16_t ) (last_seg->data_len - - (ETHER_CRC_LEN - data_len)); + (RTE_ETHER_CRC_LEN - data_len)); last_seg->next =NULL ; }else rxm->data_len = - (uint16_t ) (data_len -ETHER_CRC_LEN ); + (uint16_t ) (data_len -RTE_ETHER_CRC_LEN ); }/*
@@ -1368,7 +1368,7 @@ em_get_rx_port_offloads_capa(struct rte_eth_dev *dev)DEV_RX_OFFLOAD_TCP_CKSUM |DEV_RX_OFFLOAD_KEEP_CRC |DEV_RX_OFFLOAD_SCATTER ; -if (max_rx_pktlen >ETHER_MAX_LEN ) +if (max_rx_pktlen >RTE_ETHER_MAX_LEN ) rx_offload_capa |=DEV_RX_OFFLOAD_JUMBO_FRAME ;return rx_offload_capa;
@@ -1463,7 +1463,7 @@ eth_em_rx_queue_setup(struct rte_eth_dev *dev, rxq->queue_id = queue_idx; rxq->port_id = dev->data->port_id;if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_KEEP_CRC ) - rxq->crc_len =ETHER_CRC_LEN ; + rxq->crc_len =RTE_ETHER_CRC_LEN ;else rxq->crc_len =0 ;
@@ -1799,7 +1799,7 @@ eth_em_rx_init(struct rte_eth_dev *dev)* call to configure */ if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_KEEP_CRC ) - rxq->crc_len =ETHER_CRC_LEN ; + rxq->crc_len =RTE_ETHER_CRC_LEN ;else rxq->crc_len =0 ;
@@ -1832,7 +1832,7 @@ eth_em_rx_init(struct rte_eth_dev *dev)* one buffer. */ if (rxmode->offloads &DEV_RX_OFFLOAD_JUMBO_FRAME || - rctl_bsize <ETHER_MAX_LEN ) { + rctl_bsize <RTE_ETHER_MAX_LEN ) {if (!dev->data->scattered_rx)PMD_INIT_LOG (DEBUG ,"forcing scatter mode" ); dev->rx_pkt_burst =
drivers/net/e1000/igb_ethdev.c +21 -21
146 lines not on this page · raw message
drivers/net/e1000/igb_flow.c +2 -2
@@ -700,8 +700,8 @@ igb_parse_ethertype_filter(struct rte_eth_dev *dev, } } -if (filter->ether_type == ETHER_TYPE_IPv4 || - filter->ether_type == ETHER_TYPE_IPv6) { +if (filter->ether_type == RTE_ETHER_TYPE_IPv4 || + filter->ether_type == RTE_ETHER_TYPE_IPv6) {memset (filter,0 ,sizeof (struct rte_eth_ethertype_filter )); rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM,
drivers/net/e1000/igb_pf.c +5 -5
@@ -37,7 +37,7 @@ dev_num_vf(struct rte_eth_dev *eth_dev)static inline int igb_vf_perm_addr_gen (struct rte_eth_dev *dev,uint16_t vf_num) { -unsigned char vf_mac_addr[ETHER_ADDR_LEN ]; +unsigned char vf_mac_addr[RTE_ETHER_ADDR_LEN ];struct e1000_vf_info *vfinfo = *E1000_DEV_PRIVATE_TO_P_VFDATA (dev->data->dev_private);uint16_t vfn;
@@ -46,7 +46,7 @@ int igb_vf_perm_addr_gen(struct rte_eth_dev *dev, uint16_t vf_num)rte_eth_random_addr (vf_mac_addr);/* keep the random address as default */ memcpy (vfinfo[vfn].vf_mac_addresses, vf_mac_addr, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); }return 0 ;
@@ -290,7 +290,7 @@ igb_vf_reset(struct rte_eth_dev *dev, uint16_t vf, uint32_t *msgbuf)/* reply to reset with ack and vf mac address */ msgbuf[0 ] =E1000_VF_RESET |E1000_VT_MSGTYPE_ACK ; -rte_memcpy (new_mac, vf_mac,ETHER_ADDR_LEN ); +rte_memcpy (new_mac, vf_mac,RTE_ETHER_ADDR_LEN );e1000_write_mbx (hw, msgbuf,3 , vf);return 0 ;
@@ -400,10 +400,10 @@ igb_vf_set_rlpml(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) {struct e1000_hw *hw =E1000_DEV_PRIVATE_TO_HW (dev->data->dev_private);uint16_t rlpml = msgbuf[1 ] &E1000_VMOLR_RLPML_MASK ; -uint32_t max_frame = rlpml +ETHER_HDR_LEN +ETHER_CRC_LEN ; +uint32_t max_frame = rlpml +RTE_ETHER_HDR_LEN +RTE_ETHER_CRC_LEN ;uint32_t vmolr; -if ((max_frame <ETHER_MIN_LEN ) || (max_frame >ETHER_MAX_JUMBO_FRAME_LEN )) +if ((max_frame <RTE_ETHER_MIN_LEN ) || (max_frame >RTE_ETHER_MAX_JUMBO_FRAME_LEN ))return -1 ; vmolr =E1000_READ_REG (hw,E1000_VMOLR (vf));
drivers/net/e1000/igb_rxtx.c +6 -6
@@ -1147,17 +1147,17 @@ eth_igb_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,*/ rxm->next =NULL ;if (unlikely (rxq->crc_len >0 )) { - first_seg->pkt_len -=ETHER_CRC_LEN ; -if (data_len <=ETHER_CRC_LEN ) { + first_seg->pkt_len -=RTE_ETHER_CRC_LEN ; +if (data_len <=RTE_ETHER_CRC_LEN ) {rte_pktmbuf_free_seg (rxm); first_seg->nb_segs--; last_seg->data_len = (uint16_t ) (last_seg->data_len - - (ETHER_CRC_LEN - data_len)); + (RTE_ETHER_CRC_LEN - data_len)); last_seg->next =NULL ; }else rxm->data_len = - (uint16_t ) (data_len -ETHER_CRC_LEN ); + (uint16_t ) (data_len -RTE_ETHER_CRC_LEN ); }/*
@@ -1725,7 +1725,7 @@ eth_igb_rx_queue_setup(struct rte_eth_dev *dev, queue_idx : RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx + queue_idx); rxq->port_id = dev->data->port_id;if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_KEEP_CRC ) - rxq->crc_len =ETHER_CRC_LEN ; + rxq->crc_len =RTE_ETHER_CRC_LEN ;else rxq->crc_len =0 ;
@@ -2378,7 +2378,7 @@ eth_igb_rx_init(struct rte_eth_dev *dev)* call to configure */ if (dev->data->dev_conf.rxmode.offloads &DEV_RX_OFFLOAD_KEEP_CRC ) - rxq->crc_len =ETHER_CRC_LEN ; + rxq->crc_len =RTE_ETHER_CRC_LEN ;else rxq->crc_len =0 ;
drivers/net/ena/ena_ethdev.h +1 -1
@@ -198,7 +198,7 @@ struct ena_adapter {int id_number;char name[ENA_NAME_MAX_LEN ]; -u8 mac_addr[ETHER_ADDR_LEN ]; +u8 mac_addr[RTE_ETHER_ADDR_LEN ];void *regs;void *dev_mem_base;
drivers/net/enetc/base/enetc_hw.h +2 -2
@@ -170,8 +170,8 @@ struct enetc_hw { };struct enetc_eth_mac_info { -uint8_t addr[ETHER_ADDR_LEN ]; -uint8_t perm_addr[ETHER_ADDR_LEN ]; +uint8_t addr[RTE_ETHER_ADDR_LEN ]; +uint8_t perm_addr[RTE_ETHER_ADDR_LEN ];uint8_t get_link_status; };
drivers/net/enetc/enetc_ethdev.c +2 -2
@@ -88,11 +88,11 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) }/* Allocate memory for storing MAC addresses */ - eth_dev->data->mac_addrs =rte_zmalloc ("enetc_eth" ,ETHER_ADDR_LEN ,0 ); + eth_dev->data->mac_addrs =rte_zmalloc ("enetc_eth" ,RTE_ETHER_ADDR_LEN ,0 );if (!eth_dev->data->mac_addrs) {ENETC_PMD_ERR ("Failed to allocate %d bytes needed to " "store MAC addresses" , -ETHER_ADDR_LEN *1 ); +RTE_ETHER_ADDR_LEN *1 ); error = -ENOMEM ;return -1 ; }
drivers/net/enic/enic.h +1 -1
@@ -204,7 +204,7 @@ struct enic {static inline uint32_t enic_mtu_to_max_rx_pktlen (uint32_t mtu) {/* ethdev max size includes eth whereas NIC MTU does not */ -return mtu +ETHER_HDR_LEN ; +return mtu +RTE_ETHER_HDR_LEN ; }/* Get the CQ index from a Start of Packet(SOP) RQ index */
drivers/net/enic/enic_ethdev.c +4 -4
@@ -646,9 +646,9 @@ static int enicpmd_set_mac_addr(struct rte_eth_dev *eth_dev,static void debug_log_add_del_addr (struct rte_ether_addr *addr,bool add) { -char mac_str[ETHER_ADDR_FMT_SIZE ]; +char mac_str[RTE_ETHER_ADDR_FMT_SIZE ]; -rte_ether_format_addr (mac_str,ETHER_ADDR_FMT_SIZE , addr); +rte_ether_format_addr (mac_str,RTE_ETHER_ADDR_FMT_SIZE , addr);PMD_INIT_LOG (DEBUG ," %s address %s\n" , add ?"add" :"remove" , mac_str); }
@@ -658,7 +658,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, uint32_t nb_mc_addr) {struct enic *enic =pmd_priv (eth_dev); -char mac_str[ETHER_ADDR_FMT_SIZE ]; +char mac_str[RTE_ETHER_ADDR_FMT_SIZE ];struct rte_ether_addr *addr;uint32_t i, j;int ret;
@@ -670,7 +670,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, addr = &mc_addr_set[i];if (!rte_is_multicast_ether_addr (addr) ||rte_is_broadcast_ether_addr (addr)) { -rte_ether_format_addr (mac_str,ETHER_ADDR_FMT_SIZE , addr); +rte_ether_format_addr (mac_str,RTE_ETHER_ADDR_FMT_SIZE , addr);PMD_INIT_LOG (ERR ," invalid multicast address %s\n" , mac_str);return -EINVAL ;
drivers/net/enic/enic_flow.c +7 -7
@@ -592,7 +592,7 @@ enic_copy_item_inner_vlan_v2(struct copy_item_args *arg) arg->l2_proto_off = *off + offsetof(struct rte_vlan_hdr , eth_proto);return copy_inner_common (&arg->filter->u.generic_1, off, arg->item->spec, mask,sizeof (struct rte_vlan_hdr ), - eth_type_off,rte_cpu_to_be_16 (ETHER_TYPE_VLAN ),2 ); + eth_type_off,rte_cpu_to_be_16 (RTE_ETHER_TYPE_VLAN ),2 ); } static int
@@ -608,7 +608,7 @@ enic_copy_item_inner_ipv4_v2(struct copy_item_args *arg) arg->l3_proto_off = *off + offsetof(struct ipv4_hdr , next_proto_id);return copy_inner_common (&arg->filter->u.generic_1, off, arg->item->spec, mask,sizeof (struct ipv4_hdr ), - arg->l2_proto_off,rte_cpu_to_be_16 (ETHER_TYPE_IPv4),2 ); + arg->l2_proto_off,rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4),2 ); } static int
@@ -624,7 +624,7 @@ enic_copy_item_inner_ipv6_v2(struct copy_item_args *arg) arg->l3_proto_off = *off + offsetof(struct ipv6_hdr , proto);return copy_inner_common (&arg->filter->u.generic_1, off, arg->item->spec, mask,sizeof (struct ipv6_hdr ), - arg->l2_proto_off,rte_cpu_to_be_16 (ETHER_TYPE_IPv6),2 ); + arg->l2_proto_off,rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6),2 ); } static int
@@ -678,14 +678,14 @@ enic_copy_item_eth_v2(struct copy_item_args *arg) mask = &rte_flow_item_eth_mask;memcpy (enic_spec.d_addr.addr_bytes, spec->dst.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );memcpy (enic_spec.s_addr.addr_bytes, spec->src.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );memcpy (enic_mask.d_addr.addr_bytes, mask->dst.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN );memcpy (enic_mask.s_addr.addr_bytes, mask->src.addr_bytes, -ETHER_ADDR_LEN ); +RTE_ETHER_ADDR_LEN ); enic_spec.ether_type = spec->type; enic_mask.ether_type = mask->type;
drivers/net/enic/enic_res.c +2 -2
@@ -61,9 +61,9 @@ int enic_get_vnic_config(struct enic *enic)* and will be 0 for legacy firmware and VICs */ if (c->max_pkt_size >ENIC_DEFAULT_RX_MAX_PKT_SIZE ) - enic->max_mtu = c->max_pkt_size -ETHER_HDR_LEN ; + enic->max_mtu = c->max_pkt_size -RTE_ETHER_HDR_LEN ;else - enic->max_mtu =ENIC_DEFAULT_RX_MAX_PKT_SIZE -ETHER_HDR_LEN ; + enic->max_mtu =ENIC_DEFAULT_RX_MAX_PKT_SIZE -RTE_ETHER_HDR_LEN ;if (c->mtu ==0 ) c->mtu =1500 ;
drivers/net/failsafe/failsafe_args.c +1 -1
@@ -376,7 +376,7 @@ fs_get_mac_addr_arg(const char *key __rte_unused, &ea->addr_bytes[0 ], &ea->addr_bytes[1 ], &ea->addr_bytes[2 ], &ea->addr_bytes[3 ], &ea->addr_bytes[4], &ea->addr_bytes[5]); -return ret !=ETHER_ADDR_LEN ; +return ret !=RTE_ETHER_ADDR_LEN ; }int
drivers/net/failsafe/failsafe_ether.c +2 -2
@@ -172,9 +172,9 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev, ret =rte_eth_dev_mac_addr_add (PORT_ID (sdev), ea,PRIV (dev)->mac_addr_pool[i]);if (ret) { -char ea_fmt[ETHER_ADDR_FMT_SIZE ]; +char ea_fmt[RTE_ETHER_ADDR_FMT_SIZE ]; -rte_ether_format_addr (ea_fmt,ETHER_ADDR_FMT_SIZE , ea); +rte_ether_format_addr (ea_fmt,RTE_ETHER_ADDR_FMT_SIZE , ea);ERROR ("Adding MAC address %s failed" , ea_fmt);return ret; }
drivers/net/fm10k/fm10k.h +1 -1
@@ -305,7 +305,7 @@ fm10k_addr_alignment_valid(struct rte_mbuf *mb)/* 8B aligned, and max Ethernet frame would not cross a 4KB boundary? */ if (RTE_ALIGN (addr,8 ) == addr) { boundary1 =RTE_ALIGN_FLOOR (addr,4096 ); - boundary2 =RTE_ALIGN_FLOOR (addr +ETHER_MAX_VLAN_FRAME_LEN , + boundary2 =RTE_ALIGN_FLOOR (addr +RTE_ETHER_MAX_VLAN_FRAME_LEN ,4096 );if (boundary1 == boundary2)return 1 ;
drivers/net/fm10k/fm10k_ethdev.c +2 -2
@@ -613,7 +613,7 @@ fm10k_dev_mq_rx_configure(struct rte_eth_dev *dev)/* reset MAC/VLAN as it's based on VMDQ or PF main VSI */ memset (dev->data->mac_addrs,0 , -ETHER_ADDR_LEN *FM10K_MAX_MACADDR_NUM ); +RTE_ETHER_ADDR_LEN *FM10K_MAX_MACADDR_NUM );rte_ether_addr_copy ((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0 ]);memset (macvlan,0 ,sizeof (*macvlan));
@@ -3072,7 +3072,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)/* Initialize MAC address(es) */ dev->data->mac_addrs =rte_zmalloc ("fm10k" , -ETHER_ADDR_LEN *FM10K_MAX_MACADDR_NUM ,0 ); +RTE_ETHER_ADDR_LEN *FM10K_MAX_MACADDR_NUM ,0 );if (dev->data->mac_addrs ==NULL ) {PMD_INIT_LOG (ERR ,"Cannot allocate memory for MAC addresses" );return -ENOMEM ;
drivers/net/i40e/i40e_ethdev.c +26 -26
109 lines not on this page · raw message
drivers/net/ixgbe/ixgbe_ethdev.c +22 -22
44 lines not on this page · raw message
drivers/net/virtio/virtio_ethdev.c +23 -23
46 lines not on this page · raw message
drivers/net/virtio/virtio_user/vhost_kernel_tap.c +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/virtio/virtio_user/virtio_user_dev.c +3 -3
Lines of this file are not shown. View the raw message.
drivers/net/virtio/virtio_user/virtio_user_dev.h +1 -1
Lines of this file are not shown. View the raw message.
drivers/net/virtio/virtio_user_ethdev.c +4 -4
Lines of this file are not shown. View the raw message.
examples/performance-thread/l3fwd-thread/main.c +7 -7
Lines of this file are not shown. View the raw message.
examples/vm_power_manager/channel_monitor.c +3 -3
Lines of this file are not shown. View the raw message.
lib/librte_eventdev/rte_event_eth_rx_adapter.c +5 -5
Lines of this file are not shown. View the raw message.
lib/librte_net/rte_ether.h +57 -57
114 lines not on this page · raw message
lib/librte_pipeline/rte_table_action.c +17 -17
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.11.0
Part of the diff is not shown here. View the raw message.
RFC v2 6/14 net: add rte prefix to esp structure
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct esp_hdr as struct rte_esp_hdr.
--- app/test/test_ipsec.c | 4 ++-- examples/ipsec-secgw/esp.c | 42 +++++++++++++++++++++--------------------- examples/ipsec-secgw/sa.c | 6 +++--- lib/librte_ethdev/rte_flow.h | 2 +- lib/librte_ipsec/crypto.h | 2 +- lib/librte_ipsec/esp_inb.c | 10 +++++----- lib/librte_ipsec/esp_outb.c | 8 ++++---- lib/librte_ipsec/sa.c | 8 ++++---- lib/librte_net/rte_esp.h | 2 +- 9 files changed, 42 insertions(+), 42 deletions(-)
app/test/test_ipsec.c +2 -2
@@ -572,12 +572,12 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string, size_t len, uint32_t spi, uint32_t seq) { struct rte_mbuf *m = rte_pktmbuf_alloc(mpool); -uint32_t hdrlen =sizeof (struct ipv4_hdr ) +sizeof (struct esp_hdr ); +uint32_t hdrlen =sizeof (struct ipv4_hdr ) +sizeof (struct rte_esp_hdr );uint32_t taillen =sizeof (struct esp_tail );uint32_t t_len = len + hdrlen + taillen;uint32_t padlen; -struct esp_hdr esph = { +struct rte_esp_hdr esph = { .spi =rte_cpu_to_be_32 (spi), .seq =rte_cpu_to_be_32 (seq) };
examples/ipsec-secgw/esp.c +21 -21
141 lines not on this page · raw message
examples/ipsec-secgw/sa.c +3 -3
@@ -1194,7 +1194,7 @@ static inline void single_inbound_lookup(struct ipsec_sa *sadb, struct rte_mbuf *pkt, struct ipsec_sa **sa_ret) { - struct esp_hdr *esp; + struct rte_esp_hdr *esp;struct ip *ip;uint32_t *src4_addr;uint8_t *src6_addr;
@@ -1204,9 +1204,9 @@ single_inbound_lookup(struct ipsec_sa *sadb, struct rte_mbuf *pkt, ip = rte_pktmbuf_mtod(pkt, struct ip *);if (ip->ip_v ==IPVERSION ) - esp = (struct esp_hdr *)(ip +1 ); + esp = (struct rte_esp_hdr *)(ip +1 );else - esp = (struct esp_hdr *)(((struct ip6_hdr *)ip) +1 ); + esp = (struct rte_esp_hdr *)(((struct ip6_hdr *)ip) +1 );if (esp->spi ==INVALID_SPI )return ;
lib/librte_ethdev/rte_flow.h +1 -1
@@ -916,7 +916,7 @@ static const struct rte_flow_item_gtp rte_flow_item_gtp_mask = {* Matches an ESP header. */ struct rte_flow_item_esp { -struct esp_hdr hdr;/**< ESP header definition. */ +struct rte_esp_hdr hdr;/**< ESP header definition. */ };/** Default mask for RTE_FLOW_ITEM_TYPE_ESP. */
lib/librte_ipsec/crypto.h +1 -1
@@ -47,7 +47,7 @@ struct aead_gcm_aad { } __attribute__((packed));struct gcm_esph_iv { -struct esp_hdr esph; +struct rte_esp_hdr esph;uint64_t iv; } __attribute__((packed));
lib/librte_ipsec/esp_inb.c +5 -5
@@ -68,7 +68,7 @@ inb_cop_prepare(struct rte_crypto_op *cop, algo = sa->algo_type; ivp = rte_pktmbuf_mtod_offset(mb, uint64_t *, - pofs +sizeof (struct esp_hdr )); + pofs +sizeof (struct rte_esp_hdr ));/* fill sym op fields */ sop = cop->sym;
@@ -139,9 +139,9 @@ inb_pkt_prepare(const struct rte_ipsec_sa *sa, const struct replay_sqn *rsn,uint64_t sqn;uint32_t clen, icv_ofs, plen;struct rte_mbuf *ml; -struct esp_hdr *esph; +struct rte_esp_hdr *esph; - esph = rte_pktmbuf_mtod_offset(mb, struct esp_hdr *, hlen); + esph = rte_pktmbuf_mtod_offset(mb, struct rte_esp_hdr *, hlen);/* * retrieve and reconstruct SQN, then check it, then
@@ -295,10 +295,10 @@ static inline void * tun_process_step2(struct rte_mbuf *mb, struct rte_mbuf *ml, uint32_t hlen, uint32_t adj, uint32_t tlen, uint32_t *sqn) { - const struct esp_hdr *ph; + const struct rte_esp_hdr *ph;/* read SQN value */ - ph = rte_pktmbuf_mtod_offset(mb, const struct esp_hdr *, hlen); + ph = rte_pktmbuf_mtod_offset(mb, const struct rte_esp_hdr *, hlen); sqn[0 ] = ph->seq;/* cut of ICV, ESP tail and padding bytes */
lib/librte_ipsec/esp_outb.c +4 -4
@@ -108,7 +108,7 @@ outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc, {uint32_t clen, hlen, l2len, pdlen, pdofs, plen, tlen;struct rte_mbuf *ml; -struct esp_hdr *esph; +struct rte_esp_hdr *esph;struct esp_tail *espt;char *ph, *pt;uint64_t *iv;
@@ -156,7 +156,7 @@ outb_tun_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc, sqn_low16(sqc));/* update spi, seqn and iv */ - esph = (struct esp_hdr *)(ph + sa->hdr_len); + esph = (struct rte_esp_hdr *)(ph + sa->hdr_len); iv = (uint64_t *)(esph +1 );copy_iv (iv, ivp, sa->iv_len);
@@ -275,7 +275,7 @@ outb_trs_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc,uint8_t np;uint32_t clen, hlen, pdlen, pdofs, plen, tlen, uhlen;struct rte_mbuf *ml; -struct esp_hdr *esph; +struct rte_esp_hdr *esph;struct esp_tail *espt;char *ph, *pt;uint64_t *iv;
@@ -318,7 +318,7 @@ outb_trs_pkt_prepare(struct rte_ipsec_sa *sa, rte_be64_t sqc, IPPROTO_ESP);/* update spi, seqn and iv */ - esph = (struct esp_hdr *)(ph + uhlen); + esph = (struct rte_esp_hdr *)(ph + uhlen); iv = (uint64_t *)(esph +1 );copy_iv (iv, ivp, sa->iv_len);
lib/librte_ipsec/sa.c +4 -4
@@ -233,7 +233,7 @@ esp_inb_init(struct rte_ipsec_sa *sa)/* these params may differ with new algorithms support */ sa->ctp.auth.offset =0 ; sa->ctp.auth.length = sa->icv_len - sa->sqh_len; - sa->ctp.cipher.offset =sizeof (struct esp_hdr ) + sa->iv_len; + sa->ctp.cipher.offset =sizeof (struct rte_esp_hdr ) + sa->iv_len; sa->ctp.cipher.length = sa->icv_len + sa->ctp.cipher.offset; }
@@ -259,7 +259,7 @@ esp_outb_init(struct rte_ipsec_sa *sa, uint32_t hlen)/* these params may differ with new algorithms support */ sa->ctp.auth.offset = hlen; - sa->ctp.auth.length =sizeof (struct esp_hdr ) + sa->iv_len + sa->sqh_len; + sa->ctp.auth.length =sizeof (struct rte_esp_hdr ) + sa->iv_len + sa->sqh_len; algo_type = sa->algo_type;
@@ -267,13 +267,13 @@ esp_outb_init(struct rte_ipsec_sa *sa, uint32_t hlen)case ALGO_TYPE_AES_GCM :case ALGO_TYPE_AES_CTR :case ALGO_TYPE_NULL : - sa->ctp.cipher.offset = hlen +sizeof (struct esp_hdr ) + + sa->ctp.cipher.offset = hlen +sizeof (struct rte_esp_hdr ) + sa->iv_len; sa->ctp.cipher.length =0 ;break ;case ALGO_TYPE_AES_CBC :case ALGO_TYPE_3DES_CBC : - sa->ctp.cipher.offset = sa->hdr_len +sizeof (struct esp_hdr ); + sa->ctp.cipher.offset = sa->hdr_len +sizeof (struct rte_esp_hdr ); sa->ctp.cipher.length = sa->iv_len;break ; }
lib/librte_net/rte_esp.h +1 -1
@@ -20,7 +20,7 @@ extern "C" {/** * ESP Header */ -struct esp_hdr { +struct rte_esp_hdr {rte_be32_t spi;/**< Security Parameters Index */ rte_be32_t seq;/**< packet sequence number */ } __attribute__((__packed__ ));
Signature · 1 line
2.11.0
RFC v2 7/14 net: add rte prefix to gre structure
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct gre_hdr as struct rte_gre_hdr.
--- drivers/net/mlx5/mlx5_flow_dv.c | 4 ++-- lib/librte_net/rte_gre.h | 2 +- lib/librte_net/rte_net.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/mlx5/mlx5_flow_dv.c +2 -2
@@ -1057,7 +1057,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf,struct udp_hdr *udp =NULL ;struct rte_vxlan_hdr *vxlan =NULL ;struct rte_vxlan_gpe_hdr *vxlan_gpe =NULL ; -struct gre_hdr *gre =NULL ; +struct rte_gre_hdr *gre =NULL ;size_t len;size_t temp_size =0 ;
@@ -1170,7 +1170,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf,break ;case RTE_FLOW_ITEM_TYPE_GRE :case RTE_FLOW_ITEM_TYPE_NVGRE : - gre = (struct gre_hdr *)&buf[temp_size]; + gre = (struct rte_gre_hdr *)&buf[temp_size];if (!gre->proto) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
lib/librte_net/rte_gre.h +1 -1
@@ -16,7 +16,7 @@ extern "C" {* GRE Header */ __extension__ -struct gre_hdr { +struct rte_gre_hdr { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN uint16_t res2:4; /**< Reserved */ uint16_t s:1; /**< Sequence Number Present bit */
lib/librte_net/rte_net.c +2 -2
@@ -140,8 +140,8 @@ ptype_tunnel(uint16_t *proto, const struct rte_mbuf *m, [0xa] = 12, [0xb] = 16, }; -const struct gre_hdr *gh; -struct gre_hdr gh_copy; +const struct rte_gre_hdr *gh; +struct rte_gre_hdr gh_copy;uint16_t flags; gh =rte_pktmbuf_read (m, *off,sizeof (*gh), &gh_copy);
Signature · 1 line
2.11.0
RFC v2 8/14 net: add rte prefix to icmp structure
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct icmp_hdr as struct rte_icmp_hdr.
--- app/test-pmd/icmpecho.c | 4 ++-- lib/librte_ethdev/rte_flow.h | 2 +- lib/librte_net/rte_icmp.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
app/test-pmd/icmpecho.c +2 -2
@@ -279,7 +279,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)struct rte_vlan_hdr *vlan_h;struct rte_arp_hdr *arp_h;struct ipv4_hdr *ip_h; -struct icmp_hdr *icmp_h; +struct rte_icmp_hdr *icmp_h;struct rte_ether_addr eth_addr;uint32_t retry;uint32_t ip_addr;
@@ -425,7 +425,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)/* * Check if packet is a ICMP echo request. */ - icmp_h = (struct icmp_hdr *) ((char *)ip_h + + icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h +sizeof (struct ipv4_hdr )); if (! ((ip_h->next_proto_id == IPPROTO_ICMP) && (icmp_h->icmp_type == IP_ICMP_ECHO_REQUEST) &&
lib/librte_ethdev/rte_flow.h +1 -1
@@ -674,7 +674,7 @@ static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {* Matches an ICMP header. */ struct rte_flow_item_icmp { -struct icmp_hdr hdr;/**< ICMP header definition. */ +struct rte_icmp_hdr hdr;/**< ICMP header definition. */ };/** Default mask for RTE_FLOW_ITEM_TYPE_ICMP. */
lib/librte_net/rte_icmp.h +1 -1
@@ -23,7 +23,7 @@ extern "C" {/** * ICMP Header */ -struct icmp_hdr { +struct rte_icmp_hdr {uint8_t icmp_type;/* ICMP packet type. */ uint8_t icmp_code;/* ICMP packet code. */ uint16_t icmp_cksum;/* ICMP packet checksum. */
Signature · 1 line
2.11.0
RFC v2 9/14 net: add rte prefix to icmp defines
In reply to Olivier MatzAdd 'RTE_' prefix to defines:
- rename IP_ICMP_ECHO_REPLY as RTE_IP_ICMP_ECHO_REPLY.
- rename IP_ICMP_ECHO_REQUEST as RTE_IP_ICMP_ECHO_REQUEST.
--- app/test-pmd/icmpecho.c | 10 +++++----- lib/librte_net/rte_icmp.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
app/test-pmd/icmpecho.c +5 -5
@@ -428,7 +428,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h +sizeof (struct ipv4_hdr ));if (! ((ip_h->next_proto_id ==IPPROTO_ICMP ) && - (icmp_h->icmp_type ==IP_ICMP_ECHO_REQUEST ) && + (icmp_h->icmp_type ==RTE_IP_ICMP_ECHO_REQUEST ) && (icmp_h->icmp_code ==0 ))) {rte_pktmbuf_free (pkt);continue ;
@@ -452,7 +452,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)* - switch the request IP source and destination * addresses in the reply IP header, * - keep the IP header checksum unchanged. -* - set IP_ICMP_ECHO_REPLY in ICMP header. +* - set RTE_IP_ICMP_ECHO_REPLY in ICMP header. * ICMP checksum is computed by assuming it is valid in the * echo request and not verified. */
@@ -475,10 +475,10 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) ip_h->src_addr = ip_h->dst_addr; ip_h->dst_addr = ip_addr; } - icmp_h->icmp_type =IP_ICMP_ECHO_REPLY ; + icmp_h->icmp_type =RTE_IP_ICMP_ECHO_REPLY ; cksum = ~icmp_h->icmp_cksum &0xffff ; - cksum += ~htons (IP_ICMP_ECHO_REQUEST <<8 ) &0xffff ; - cksum +=htons (IP_ICMP_ECHO_REPLY <<8 ); + cksum += ~htons (RTE_IP_ICMP_ECHO_REQUEST <<8 ) &0xffff ; + cksum +=htons (RTE_IP_ICMP_ECHO_REPLY <<8 ); cksum = (cksum &0xffff ) + (cksum >>16 ); cksum = (cksum &0xffff ) + (cksum >>16 ); icmp_h->icmp_cksum = ~cksum;
lib/librte_net/rte_icmp.h +2 -2
@@ -32,8 +32,8 @@ struct rte_icmp_hdr { } __attribute__((__packed__));/* ICMP packet types */ -#define IP_ICMP_ECHO_REPLY 0 -#define IP_ICMP_ECHO_REQUEST 8 +#define RTE_IP_ICMP_ECHO_REPLY 0 +#define RTE_IP_ICMP_ECHO_REQUEST 8 #ifdef __cplusplus }
Signature · 1 line
2.11.0
RFC v2 10/14 net: add rte prefix to ip structure
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_hdr.
--- app/test-pipeline/pipeline_acl.c | 10 +- app/test-pipeline/pipeline_hash.c | 8 +- app/test-pmd/csumonly.c | 40 ++++---- app/test-pmd/flowgen.c | 6 +- app/test-pmd/icmpecho.c | 8 +- app/test-pmd/macfwd.c | 2 +- app/test-pmd/macswap_common.h | 2 +- app/test-pmd/txonly.c | 16 +-- app/test-pmd/util.c | 12 +-- app/test/packet_burst_generator.c | 44 ++++----- app/test/packet_burst_generator.h | 6 +- app/test/test_flow_classify.c | 16 +-- app/test/test_ipsec.c | 4 +- app/test/test_link_bonding.c | 8 +- app/test/test_link_bonding_mode4.c | 4 +- app/test/test_pmd_perf.c | 2 +- app/test/test_sched.c | 4 +- app/test/test_thash.c | 2 +- .../prog_guide/packet_classif_access_ctrl.rst | 12 +-- doc/guides/sample_app_ug/flow_classify.rst | 10 +- doc/guides/sample_app_ug/ipv4_multicast.rst | 2 +- doc/guides/sample_app_ug/l3_forward.rst | 12 +-- doc/guides/sample_app_ug/server_node_efd.rst | 8 +- drivers/net/bonding/rte_eth_bond_pmd.c | 16 +-- drivers/net/dpaa/dpaa_rxtx.c | 8 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/ena/ena_ethdev.c | 4 +- drivers/net/enic/enic_clsf.c | 16 +-- drivers/net/enic/enic_flow.c | 30 +++--- drivers/net/i40e/i40e_fdir.c | 36 +++---- drivers/net/mlx5/mlx5_flow.c | 6 +- drivers/net/mlx5/mlx5_flow_dv.c | 8 +- drivers/net/mlx5/mlx5_flow_tcf.c | 12 +-- drivers/net/mvpp2/mrvl_flow.c | 2 +- drivers/net/qede/qede_filter.c | 14 +-- drivers/net/qede/qede_rxtx.c | 12 +-- drivers/net/sfc/sfc_tso.h | 4 +- drivers/net/softnic/rte_eth_softnic_pipeline.c | 32 +++--- drivers/net/tap/rte_eth_tap.c | 10 +- drivers/net/virtio/virtio_rxtx.c | 8 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 18 ++-- examples/bond/main.c | 4 +- examples/flow_classify/flow_classify.c | 10 +- examples/ip_fragmentation/main.c | 12 +-- examples/ip_pipeline/pipeline.c | 32 +++--- examples/ip_reassembly/main.c | 12 +-- examples/ipsec-secgw/ipsec-secgw.c | 2 +- examples/ipsec-secgw/sa.c | 6 +- examples/ipv4_multicast/main.c | 4 +- examples/l2fwd-crypto/main.c | 4 +- examples/l3fwd-acl/main.c | 80 +++++++-------- examples/l3fwd-power/main.c | 28 +++--- examples/l3fwd-vf/main.c | 18 ++-- examples/l3fwd/l3fwd.h | 6 +- examples/l3fwd/l3fwd_altivec.h | 10 +- examples/l3fwd/l3fwd_common.h | 4 +- examples/l3fwd/l3fwd_em.c | 14 +-- examples/l3fwd/l3fwd_em.h | 8 +- examples/l3fwd/l3fwd_em_hlm.h | 8 +- examples/l3fwd/l3fwd_em_hlm_neon.h | 8 +- examples/l3fwd/l3fwd_em_hlm_sse.h | 8 +- examples/l3fwd/l3fwd_em_sequential.h | 8 +- examples/l3fwd/l3fwd_lpm.c | 16 +-- examples/l3fwd/l3fwd_lpm.h | 8 +- examples/l3fwd/l3fwd_lpm_altivec.h | 10 +- examples/l3fwd/l3fwd_lpm_neon.h | 10 +- examples/l3fwd/l3fwd_lpm_sse.h | 10 +- examples/l3fwd/l3fwd_neon.h | 10 +- examples/l3fwd/l3fwd_sse.h | 10 +- examples/load_balancer/runtime.c | 4 +- examples/performance-thread/l3fwd-thread/main.c | 110 ++++++++++----------- examples/server_node_efd/node/node.c | 4 +- examples/server_node_efd/server/main.c | 4 +- examples/tep_termination/vxlan.c | 32 +++--- examples/tep_termination/vxlan.h | 2 +- examples/tep_termination/vxlan_setup.c | 4 +- examples/vhost/main.c | 2 +- lib/librte_ethdev/rte_flow.h | 4 +- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 16 +-- lib/librte_gro/gro_tcp4.c | 8 +- lib/librte_gro/gro_tcp4.h | 4 +- lib/librte_gro/gro_vxlan_tcp4.c | 12 +-- lib/librte_gso/gso_common.h | 4 +- lib/librte_gso/gso_tcp4.c | 8 +- lib/librte_gso/gso_tunnel_tcp4.c | 10 +- lib/librte_gso/gso_udp4.c | 8 +- lib/librte_gso/rte_gso.h | 4 +- lib/librte_hash/rte_thash.h | 2 +- lib/librte_ip_frag/rte_ip_frag.h | 8 +- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 26 ++--- lib/librte_ip_frag/rte_ipv4_reassembly.c | 6 +- lib/librte_ip_frag/rte_ipv6_fragmentation.c | 26 ++--- lib/librte_ip_frag/rte_ipv6_reassembly.c | 6 +- lib/librte_ipsec/iph.h | 8 +- lib/librte_net/rte_ip.h | 22 ++--- lib/librte_net/rte_net.c | 18 ++-- lib/librte_net/rte_net.h | 10 +- lib/librte_pipeline/rte_table_action.c | 50 +++++----- lib/librte_port/rte_port_ras.c | 4 +- lib/librte_vhost/virtio_net.c | 10 +- 100 files changed, 636 insertions(+), 636 deletions(-)
app/test-pipeline/pipeline_acl.c +5 -5
@@ -40,7 +40,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_FIELD_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, next_proto_id), + offsetof(struct rte_ipv4_hdr, next_proto_id), }, { .type = RTE_ACL_FIELD_TYPE_MASK,
@@ -48,7 +48,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .field_index = SRC_FIELD_IPV4, .input_index = SRC_FIELD_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, src_addr), + offsetof(struct rte_ipv4_hdr, src_addr), }, { .type = RTE_ACL_FIELD_TYPE_MASK,
@@ -56,21 +56,21 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .field_index = DST_FIELD_IPV4, .input_index = DST_FIELD_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, dst_addr), + offsetof(struct rte_ipv4_hdr, dst_addr), }, { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, - .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr), + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr), }, { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, - .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + sizeof(uint16_t), }, };
app/test-pipeline/pipeline_hash.c +4 -4
@@ -426,8 +426,8 @@ app_main_loop_rx_metadata(void) {for (j =0 ; j < n_mbufs; j++) {struct rte_mbuf *m;uint8_t *m_data, *key; -struct ipv4_hdr *ip_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ip_hdr; +struct rte_ipv6_hdr *ipv6_hdr;uint32_t ip_dst;uint8_t *ipv6_dst;uint32_t *signature, *k32;
@@ -440,14 +440,14 @@ app_main_loop_rx_metadata(void) { APP_METADATA_OFFSET(32));if (RTE_ETH_IS_IPV4_HDR (m->packet_type)) { - ip_hdr = (struct ipv4_hdr *) + ip_hdr = (struct rte_ipv4_hdr *) &m_data[sizeof (struct rte_ether_hdr )]; ip_dst = ip_hdr->dst_addr; k32 = (uint32_t *) key; k32[0 ] = ip_dst &0xFFFFFF00 ; }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) { - ipv6_hdr = (struct ipv6_hdr *) + ipv6_hdr = (struct rte_ipv6_hdr *) &m_data[sizeof (struct rte_ether_hdr )]; ipv6_dst = ipv6_hdr->dst_addr;
app/test-pmd/csumonly.c +20 -20
@@ -100,7 +100,7 @@ get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)/* Parse an IPv4 header to fill l3_len, l4_len, and l4_proto */ static void -parse_ipv4 (struct ipv4_hdr *ipv4_hdr,struct testpmd_offload_info *info) +parse_ipv4 (struct rte_ipv4_hdr *ipv4_hdr,struct testpmd_offload_info *info) {struct tcp_hdr *tcp_hdr;
@@ -119,11 +119,11 @@ parse_ipv4(struct ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)/* Parse an IPv6 header to fill l3_len, l4_len, and l4_proto */ static void -parse_ipv6 (struct ipv6_hdr *ipv6_hdr,struct testpmd_offload_info *info) +parse_ipv6 (struct rte_ipv6_hdr *ipv6_hdr,struct testpmd_offload_info *info) {struct tcp_hdr *tcp_hdr; - info->l3_len =sizeof (struct ipv6_hdr ); + info->l3_len =sizeof (struct rte_ipv6_hdr ); info->l4_proto = ipv6_hdr->proto;/* only fill l4_len for TCP, it's useful for TSO */
@@ -144,8 +144,8 @@ parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)static void parse_ethernet (struct rte_ether_hdr *eth_hdr,struct testpmd_offload_info *info) { -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr; info->l2_len =sizeof (struct rte_ether_hdr ); info->ethertype = eth_hdr->ether_type;
@@ -159,11 +159,11 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)switch (info->ethertype) {case _htons (RTE_ETHER_TYPE_IPv4): - ipv4_hdr = (struct ipv4_hdr *) ((char *)eth_hdr + info->l2_len); + ipv4_hdr = (struct rte_ipv4_hdr *) ((char *)eth_hdr + info->l2_len);parse_ipv4 (ipv4_hdr, info);break ;case _htons (RTE_ETHER_TYPE_IPv6): - ipv6_hdr = (struct ipv6_hdr *) ((char *)eth_hdr + info->l2_len); + ipv6_hdr = (struct rte_ipv6_hdr *) ((char *)eth_hdr + info->l2_len);parse_ipv6 (ipv6_hdr, info);break ;default :
@@ -209,8 +209,8 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info) {struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr;struct rte_vxlan_gpe_hdr *vxlan_gpe_hdr;uint8_t vxlan_gpe_len =sizeof (*vxlan_gpe_hdr);
@@ -229,7 +229,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr, info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr + + ipv4_hdr = (struct rte_ipv4_hdr *)((char *)vxlan_gpe_hdr + vxlan_gpe_len);parse_ipv4 (ipv4_hdr, info);
@@ -243,7 +243,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr, info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr + + ipv6_hdr = (struct rte_ipv6_hdr *)((char *)vxlan_gpe_hdr + vxlan_gpe_len); info->ethertype =_htons (RTE_ETHER_TYPE_IPv6);
@@ -272,8 +272,8 @@ static void parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info) { struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr;uint8_t gre_len =0 ; gre_len +=sizeof (struct simple_gre_hdr );
@@ -292,7 +292,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info) info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - ipv4_hdr = (struct ipv4_hdr *)((char *)gre_hdr + gre_len); + ipv4_hdr = (struct rte_ipv4_hdr *)((char *)gre_hdr + gre_len);parse_ipv4 (ipv4_hdr, info); info->ethertype =_htons (RTE_ETHER_TYPE_IPv4);
@@ -305,7 +305,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info) info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - ipv6_hdr = (struct ipv6_hdr *)((char *)gre_hdr + gre_len); + ipv6_hdr = (struct rte_ipv6_hdr *)((char *)gre_hdr + gre_len); info->ethertype =_htons (RTE_ETHER_TYPE_IPv6);parse_ipv6 (ipv6_hdr, info);
@@ -332,8 +332,8 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)static void parse_encap_ip (void *encap_ip,struct testpmd_offload_info *info) { -struct ipv4_hdr *ipv4_hdr = encap_ip; -struct ipv6_hdr *ipv6_hdr = encap_ip; +struct rte_ipv4_hdr *ipv4_hdr = encap_ip; +struct rte_ipv6_hdr *ipv6_hdr = encap_ip;uint8_t ip_version; ip_version = (ipv4_hdr->version_ihl &0xf0 ) >>4 ;
@@ -362,7 +362,7 @@ static uint64_t process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, uint64_t tx_offloads) { -struct ipv4_hdr *ipv4_hdr = l3_hdr; +struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;struct udp_hdr *udp_hdr;struct tcp_hdr *tcp_hdr;struct sctp_hdr *sctp_hdr;
@@ -453,8 +453,8 @@ static uint64_t process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info, uint64_t tx_offloads, int tso_enabled) { -struct ipv4_hdr *ipv4_hdr = outer_l3_hdr; -struct ipv6_hdr *ipv6_hdr = outer_l3_hdr; +struct rte_ipv4_hdr *ipv4_hdr = outer_l3_hdr; +struct rte_ipv6_hdr *ipv6_hdr = outer_l3_hdr;struct udp_hdr *udp_hdr;uint64_t ol_flags =0 ;
app/test-pmd/flowgen.c +3 -3
@@ -120,7 +120,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)struct rte_mempool *mbp;struct rte_mbuf *pkt;struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ip_hdr; +struct rte_ipv4_hdr *ip_hdr;struct udp_hdr *udp_hdr;uint16_t vlan_tci, vlan_tci_outer;uint64_t ol_flags =0 ;
@@ -176,7 +176,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) eth_hdr->ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4);/* Initialize IP header. */ - ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ip_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 );memset (ip_hdr,0 ,sizeof (*ip_hdr)); ip_hdr->version_ihl =IP_VHL_DEF ; ip_hdr->type_of_service =0 ;
@@ -206,7 +206,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) pkt->vlan_tci = vlan_tci; pkt->vlan_tci_outer = vlan_tci_outer; pkt->l2_len =sizeof (struct rte_ether_hdr ); - pkt->l3_len =sizeof (struct ipv4_hdr ); + pkt->l3_len =sizeof (struct rte_ipv4_hdr ); pkts_burst[nb_pkt] = pkt; next_flow = (next_flow +1 ) % cfg_n_flows;
app/test-pmd/icmpecho.c +4 -4
@@ -243,7 +243,7 @@ ipv4_addr_dump(const char *what, uint32_t be_ipv4_addr) }static uint16_t -ipv4_hdr_cksum (struct ipv4_hdr *ip_h) +ipv4_hdr_cksum (struct rte_ipv4_hdr *ip_h) {uint16_t *v16_h;uint32_t ip_cksum;
@@ -278,7 +278,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)struct rte_ether_hdr *eth_h;struct rte_vlan_hdr *vlan_h;struct rte_arp_hdr *arp_h; -struct ipv4_hdr *ip_h; +struct rte_ipv4_hdr *ip_h;struct rte_icmp_hdr *icmp_h;struct rte_ether_addr eth_addr;uint32_t retry;
@@ -413,7 +413,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)rte_pktmbuf_free (pkt);continue ; } - ip_h = (struct ipv4_hdr *) ((char *)eth_h + l2_len); + ip_h = (struct rte_ipv4_hdr *) ((char *)eth_h + l2_len);if (verbose_level >0 ) {ipv4_addr_dump (" IPV4: src=" , ip_h->src_addr);ipv4_addr_dump (" dst=" , ip_h->dst_addr);
@@ -426,7 +426,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)* Check if packet is a ICMP echo request. */ icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h + -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr ));if (! ((ip_h->next_proto_id ==IPPROTO_ICMP ) && (icmp_h->icmp_type ==RTE_IP_ICMP_ECHO_REQUEST ) && (icmp_h->icmp_code ==0 ))) {
app/test-pmd/macfwd.c +1 -1
@@ -99,7 +99,7 @@ pkt_burst_mac_forward(struct fwd_stream *fs) mb->ol_flags &=IND_ATTACHED_MBUF |EXT_ATTACHED_MBUF ; mb->ol_flags |= ol_flags; mb->l2_len =sizeof (struct rte_ether_hdr ); - mb->l3_len =sizeof (struct ipv4_hdr ); + mb->l3_len =sizeof (struct rte_ipv4_hdr ); mb->vlan_tci = txp->tx_vlan_id; mb->vlan_tci_outer = txp->tx_vlan_id_outer; }
app/test-pmd/macswap_common.h +1 -1
@@ -40,7 +40,7 @@ mbuf_field_set(struct rte_mbuf *mb, uint64_t ol_flags) mb->ol_flags &=IND_ATTACHED_MBUF |EXT_ATTACHED_MBUF ; mb->ol_flags |= ol_flags; mb->l2_len =sizeof (struct rte_ether_hdr ); - mb->l3_len = sizeof(struct ipv4_hdr); + mb->l3_len = sizeof(struct rte_ipv4_hdr); }#endif /* _MACSWAP_COMMON_H_ */
app/test-pmd/txonly.c +8 -8
@@ -51,7 +51,7 @@#define IP_HDRLEN 0x05/* default IP header length == five 32-bits words. */ #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN) -static struct ipv4_hdr pkt_ip_hdr;/**< IP header of transmitted packets. */ +static struct rte_ipv4_hdr pkt_ip_hdr;/**< IP header of transmitted packets. */ RTE_DEFINE_PER_LCORE (uint8_t, _ip_var);/**< IP address variation */ static struct udp_hdr pkt_udp_hdr;/**< UDP header of transmitted packets. */
@@ -93,7 +93,7 @@ copy_buf_to_pkt(void* buf, unsigned len, struct rte_mbuf *pkt, unsigned offset) }static void -setup_pkt_udp_ip_headers (struct ipv4_hdr *ip_hdr, +setup_pkt_udp_ip_headers (struct rte_ipv4_hdr *ip_hdr,struct udp_hdr *udp_hdr,uint16_t pkt_data_len) {
@@ -113,7 +113,7 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,/* * Initialize IP header. */ - pkt_len = (uint16_t ) (pkt_len +sizeof (struct ipv4_hdr )); + pkt_len = (uint16_t ) (pkt_len +sizeof (struct rte_ipv4_hdr )); ip_hdr->version_ihl =IP_VHL_DEF ; ip_hdr->type_of_service =0 ; ip_hdr->fragment_offset =0 ;
@@ -175,7 +175,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, pkt->vlan_tci = vlan_tci; pkt->vlan_tci_outer = vlan_tci_outer; pkt->l2_len =sizeof (struct rte_ether_hdr ); - pkt->l3_len =sizeof (struct ipv4_hdr ); + pkt->l3_len =sizeof (struct rte_ipv4_hdr ); pkt_len = pkt->data_len; pkt_seg = pkt;
@@ -193,11 +193,11 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,copy_buf_to_pkt (&pkt_ip_hdr,sizeof (pkt_ip_hdr), pkt,sizeof (struct rte_ether_hdr ));if (txonly_multi_flow) { -struct ipv4_hdr *ip_hdr; +struct rte_ipv4_hdr *ip_hdr;uint32_t addr; ip_hdr =rte_pktmbuf_mtod_offset (pkt, - struct ipv4_hdr *, + struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr ));/* * Generate multiple flows by varying IP src addr. This
@@ -211,7 +211,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, }copy_buf_to_pkt (&pkt_udp_hdr,sizeof (pkt_udp_hdr), pkt,sizeof (struct rte_ether_hdr ) + -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr ));/* * Complete first mbuf of packet and append it to the * burst of packets to be transmitted.
@@ -346,7 +346,7 @@ tx_only_begin(__attribute__((unused)) portid_t pi)uint16_t pkt_data_len; pkt_data_len = (uint16_t ) (tx_pkt_length - (sizeof (struct rte_ether_hdr ) + -sizeof (struct ipv4_hdr ) + +sizeof (struct rte_ipv4_hdr ) +sizeof (struct udp_hdr )));setup_pkt_udp_ip_headers (&pkt_ip_hdr, &pkt_udp_hdr, pkt_data_len); }
app/test-pmd/util.c +6 -6
@@ -103,8 +103,8 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],if (sw_packet_type &RTE_PTYPE_INNER_L4_MASK )printf (" - inner_l4_len=%d" , hdr_lens.inner_l4_len);if (is_encapsulation) { -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr;struct udp_hdr *udp_hdr;uint8_t l2_len;uint8_t l3_len;
@@ -116,15 +116,15 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],/* Do not support ipv4 option field */ if (RTE_ETH_IS_IPV4_HDR (packet_type)) { - l3_len =sizeof (struct ipv4_hdr ); + l3_len =sizeof (struct rte_ipv4_hdr ); ipv4_hdr =rte_pktmbuf_mtod_offset (mb, - struct ipv4_hdr *, + struct rte_ipv4_hdr *, l2_len); l4_proto = ipv4_hdr->next_proto_id; }else { - l3_len =sizeof (struct ipv6_hdr ); + l3_len =sizeof (struct rte_ipv6_hdr ); ipv6_hdr =rte_pktmbuf_mtod_offset (mb, - struct ipv6_hdr *, + struct rte_ipv6_hdr *, l2_len); l4_proto = ipv6_hdr->proto; }
app/test/packet_burst_generator.c +22 -22
139 lines not on this page · raw message
app/test/packet_burst_generator.h +3 -3
@@ -46,15 +46,15 @@ initialize_sctp_header(struct sctp_hdr *sctp_hdr, uint16_t src_port, uint16_t dst_port, uint16_t pkt_data_len);uint16_t -initialize_ipv6_header (struct ipv6_hdr *ip_hdr,uint8_t *src_addr, +initialize_ipv6_header (struct rte_ipv6_hdr *ip_hdr,uint8_t *src_addr,uint8_t *dst_addr,uint16_t pkt_data_len);uint16_t -initialize_ipv4_header (struct ipv4_hdr *ip_hdr,uint32_t src_addr, +initialize_ipv4_header (struct rte_ipv4_hdr *ip_hdr,uint32_t src_addr,uint32_t dst_addr,uint16_t pkt_data_len);uint16_t -initialize_ipv4_header_proto (struct ipv4_hdr *ip_hdr,uint32_t src_addr, +initialize_ipv4_header_proto (struct rte_ipv4_hdr *ip_hdr,uint32_t src_addr,uint32_t dst_addr,uint16_t pkt_data_len,uint8_t proto);int
app/test/test_flow_classify.c +8 -8
@@ -40,7 +40,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, next_proto_id), + offsetof(struct rte_ipv4_hdr, next_proto_id), },/* next input field (IPv4 source address) - 4 consecutive bytes. */ {
@@ -50,7 +50,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, src_addr), + offsetof(struct rte_ipv4_hdr, src_addr), },/* next input field (IPv4 destination address) - 4 consecutive bytes. */ {
@@ -60,7 +60,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, .offset =sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv4_hdr, dst_addr), + offsetof(struct rte_ipv4_hdr, dst_addr), },/* * Next 2 fields (src & dst ports) form 4 consecutive bytes.
@@ -73,7 +73,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - sizeof(struct ipv4_hdr) + + sizeof(struct rte_ipv4_hdr) + offsetof(struct tcp_hdr, src_port), }, {
@@ -83,7 +83,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, .offset =sizeof (struct rte_ether_hdr ) + -sizeof (struct ipv4_hdr ) + +sizeof (struct rte_ipv4_hdr ) + offsetof(struct tcp_hdr, dst_port), }, };
@@ -490,7 +490,7 @@ init_ipv4_udp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) {struct rte_ether_hdr pkt_eth_hdr; -struct ipv4_hdr pkt_ipv4_hdr; +struct rte_ipv4_hdr pkt_ipv4_hdr;struct udp_hdr pkt_udp_hdr;uint32_t src_addr =IPV4_ADDR (2 ,2 ,2 ,3 );uint32_t dst_addr =IPV4_ADDR (2 ,2 ,2 ,7 );
@@ -527,7 +527,7 @@ init_ipv4_tcp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) {struct rte_ether_hdr pkt_eth_hdr; -struct ipv4_hdr pkt_ipv4_hdr; +struct rte_ipv4_hdr pkt_ipv4_hdr;struct tcp_hdr pkt_tcp_hdr;uint32_t src_addr =IPV4_ADDR (1 ,2 ,3 ,4 );uint32_t dst_addr =IPV4_ADDR (5 ,6 ,7 ,8 );
@@ -564,7 +564,7 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) {struct rte_ether_hdr pkt_eth_hdr; -struct ipv4_hdr pkt_ipv4_hdr; +struct rte_ipv4_hdr pkt_ipv4_hdr;struct sctp_hdr pkt_sctp_hdr;uint32_t src_addr =IPV4_ADDR (11 ,12 ,13 ,14 );uint32_t dst_addr =IPV4_ADDR (15 ,16 ,17 ,18 );
app/test/test_ipsec.c +2 -2
@@ -534,7 +534,7 @@ const char null_encrypted_data[] ="Network Security People Have A Strange Sense Of Humor unlike Other " "People who have a normal sense of humour" ; -struct ipv4_hdr ipv4_outer = { +struct rte_ipv4_hdr ipv4_outer = { .version_ihl =IPVERSION <<4 |sizeof (ipv4_outer) /IPV4_IHL_MULTIPLIER , .time_to_live =IPDEFTTL ,
@@ -572,7 +572,7 @@ setup_test_string_tunneled(struct rte_mempool *mpool, const char *string, size_t len, uint32_t spi, uint32_t seq) { struct rte_mbuf *m = rte_pktmbuf_alloc(mpool); -uint32_t hdrlen =sizeof (struct ipv4_hdr ) +sizeof (struct rte_esp_hdr ); +uint32_t hdrlen =sizeof (struct rte_ipv4_hdr ) +sizeof (struct rte_esp_hdr );uint32_t taillen =sizeof (struct esp_tail );uint32_t t_len = len + hdrlen + taillen;uint32_t padlen;
app/test/test_link_bonding.c +4 -4
@@ -78,14 +78,14 @@ struct link_bonding_unittest_params {/* Packet Headers */ struct rte_ether_hdr *pkt_eth_hdr; -struct ipv4_hdr *pkt_ipv4_hdr; -struct ipv6_hdr *pkt_ipv6_hdr; +struct rte_ipv4_hdr *pkt_ipv4_hdr; +struct rte_ipv6_hdr *pkt_ipv6_hdr;struct udp_hdr *pkt_udp_hdr; }; -static struct ipv4_hdr pkt_ipv4_hdr; -static struct ipv6_hdr pkt_ipv6_hdr; +static struct rte_ipv4_hdr pkt_ipv4_hdr; +static struct rte_ipv6_hdr pkt_ipv6_hdr;static struct udp_hdr pkt_udp_hdr;static struct link_bonding_unittest_params default_params = {
app/test/test_link_bonding_mode4.c +2 -2
@@ -734,8 +734,8 @@ generate_packets(struct rte_ether_addr *src_mac,struct rte_ether_hdr pkt_eth_hdr;struct udp_hdr pkt_udp_hdr;union { -struct ipv4_hdr v4; -struct ipv6_hdr v6; +struct rte_ipv4_hdr v4; +struct rte_ipv6_hdr v6; } pkt_ip_hdr;int retval;
app/test/test_pmd_perf.c +1 -1
@@ -183,7 +183,7 @@ init_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) {struct rte_ether_hdr pkt_eth_hdr; -struct ipv4_hdr pkt_ipv4_hdr; +struct rte_ipv4_hdr pkt_ipv4_hdr;struct udp_hdr pkt_udp_hdr;uint32_t pktlen;static uint8_t src_mac[] = {0x00 ,0xFF ,0xAA ,0xFF ,0xAA ,0xFF };
app/test/test_sched.c +2 -2
@@ -80,14 +80,14 @@ prepare_pkt(struct rte_sched_port *port, struct rte_mbuf *mbuf) {struct rte_ether_hdr *eth_hdr;struct rte_vlan_hdr *vlan1, *vlan2; -struct ipv4_hdr *ip_hdr; +struct rte_ipv4_hdr *ip_hdr;/* Simulate a classifier */ eth_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *); vlan1 = (struct rte_vlan_hdr *)(ð_hdr->ether_type ); vlan2 = (struct rte_vlan_hdr *)((uintptr_t )ð_hdr->ether_type +sizeof (struct rte_vlan_hdr )); eth_hdr = (struct rte_ether_hdr *)((uintptr_t )ð_hdr->ether_type +2 *sizeof (struct rte_vlan_hdr )); - ip_hdr = (struct ipv4_hdr *)((uintptr_t )eth_hdr +sizeof (eth_hdr->ether_type)); + ip_hdr = (struct rte_ipv4_hdr *)((uintptr_t )eth_hdr +sizeof (eth_hdr->ether_type)); vlan1->vlan_tci =rte_cpu_to_be_16 (SUBPORT ); vlan2->vlan_tci =rte_cpu_to_be_16 (PIPE );
app/test/test_thash.c +1 -1
@@ -110,7 +110,7 @@ test_thash(void)union rte_thash_tuple tuple;uint32_t rss_l3, rss_l3l4;uint8_t rss_key_be[RTE_DIM (default_rss_key)]; -struct ipv6_hdr ipv6_hdr; +struct rte_ipv6_hdr ipv6_hdr;/* Convert RSS key*/ rte_convert_rss_key((uint32_t *)&default_rss_key,
doc/guides/prog_guide/packet_classif_access_ctrl.rst +6 -6
@@ -154,7 +154,7 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o .. code-block:: c - struct struct ipv6_hdr { + struct struct rte_ipv6_hdr { uint32_t vtc_flow; /* IP version, traffic class & flow label. */ uint16_t payload_len; /* IP packet length - includes sizeof(ip_header). */ uint8_t proto; /* Protocol, next header. */
@@ -173,7 +173,7 @@ The following array of field definitions can be used: .size = sizeof (uint8_t), .field_index = 0, .input_index = 0, - .offset = offsetof (struct ipv6_hdr, proto), + .offset = offsetof (struct rte_ipv6_hdr, proto), }, {
@@ -181,7 +181,7 @@ The following array of field definitions can be used: .size = sizeof (uint32_t), .field_index = 1, .input_index = 1, - .offset = offsetof (struct ipv6_hdr, src_addr[0]), + .offset = offsetof (struct rte_ipv6_hdr, src_addr[0]), }, {
@@ -189,7 +189,7 @@ The following array of field definitions can be used: .size = sizeof (uint32_t), .field_index = 2, .input_index = 2, - .offset = offsetof (struct ipv6_hdr, src_addr[4]), + .offset = offsetof (struct rte_ipv6_hdr, src_addr[4]), }, {
@@ -197,7 +197,7 @@ The following array of field definitions can be used: .size = sizeof (uint32_t), .field_index = 3, .input_index = 3, - .offset = offsetof (struct ipv6_hdr, src_addr[8]), + .offset = offsetof (struct rte_ipv6_hdr, src_addr[8]), }, {
@@ -205,7 +205,7 @@ The following array of field definitions can be used: .size = sizeof (uint32_t), .field_index = 4, .input_index = 4, - .offset = offsetof (struct ipv6_hdr, src_addr[12]), + .offset = offsetof (struct rte_ipv6_hdr, src_addr[12]), }, };
doc/guides/sample_app_ug/flow_classify.rst +5 -5
@@ -92,7 +92,7 @@ initialisation of the ``Flow Classify`` application.. .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, next_proto_id), + offsetof(struct rte_ipv4_hdr, next_proto_id), }, /* next input field (IPv4 source address) - 4 consecutive bytes. */ {
@@ -102,7 +102,7 @@ initialisation of the ``Flow Classify`` application.. .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, src_addr), + offsetof(struct rte_ipv4_hdr, src_addr), }, /* next input field (IPv4 destination address) - 4 consecutive bytes. */ {
@@ -112,7 +112,7 @@ initialisation of the ``Flow Classify`` application.. .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, dst_addr), + offsetof(struct rte_ipv4_hdr, dst_addr), }, /* * Next 2 fields (src & dst ports) form 4 consecutive bytes.
@@ -125,7 +125,7 @@ initialisation of the ``Flow Classify`` application.. .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - sizeof(struct ipv4_hdr) + + sizeof(struct rte_ipv4_hdr) + offsetof(struct tcp_hdr, src_port), }, {
@@ -135,7 +135,7 @@ initialisation of the ``Flow Classify`` application.. .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - sizeof(struct ipv4_hdr) + + sizeof(struct rte_ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), }, };
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
@@ -146,7 +146,7 @@ Firstly, the Ethernet* header is removed from the packet and the IPv4 address is /* Remove the Ethernet header from the input packet */ - iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct rte_ether_hdr)); + iphdr = (struct rte_ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct rte_ether_hdr)); RTE_ASSERT(iphdr != NULL); dest_addr = rte_be_to_cpu_32(iphdr->dst_addr);
doc/guides/sample_app_ug/l3_forward.rst +6 -6
@@ -242,7 +242,7 @@ The get_ipv4_dst_port() function is shown below: int ret = 0; union ipv4_5tuple_host key; - ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct ipv4_hdr, time_to_live); + ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct rte_ipv4_hdr, time_to_live); m128i data = _mm_loadu_si128(( m128i*)(ipv4_hdr));
@@ -270,10 +270,10 @@ The key code snippet of simple_ipv4_fwd_4pkts() is shown below: { // ... - data[0] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[0], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[0] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[0], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live))); + data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live))); + data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live))); + data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live))); key[0].xmm = _mm_and_si128(data[0], mask0); key[1].xmm = _mm_and_si128(data[1], mask0);
@@ -306,7 +306,7 @@ for LPM-based lookups is done by the get_ipv4_dst_port() function below: .. code-block:: c static inline uint16_t - get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) + get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct) { uint8_t next_hop;
doc/guides/sample_app_ug/server_node_efd.rst +4 -4
@@ -191,12 +191,12 @@ which tells the node where the packet has to be distributed. efd_value_t data[EFD_BURST_MAX]; const void *key_ptrs[EFD_BURST_MAX]; - struct ipv4_hdr *ipv4_hdr; + struct rte_ipv4_hdr *ipv4_hdr; uint32_t ipv4_dst_ip[EFD_BURST_MAX]; for (i = 0; i < rx_count; i++) { /* Handle IPv4 header.*/ - ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct ipv4_hdr *, + ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct rte_ipv4_hdr *, sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = (void *)&ipv4_dst_ip[i];
@@ -348,7 +348,7 @@ flow is not handled by the node. static inline void handle_packets(struct rte_hash *h, struct rte_mbuf **bufs, uint16_t num_packets) { - struct ipv4_hdr *ipv4_hdr; + struct rte_ipv4_hdr *ipv4_hdr; uint32_t ipv4_dst_ip[PKT_READ_SIZE]; const void *key_ptrs[PKT_READ_SIZE]; unsigned int i;
@@ -356,7 +356,7 @@ flow is not handled by the node. for (i = 0; i < num_packets; i++) { /* Handle IPv4 header.*/ - ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct ipv4_hdr *, + ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct rte_ipv4_hdr *, sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = &ipv4_dst_ip[i];
drivers/net/bonding/rte_eth_bond_pmd.c +8 -8
@@ -587,7 +587,7 @@ static void mode6_debug(const char __attribute__((unused)) *info, struct rte_ether_hdr *eth_h, uint16_t port, uint32_t __attribute__((unused)) *burstnumber) { - struct ipv4_hdr *ipv4_h; + struct rte_ipv4_hdr *ipv4_h;#ifdef RTE_LIBRTE_BOND_DEBUG_ALB struct rte_arp_hdr *arp_h;char dst_ip[16 ];
@@ -604,7 +604,7 @@ mode6_debug(const char __attribute__((unused)) *info, struct rte_ether_hdr *eth_#endif if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4)) { - ipv4_h = (struct ipv4_hdr *)((char *)(eth_h +1 ) + offset); + ipv4_h = (struct rte_ipv4_hdr *)((char *)(eth_h +1 ) + offset);ipv4_addr_to_dot (ipv4_h->src_addr, src_ip, MaxIPv4String);#ifdef RTE_LIBRTE_BOND_DEBUG_ALB ipv4_addr_to_dot (ipv4_h->dst_addr, dst_ip, MaxIPv4String);
@@ -751,13 +751,13 @@ ether_hash(struct rte_ether_hdr *eth_hdr) }static inline uint32_t -ipv4_hash (struct ipv4_hdr *ipv4_hdr) +ipv4_hash (struct rte_ipv4_hdr *ipv4_hdr) {return ipv4_hdr->src_addr ^ ipv4_hdr->dst_addr; }static inline uint32_t -ipv6_hash (struct ipv6_hdr *ipv6_hdr) +ipv6_hash (struct rte_ipv6_hdr *ipv6_hdr) {unaligned_uint32_t *word_src_addr = (unaligned_uint32_t *)&(ipv6_hdr->src_addr[0 ]);
@@ -808,12 +808,12 @@ burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, vlan_offset =get_vlan_offset (eth_hdr, &proto);if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4) == proto) { -struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *) +struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset); l3hash =ipv4_hash (ipv4_hdr); }else if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6) == proto) { -struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *) +struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset); l3hash =ipv6_hash (ipv6_hdr); }
@@ -847,7 +847,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, l4hash =0 ;if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4) == proto) { -struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *) +struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset);size_t ip_hdr_offset;
@@ -874,7 +874,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, } } }else if (rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6) == proto) { -struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *) +struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *) ((char *)(eth_hdr +1 ) + vlan_offset); l3hash =ipv6_hash (ipv6_hdr);
drivers/net/dpaa/dpaa_rxtx.c +4 -4
@@ -200,22 +200,22 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf) { struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *);char *l3_hdr = (char *)eth_hdr + mbuf->l2_len; -struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)l3_hdr; -struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)l3_hdr; +struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr; +struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;DPAA_DP_LOG (DEBUG ,"Calculating checksum for mbuf: %p" , mbuf);if (((mbuf->packet_type &RTE_PTYPE_L3_MASK ) ==RTE_PTYPE_L3_IPV4 ) || ((mbuf->packet_type &RTE_PTYPE_L3_MASK ) ==RTE_PTYPE_L3_IPV4_EXT )) { - ipv4_hdr = (struct ipv4_hdr *)l3_hdr; + ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr; ipv4_hdr->hdr_checksum =0 ; ipv4_hdr->hdr_checksum =rte_ipv4_cksum (ipv4_hdr); }else if (((mbuf->packet_type &RTE_PTYPE_L3_MASK ) ==RTE_PTYPE_L3_IPV6 ) || ((mbuf->packet_type &RTE_PTYPE_L3_MASK ) ==RTE_PTYPE_L3_IPV6_EXT )) - ipv6_hdr = (struct ipv6_hdr *)l3_hdr; + ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;if ((mbuf->packet_type &RTE_PTYPE_L4_MASK ) ==RTE_PTYPE_L4_TCP ) { struct tcp_hdr *tcp_hdr = (struct tcp_hdr *)(l3_hdr +
drivers/net/e1000/em_rxtx.c +1 -1
@@ -222,7 +222,7 @@ em_set_xmit_ctx(struct em_tx_queue* txq,/* setup IPCS* fields */ ctx.lower_setup.ip_fields.ipcss = (uint8_t )l2len; ctx.lower_setup.ip_fields.ipcso = (uint8_t )(l2len + - offsetof(struct ipv4_hdr , hdr_checksum)); + offsetof(struct rte_ipv4_hdr , hdr_checksum));/* * When doing checksum or TCP segmentation with IPv6 headers,
drivers/net/ena/ena_ethdev.c +2 -2
@@ -2136,7 +2136,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,uint32_t i;struct rte_mbuf *m;struct ena_ring *tx_ring = (struct ena_ring *)(tx_queue); -struct ipv4_hdr *ip_hdr; +struct rte_ipv4_hdr *ip_hdr;uint64_t ol_flags;uint16_t frag_field;
@@ -2153,7 +2153,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,if (unlikely (m->l2_len ==0 )) m->l2_len =sizeof (struct rte_ether_hdr ); - ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + ip_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *, m->l2_len); frag_field =rte_be_to_cpu_16 (ip_hdr->fragment_offset);
drivers/net/enic/enic_clsf.c +8 -8
@@ -183,9 +183,9 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_TCP || input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_SCTP || input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) { -struct ipv4_hdr ip4_mask, ip4_val; -memset (&ip4_mask,0 ,sizeof (struct ipv4_hdr )); -memset (&ip4_val,0 ,sizeof (struct ipv4_hdr )); +struct rte_ipv4_hdr ip4_mask, ip4_val; +memset (&ip4_mask,0 ,sizeof (struct rte_ipv4_hdr )); +memset (&ip4_val,0 ,sizeof (struct rte_ipv4_hdr ));if (input->flow.ip4_flow.tos) { ip4_mask.type_of_service = masks->ipv4_mask.tos;
@@ -213,7 +213,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, }enic_set_layer (gp,FILTER_GENERIC_1_IPV4 ,FILTER_GENERIC_1_L3 , - &ip4_mask, &ip4_val,sizeof (struct ipv4_hdr )); + &ip4_mask, &ip4_val,sizeof (struct rte_ipv4_hdr )); }if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV6_UDP ) {
@@ -272,9 +272,9 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_TCP || input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_SCTP || input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) { -struct ipv6_hdr ipv6_mask, ipv6_val; -memset (&ipv6_mask,0 ,sizeof (struct ipv6_hdr )); -memset (&ipv6_val,0 ,sizeof (struct ipv6_hdr )); +struct rte_ipv6_hdr ipv6_mask, ipv6_val; +memset (&ipv6_mask,0 ,sizeof (struct rte_ipv6_hdr )); +memset (&ipv6_val,0 ,sizeof (struct rte_ipv6_hdr ));if (input->flow.ipv6_flow.proto) { ipv6_mask.proto = masks->ipv6_mask.proto;
@@ -302,7 +302,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, }enic_set_layer (gp,FILTER_GENERIC_1_IPV6 ,FILTER_GENERIC_1_L3 , - &ipv6_mask, &ipv6_val,sizeof (struct ipv6_hdr )); + &ipv6_mask, &ipv6_val,sizeof (struct rte_ipv6_hdr )); } }
drivers/net/enic/enic_flow.c +15 -15
@@ -410,7 +410,7 @@ enic_copy_item_ipv4_v1(struct copy_item_args *arg)const struct rte_flow_item_ipv4 *spec = item->spec;const struct rte_flow_item_ipv4 *mask = item->mask;struct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4; -struct ipv4_hdr supported_mask = { +struct rte_ipv4_hdr supported_mask = { .src_addr =0xffffffff , .dst_addr =0xffffffff , };
@@ -605,9 +605,9 @@ enic_copy_item_inner_ipv4_v2(struct copy_item_args *arg)if (!mask) mask = &rte_flow_item_ipv4_mask;/* Append ipv4 header to L5 and set ether type = ipv4 */ - arg->l3_proto_off = *off + offsetof(struct ipv4_hdr , next_proto_id); + arg->l3_proto_off = *off + offsetof(struct rte_ipv4_hdr , next_proto_id);return copy_inner_common (&arg->filter->u.generic_1, off, - arg->item->spec, mask,sizeof (struct ipv4_hdr ), + arg->item->spec, mask,sizeof (struct rte_ipv4_hdr ), arg->l2_proto_off,rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4),2 ); }
@@ -621,9 +621,9 @@ enic_copy_item_inner_ipv6_v2(struct copy_item_args *arg)if (!mask) mask = &rte_flow_item_ipv6_mask;/* Append ipv6 header to L5 and set ether type = ipv6 */ - arg->l3_proto_off = *off + offsetof(struct ipv6_hdr , proto); + arg->l3_proto_off = *off + offsetof(struct rte_ipv6_hdr , proto);return copy_inner_common (&arg->filter->u.generic_1, off, - arg->item->spec, mask,sizeof (struct ipv6_hdr ), + arg->item->spec, mask,sizeof (struct rte_ipv6_hdr ), arg->l2_proto_off,rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6),2 ); }
@@ -758,9 +758,9 @@ enic_copy_item_ipv4_v2(struct copy_item_args *arg) mask = &rte_flow_item_ipv4_mask;memcpy (gp->layer[FILTER_GENERIC_1_L3 ].mask, &mask->hdr, -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr ));memcpy (gp->layer[FILTER_GENERIC_1_L3 ].val, &spec->hdr, -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr ));return 0 ; }
@@ -787,9 +787,9 @@ enic_copy_item_ipv6_v2(struct copy_item_args *arg) mask = &rte_flow_item_ipv6_mask;memcpy (gp->layer[FILTER_GENERIC_1_L3 ].mask, &mask->hdr, -sizeof (struct ipv6_hdr )); +sizeof (struct rte_ipv6_hdr ));memcpy (gp->layer[FILTER_GENERIC_1_L3 ].val, &spec->hdr, -sizeof (struct ipv6_hdr )); +sizeof (struct rte_ipv6_hdr ));return 0 ; }
@@ -869,16 +869,16 @@ enic_copy_item_sctp_v2(struct copy_item_args *arg)* the protocol number in the IP pattern. */ if (gp->val_flags &FILTER_GENERIC_1_IPV4 ) { -struct ipv4_hdr *ip; - ip = (struct ipv4_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].mask; +struct rte_ipv4_hdr *ip; + ip = (struct rte_ipv4_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].mask; ip_proto_mask = &ip->next_proto_id; - ip = (struct ipv4_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].val; + ip = (struct rte_ipv4_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].val; ip_proto = &ip->next_proto_id; }else if (gp->val_flags &FILTER_GENERIC_1_IPV6 ) { -struct ipv6_hdr *ip; - ip = (struct ipv6_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].mask; +struct rte_ipv6_hdr *ip; + ip = (struct rte_ipv6_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].mask; ip_proto_mask = &ip->proto; - ip = (struct ipv6_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].val; + ip = (struct rte_ipv6_hdr *)gp->layer[FILTER_GENERIC_1_L3 ].val; ip_proto = &ip->proto; }else {/* Need IPv4/IPv6 pattern first */
drivers/net/i40e/i40e_fdir.c +18 -18
@@ -686,8 +686,8 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,static uint8_t vlan_frame[] = {0x81 ,0 ,0 ,0 };uint16_t *ether_type;uint8_t len =2 *sizeof (struct rte_ether_addr ); -struct ipv4_hdr *ip; -struct ipv6_hdr *ip6; +struct rte_ipv4_hdr *ip; +struct rte_ipv6_hdr *ip6;static const uint8_t next_proto[] = { [RTE_ETH_FLOW_FRAG_IPV4 ] =IPPROTO_IP , [RTE_ETH_FLOW_NONFRAG_IPV4_TCP ] =IPPROTO_TCP ,
@@ -723,7 +723,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP :case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER :case RTE_ETH_FLOW_FRAG_IPV4 : - ip = (struct ipv4_hdr *)raw_pkt; + ip = (struct rte_ipv4_hdr *)raw_pkt; *ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4); ip->version_ihl =I40E_FDIR_IP_DEFAULT_VERSION_IHL ;
@@ -743,14 +743,14 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,*/ ip->src_addr = fdir_input->flow.ip4_flow.dst_ip; ip->dst_addr = fdir_input->flow.ip4_flow.src_ip; - len +=sizeof (struct ipv4_hdr ); + len +=sizeof (struct rte_ipv4_hdr );break ;case RTE_ETH_FLOW_NONFRAG_IPV6_TCP :case RTE_ETH_FLOW_NONFRAG_IPV6_UDP :case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP :case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER :case RTE_ETH_FLOW_FRAG_IPV6 : - ip6 = (struct ipv6_hdr *)raw_pkt; + ip6 = (struct rte_ipv6_hdr *)raw_pkt; *ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6); ip6->vtc_flow =
@@ -776,7 +776,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,rte_memcpy (&(ip6->dst_addr), &(fdir_input->flow.ipv6_flow.src_ip),IPV6_ADDR_LEN ); - len +=sizeof (struct ipv6_hdr ); + len +=sizeof (struct rte_ipv6_hdr );break ;default : PMD_DRV_LOG(ERR, "unknown flow type %u.",
@@ -960,8 +960,8 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,static uint8_t vlan_frame[] = {0x81 ,0 ,0 ,0 };uint16_t *ether_type;uint8_t len =2 *sizeof (struct rte_ether_addr ); -struct ipv4_hdr *ip; -struct ipv6_hdr *ip6; +struct rte_ipv4_hdr *ip; +struct rte_ipv6_hdr *ip6;uint8_t pctype = fdir_input->pctype;bool is_customized_pctype = fdir_input->flow_ext.customized_pctype;static const uint8_t next_proto[] = {
@@ -1007,7 +1007,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf, pctype == I40E_FILTER_PCTYPE_NONF_IPV4_OTHER || pctype == I40E_FILTER_PCTYPE_FRAG_IPV4 || is_customized_pctype) { - ip = (struct ipv4_hdr *)raw_pkt; + ip = (struct rte_ipv4_hdr *)raw_pkt; *ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4); ip->version_ihl =I40E_FDIR_IP_DEFAULT_VERSION_IHL ;
@@ -1034,13 +1034,13 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf, cus_pctype->index ==I40E_CUSTOMIZED_GTPU_IPV6 || cus_pctype->index == I40E_CUSTOMIZED_GTPU) ip->next_proto_id = IPPROTO_UDP; - len +=sizeof (struct ipv4_hdr ); + len +=sizeof (struct rte_ipv4_hdr ); }else if (pctype ==I40E_FILTER_PCTYPE_NONF_IPV6_TCP || pctype ==I40E_FILTER_PCTYPE_NONF_IPV6_UDP || pctype ==I40E_FILTER_PCTYPE_NONF_IPV6_SCTP || pctype ==I40E_FILTER_PCTYPE_NONF_IPV6_OTHER || pctype ==I40E_FILTER_PCTYPE_FRAG_IPV6 ) { - ip6 = (struct ipv6_hdr *)raw_pkt; + ip6 = (struct rte_ipv6_hdr *)raw_pkt; *ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6); ip6->vtc_flow =
@@ -1066,7 +1066,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,rte_memcpy (&ip6->dst_addr, &fdir_input->flow.ipv6_flow.src_ip,IPV6_ADDR_LEN ); - len +=sizeof (struct ipv6_hdr ); + len +=sizeof (struct rte_ipv6_hdr ); }else {PMD_DRV_LOG (ERR ,"unknown pctype %u." , fdir_input->pctype);
@@ -1093,8 +1093,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,struct tcp_hdr *tcp;struct sctp_hdr *sctp;struct rte_flow_item_gtp *gtp; -struct ipv4_hdr *gtp_ipv4; -struct ipv6_hdr *gtp_ipv6; +struct rte_ipv4_hdr *gtp_ipv4; +struct rte_ipv6_hdr *gtp_ipv6;uint8_t size, dst =0 ;uint8_t i, pit_idx, set_idx =I40E_FLXPLD_L4_IDX ;/* use l4 by default*/ int len;
@@ -1232,7 +1232,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,if (cus_pctype->index ==I40E_CUSTOMIZED_GTPU_IPV4 ) { gtp->msg_type =I40E_FDIR_GTP_MSG_TYPE_0XFF ; - gtp_ipv4 = (struct ipv4_hdr *) + gtp_ipv4 = (struct rte_ipv4_hdr *) ((unsigned char *)gtp +sizeof (struct rte_flow_item_gtp )); gtp_ipv4->version_ihl =
@@ -1242,11 +1242,11 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,rte_cpu_to_be_16 (I40E_FDIR_INNER_IP_DEFAULT_LEN ); payload = (unsigned char *)gtp_ipv4 + -sizeof (struct ipv4_hdr ); +sizeof (struct rte_ipv4_hdr ); }else if (cus_pctype->index ==I40E_CUSTOMIZED_GTPU_IPV6 ) { gtp->msg_type =I40E_FDIR_GTP_MSG_TYPE_0XFF ; - gtp_ipv6 = (struct ipv6_hdr *) + gtp_ipv6 = (struct rte_ipv6_hdr *) ((unsigned char *)gtp +sizeof (struct rte_flow_item_gtp )); gtp_ipv6->vtc_flow =
@@ -1260,7 +1260,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, gtp_ipv6->hop_limits = I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS; payload = (unsigned char *)gtp_ipv6 + -sizeof (struct ipv6_hdr ); +sizeof (struct rte_ipv6_hdr ); }else payload = (unsigned char *)gtp +sizeof (struct rte_flow_item_gtp );
drivers/net/mlx5/mlx5_flow.c +3 -3
@@ -2538,13 +2538,13 @@ flow_fdir_filter_convert(struct rte_eth_dev *dev,case RTE_ETH_FLOW_NONFRAG_IPV4_UDP :case RTE_ETH_FLOW_NONFRAG_IPV4_TCP :case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER : - attributes->l3.ipv4.hdr = (struct ipv4_hdr ){ + attributes->l3.ipv4.hdr = (struct rte_ipv4_hdr ){ .src_addr = input->flow.ip4_flow.src_ip, .dst_addr = input->flow.ip4_flow.dst_ip, .time_to_live = input->flow.ip4_flow.ttl, .type_of_service = input->flow.ip4_flow.tos, }; - attributes->l3_mask.ipv4.hdr = (struct ipv4_hdr ){ + attributes->l3_mask.ipv4.hdr = (struct rte_ipv4_hdr ){ .src_addr = mask->ipv4_mask.src_ip, .dst_addr = mask->ipv4_mask.dst_ip, .time_to_live = mask->ipv4_mask.ttl,
@@ -2560,7 +2560,7 @@ flow_fdir_filter_convert(struct rte_eth_dev *dev,case RTE_ETH_FLOW_NONFRAG_IPV6_UDP :case RTE_ETH_FLOW_NONFRAG_IPV6_TCP :case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER : - attributes->l3.ipv6.hdr = (struct ipv6_hdr ){ + attributes->l3.ipv6.hdr = (struct rte_ipv6_hdr ){ .hop_limits = input->flow.ipv6_flow.hop_limits, .proto = input->flow.ipv6_flow.proto, };
drivers/net/mlx5/mlx5_flow_dv.c +4 -4
@@ -1052,8 +1052,8 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, {struct rte_ether_hdr *eth =NULL ;struct rte_vlan_hdr *vlan =NULL ; -struct ipv4_hdr *ipv4 =NULL ; -struct ipv6_hdr *ipv6 =NULL ; +struct rte_ipv4_hdr *ipv4 =NULL ; +struct rte_ipv6_hdr *ipv6 =NULL ;struct udp_hdr *udp =NULL ;struct rte_vxlan_hdr *vxlan =NULL ;struct rte_vxlan_gpe_hdr *vxlan_gpe =NULL ;
@@ -1089,7 +1089,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, eth->ether_type =RTE_BE16 (RTE_ETHER_TYPE_VLAN );break ;case RTE_FLOW_ITEM_TYPE_IPV4 : - ipv4 = (struct ipv4_hdr *)&buf[temp_size]; + ipv4 = (struct rte_ipv4_hdr *)&buf[temp_size];if (!vlan && !eth) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
@@ -1107,7 +1107,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, ipv4->time_to_live =MLX5_ENCAP_IPV4_TTL_DEF ;break ;case RTE_FLOW_ITEM_TYPE_IPV6 : - ipv6 = (struct ipv6_hdr *)&buf[temp_size]; + ipv6 = (struct rte_ipv6_hdr *)&buf[temp_size];if (!vlan && !eth) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
drivers/net/mlx5/mlx5_flow_tcf.c +6 -6
@@ -732,12 +732,12 @@ flow_tcf_pedit_key_set_dec_ttl(const struct rte_flow_action *actions,if (item_flags &MLX5_FLOW_LAYER_OUTER_L3_IPV4 ) { p_parser->keys_ex[idx].htype =TCA_PEDIT_KEY_EX_HDR_TYPE_IP4 ; p_parser->keys[idx].off = - offsetof(struct ipv4_hdr , time_to_live); + offsetof(struct rte_ipv4_hdr , time_to_live); }if (item_flags &MLX5_FLOW_LAYER_OUTER_L3_IPV6 ) { p_parser->keys_ex[idx].htype =TCA_PEDIT_KEY_EX_HDR_TYPE_IP6 ; p_parser->keys[idx].off = - offsetof(struct ipv6_hdr , hop_limits); + offsetof(struct rte_ipv6_hdr , hop_limits); }if (actions->type ==RTE_FLOW_ACTION_TYPE_DEC_TTL ) { p_parser->keys_ex[idx].cmd =TCA_PEDIT_KEY_EX_CMD_ADD ;
@@ -801,8 +801,8 @@ flow_tcf_pedit_key_set_ipv6_addr(const struct rte_flow_action *actions,int keys =NUM_OF_PEDIT_KEYS (IPV6_ADDR_LEN );int off_base = actions->type ==RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC ? - offsetof(struct ipv6_hdr , src_addr) : - offsetof(struct ipv6_hdr , dst_addr); + offsetof(struct rte_ipv6_hdr , src_addr) : + offsetof(struct rte_ipv6_hdr , dst_addr);const struct rte_flow_action_set_ipv6 *conf = (const struct rte_flow_action_set_ipv6 *)actions->conf;
@@ -836,8 +836,8 @@ flow_tcf_pedit_key_set_ipv4_addr(const struct rte_flow_action *actions, p_parser->keys_ex[idx].cmd =TCA_PEDIT_KEY_EX_CMD_SET ; p_parser->keys[idx].off = actions->type ==RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC ? - offsetof(struct ipv4_hdr , src_addr) : - offsetof(struct ipv4_hdr , dst_addr); + offsetof(struct rte_ipv4_hdr , src_addr) : + offsetof(struct rte_ipv4_hdr , dst_addr); p_parser->keys[idx].mask = ~UINT32_MAX ; p_parser->keys[idx].val = ((const struct rte_flow_action_set_ipv4 *)
drivers/net/mvpp2/mrvl_flow.c +1 -1
@@ -1170,7 +1170,7 @@ mrvl_parse_ip6(const struct rte_flow_item *item, struct rte_flow_error *error) {const struct rte_flow_item_ipv6 *spec =NULL , *mask =NULL ; -struct ipv6_hdr zero; +struct rte_ipv6_hdr zero;uint32_t flow_mask;int ret;
drivers/net/qede/qede_filter.c +7 -7
@@ -457,8 +457,8 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,struct ecore_dev *edev =QEDE_INIT_EDEV (qdev);uint16_t *ether_type;uint8_t *raw_pkt; -struct ipv4_hdr *ip; -struct ipv6_hdr *ip6; +struct rte_ipv4_hdr *ip; +struct rte_ipv6_hdr *ip6;struct udp_hdr *udp;struct tcp_hdr *tcp;uint16_t len;
@@ -474,14 +474,14 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, *ether_type =rte_cpu_to_be_16 (arfs->tuple.eth_proto);switch (arfs->tuple.eth_proto) {case RTE_ETHER_TYPE_IPv4: - ip = (struct ipv4_hdr *)raw_pkt; + ip = (struct rte_ipv4_hdr *)raw_pkt; ip->version_ihl =QEDE_FDIR_IP_DEFAULT_VERSION_IHL ; - ip->total_length =sizeof (struct ipv4_hdr ); + ip->total_length =sizeof (struct rte_ipv4_hdr ); ip->next_proto_id = arfs->tuple.ip_proto; ip->time_to_live =QEDE_FDIR_IPV4_DEF_TTL ; ip->dst_addr = arfs->tuple.dst_ipv4; ip->src_addr = arfs->tuple.src_ipv4; - len +=sizeof (struct ipv4_hdr ); + len +=sizeof (struct rte_ipv4_hdr ); params->ipv4 = true; raw_pkt = (uint8_t *)buff;
@@ -507,7 +507,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, }break ;case RTE_ETHER_TYPE_IPv6: - ip6 = (struct ipv6_hdr *)raw_pkt; + ip6 = (struct rte_ipv6_hdr *)raw_pkt; ip6->proto = arfs->tuple.ip_proto; ip6->vtc_flow =rte_cpu_to_be_32 (QEDE_FDIR_IPV6_DEFAULT_VTC_FLOW );
@@ -516,7 +516,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, IPV6_ADDR_LEN);rte_memcpy (&ip6->dst_addr, arfs->tuple.dst_ipv6,IPV6_ADDR_LEN ); - len +=sizeof (struct ipv6_hdr ); + len +=sizeof (struct rte_ipv6_hdr ); params->ipv6 = true; raw_pkt = (uint8_t *)buff;
drivers/net/qede/qede_rxtx.c +6 -6
@@ -951,8 +951,8 @@ static inline uint32_t qede_rx_cqe_to_pkt_type_outer(struct rte_mbuf *m) {uint32_t packet_type =RTE_PTYPE_UNKNOWN ;struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr;struct rte_vlan_hdr *vlan_hdr;uint16_t ethertype;bool vlan_tagged =0 ;
@@ -972,14 +972,14 @@ static inline uint32_t qede_rx_cqe_to_pkt_type_outer(struct rte_mbuf *m)if (ethertype == RTE_ETHER_TYPE_IPv4) { packet_type |=RTE_PTYPE_L3_IPV4 ; - ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, len); + ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *, len);if (ipv4_hdr->next_proto_id ==IPPROTO_TCP ) packet_type |=RTE_PTYPE_L4_TCP ;else if (ipv4_hdr->next_proto_id ==IPPROTO_UDP ) packet_type |=RTE_PTYPE_L4_UDP ; }else if (ethertype == RTE_ETHER_TYPE_IPv6) { packet_type |=RTE_PTYPE_L3_IPV6 ; - ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, len); + ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *, len);if (ipv6_hdr->proto ==IPPROTO_TCP ) packet_type |=RTE_PTYPE_L4_TCP ;else if (ipv6_hdr->proto ==IPPROTO_UDP )
@@ -1141,7 +1141,7 @@ static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags)static inline uint8_t qede_check_notunn_csum_l3 (struct rte_mbuf *m,uint16_t flag) { -struct ipv4_hdr *ip; +struct rte_ipv4_hdr *ip;uint16_t pkt_csum;uint16_t calc_csum;uint16_t val;
@@ -1152,7 +1152,7 @@ qede_check_notunn_csum_l3(struct rte_mbuf *m, uint16_t flag)if (unlikely (val)) { m->packet_type =qede_rx_cqe_to_pkt_type (flag);if (RTE_ETH_IS_IPV4_HDR (m->packet_type)) { - ip = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + ip = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr )); pkt_csum = ip->hdr_checksum; ip->hdr_checksum =0 ;
drivers/net/sfc/sfc_tso.h +2 -2
@@ -29,10 +29,10 @@ extern "C" {static inline uint16_t sfc_tso_ip4_get_ipid (const uint8_t *pkt_hdrp,size_t ip_hdr_off) { -const struct ipv4_hdr *ip_hdrp; +const struct rte_ipv4_hdr *ip_hdrp;uint16_t ipid; - ip_hdrp = (const struct ipv4_hdr *)(pkt_hdrp + ip_hdr_off); + ip_hdrp = (const struct rte_ipv4_hdr *)(pkt_hdrp + ip_hdr_off);rte_memcpy (&ipid, &ip_hdrp->packet_id,sizeof (ipid));return rte_be_to_cpu_16 (ipid);
drivers/net/softnic/rte_eth_softnic_pipeline.c +16 -16
@@ -660,7 +660,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint8_t), .field_index = 0, .input_index = 0, - .offset = offsetof(struct ipv4_hdr, next_proto_id), + .offset = offsetof(struct rte_ipv4_hdr, next_proto_id), },/* Source IP address (IPv4) */
@@ -669,7 +669,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint32_t), .field_index = 1, .input_index = 1, - .offset = offsetof(struct ipv4_hdr, src_addr), + .offset = offsetof(struct rte_ipv4_hdr, src_addr), },/* Destination IP address (IPv4) */
@@ -678,7 +678,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint32_t), .field_index = 2, .input_index = 2, - .offset = offsetof(struct ipv4_hdr, dst_addr), + .offset = offsetof(struct rte_ipv4_hdr, dst_addr), },/* Source Port */
@@ -687,7 +687,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint16_t), .field_index = 3, .input_index = 3, - .offset =sizeof (struct ipv4_hdr ) + + .offset =sizeof (struct rte_ipv4_hdr ) + offsetof(struct tcp_hdr, src_port), },
@@ -697,7 +697,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint16_t), .field_index = 4, .input_index = 3, - .offset = sizeof(struct ipv4_hdr) + + .offset = sizeof(struct rte_ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), }, };
@@ -709,7 +709,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint8_t), .field_index = 0, .input_index = 0, - .offset = offsetof(struct ipv6_hdr, proto), + .offset = offsetof(struct rte_ipv6_hdr, proto), },/* Source IP address (IPv6) */
@@ -718,7 +718,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 1, .input_index = 1, - .offset = offsetof(struct ipv6_hdr, src_addr[0]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[0]), }, [2] = {
@@ -726,7 +726,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 2, .input_index = 2, - .offset = offsetof(struct ipv6_hdr, src_addr[4]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[4]), }, [3] = {
@@ -734,7 +734,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 3, .input_index = 3, - .offset = offsetof(struct ipv6_hdr, src_addr[8]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[8]), }, [4] = {
@@ -742,7 +742,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 4, .input_index = 4, - .offset = offsetof(struct ipv6_hdr, src_addr[12]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[12]), },/* Destination IP address (IPv6) */
@@ -751,7 +751,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 5, .input_index = 5, - .offset = offsetof(struct ipv6_hdr, dst_addr[0]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[0]), }, [6] = {
@@ -759,7 +759,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 6, .input_index = 6, - .offset = offsetof(struct ipv6_hdr, dst_addr[4]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[4]), }, [7] = {
@@ -767,7 +767,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 7, .input_index = 7, - .offset = offsetof(struct ipv6_hdr, dst_addr[8]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[8]), }, [8] = {
@@ -775,7 +775,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 8, .input_index = 8, - .offset = offsetof(struct ipv6_hdr, dst_addr[12]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[12]), },/* Source Port */
@@ -784,7 +784,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint16_t), .field_index = 9, .input_index = 9, - .offset =sizeof (struct ipv6_hdr ) + + .offset =sizeof (struct rte_ipv6_hdr ) + offsetof(struct tcp_hdr, src_port), },
@@ -794,7 +794,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint16_t), .field_index = 10, .input_index = 9, - .offset = sizeof(struct ipv6_hdr) + + .offset = sizeof(struct rte_ipv6_hdr) + offsetof(struct tcp_hdr, dst_port), }, };
drivers/net/tap/rte_eth_tap.c +5 -5
@@ -272,12 +272,12 @@ tap_verify_csum(struct rte_mbuf *mbuf)else if (l2 ==RTE_PTYPE_L2_ETHER_QINQ ) l2_len +=8 ;/* Don't verify checksum for packets with discontinuous L2 header */ -if (unlikely (l2_len +sizeof (struct ipv4_hdr ) > +if (unlikely (l2_len +sizeof (struct rte_ipv4_hdr ) >rte_pktmbuf_data_len (mbuf)))return ; l3_hdr = rte_pktmbuf_mtod_offset(mbuf, void *, l2_len);if (l3 ==RTE_PTYPE_L3_IPV4 || l3 ==RTE_PTYPE_L3_IPV4_EXT ) { -struct ipv4_hdr *iph = l3_hdr; +struct rte_ipv4_hdr *iph = l3_hdr;/* ihl contains the number of 4-byte words in the header */ l3_len =4 * (iph->version_ihl &0xf );
@@ -295,9 +295,9 @@ tap_verify_csum(struct rte_mbuf *mbuf) PKT_RX_IP_CKSUM_BAD :PKT_RX_IP_CKSUM_GOOD ; }else if (l3 ==RTE_PTYPE_L3_IPV6 ) { -struct ipv6_hdr *iph = l3_hdr; +struct rte_ipv6_hdr *iph = l3_hdr; - l3_len =sizeof (struct ipv6_hdr ); + l3_len =sizeof (struct rte_ipv6_hdr );/* check that the total length reported by header is not * greater than the total received size */
@@ -496,7 +496,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,void *l3_hdr = packet + l2_len;if (ol_flags & (PKT_TX_IP_CKSUM |PKT_TX_IPV4 )) { -struct ipv4_hdr *iph = l3_hdr; +struct rte_ipv4_hdr *iph = l3_hdr;uint16_t cksum; iph->hdr_checksum =0 ;
drivers/net/virtio/virtio_rxtx.c +4 -4
@@ -479,13 +479,13 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)/* common case: header is not fragmented */ if (likely (rte_pktmbuf_data_len (m) >= m->l2_len + m->l3_len + m->l4_len)) { -struct ipv4_hdr *iph; -struct ipv6_hdr *ip6h; +struct rte_ipv4_hdr *iph; +struct rte_ipv6_hdr *ip6h;struct tcp_hdr *th;uint16_t prev_cksum, new_cksum, ip_len, ip_paylen;uint32_t tmp; - iph = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len); + iph = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *, m->l2_len); th =RTE_PTR_ADD (iph, m->l3_len);if ((iph->version_ihl >>4 ) ==4 ) { iph->hdr_checksum =0 ;
@@ -494,7 +494,7 @@ virtio_tso_fix_cksum(struct rte_mbuf *m) ip_paylen =rte_cpu_to_be_16 (rte_be_to_cpu_16 (ip_len) - m->l3_len); }else { - ip6h = (struct ipv6_hdr *)iph; + ip6h = (struct rte_ipv6_hdr *)iph; ip_paylen = ip6h->payload_len; }
drivers/net/vmxnet3/vmxnet3_rxtx.c +9 -9
@@ -667,8 +667,8 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, struct rte_mbuf *rxm) {uint32_t hlen, slen; -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr;struct tcp_hdr *tcp_hdr;char *ptr;
@@ -679,20 +679,20 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, hlen =sizeof (struct rte_ether_hdr );if (rcd->v4) { -if (unlikely (slen < hlen +sizeof (struct ipv4_hdr ))) -return hw->mtu -sizeof (struct ipv4_hdr ) +if (unlikely (slen < hlen +sizeof (struct rte_ipv4_hdr ))) +return hw->mtu -sizeof (struct rte_ipv4_hdr ) -sizeof (struct tcp_hdr ); - ipv4_hdr = (struct ipv4_hdr *)(ptr + hlen); + ipv4_hdr = (struct rte_ipv4_hdr *)(ptr + hlen); hlen += (ipv4_hdr->version_ihl &IPV4_HDR_IHL_MASK ) *IPV4_IHL_MULTIPLIER ; }else if (rcd->v6) { -if (unlikely (slen < hlen +sizeof (struct ipv6_hdr ))) -return hw->mtu -sizeof (struct ipv6_hdr ) - +if (unlikely (slen < hlen +sizeof (struct rte_ipv6_hdr ))) +return hw->mtu -sizeof (struct rte_ipv6_hdr ) -sizeof (struct tcp_hdr ); - ipv6_hdr = (struct ipv6_hdr *)(ptr + hlen); - hlen +=sizeof (struct ipv6_hdr ); + ipv6_hdr = (struct rte_ipv6_hdr *)(ptr + hlen); + hlen +=sizeof (struct rte_ipv6_hdr );if (unlikely (ipv6_hdr->proto !=IPPROTO_TCP )) {int frag;
examples/bond/main.c +2 -2
@@ -340,7 +340,7 @@ static int lcore_main(__attribute__((unused)) void *arg1)struct rte_ether_hdr *eth_hdr;struct rte_arp_hdr *arp_hdr; -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;uint16_t ether_type, offset;uint16_t rx_cnt;
@@ -405,7 +405,7 @@ static int lcore_main(__attribute__((unused)) void *arg1) global_flag_stru_p->port_packets[2 ]++;rte_spinlock_unlock (&global_flag_stru_p->lock); } - ipv4_hdr = (struct ipv4_hdr *)((char *)(eth_hdr +1 ) + offset); + ipv4_hdr = (struct rte_ipv4_hdr *)((char *)(eth_hdr +1 ) + offset);if (ipv4_hdr->dst_addr == bond_ip) {rte_ether_addr_copy (ð_hdr->s_addr, ð_hdr->d_addr);rte_eth_macaddr_get (BOND_PORT , ð_hdr->s_addr);
examples/flow_classify/flow_classify.c +5 -5
@@ -99,7 +99,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, next_proto_id), + offsetof(struct rte_ipv4_hdr, next_proto_id), },/* next input field (IPv4 source address) - 4 consecutive bytes. */ {
@@ -109,7 +109,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - offsetof(struct ipv4_hdr, src_addr), + offsetof(struct rte_ipv4_hdr, src_addr), },/* next input field (IPv4 destination address) - 4 consecutive bytes. */ {
@@ -119,7 +119,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, .offset =sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv4_hdr, dst_addr), + offsetof(struct rte_ipv4_hdr, dst_addr), },/* * Next 2 fields (src & dst ports) form 4 consecutive bytes.
@@ -132,7 +132,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + - sizeof(struct ipv4_hdr) + + sizeof(struct rte_ipv4_hdr) + offsetof(struct tcp_hdr, src_port), }, {
@@ -142,7 +142,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, .offset =sizeof (struct rte_ether_hdr ) + -sizeof (struct ipv4_hdr ) + +sizeof (struct rte_ipv4_hdr ) + offsetof(struct tcp_hdr, dst_port), }, };
examples/ip_fragmentation/main.c +6 -6
@@ -65,8 +65,8 @@/* * Default payload in bytes for the IPv6 packet. */ -#define IPV4_DEFAULT_PAYLOAD (IPV4_MTU_DEFAULT - sizeof(struct ipv4_hdr)) -#define IPV6_DEFAULT_PAYLOAD (IPV6_MTU_DEFAULT - sizeof(struct ipv6_hdr)) +#define IPV4_DEFAULT_PAYLOAD (IPV4_MTU_DEFAULT - sizeof(struct rte_ipv4_hdr)) +#define IPV6_DEFAULT_PAYLOAD (IPV6_MTU_DEFAULT - sizeof(struct rte_ipv6_hdr))/* * Max number of fragments per packet expected - defined by config file.
@@ -259,10 +259,10 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,/* if this is an IPv4 packet */ if (RTE_ETH_IS_IPV4_HDR (m->packet_type)) { -struct ipv4_hdr *ip_hdr; +struct rte_ipv4_hdr *ip_hdr;uint32_t ip_dst;/* Read the lookup key (i.e. ip_dst) from the input packet */ - ip_hdr = rte_pktmbuf_mtod(m, struct ipv4_hdr *); + ip_hdr = rte_pktmbuf_mtod(m, struct rte_ipv4_hdr *); ip_dst =rte_be_to_cpu_32 (ip_hdr->dst_addr);/* Find destination port */
@@ -294,12 +294,12 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, } }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) {/* if this is an IPv6 packet */ -struct ipv6_hdr *ip_hdr; +struct rte_ipv6_hdr *ip_hdr; ipv6 =1 ;/* Read the lookup key (i.e. ip_dst) from the input packet */ - ip_hdr = rte_pktmbuf_mtod(m, struct ipv6_hdr *); + ip_hdr = rte_pktmbuf_mtod(m, struct rte_ipv6_hdr *);/* Find destination port */ if (rte_lpm6_lookup(rxq->lpm6, ip_hdr->dst_addr,
examples/ip_pipeline/pipeline.c +16 -16
@@ -636,7 +636,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint8_t), .field_index = 0, .input_index = 0, - .offset = offsetof(struct ipv4_hdr, next_proto_id), + .offset = offsetof(struct rte_ipv4_hdr, next_proto_id), },/* Source IP address (IPv4) */
@@ -645,7 +645,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint32_t), .field_index = 1, .input_index = 1, - .offset = offsetof(struct ipv4_hdr, src_addr), + .offset = offsetof(struct rte_ipv4_hdr, src_addr), },/* Destination IP address (IPv4) */
@@ -654,7 +654,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint32_t), .field_index = 2, .input_index = 2, - .offset = offsetof(struct ipv4_hdr, dst_addr), + .offset = offsetof(struct rte_ipv4_hdr, dst_addr), },/* Source Port */
@@ -663,7 +663,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint16_t), .field_index = 3, .input_index = 3, - .offset =sizeof (struct ipv4_hdr ) + + .offset =sizeof (struct rte_ipv4_hdr ) + offsetof(struct tcp_hdr, src_port), },
@@ -673,7 +673,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .size = sizeof(uint16_t), .field_index = 4, .input_index = 3, - .offset = sizeof(struct ipv4_hdr) + + .offset = sizeof(struct rte_ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), }, };
@@ -685,7 +685,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint8_t), .field_index = 0, .input_index = 0, - .offset = offsetof(struct ipv6_hdr, proto), + .offset = offsetof(struct rte_ipv6_hdr, proto), },/* Source IP address (IPv6) */
@@ -694,7 +694,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 1, .input_index = 1, - .offset = offsetof(struct ipv6_hdr, src_addr[0]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[0]), }, [2] = {
@@ -702,7 +702,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 2, .input_index = 2, - .offset = offsetof(struct ipv6_hdr, src_addr[4]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[4]), }, [3] = {
@@ -710,7 +710,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 3, .input_index = 3, - .offset = offsetof(struct ipv6_hdr, src_addr[8]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[8]), }, [4] = {
@@ -718,7 +718,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 4, .input_index = 4, - .offset = offsetof(struct ipv6_hdr, src_addr[12]), + .offset = offsetof(struct rte_ipv6_hdr, src_addr[12]), },/* Destination IP address (IPv6) */
@@ -727,7 +727,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 5, .input_index = 5, - .offset = offsetof(struct ipv6_hdr, dst_addr[0]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[0]), }, [6] = {
@@ -735,7 +735,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 6, .input_index = 6, - .offset = offsetof(struct ipv6_hdr, dst_addr[4]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[4]), }, [7] = {
@@ -743,7 +743,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 7, .input_index = 7, - .offset = offsetof(struct ipv6_hdr, dst_addr[8]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[8]), }, [8] = {
@@ -751,7 +751,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint32_t), .field_index = 8, .input_index = 8, - .offset = offsetof(struct ipv6_hdr, dst_addr[12]), + .offset = offsetof(struct rte_ipv6_hdr, dst_addr[12]), },/* Source Port */
@@ -760,7 +760,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint16_t), .field_index = 9, .input_index = 9, - .offset =sizeof (struct ipv6_hdr ) + + .offset =sizeof (struct rte_ipv6_hdr ) + offsetof(struct tcp_hdr, src_port), },
@@ -770,7 +770,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .size = sizeof(uint16_t), .field_index = 10, .input_index = 9, - .offset = sizeof(struct ipv6_hdr) + + .offset = sizeof(struct rte_ipv6_hdr) + offsetof(struct tcp_hdr, dst_port), }, };
examples/ip_reassembly/main.c +6 -6
@@ -324,10 +324,10 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,/* if packet is IPv4 */ if (RTE_ETH_IS_IPV4_HDR (m->packet_type)) { -struct ipv4_hdr *ip_hdr; +struct rte_ipv4_hdr *ip_hdr;uint32_t ip_dst; - ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ip_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 );/* if it is a fragmented packet, then try to reassemble. */ if (rte_ipv4_frag_pkt_is_fragmented (ip_hdr)) {
@@ -351,7 +351,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, m = mo; eth_hdr =rte_pktmbuf_mtod (m, struct rte_ether_hdr *); - ip_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ip_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); } } ip_dst =rte_be_to_cpu_32 (ip_hdr->dst_addr);
@@ -366,9 +366,9 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) {/* if packet is IPv6 */ struct ipv6_extension_fragment *frag_hdr; -struct ipv6_hdr *ip_hdr; +struct rte_ipv6_hdr *ip_hdr; - ip_hdr = (struct ipv6_hdr *)(eth_hdr +1 ); + ip_hdr = (struct rte_ipv6_hdr *)(eth_hdr +1 ); frag_hdr =rte_ipv6_frag_get_ipv6_fragment_header (ip_hdr);
@@ -389,7 +389,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,if (mo != m) { m = mo; eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); - ip_hdr = (struct ipv6_hdr *)(eth_hdr +1 ); + ip_hdr = (struct rte_ipv6_hdr *)(eth_hdr +1 ); } }
examples/ipsec-secgw/ipsec-secgw.c +1 -1
@@ -340,7 +340,7 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port,/* calculate IPv4 cksum in SW */ if ((pkt->ol_flags &PKT_TX_IP_CKSUM ) ==0 ) - ip->ip_sum =rte_ipv4_cksum ((struct ipv4_hdr *)ip); + ip->ip_sum =rte_ipv4_cksum ((struct rte_ipv4_hdr *)ip); ethhdr->ether_type =rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4); }else {
examples/ipsec-secgw/sa.c +3 -3
@@ -967,7 +967,7 @@ get_spi_proto(uint32_t spi, enum rte_security_ipsec_sa_direction dir)static int fill_ipsec_sa_prm (struct rte_ipsec_sa_prm *prm,const struct ipsec_sa *ss, -const struct ipv4_hdr *v4,struct ipv6_hdr *v6) +const struct rte_ipv4_hdr *v4,struct rte_ipv6_hdr *v6) {int32_t rc;
@@ -1038,7 +1038,7 @@ ipsec_sa_init(struct ipsec_sa *lsa, struct rte_ipsec_sa *sa, uint32_t sa_size) {int rc;struct rte_ipsec_sa_prm prm; -struct ipv4_hdr v4 = { +struct rte_ipv4_hdr v4 = { .version_ihl =IPVERSION <<4 |sizeof (v4) /IPV4_IHL_MULTIPLIER , .time_to_live =IPDEFTTL ,
@@ -1046,7 +1046,7 @@ ipsec_sa_init(struct ipsec_sa *lsa, struct rte_ipsec_sa *sa, uint32_t sa_size) .src_addr = lsa->src.ip.ip4, .dst_addr = lsa->dst.ip.ip4, }; -struct ipv6_hdr v6 = { +struct rte_ipv6_hdr v6 = { .vtc_flow =htonl (IP6_VERSION <<28 ), .proto =IPPROTO_ESP , };
examples/ipv4_multicast/main.c +2 -2
@@ -296,7 +296,7 @@ static inline void mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) { struct rte_mbuf *mc; -struct ipv4_hdr *iphdr; +struct rte_ipv4_hdr *iphdr;uint32_t dest_addr, port_mask, port_num, use_clone;int32_t hash;uint16_t port;
@@ -306,7 +306,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) } dst_eth_addr;/* Remove the Ethernet header from the input packet */ - iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj (m, (uint16_t )sizeof (struct rte_ether_hdr )); + iphdr = (struct rte_ipv4_hdr *)rte_pktmbuf_adj (m, (uint16_t )sizeof (struct rte_ether_hdr ));RTE_ASSERT (iphdr !=NULL ); dest_addr =rte_be_to_cpu_32 (iphdr->dst_addr);
examples/l2fwd-crypto/main.c +2 -2
@@ -388,7 +388,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, struct l2fwd_crypto_params *cparams) {struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ip_hdr; +struct rte_ipv4_hdr *ip_hdr;uint32_t ipdata_offset, data_len;uint32_t pad_len =0 ;
@@ -401,7 +401,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, ipdata_offset =sizeof (struct rte_ether_hdr ); - ip_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) + + ip_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) + ipdata_offset); ipdata_offset += (ip_hdr->version_ihl &IPV4_HDR_IHL_MASK )
examples/l3fwd-acl/main.c +40 -40
215 lines not on this page · raw message
examples/l3fwd-power/main.c +14 -14
@@ -466,14 +466,14 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)#ifdef DO_RFC_1812_CHECKS static inline int -is_valid_ipv4_pkt (struct ipv4_hdr *pkt,uint32_t link_len) +is_valid_ipv4_pkt (struct rte_ipv4_hdr *pkt,uint32_t link_len) {/* From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2 */ /* * 1. The packet length reported by the Link Layer must be large * enough to hold the minimum length legal IP datagram (20 bytes). */ -if (link_len <sizeof (struct ipv4_hdr )) +if (link_len <sizeof (struct rte_ipv4_hdr ))return -1 ;/* 2. The IP checksum must be correct. */
@@ -498,7 +498,7 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len)* datagram header, whose length is specified in the IP header length * field. */ -if (rte_cpu_to_be_16 (pkt->total_length) <sizeof (struct ipv4_hdr )) +if (rte_cpu_to_be_16 (pkt->total_length) <sizeof (struct rte_ipv4_hdr ))return -5 ;return 0 ;
@@ -523,7 +523,7 @@ print_ipv6_key(struct ipv6_5tuple key) }static inline uint16_t -get_ipv4_dst_port (struct ipv4_hdr *ipv4_hdr,uint16_t portid, +get_ipv4_dst_port (struct rte_ipv4_hdr *ipv4_hdr,uint16_t portid,lookup_struct_t * ipv4_l3fwd_lookup_struct) {struct ipv4_5tuple key;
@@ -538,14 +538,14 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,switch (ipv4_hdr->next_proto_id) {case IPPROTO_TCP : tcp = (struct tcp_hdr *)((unsigned char *)ipv4_hdr + -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr )); key.port_dst =rte_be_to_cpu_16 (tcp->dst_port); key.port_src =rte_be_to_cpu_16 (tcp->src_port);break ;case IPPROTO_UDP : udp = (struct udp_hdr *)((unsigned char *)ipv4_hdr + -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr )); key.port_dst =rte_be_to_cpu_16 (udp->dst_port); key.port_src =rte_be_to_cpu_16 (udp->src_port);break ;
@@ -562,7 +562,7 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, }static inline uint16_t -get_ipv6_dst_port (struct ipv6_hdr *ipv6_hdr,uint16_t portid, +get_ipv6_dst_port (struct rte_ipv6_hdr *ipv6_hdr,uint16_t portid,lookup_struct_t *ipv6_l3fwd_lookup_struct) {struct ipv6_5tuple key;
@@ -578,14 +578,14 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid,switch (ipv6_hdr->proto) {case IPPROTO_TCP : tcp = (struct tcp_hdr *)((unsigned char *) ipv6_hdr + -sizeof (struct ipv6_hdr )); +sizeof (struct rte_ipv6_hdr )); key.port_dst =rte_be_to_cpu_16 (tcp->dst_port); key.port_src =rte_be_to_cpu_16 (tcp->src_port);break ;case IPPROTO_UDP : udp = (struct udp_hdr *)((unsigned char *) ipv6_hdr + -sizeof (struct ipv6_hdr )); +sizeof (struct rte_ipv6_hdr )); key.port_dst =rte_be_to_cpu_16 (udp->dst_port); key.port_src =rte_be_to_cpu_16 (udp->src_port);break ;
@@ -604,7 +604,7 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid,#if (APP_LOOKUP_METHOD ==APP_LOOKUP_LPM )static inline uint16_t -get_ipv4_dst_port (struct ipv4_hdr *ipv4_hdr,uint16_t portid, +get_ipv4_dst_port (struct rte_ipv4_hdr *ipv4_hdr,uint16_t portid,lookup_struct_t *ipv4_l3fwd_lookup_struct) {uint32_t next_hop;
@@ -662,7 +662,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) {struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;void *d_addr_bytes;uint16_t dst_port;
@@ -671,7 +671,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,if (RTE_ETH_IS_IPV4_HDR (m->packet_type)) {/* Handle IPv4 headers.*/ ipv4_hdr = - rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr ));#ifdef DO_RFC_1812_CHECKS
@@ -706,10 +706,10 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) {/* Handle IPv6 headers.*/ #if (APP_LOOKUP_METHOD ==APP_LOOKUP_EXACT_MATCH ) -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv6_hdr *ipv6_hdr; ipv6_hdr = - rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, + rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr )); dst_port = get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd-vf/main.c +9 -9
@@ -314,14 +314,14 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)#ifdef DO_RFC_1812_CHECKS static inline int -is_valid_ipv4_pkt (struct ipv4_hdr *pkt,uint32_t link_len) +is_valid_ipv4_pkt (struct rte_ipv4_hdr *pkt,uint32_t link_len) {/* From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2 */ /* * 1. The packet length reported by the Link Layer must be large * enough to hold the minimum length legal IP datagram (20 bytes). */ -if (link_len <sizeof (struct ipv4_hdr )) +if (link_len <sizeof (struct rte_ipv4_hdr ))return -1 ;/* 2. The IP checksum must be correct. */
@@ -346,7 +346,7 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len)* datagram header, whose length is specified in the IP header length * field. */ -if (rte_cpu_to_be_16 (pkt->total_length) <sizeof (struct ipv4_hdr )) +if (rte_cpu_to_be_16 (pkt->total_length) <sizeof (struct rte_ipv4_hdr ))return -5 ;return 0 ;
@@ -362,7 +362,7 @@ print_key(struct ipv4_5tuple key) }static inline uint16_t -get_dst_port (struct ipv4_hdr *ipv4_hdr,uint16_t portid, +get_dst_port (struct rte_ipv4_hdr *ipv4_hdr,uint16_t portid,lookup_struct_t *l3fwd_lookup_struct) {struct ipv4_5tuple key;
@@ -377,14 +377,14 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,switch (ipv4_hdr->next_proto_id) {case IPPROTO_TCP : tcp = (struct tcp_hdr *)((unsigned char *) ipv4_hdr + -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr )); key.port_dst =rte_be_to_cpu_16 (tcp->dst_port); key.port_src =rte_be_to_cpu_16 (tcp->src_port);break ;case IPPROTO_UDP : udp = (struct udp_hdr *)((unsigned char *) ipv4_hdr + -sizeof (struct ipv4_hdr )); +sizeof (struct rte_ipv4_hdr )); key.port_dst =rte_be_to_cpu_16 (udp->dst_port); key.port_src =rte_be_to_cpu_16 (udp->src_port);break ;
@@ -402,7 +402,7 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,#if (APP_LOOKUP_METHOD ==APP_LOOKUP_LPM )static inline uint32_t -get_dst_port (struct ipv4_hdr *ipv4_hdr,uint16_t portid, +get_dst_port (struct rte_ipv4_hdr *ipv4_hdr,uint16_t portid,lookup_struct_t *l3fwd_lookup_struct) {uint32_t next_hop;
@@ -418,13 +418,13 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, lookup_struct_t *l3fwd_lookup_struct) {struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;void *tmp;uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); - ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr ));#ifdef DO_RFC_1812_CHECKS
examples/l3fwd/l3fwd.h +3 -3
@@ -130,14 +130,14 @@ send_single_packet(struct lcore_conf *qconf,#ifdef DO_RFC_1812_CHECKS static inline int -is_valid_ipv4_pkt (struct ipv4_hdr *pkt,uint32_t link_len) +is_valid_ipv4_pkt (struct rte_ipv4_hdr *pkt,uint32_t link_len) {/* From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2 */ /* * 1. The packet length reported by the Link Layer must be large * enough to hold the minimum length legal IP datagram (20 bytes). */ -if (link_len <sizeof (struct ipv4_hdr )) +if (link_len <sizeof (struct rte_ipv4_hdr ))return -1 ;/* 2. The IP checksum must be correct. */
@@ -162,7 +162,7 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len)* datagram header, whose length is specified in the IP header length * field. */ -if (rte_cpu_to_be_16 (pkt->total_length) <sizeof (struct ipv4_hdr )) +if (rte_cpu_to_be_16 (pkt->total_length) <sizeof (struct rte_ipv4_hdr ))return -5 ;return 0 ;
examples/l3fwd/l3fwd_altivec.h +5 -5
@@ -68,13 +68,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP]) *p[2 ] = te[2 ]; *p[3 ] = te[3 ]; -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[0 ] +1 ), &dst_port[0 ], pkt[0 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[1 ] +1 ), &dst_port[1 ], pkt[1 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[2 ] +1 ), &dst_port[2 ], pkt[2 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), &dst_port[3 ], pkt[3 ]->packet_type); }
@@ -129,7 +129,7 @@ process_packet(struct rte_mbuf *pkt, uint16_t *dst_port) te = *(vector unsigned int *)eth_hdr; ve = (vector unsigned int)val_eth[dst_port[0]]; -rfc1812_process ((struct ipv4_hdr *)(eth_hdr +1 ), dst_port, +rfc1812_process ((struct rte_ipv4_hdr *)(eth_hdr +1 ), dst_port, pkt->packet_type);/* dynamically vec_sel te and ve for MASK_ETH (0x3f) */
examples/l3fwd/l3fwd_common.h +2 -2
@@ -14,7 +14,7 @@#define IPV4_MAX_VER_IHL_DIFF (IPV4_MAX_VER_IHL - IPV4_MIN_VER_IHL)/* Minimum value of IPV4 total length (20B) in network byte order. */ -#define IPV4_MIN_LEN_BE (sizeof(struct ipv4_hdr) << 8) +#define IPV4_MIN_LEN_BE (sizeof(struct rte_ipv4_hdr) << 8)/* * From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2:
@@ -28,7 +28,7 @@* to BAD_PORT value. */ static __rte_always_inline void -rfc1812_process (struct ipv4_hdr *ipv4_hdr,uint16_t *dp,uint32_t ptype) +rfc1812_process (struct rte_ipv4_hdr *ipv4_hdr,uint16_t *dp,uint32_t ptype) {uint8_t ihl;
examples/l3fwd/l3fwd_em.c +7 -7
@@ -252,7 +252,7 @@ em_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct)struct rte_hash *ipv4_l3fwd_lookup_struct = (struct rte_hash *)lookup_struct; - ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct ipv4_hdr , time_to_live); + ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct rte_ipv4_hdr , time_to_live);/* * Get 5 tuple: dst port, src port, dst IP address,
@@ -273,7 +273,7 @@ em_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct)struct rte_hash *ipv6_l3fwd_lookup_struct = (struct rte_hash *)lookup_struct; - ipv6_hdr = (uint8_t *)ipv6_hdr + offsetof(struct ipv6_hdr , payload_len); + ipv6_hdr = (uint8_t *)ipv6_hdr + offsetof(struct rte_ipv6_hdr , payload_len);void *data0 = ipv6_hdr;void *data1 = ((uint8_t *)ipv6_hdr) +sizeof (xmm_t);void *data2 = ((uint8_t *)ipv6_hdr) +sizeof (xmm_t) +sizeof (xmm_t);
@@ -566,17 +566,17 @@ em_parse_ptype(struct rte_mbuf *m)uint16_t ether_type;void *l3;int hdr_len; -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr; eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_type = eth_hdr->ether_type; l3 = (uint8_t *)eth_hdr +sizeof (struct rte_ether_hdr );if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv4)) { - ipv4_hdr = (struct ipv4_hdr *)l3; + ipv4_hdr = (struct rte_ipv4_hdr *)l3; hdr_len = (ipv4_hdr->version_ihl &IPV4_HDR_IHL_MASK ) *IPV4_IHL_MULTIPLIER ; -if (hdr_len ==sizeof (struct ipv4_hdr )) { +if (hdr_len ==sizeof (struct rte_ipv4_hdr )) { packet_type |=RTE_PTYPE_L3_IPV4 ;if (ipv4_hdr->next_proto_id ==IPPROTO_TCP ) packet_type |=RTE_PTYPE_L4_TCP ;
@@ -585,7 +585,7 @@ em_parse_ptype(struct rte_mbuf *m) }else packet_type |=RTE_PTYPE_L3_IPV4_EXT ; }else if (ether_type ==rte_cpu_to_be_16 (RTE_ETHER_TYPE_IPv6)) { - ipv6_hdr = (struct ipv6_hdr *)l3; + ipv6_hdr = (struct rte_ipv6_hdr *)l3;if (ipv6_hdr->proto ==IPPROTO_TCP ) packet_type |=RTE_PTYPE_L3_IPV6 |RTE_PTYPE_L4_TCP ;else if (ipv6_hdr->proto ==IPPROTO_UDP )
examples/l3fwd/l3fwd_em.h +4 -4
@@ -10,7 +10,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) {struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;uint16_t dst_port;uint32_t tcp_or_udp;uint32_t l3_ptypes;
@@ -21,7 +21,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,if (tcp_or_udp && (l3_ptypes ==RTE_PTYPE_L3_IPV4 )) {/* Handle IPv4 headers.*/ - ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr ));#ifdef DO_RFC_1812_CHECKS
@@ -52,9 +52,9 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,send_single_packet (qconf, m, dst_port); }else if (tcp_or_udp && (l3_ptypes ==RTE_PTYPE_L3_IPV6 )) {/* Handle IPv6 headers.*/ -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv6_hdr *ipv6_hdr; - ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, + ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr )); dst_port = em_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_em_hlm.h +4 -4
@@ -80,8 +80,8 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, uint16_t portid) {uint16_t next_hop; -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr;uint32_t tcp_or_udp;uint32_t l3_ptypes;
@@ -91,7 +91,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,if (tcp_or_udp && (l3_ptypes ==RTE_PTYPE_L3_IPV4 )) {/* Handle IPv4 headers.*/ - ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, + ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr )); next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
@@ -106,7 +106,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, }else if (tcp_or_udp && (l3_ptypes ==RTE_PTYPE_L3_IPV6 )) {/* Handle IPv6 headers.*/ - ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *, + ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr )); next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_em_hlm_neon.h +4 -4
@@ -14,7 +14,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, int32x4_t mask0, { int32x4_t tmpdata0 = vld1q_s32(rte_pktmbuf_mtod_offset(m0, int32_t *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv4_hdr , time_to_live))); + offsetof(struct rte_ipv4_hdr , time_to_live))); key->xmm =vandq_s32 (tmpdata0, mask0); }
@@ -26,17 +26,17 @@ get_ipv6_5tuple(struct rte_mbuf *m0, int32x4_t mask0,int32x4_t tmpdata0 =vld1q_s32 ( rte_pktmbuf_mtod_offset(m0, int *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv6_hdr , payload_len))); + offsetof(struct rte_ipv6_hdr , payload_len)));int32x4_t tmpdata1 =vld1q_s32 ( rte_pktmbuf_mtod_offset(m0, int *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv6_hdr , payload_len) +8 )); + offsetof(struct rte_ipv6_hdr , payload_len) +8 ));int32x4_t tmpdata2 =vld1q_s32 ( rte_pktmbuf_mtod_offset(m0, int *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv6_hdr , payload_len) +16 )); + offsetof(struct rte_ipv6_hdr , payload_len) +16 )); key->xmm[0 ] =vandq_s32 (tmpdata0, mask0); key->xmm[1 ] = tmpdata1;
examples/l3fwd/l3fwd_em_hlm_sse.h +4 -4
@@ -14,7 +14,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, __m128i mask0,__m128i tmpdata0 =_mm_loadu_si128 ( rte_pktmbuf_mtod_offset(m0, __m128i *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv4_hdr , time_to_live))); + offsetof(struct rte_ipv4_hdr , time_to_live))); key->xmm =_mm_and_si128 (tmpdata0, mask0); }
@@ -26,18 +26,18 @@ get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0,__m128i tmpdata0 =_mm_loadu_si128 ( rte_pktmbuf_mtod_offset(m0, __m128i *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv6_hdr , payload_len))); + offsetof(struct rte_ipv6_hdr , payload_len)));__m128i tmpdata1 =_mm_loadu_si128 ( rte_pktmbuf_mtod_offset(m0, __m128i *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv6_hdr , payload_len) + + offsetof(struct rte_ipv6_hdr , payload_len) +sizeof (__m128i)));__m128i tmpdata2 =_mm_loadu_si128 ( rte_pktmbuf_mtod_offset(m0, __m128i *,sizeof (struct rte_ether_hdr ) + - offsetof(struct ipv6_hdr , payload_len) + + offsetof(struct rte_ipv6_hdr , payload_len) +sizeof (__m128i) +sizeof (__m128i))); key->xmm[0 ] =_mm_and_si128 (tmpdata0, mask0);
examples/l3fwd/l3fwd_em_sequential.h +4 -4
@@ -25,8 +25,8 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, uint16_t portid) {uint8_t next_hop; -struct ipv4_hdr *ipv4_hdr; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr; +struct rte_ipv6_hdr *ipv6_hdr;uint32_t tcp_or_udp;uint32_t l3_ptypes;
@@ -36,7 +36,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,if (tcp_or_udp && (l3_ptypes ==RTE_PTYPE_L3_IPV4 )) {/* Handle IPv4 headers.*/ - ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, + ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr )); next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
@@ -51,7 +51,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, }else if (tcp_or_udp && (l3_ptypes ==RTE_PTYPE_L3_IPV6 )) {/* Handle IPv6 headers.*/ - ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *, + ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr )); next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_lpm.c +8 -8
@@ -82,7 +82,7 @@ lpm_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct) (struct rte_lpm *)lookup_struct;return (uint16_t ) ((rte_lpm_lookup (ipv4_l3fwd_lookup_struct, -rte_be_to_cpu_32 (((struct ipv4_hdr *)ipv4_hdr)->dst_addr), +rte_be_to_cpu_32 (((struct rte_ipv4_hdr *)ipv4_hdr)->dst_addr), &next_hop) ==0 ) ? next_hop : portid); }
@@ -94,7 +94,7 @@ lpm_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct) (struct rte_lpm6 *)lookup_struct;return (uint16_t ) ((rte_lpm6_lookup (ipv6_l3fwd_lookup_struct, - ((struct ipv6_hdr *)ipv6_hdr)->dst_addr, + ((struct rte_ipv6_hdr *)ipv6_hdr)->dst_addr, &next_hop) ==0 ) ? next_hop : portid); }
@@ -102,21 +102,21 @@ static __rte_always_inline uint16_t lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, uint16_t portid) { - struct ipv6_hdr *ipv6_hdr; -struct ipv4_hdr *ipv4_hdr; + struct rte_ipv6_hdr *ipv6_hdr; +struct rte_ipv4_hdr *ipv4_hdr;struct rte_ether_hdr *eth_hdr;if (RTE_ETH_IS_IPV4_HDR (pkt->packet_type)) { eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 );return lpm_get_ipv4_dst_port (ipv4_hdr, portid, qconf->ipv4_lookup_struct); }else if (RTE_ETH_IS_IPV6_HDR (pkt->packet_type)) { eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); - ipv6_hdr = (struct ipv6_hdr *)(eth_hdr +1 ); + ipv6_hdr = (struct rte_ipv6_hdr *)(eth_hdr +1 );return lpm_get_ipv6_dst_port (ipv6_hdr, portid, qconf->ipv6_lookup_struct);
@@ -135,7 +135,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv6_hdr *ipv6_hdr;struct rte_ether_hdr *eth_hdr;if (RTE_ETH_IS_IPV4_HDR (pkt->packet_type)) {
@@ -146,7 +146,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, }else if (RTE_ETH_IS_IPV6_HDR (pkt->packet_type)) { eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); - ipv6_hdr = (struct ipv6_hdr *)(eth_hdr +1 ); + ipv6_hdr = (struct rte_ipv6_hdr *)(eth_hdr +1 );return (uint16_t ) ((rte_lpm6_lookup (qconf->ipv6_lookup_struct, ipv6_hdr->dst_addr, &next_hop) == 0)
examples/l3fwd/l3fwd_lpm.h +4 -4
@@ -10,14 +10,14 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) {struct rte_ether_hdr *eth_hdr; -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;uint16_t dst_port; eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);if (RTE_ETH_IS_IPV4_HDR (m->packet_type)) {/* Handle IPv4 headers.*/ - ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr ));#ifdef DO_RFC_1812_CHECKS
@@ -48,9 +48,9 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,send_single_packet (qconf, m, dst_port); }else if (RTE_ETH_IS_IPV6_HDR (m->packet_type)) {/* Handle IPv6 headers.*/ -struct ipv6_hdr *ipv6_hdr; +struct rte_ipv6_hdr *ipv6_hdr; - ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, + ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,sizeof (struct rte_ether_hdr )); dst_port = lpm_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_lpm_altivec.h +5 -5
@@ -17,30 +17,30 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], vector unsigned int *dip, uint32_t *ipv4_flag) { -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;struct rte_ether_hdr *eth_hdr;uint32_t x0, x1, x2, x3; eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x0 = ipv4_hdr->dst_addr; ipv4_flag[0 ] = pkt[0 ]->packet_type &RTE_PTYPE_L3_IPV4 ;rte_compiler_barrier (); eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x1 = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[1 ]->packet_type;rte_compiler_barrier (); eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x2 = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[2 ]->packet_type;rte_compiler_barrier (); eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x3 = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[3 ]->packet_type;
examples/l3fwd/l3fwd_lpm_neon.h +5 -5
@@ -18,27 +18,27 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], int32x4_t *dip, uint32_t *ipv4_flag) { -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;struct rte_ether_hdr *eth_hdr;int32_t dst[FWDSTEP ]; eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); dst[0 ] = ipv4_hdr->dst_addr; ipv4_flag[0 ] = pkt[0 ]->packet_type &RTE_PTYPE_L3_IPV4 ; eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); dst[1 ] = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[1 ]->packet_type; eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); dst[2 ] = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[2 ]->packet_type; eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); dst[3 ] = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[3 ]->packet_type;
examples/l3fwd/l3fwd_lpm_sse.h +5 -5
@@ -15,27 +15,27 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], __m128i *dip, uint32_t *ipv4_flag) { -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;struct rte_ether_hdr *eth_hdr;uint32_t x0, x1, x2, x3; eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x0 = ipv4_hdr->dst_addr; ipv4_flag[0 ] = pkt[0 ]->packet_type &RTE_PTYPE_L3_IPV4 ; eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x1 = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[1 ]->packet_type; eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x2 = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[2 ]->packet_type; eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *); - ipv4_hdr = (struct ipv4_hdr *)(eth_hdr +1 ); + ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr +1 ); x3 = ipv4_hdr->dst_addr; ipv4_flag[0 ] &= pkt[3 ]->packet_type;
examples/l3fwd/l3fwd_neon.h +5 -5
@@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])vst1q_u32 (p[2 ], ve[2 ]);vst1q_u32 (p[3 ], ve[3 ]); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[0 ] +1 ), &dst_port[0 ], pkt[0 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[1 ] +1 ), &dst_port[1 ], pkt[1 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[2 ] +1 ), &dst_port[2 ], pkt[2 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), &dst_port[3 ], pkt[3 ]->packet_type); }
@@ -113,7 +113,7 @@ process_packet(struct rte_mbuf *pkt, uint16_t *dst_port) ve =vreinterpretq_u32_s32 (val_eth[dst_port[0 ]]); -rfc1812_process ((struct ipv4_hdr *)(eth_hdr +1 ), dst_port, +rfc1812_process ((struct rte_ipv4_hdr *)(eth_hdr +1 ), dst_port, pkt->packet_type); ve =vcopyq_laneq_u32 (ve,3 , te,3 );
examples/l3fwd/l3fwd_sse.h +5 -5
@@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])_mm_storeu_si128 (p[2 ], te[2 ]);_mm_storeu_si128 (p[3 ], te[3 ]); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[0 ] +1 ), &dst_port[0 ], pkt[0 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[1 ] +1 ), &dst_port[1 ], pkt[1 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[2 ] +1 ), &dst_port[2 ], pkt[2 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), +rfc1812_process ((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), &dst_port[3 ], pkt[3 ]->packet_type); }
@@ -109,7 +109,7 @@ process_packet(struct rte_mbuf *pkt, uint16_t *dst_port) te =_mm_loadu_si128 ((__m128i *)eth_hdr); ve = val_eth[dst_port[0 ]]; -rfc1812_process ((struct ipv4_hdr *)(eth_hdr +1 ), dst_port, +rfc1812_process ((struct rte_ipv4_hdr *)(eth_hdr +1 ), dst_port, pkt->packet_type); te =_mm_blend_epi16 (te, ve,MASK_ETH );
examples/load_balancer/runtime.c +2 -2
@@ -495,7 +495,7 @@ app_lcore_worker(for (j =0 ; j < bsz_rd; j ++) {struct rte_mbuf *pkt; -struct ipv4_hdr *ipv4_hdr; +struct rte_ipv4_hdr *ipv4_hdr;uint32_t ipv4_dst, pos;uint32_t port;
@@ -508,7 +508,7 @@ app_lcore_worker( pkt = lp->mbuf_in.array[j]; ipv4_hdr =rte_pktmbuf_mtod_offset (pkt, - struct ipv4_hdr *, + struct rte_ipv4_hdr *,sizeof (struct rte_ether_hdr )); ipv4_dst =rte_be_to_cpu_32 (ipv4_hdr->dst_addr);
examples/performance-thread/l3fwd-thread/main.c +55 -55
226 lines not on this page · raw message
lib/librte_eventdev/rte_event_eth_rx_adapter.c +8 -8
Lines of this file are not shown. View the raw message.
lib/librte_ip_frag/rte_ipv4_fragmentation.c +13 -13
Lines of this file are not shown. View the raw message.
lib/librte_ip_frag/rte_ipv4_reassembly.c +3 -3
Lines of this file are not shown. View the raw message.
lib/librte_ip_frag/rte_ipv6_fragmentation.c +13 -13
Lines of this file are not shown. View the raw message.
lib/librte_ip_frag/rte_ipv6_reassembly.c +3 -3
Lines of this file are not shown. View the raw message.
lib/librte_pipeline/rte_table_action.c +25 -25
50 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.11.0
Part of the diff is not shown here. View the raw message.