prefix network structures
Subsystems (3)
PATCH 5/15 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 | 11 +- 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 | 111 ++++++++++---------- app/test/test_link_bonding_mode4.c | 30 +++--- 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/include/compat.h | 2 + drivers/net/af_xdp/rte_eth_af_xdp.c | 4 +- drivers/net/ark/ark_ethdev.c | 5 +- drivers/net/atlantic/atl_ethdev.c | 13 ++- drivers/net/avp/avp_ethdev.c | 9 +- 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 | 73 ++++++------- drivers/net/bnxt/bnxt_filter.c | 4 +- drivers/net/bnxt/bnxt_filter.h | 8 +- drivers/net/bnxt/bnxt_flow.c | 15 +-- drivers/net/bnxt/bnxt_hwrm.c | 35 ++++--- drivers/net/bnxt/bnxt_ring.c | 8 +- drivers/net/bnxt/bnxt_rxq.c | 2 +- drivers/net/bnxt/bnxt_rxr.c | 4 +- drivers/net/bnxt/bnxt_vnic.c | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 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 | 42 ++++---- drivers/net/cxgbe/cxgbe.h | 5 +- drivers/net/cxgbe/cxgbe_compat.h | 1 + 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 | 9 +- 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 | 5 +- drivers/net/e1000/em_ethdev.c | 22 ++-- drivers/net/e1000/em_rxtx.c | 18 ++-- drivers/net/e1000/igb_ethdev.c | 46 ++++---- drivers/net/e1000/igb_flow.c | 4 +- drivers/net/e1000/igb_pf.c | 11 +- drivers/net/e1000/igb_rxtx.c | 14 +-- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enetc/base/enetc_hw.h | 4 +- drivers/net/enetc/enetc_ethdev.c | 19 ++-- 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 | 5 +- drivers/net/failsafe/failsafe_args.c | 2 +- drivers/net/failsafe/failsafe_ether.c | 5 +- drivers/net/fm10k/fm10k.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 4 +- drivers/net/i40e/i40e_ethdev.c | 54 +++++----- drivers/net/i40e/i40e_ethdev.h | 2 +- drivers/net/i40e/i40e_ethdev_vf.c | 25 ++--- 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 | 22 ++-- drivers/net/iavf/iavf_rxtx.c | 8 +- drivers/net/ice/ice_ethdev.c | 21 ++-- drivers/net/ice/ice_ethdev.h | 2 +- drivers/net/ice/ice_rxtx.c | 22 ++-- drivers/net/ipn3ke/ipn3ke_ethdev.h | 2 +- drivers/net/ipn3ke/ipn3ke_flow.c | 4 +- drivers/net/ipn3ke/ipn3ke_representor.c | 10 +- drivers/net/ixgbe/ixgbe_ethdev.c | 49 +++++---- drivers/net/ixgbe/ixgbe_ethdev.h | 4 +- drivers/net/ixgbe/ixgbe_flow.c | 14 +-- drivers/net/ixgbe/ixgbe_pf.c | 11 +- drivers/net/ixgbe/ixgbe_rxtx.c | 7 +- 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 | 10 +- 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 | 14 ++- 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 | 6 +- drivers/net/mvpp2/mrvl_ethdev.c | 12 +-- drivers/net/mvpp2/mrvl_ethdev.h | 6 +- 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/nfb/nfb_ethdev.c | 2 +- drivers/net/nfp/nfp_net.c | 11 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 7 +- drivers/net/octeontx/octeontx_ethdev.h | 2 +- drivers/net/pcap/rte_eth_pcap.c | 18 ++-- drivers/net/qede/base/bcm_osal.h | 4 +- drivers/net/qede/qede_ethdev.c | 18 ++-- drivers/net/qede/qede_filter.c | 24 +++-- 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 | 6 +- drivers/net/sfc/sfc_flow.c | 2 +- drivers/net/softnic/parser.c | 6 +- drivers/net/tap/rte_eth_tap.c | 24 +++-- drivers/net/tap/tap_flow.c | 12 ++- drivers/net/thunderx/base/nicvf_plat.h | 4 +- drivers/net/thunderx/nicvf_ethdev.c | 13 +-- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/virtio/virtio_ethdev.c | 52 ++++++---- 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 | 21 ++-- 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 | 16 +-- 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 | 19 ++-- lib/librte_ethdev/rte_ethdev.h | 2 +- lib/librte_ethdev/rte_flow.h | 8 +- 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 | 121 +++++++++++----------- 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 +- 212 files changed, 1150 insertions(+), 1077 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
@@ -1925,16 +1925,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 ;
@@ -1996,8 +1996,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);
@@ -8236,7 +8236,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 ;
@@ -9210,7 +9210,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 ; }
@@ -15301,9 +15301,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 = {
@@ -15492,9 +15492,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 = {
@@ -15609,9 +15609,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 = {
@@ -15801,9 +15801,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 = {
@@ -16039,9 +16039,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_op =RTE_BE_TO_CPU_16 (arp_h->arp_opcode); arp_pro =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_pro != ETHER_TYPE_IPv4) || + (arp_pro != RTE_ETHER_TYPE_IPv4) || (arp_h->arp_hlen !=6 ) || (arp_h->arp_plen !=4 ) ) {
@@ -414,7 +414,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
@@ -879,15 +879,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 +6 -5
@@ -413,7 +413,8 @@ 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 = {
@@ -526,7 +527,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.
@@ -582,7 +583,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; } }
@@ -1223,8 +1224,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
@@ -501,8 +501,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;
@@ -516,8 +516,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;
@@ -526,8 +526,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;
@@ -547,8 +547,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;
@@ -571,8 +571,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
@@ -268,7 +268,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
@@ -65,7 +65,7 @@ initialize_eth_header(struct rte_ether_hdr *eth_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 ); + 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;
@@ -82,8 +82,8 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, 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);
@@ -322,10 +322,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 ); }
@@ -437,10 +437,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 +57 -54
311 lines not on this page · raw message
app/test/test_link_bonding_mode4.c +16 -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,8 @@ 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 */
@@ -930,11 +931,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." );
@@ -995,7 +996,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 )
@@ -1068,7 +1069,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 )
@@ -1140,9 +1141,10 @@ 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 ;
@@ -1168,7 +1170,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 );
@@ -1368,7 +1370,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);
@@ -1422,7 +1424,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
@@ -95,7 +95,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/include/compat.h +2 -0
@@ -109,6 +109,8 @@ typedef uint32_t phandle;typedef uint32_t gfp_t ;typedef uint32_t irqreturn_t ; +#define ETHER_ADDR_LEN 6 +#define IRQ_HANDLED 0#define request_irq qbman_request_irq#define free_irq qbman_free_irq
drivers/net/af_xdp/rte_eth_af_xdp.c +2 -2
@@ -352,7 +352,7 @@ eth_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->max_rx_queues =1 ; dev_info->max_tx_queues =1 ; - dev_info->min_mtu =ETHER_MIN_MTU ; + dev_info->min_mtu =RTE_ETHER_MIN_MTU ; dev_info->max_mtu =ETH_AF_XDP_FRAME_SIZE -ETH_AF_XDP_DATA_HEADROOM ; dev_info->default_rxportconf.nb_queues =1 ;
@@ -816,7 +816,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 +3 -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,8 @@ 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 +8 -5
@@ -416,7 +416,8 @@ 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 ;
@@ -897,7 +898,8 @@ int atl_macsec_config_txsc(struct rte_eth_dev *dev, uint8_t *mac)ATL_DEV_PRIVATE_TO_CFG (dev->data->dev_private);memset (&cfg->aq_macsec.txsc.mac,0 ,sizeof (cfg->aq_macsec.txsc.mac)); -memcpy ((uint8_t *)&cfg->aq_macsec.txsc.mac +2 , mac,ETHER_ADDR_LEN ); +memcpy ((uint8_t *)&cfg->aq_macsec.txsc.mac +2 , mac, +RTE_ETHER_ADDR_LEN );return 0 ; }
@@ -909,7 +911,8 @@ int atl_macsec_config_rxsc(struct rte_eth_dev *dev,ATL_DEV_PRIVATE_TO_CFG (dev->data->dev_private);memset (&cfg->aq_macsec.rxsc.mac,0 ,sizeof (cfg->aq_macsec.rxsc.mac)); -memcpy ((uint8_t *)&cfg->aq_macsec.rxsc.mac +2 , mac,ETHER_ADDR_LEN ); +memcpy ((uint8_t *)&cfg->aq_macsec.rxsc.mac +2 , mac, +RTE_ETHER_ADDR_LEN ); cfg->aq_macsec.rxsc.pi = pi;return 0 ;
@@ -1604,11 +1607,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 +5 -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,11 @@ 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
@@ -9787,13 +9787,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 +38 -35
208 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 +8 -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,14 @@ 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 +18 -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,8 @@ 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 +3126,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 +3697,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 +3800,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 +2 -2
@@ -640,8 +640,8 @@ 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 + - (2 *VLAN_TAG_SIZE ); + 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 ); rxr = rte_zmalloc_socket("bnxt_rx_ring",
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
@@ -216,9 +216,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)
@@ -233,8 +233,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 +22 -20
152 lines not on this page · raw message
drivers/net/cxgbe/cxgbe.h +3 -2
@@ -15,8 +15,9 @@#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_compat.h +1 -0
@@ -101,6 +101,7 @@#define PTR_ALIGN (p, a) ((typeof(p))CXGBE_ALIGN((unsigned long)(p), (a)))#define VLAN_HLEN 4 +#define ETHER_ADDR_LEN 6#define rmb () rte_rmb()/* dpdk rte provided rmb */ #define wmb () rte_wmb()/* dpdk rte provided wmb */
drivers/net/cxgbe/cxgbe_ethdev.c +6 -6
@@ -277,16 +277,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
@@ -587,7 +587,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",
@@ -626,7 +626,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 cxgbe_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 +5 -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,8 @@ 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 +1231,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
@@ -222,10 +222,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) ==
@@ -233,10 +233,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
@@ -2186,11 +2186,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 +3 -2
@@ -92,7 +92,8 @@* 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 +156,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 +12 -10
@@ -284,12 +284,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 ; }
@@ -576,7 +576,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);
@@ -821,7 +821,8 @@ 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)
@@ -1037,7 +1038,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 ; }
@@ -1697,7 +1698,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" );
@@ -1747,7 +1748,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));
@@ -1773,10 +1774,11 @@ 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
@@ -1789,7 +1791,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 +9 -9
@@ -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 ); + rxm->data_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 +24 -22
150 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 +6 -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,11 @@ 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 +7 -7
@@ -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 ); + rxm->data_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
@@ -215,8 +215,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 +11 -8
@@ -417,7 +417,7 @@ enetc_rx_queue_setup(struct rte_eth_dev *dev, } rx_ring->crc_len = (uint8_t )((rx_offloads &DEV_RX_OFFLOAD_KEEP_CRC ) ? -ETHER_CRC_LEN :0 ); +RTE_ETHER_CRC_LEN :0 );return 0 ; fail:
@@ -595,7 +595,7 @@ enetc_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)struct enetc_eth_hw *hw =ENETC_DEV_PRIVATE_TO_HW (dev->data->dev_private);struct enetc_hw *enetc_hw = &hw->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 ;/* check that mtu is within the allowed range */ if (mtu <ENETC_MAC_MINFRM_SIZE || frame_size >ENETC_MAC_MAXFRM_SIZE )
@@ -612,7 +612,7 @@ enetc_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
@@ -654,7 +654,8 @@ enetc_dev_configure(struct rte_eth_dev *dev) ENETC_MAC_MAXFRM_SIZE);enetc_port_wr (enetc_hw,ENETC_PTXMBAR ,2 *ENETC_MAC_MAXFRM_SIZE ); - dev->data->mtu =ETHER_MAX_LEN -ETHER_HDR_LEN -ETHER_CRC_LEN ; + dev->data->mtu =RTE_ETHER_MAX_LEN -RTE_ETHER_HDR_LEN - +RTE_ETHER_CRC_LEN ; }if (rx_offloads &DEV_RX_OFFLOAD_KEEP_CRC ) {
@@ -830,11 +831,12 @@ 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 ; }
@@ -845,8 +847,9 @@ enetc_dev_init(struct rte_eth_dev *eth_dev)/* Set MTU */ enetc_port_wr (&hw->hw,ENETC_PM0_MAXFRM , -ENETC_SET_MAXFRM (ETHER_MAX_LEN )); - eth_dev->data->mtu =ETHER_MAX_LEN -ETHER_HDR_LEN -ETHER_CRC_LEN ; +ENETC_SET_MAXFRM (RTE_ETHER_MAX_LEN )); + eth_dev->data->mtu =RTE_ETHER_MAX_LEN -RTE_ETHER_HDR_LEN - +RTE_ETHER_CRC_LEN ; ENETC_PMD_DEBUG("port_id %d vendorID=0x%x deviceID=0x%x", eth_dev->data->port_id, pci_dev->id.vendor_id,
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;
@@ -671,7 +671,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev,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_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
@@ -593,7 +593,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
@@ -609,7 +609,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
@@ -625,7 +625,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
@@ -679,14 +679,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 +3 -2
@@ -61,9 +61,10 @@ 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 +3 -2
@@ -172,9 +172,10 @@ 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 +28 -26
12 lines not on this page · raw message
drivers/net/ipn3ke/ipn3ke_representor.c +5 -5
Lines of this file are not shown. View the raw message.
drivers/net/ixgbe/ixgbe_ethdev.c +26 -23
49 lines not on this page · raw message
drivers/net/virtio/virtio_ethdev.c +29 -23
52 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 +9 -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 +63 -58
121 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.
Re: [dpdk-dev] [PATCH 05/15] net: add rte prefix to ether defines
Quoted 8 lines · Olivier Matz
Add '
RTE_' prefix to defines:
- renameETHER_ADDR_LENasRTE_ETHER_ADDR_LEN.
- renameETHER_TYPE_LENasRTE_ETHER_TYPE_LEN.
- renameETHER_CRC_LENasRTE_ETHER_CRC_LEN.
- renameETHER_HDR_LENasRTE_ETHER_HDR_LEN.
- renameETHER_MIN_LENasRTE_ETHER_MIN_LEN.
- renameETHER_MAX_LENasRTE_ETHER_MAX_LEN.
- renameETHER_MTUasRTE_ETHER_MTU.
net/ice has RTE_ETHER_MTU in next-net, I am fixing it.
Quoted 34 lines
- rename
ETHER_MAX_VLAN_FRAME_LENasRTE_ETHER_MAX_VLAN_FRAME_LEN.
- renameETHER_MAX_VLAN_IDasRTE_ETHER_MAX_VLAN_ID.
- renameETHER_MAX_JUMBO_FRAME_LENasRTE_ETHER_MAX_JUMBO_FRAME_LEN.
- renameETHER_MIN_MTUasRTE_ETHER_MIN_MTU.
- renameETHER_LOCAL_ADMIN_ADDRasRTE_ETHER_LOCAL_ADMIN_ADDR.
- renameETHER_GROUP_ADDRasRTE_ETHER_GROUP_ADDR.
- renameETHER_TYPE_IPv4asRTE_ETHER_TYPE_IPv4.
- renameETHER_TYPE_IPv6asRTE_ETHER_TYPE_IPv6.
- renameETHER_TYPE_ARPasRTE_ETHER_TYPE_ARP.
- renameETHER_TYPE_VLANasRTE_ETHER_TYPE_VLAN.
- renameETHER_TYPE_RARPasRTE_ETHER_TYPE_RARP.
- renameETHER_TYPE_QINQasRTE_ETHER_TYPE_QINQ.
- renameETHER_TYPE_ETAGasRTE_ETHER_TYPE_ETAG.
- renameETHER_TYPE_1588asRTE_ETHER_TYPE_1588.
- renameETHER_TYPE_SLOWasRTE_ETHER_TYPE_SLOW.
- renameETHER_TYPE_TEBasRTE_ETHER_TYPE_TEB.
- renameETHER_TYPE_LLDPasRTE_ETHER_TYPE_LLDP.
- renameETHER_TYPE_MPLSasRTE_ETHER_TYPE_MPLS.
- renameETHER_TYPE_MPLSMasRTE_ETHER_TYPE_MPLSM.
- renameETHER_VXLAN_HLENasRTE_ETHER_VXLAN_HLEN.
- renameETHER_ADDR_FMT_SIZEasRTE_ETHER_ADDR_FMT_SIZE.
- renameVXLAN_GPE_TYPE_IPV4asRTE_VXLAN_GPE_TYPE_IPV4.
- renameVXLAN_GPE_TYPE_IPV6asRTE_VXLAN_GPE_TYPE_IPV6.
- renameVXLAN_GPE_TYPE_ETHasRTE_VXLAN_GPE_TYPE_ETH.
- renameVXLAN_GPE_TYPE_NSHasRTE_VXLAN_GPE_TYPE_NSH.
- renameVXLAN_GPE_TYPE_MPLSasRTE_VXLAN_GPE_TYPE_MPLS.
- renameVXLAN_GPE_TYPE_GBPasRTE_VXLAN_GPE_TYPE_GBP.
- renameVXLAN_GPE_TYPE_VBNGasRTE_VXLAN_GPE_TYPE_VBNG.
- renameETHER_VXLAN_GPE_HLENasRTE_ETHER_VXLAN_GPE_HLEN.Do not update the command line library to avoid adding a dependency to
librte_net.Signed-off-by Olivier Matz <[email protected]>
<...>
PATCH 6/15 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 | 47 +++++++++++++++++++++++--------------------- 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 | 10 ++++++---- lib/librte_net/rte_esp.h | 2 +- 9 files changed, 48 insertions(+), 43 deletions(-)
app/test/test_ipsec.c +2 -2
@@ -569,12 +569,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 +25 -22
145 lines not on this page · raw message
examples/ipsec-secgw/sa.c +3 -3
@@ -1219,7 +1219,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;
@@ -1229,9 +1229,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
@@ -915,7 +915,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 +6 -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,8 @@ 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 +268,14 @@ 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
PATCH 7/15 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
@@ -1218,7 +1218,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 ;
@@ -1331,7 +1331,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
PATCH 8/15 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;
@@ -430,7 +430,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
@@ -673,7 +673,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
PATCH 9/15 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
@@ -433,7 +433,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 ;
@@ -457,7 +457,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. */
@@ -480,10 +480,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
PATCH 10/15 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 | 42 +++---- 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 | 60 +++++----- app/test/packet_burst_generator.h | 6 +- app/test/test_flow_classify.c | 16 +-- app/test/test_ipsec.c | 5 +- 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 | 14 ++- 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 | 9 +- 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 | 84 +++++++------- examples/l3fwd-power/main.c | 28 ++--- examples/l3fwd-vf/main.c | 18 +-- examples/l3fwd/l3fwd.h | 6 +- examples/l3fwd/l3fwd_altivec.h | 22 ++-- examples/l3fwd/l3fwd_common.h | 4 +- examples/l3fwd/l3fwd_em.c | 16 +-- examples/l3fwd/l3fwd_em.h | 8 +- examples/l3fwd/l3fwd_em_hlm.h | 8 +- examples/l3fwd/l3fwd_em_hlm_neon.h | 16 +-- 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 | 22 ++-- examples/l3fwd/l3fwd_sse.h | 22 ++-- examples/load_balancer/runtime.c | 4 +- examples/performance-thread/l3fwd-thread/main.c | 121 +++++++++++---------- examples/server_node_efd/node/node.c | 6 +- examples/server_node_efd/server/main.c | 6 +- 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 | 10 +- lib/librte_gso/rte_gso.h | 4 +- lib/librte_hash/rte_thash.h | 3 +- lib/librte_ip_frag/rte_ip_frag.h | 9 +- 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 | 28 ++--- 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 | 14 +-- lib/librte_pipeline/rte_table_action.c | 60 +++++----- lib/librte_port/rte_port_ras.c | 6 +- lib/librte_vhost/virtio_net.c | 10 +- 100 files changed, 713 insertions(+), 668 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,7 +56,7 @@ 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,
@@ -64,7 +64,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, .offset = sizeof(struct rte_ether_hdr) + - sizeof(struct ipv4_hdr), + sizeof(struct rte_ipv4_hdr), }, { .type = RTE_ACL_FIELD_TYPE_RANGE,
@@ -72,7 +72,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, .offset = sizeof(struct rte_ether_hdr) + - sizeof(struct ipv4_hdr) + sizeof(uint16_t), + 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 +22 -20
126 lines not on this page · raw message
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;
@@ -418,7 +418,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);
@@ -431,7 +431,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
@@ -53,7 +53,7 @@ uint32_t tx_ip_dst_addr = (192U << 24) | (18 << 16) | (0 << 8) | 2;#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. */
@@ -95,7 +95,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) {
@@ -115,7 +115,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 ;
@@ -177,7 +177,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;
@@ -195,11 +195,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
@@ -213,7 +213,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.
@@ -349,7 +349,7 @@ tx_only_begin(__attribute__((unused)) portid_t pi) 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 +34 -26
151 lines not on this page · raw message
app/test/packet_burst_generator.h +3 -3
@@ -47,15 +47,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 +3 -2
@@ -531,7 +531,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 ,
@@ -569,7 +569,8 @@ 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
@@ -735,8 +735,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,7 +80,7 @@ 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 *);
@@ -90,7 +90,7 @@ prepare_pkt(struct rte_sched_port *port, struct rte_mbuf *mbuf) eth_hdr = (struct rte_ether_hdr *)( (uintptr_t )ð_hdr->ether_type +2 *sizeof (struct rte_vlan_hdr )); - ip_hdr = (struct ipv4_hdr *)( + ip_hdr = (struct rte_ipv4_hdr *)( (uintptr_t )eth_hdr +sizeof (eth_hdr->ether_type)); vlan1->vlan_tci =rte_cpu_to_be_16 (SUBPORT );
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
@@ -245,7 +245,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));
@@ -273,10 +273,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);
@@ -309,7 +309,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
@@ -591,7 +591,7 @@ 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 ];
@@ -608,7 +608,7 @@ mode6_debug(const char __attribute__((unused)) *info,#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);
@@ -755,13 +755,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 ]);
@@ -812,12 +812,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); }
@@ -852,7 +852,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;
@@ -883,7 +883,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
@@ -201,22 +201,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
@@ -2137,7 +2137,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;
@@ -2154,7 +2154,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
@@ -182,9 +182,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;
@@ -212,7 +212,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 ) {
@@ -271,9 +271,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;
@@ -301,7 +301,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
@@ -411,7 +411,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 , };
@@ -606,9 +606,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 ); }
@@ -622,9 +622,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 ); }
@@ -773,9 +773,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 ; }
@@ -802,9 +802,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 ; }
@@ -884,16 +884,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
@@ -2548,13 +2548,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,
@@ -2570,7 +2570,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
@@ -1213,8 +1213,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 ;
@@ -1250,7 +1250,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,
@@ -1268,7 +1268,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 +8 -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,16 @@ 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 +1143,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 +1154,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 +5 -4
@@ -479,13 +479,14 @@ 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 +495,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
@@ -341,7 +341,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;
@@ -409,7 +409,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
@@ -66,8 +66,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.
@@ -260,10 +260,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 */
@@ -295,12 +295,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);
@@ -390,7 +390,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 ipv6_hdr *)(eth_hdr +1 ); + ip_hdr = (struct rte_ipv6_hdr *)(eth_hdr +1 ); } }
examples/ipsec-secgw/ipsec-secgw.c +1 -1
@@ -341,7 +341,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
@@ -297,7 +297,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;
@@ -307,7 +307,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 *) + iphdr = (struct rte_ipv4_hdr *)rte_pktmbuf_adj (m, (uint16_t )sizeof (struct rte_ether_hdr ));RTE_ASSERT (iphdr !=NULL );
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 +44 -40
219 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
@@ -707,10 +707,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 +13 -9
@@ -68,14 +68,18 @@ 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 ), - &dst_port[0 ], pkt[0 ]->packet_type); -rfc1812_process ((struct 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 ), - &dst_port[2 ], pkt[2 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), - &dst_port[3 ], pkt[3 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[0 ] +1 ), + &dst_port[0 ], pkt[0 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[1 ] +1 ), + &dst_port[1 ], pkt[1 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[2 ] +1 ), + &dst_port[2 ], pkt[2 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[3 ] +1 ), + &dst_port[3 ], pkt[3 ]->packet_type); }/*
@@ -129,7 +133,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 +9 -7
@@ -252,7 +252,8 @@ 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 +274,8 @@ 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 +568,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 +587,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
@@ -53,9 +53,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 +8 -8
@@ -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 )); + rte_pktmbuf_mtod_offset(m0, int *, +sizeof (struct rte_ether_hdr ) + + 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 )); + rte_pktmbuf_mtod_offset(m0, int *, +sizeof (struct rte_ether_hdr ) + + 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
@@ -86,7 +86,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); }
@@ -98,7 +98,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); }
@@ -106,21 +106,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);
@@ -139,7 +139,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)) {
@@ -150,7 +150,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
@@ -49,9 +49,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 +13 -9
@@ -48,14 +48,18 @@ 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 ), - &dst_port[0 ], pkt[0 ]->packet_type); -rfc1812_process ((struct 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 ), - &dst_port[2 ], pkt[2 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), - &dst_port[3 ], pkt[3 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[0 ] +1 ), + &dst_port[0 ], pkt[0 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[1 ] +1 ), + &dst_port[1 ], pkt[1 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[2 ] +1 ), + &dst_port[2 ], pkt[2 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[3 ] +1 ), + &dst_port[3 ], pkt[3 ]->packet_type); }/*
@@ -113,7 +117,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 +13 -9
@@ -48,14 +48,18 @@ 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 ), - &dst_port[0 ], pkt[0 ]->packet_type); -rfc1812_process ((struct 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 ), - &dst_port[2 ], pkt[2 ]->packet_type); -rfc1812_process ((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3 ] +1 ), - &dst_port[3 ], pkt[3 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[0 ] +1 ), + &dst_port[0 ], pkt[0 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[1 ] +1 ), + &dst_port[1 ], pkt[1 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[2 ] +1 ), + &dst_port[2 ], pkt[2 ]->packet_type); +rfc1812_process ((struct rte_ipv4_hdr *) + ((struct rte_ether_hdr *)p[3 ] +1 ), + &dst_port[3 ], pkt[3 ]->packet_type); }/*
@@ -109,7 +113,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 *, + pkt, 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 +64 -57
171 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 +15 -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 +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.
PATCH 11/15 net: add rte prefix to ip defines
In reply to Olivier MatzAdd 'RTE_' prefix to defines:
- rename IPv4( as RTE_IPv4(.
- rename IPV4_MAX_PKT_LEN as RTE_IPV4_MAX_PKT_LEN.
- rename IPV4_HDR_IHL_MASK as RTE_IPV4_HDR_IHL_MASK.
- rename IPV4_IHL_MULTIPLIER as RTE_IPV4_IHL_MULTIPLIER.
- rename IPV4_HDR_DF_SHIFT as RTE_IPV4_HDR_DF_SHIFT.
- rename IPV4_HDR_MF_SHIFT as RTE_IPV4_HDR_MF_SHIFT.
- rename IPV4_HDR_FO_SHIFT as RTE_IPV4_HDR_FO_SHIFT.
- rename IPV4_HDR_DF_FLAG as RTE_IPV4_HDR_DF_FLAG.
- rename IPV4_HDR_MF_FLAG as RTE_IPV4_HDR_MF_FLAG.
- rename IPV4_HDR_OFFSET_MASK as RTE_IPV4_HDR_OFFSET_MASK.
- rename IPV4_HDR_OFFSET_UNITS as RTE_IPV4_HDR_OFFSET_UNITS.
- rename IPV4_ANY as RTE_IPV4_ANY.
- rename IPV4_LOOPBACK as RTE_IPV4_LOOPBACK.
- rename IPV4_BROADCAST as RTE_IPV4_BROADCAST.
- rename IPV4_ALLHOSTS_GROUP as RTE_IPV4_ALLHOSTS_GROUP.
- rename IPV4_ALLRTRS_GROUP as RTE_IPV4_ALLRTRS_GROUP.
- rename IPV4_MAX_LOCAL_GROUP as RTE_IPV4_MAX_LOCAL_GROUP.
- rename IPV4_MIN_MCAST as RTE_IPV4_MIN_MCAST.
- rename IPV4_MAX_MCAST as RTE_IPV4_MAX_MCAST.
- rename IS_IPV4_MCAST as RTE_IS_IPV4_MCAST.
- rename IPV6_HDR_FL_SHIFT as RTE_IPV6_HDR_FL_SHIFT.
- rename IPV6_HDR_TC_SHIFT as RTE_IPV6_HDR_TC_SHIFT.
- rename IPV6_HDR_FL_MASK as RTE_IPV6_HDR_FL_MASK.
- rename IPV6_HDR_TC_MASK as RTE_IPV6_HDR_TC_MASK.
--- app/test-acl/main.c | 2 +- app/test-pmd/cmdline_flow.c | 4 +- app/test-pmd/flowgen.c | 4 +- app/test-pmd/testpmd.c | 8 +- app/test/test_acl.c | 8 +- app/test/test_acl.h | 122 ++++++++++----------- app/test/test_efd.c | 20 ++-- app/test/test_flow_classify.c | 10 +- app/test/test_hash.c | 20 ++-- app/test/test_ipsec.c | 6 +- app/test/test_link_bonding_mode4.c | 4 +- app/test/test_lpm.c | 76 ++++++------- app/test/test_lpm_perf.c | 10 +- app/test/test_member.c | 20 ++-- app/test/test_sched.c | 2 +- app/test/test_table_acl.c | 8 +- app/test/test_thash.c | 10 +- .../prog_guide/packet_classif_access_ctrl.rst | 6 +- doc/guides/sample_app_ug/ip_frag.rst | 16 +-- doc/guides/sample_app_ug/ip_reassembly.rst | 16 +-- doc/guides/sample_app_ug/ipv4_multicast.rst | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 4 +- drivers/net/ena/ena_ethdev.c | 2 +- drivers/net/i40e/i40e_flow.c | 4 +- drivers/net/ixgbe/ixgbe_rxtx.c | 2 +- drivers/net/mlx5/mlx5_flow_tcf.c | 16 +-- drivers/net/mlx5/mlx5_flow_verbs.c | 16 +-- drivers/net/tap/tap_bpf_program.c | 6 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 4 +- examples/flow_classify/flow_classify.c | 2 +- examples/ip_fragmentation/main.c | 16 +-- examples/ip_reassembly/main.c | 16 +-- examples/ipsec-secgw/sa.c | 4 +- examples/ipv4_multicast/main.c | 32 +++--- examples/l2fwd-crypto/main.c | 4 +- examples/l3fwd-acl/main.c | 2 +- examples/l3fwd-power/main.c | 24 ++-- examples/l3fwd-vf/main.c | 24 ++-- examples/l3fwd/l3fwd_em.c | 20 ++-- examples/l3fwd/l3fwd_lpm.c | 16 +-- examples/performance-thread/l3fwd-thread/main.c | 32 +++--- lib/librte_gro/gro_tcp4.c | 2 +- lib/librte_gro/gro_vxlan_tcp4.c | 5 +- lib/librte_gso/gso_common.h | 4 +- lib/librte_ip_frag/rte_ip_frag.h | 4 +- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 16 +-- lib/librte_ip_frag/rte_ipv4_reassembly.c | 8 +- lib/librte_net/rte_ip.h | 53 ++++----- lib/librte_net/rte_net.c | 6 +- lib/librte_port/rte_port_ras.c | 4 +- 50 files changed, 364 insertions(+), 358 deletions(-)
app/test-acl/main.c +1 -1
@@ -625,7 +625,7 @@ parse_ipv4_net(const char *in, uint32_t *addr, uint32_t *mask_len)GET_CB_FIELD (in, d,0 ,UINT8_MAX ,'/' );GET_CB_FIELD (in, m,0 ,sizeof (uint32_t ) *CHAR_BIT ,0 ); - addr[0 ] =IPv4 (a, b, c, d); + addr[0 ] =RTE_IPv4 (a, b, c, d); mask_len[0 ] = m;return 0 ;
app/test-pmd/cmdline_flow.c +2 -2
@@ -3532,12 +3532,12 @@ parse_vc_action_vxlan_encap(struct context *ctx, const struct token *token,memcpy (&ipv6_mask_tos, &rte_flow_item_ipv6_mask,sizeof (ipv6_mask_tos)); ipv6_mask_tos.hdr.vtc_flow |= -RTE_BE32 (0xfful <<IPV6_HDR_TC_SHIFT ); +RTE_BE32 (0xfful <<RTE_IPV6_HDR_TC_SHIFT ); ipv6_mask_tos.hdr.hop_limits =0xff ; action_vxlan_encap_data->item_ipv6.hdr.vtc_flow |=rte_cpu_to_be_32 ((uint32_t )vxlan_encap_conf.ip_tos << -IPV6_HDR_TC_SHIFT ); +RTE_IPV6_HDR_TC_SHIFT ); action_vxlan_encap_data->item_ipv6.hdr.hop_limits = vxlan_encap_conf.ip_ttl; action_vxlan_encap_data->items[2].mask =
app/test-pmd/flowgen.c +2 -2
@@ -72,8 +72,8 @@/* hardcoded configuration (for now) */ static unsigned cfg_n_flows =1024 ; -static uint32_t cfg_ip_src =IPv4 (10 ,254 ,0 ,0 ); -static uint32_t cfg_ip_dst =IPv4 (10 ,253 ,0 ,0 ); +static uint32_t cfg_ip_src =RTE_IPv4 (10 ,254 ,0 ,0 ); +static uint32_t cfg_ip_dst =RTE_IPv4 (10 ,253 ,0 ,0 );static uint16_t cfg_udp_src =1000 ;static uint16_t cfg_udp_dst =1001 ; static struct rte_ether_addr cfg_ether_src =
app/test-pmd/testpmd.c +4 -4
@@ -480,8 +480,8 @@ struct vxlan_encap_conf vxlan_encap_conf = { .vni = "\x00\x00\x00", .udp_src = 0, .udp_dst = RTE_BE16(4789), - .ipv4_src = IPv4(127, 0, 0, 1), - .ipv4_dst = IPv4(255, 255, 255, 255), + .ipv4_src = RTE_IPv4(127, 0, 0, 1), + .ipv4_dst = RTE_IPv4(255, 255, 255, 255), .ipv6_src ="\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x01" , .ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -497,8 +497,8 @@ struct nvgre_encap_conf nvgre_encap_conf = { .select_ipv4 = 1, .select_vlan = 0, .tni = "\x00\x00\x00", - .ipv4_src = IPv4(127, 0, 0, 1), - .ipv4_dst = IPv4(255, 255, 255, 255), + .ipv4_src = RTE_IPv4(127, 0, 0, 1), + .ipv4_dst = RTE_IPv4(255, 255, 255, 255), .ipv6_src ="\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x01" , .ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00"
app/test/test_acl.c +4 -4
@@ -515,15 +515,15 @@ test_build_ports_range(void)static struct ipv4_7tuple test_data[] = { { .proto =6 , - .ip_src =IPv4 (10 ,1 ,1 ,1 ), - .ip_dst =IPv4 (192 ,168 ,0 ,33 ), + .ip_src =RTE_IPv4 (10 ,1 ,1 ,1 ), + .ip_dst =RTE_IPv4 (192 ,168 ,0 ,33 ), .port_dst =53 , .allow =1 , }, { .proto =6 , - .ip_src =IPv4 (127 ,84 ,33 ,1 ), - .ip_dst =IPv4 (1 ,2 ,3 ,4 ), + .ip_src =RTE_IPv4 (127 ,84 ,33 ,1 ), + .ip_dst =RTE_IPv4 (1 ,2 ,3 ,4 ), .port_dst =65281 , .allow =1 , },
app/test/test_acl.h +61 -61
304 lines not on this page · raw message
app/test/test_efd.c +10 -10
@@ -58,36 +58,36 @@ static void print_key_info(const char *msg, const struct flow_key *key,/* Keys used by unit test functions */ static struct flow_key keys[5 ] = { { - .ip_src =IPv4 (0x03 ,0x02 ,0x01 ,0x00 ), - .ip_dst =IPv4 (0x07 ,0x06 ,0x05 ,0x04 ), + .ip_src =RTE_IPv4 (0x03 ,0x02 ,0x01 ,0x00 ), + .ip_dst =RTE_IPv4 (0x07 ,0x06 ,0x05 ,0x04 ), .port_src =0x0908 , .port_dst =0x0b0a , .proto =0x0c , }, { - .ip_src =IPv4 (0x13 ,0x12 ,0x11 ,0x10 ), - .ip_dst =IPv4 (0x17 ,0x16 ,0x15 ,0x14 ), + .ip_src =RTE_IPv4 (0x13 ,0x12 ,0x11 ,0x10 ), + .ip_dst =RTE_IPv4 (0x17 ,0x16 ,0x15 ,0x14 ), .port_src =0x1918 , .port_dst =0x1b1a , .proto =0x1c , }, { - .ip_src =IPv4 (0x23 ,0x22 ,0x21 ,0x20 ), - .ip_dst =IPv4 (0x27 ,0x26 ,0x25 ,0x24 ), + .ip_src =RTE_IPv4 (0x23 ,0x22 ,0x21 ,0x20 ), + .ip_dst =RTE_IPv4 (0x27 ,0x26 ,0x25 ,0x24 ), .port_src =0x2928 , .port_dst =0x2b2a , .proto =0x2c , }, { - .ip_src =IPv4 (0x33 ,0x32 ,0x31 ,0x30 ), - .ip_dst =IPv4 (0x37 ,0x36 ,0x35 ,0x34 ), + .ip_src =RTE_IPv4 (0x33 ,0x32 ,0x31 ,0x30 ), + .ip_dst =RTE_IPv4 (0x37 ,0x36 ,0x35 ,0x34 ), .port_src =0x3938 , .port_dst =0x3b3a , .proto =0x3c , }, { - .ip_src =IPv4 (0x43 ,0x42 ,0x41 ,0x40 ), - .ip_dst =IPv4 (0x47 ,0x46 ,0x45 ,0x44 ), + .ip_src =RTE_IPv4 (0x43 ,0x42 ,0x41 ,0x40 ), + .ip_dst =RTE_IPv4 (0x47 ,0x46 ,0x45 ,0x44 ), .port_src =0x4948 , .port_dst =0x4b4a , .proto =0x4c ,
app/test/test_flow_classify.c +6 -4
@@ -95,7 +95,8 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {* dst mask 255.255.255.00 / udp src is 32 dst is 33 / end" */ static struct rte_flow_item_ipv4 ipv4_udp_spec_1 = { - {0 ,0 ,0 ,0 ,0 ,0 ,IPPROTO_UDP ,0 ,IPv4 (2 ,2 ,2 ,3 ),IPv4 (2 ,2 ,2 ,7 )} + {0 ,0 ,0 ,0 ,0 ,0 ,IPPROTO_UDP ,0 , +RTE_IPv4 (2 ,2 ,2 ,3 ),RTE_IPv4 (2 ,2 ,2 ,7 )} };static const struct rte_flow_item_ipv4 ipv4_mask_24 = { .hdr = {
@@ -131,7 +132,8 @@ static struct rte_flow_item end_item_bad = { -1, 0, 0, 0 };* dst mask 255.255.255.00 / tcp src is 16 dst is 17 / end" */ static struct rte_flow_item_ipv4 ipv4_tcp_spec_1 = { - {0 ,0 ,0 ,0 ,0 ,0 ,IPPROTO_TCP ,0 ,IPv4 (1 ,2 ,3 ,4 ),IPv4 (5 ,6 ,7 ,8 )} + {0 ,0 ,0 ,0 ,0 ,0 ,IPPROTO_TCP ,0 , +RTE_IPv4 (1 ,2 ,3 ,4 ),RTE_IPv4 (5 ,6 ,7 ,8 )} };static struct rte_flow_item_tcp tcp_spec_1 = {
@@ -149,8 +151,8 @@ static struct rte_flow_item tcp_item_1 = { RTE_FLOW_ITEM_TYPE_TCP,* dst mask 255.255.255.00 / sctp src is 16 dst is 17/ end" */ static struct rte_flow_item_ipv4 ipv4_sctp_spec_1 = { - {0 ,0 ,0 ,0 ,0 ,0 ,IPPROTO_SCTP ,0 ,IPv4 (11 ,12 ,13 ,14 ), -IPv4 (15 ,16 ,17 ,18 )} + {0 ,0 ,0 ,0 ,0 ,0 ,IPPROTO_SCTP ,0 ,RTE_IPv4 (11 ,12 ,13 ,14 ), +RTE_IPv4 (15 ,16 ,17 ,18 )} };static struct rte_flow_item_sctp sctp_spec_1 = {
app/test/test_hash.c +10 -10
@@ -104,32 +104,32 @@ static void print_key_info(const char *msg, const struct flow_key *key,/* Keys used by unit test functions */ static struct flow_key keys[5 ] = { { - .ip_src =IPv4 (0x03 ,0x02 ,0x01 ,0x00 ), - .ip_dst =IPv4 (0x07 ,0x06 ,0x05 ,0x04 ), + .ip_src =RTE_IPv4 (0x03 ,0x02 ,0x01 ,0x00 ), + .ip_dst =RTE_IPv4 (0x07 ,0x06 ,0x05 ,0x04 ), .port_src =0x0908 , .port_dst =0x0b0a , .proto =0x0c , }, { - .ip_src =IPv4 (0x13 ,0x12 ,0x11 ,0x10 ), - .ip_dst =IPv4 (0x17 ,0x16 ,0x15 ,0x14 ), + .ip_src =RTE_IPv4 (0x13 ,0x12 ,0x11 ,0x10 ), + .ip_dst =RTE_IPv4 (0x17 ,0x16 ,0x15 ,0x14 ), .port_src =0x1918 , .port_dst =0x1b1a , .proto =0x1c , }, { - .ip_src =IPv4 (0x23 ,0x22 ,0x21 ,0x20 ), - .ip_dst =IPv4 (0x27 ,0x26 ,0x25 ,0x24 ), + .ip_src =RTE_IPv4 (0x23 ,0x22 ,0x21 ,0x20 ), + .ip_dst =RTE_IPv4 (0x27 ,0x26 ,0x25 ,0x24 ), .port_src =0x2928 , .port_dst =0x2b2a , .proto =0x2c , }, { - .ip_src =IPv4 (0x33 ,0x32 ,0x31 ,0x30 ), - .ip_dst =IPv4 (0x37 ,0x36 ,0x35 ,0x34 ), + .ip_src =RTE_IPv4 (0x33 ,0x32 ,0x31 ,0x30 ), + .ip_dst =RTE_IPv4 (0x37 ,0x36 ,0x35 ,0x34 ), .port_src =0x3938 , .port_dst =0x3b3a , .proto =0x3c , }, { - .ip_src =IPv4 (0x43 ,0x42 ,0x41 ,0x40 ), - .ip_dst =IPv4 (0x47 ,0x46 ,0x45 ,0x44 ), + .ip_src =RTE_IPv4 (0x43 ,0x42 ,0x41 ,0x40 ), + .ip_dst =RTE_IPv4 (0x47 ,0x46 ,0x45 ,0x44 ), .port_src =0x4948 , .port_dst =0x4b4a , .proto =0x4c ,
app/test/test_ipsec.c +3 -3
@@ -533,11 +533,11 @@ const char null_encrypted_data[] =struct rte_ipv4_hdr ipv4_outer = { .version_ihl =IPVERSION <<4 | -sizeof (ipv4_outer) /IPV4_IHL_MULTIPLIER , +sizeof (ipv4_outer) /RTE_IPV4_IHL_MULTIPLIER , .time_to_live =IPDEFTTL , .next_proto_id =IPPROTO_ESP , - .src_addr =IPv4 (192 ,168 ,1 ,100 ), - .dst_addr =IPv4 (192 ,168 ,2 ,100 ), + .src_addr =RTE_IPv4 (192 ,168 ,1 ,100 ), + .dst_addr =RTE_IPv4 (192 ,168 ,2 ,100 ), }; static struct rte_mbuf *
app/test/test_link_bonding_mode4.c +2 -2
@@ -729,8 +729,8 @@ generate_packets(struct rte_ether_addr *src_mac,uint16_t src_port =10 , dst_port =20 ; -uint32_t ip_src[4 ] = { [0 ...2 ] =0xDEADBEEF , [3 ] =IPv4 (192 ,168 ,0 ,1 ) }; -uint32_t ip_dst[4 ] = { [0 ...2 ] =0xFEEDFACE , [3 ] =IPv4 (192 ,168 ,0 ,2 ) }; +uint32_t ip_src[4 ] = { [0 ...2 ] =0xDEADBEEF , [3 ] =RTE_IPv4 (192 ,168 ,0 ,1 ) }; +uint32_t ip_dst[4 ] = { [0 ...2 ] =0xFEEDFACE , [3 ] =RTE_IPv4 (192 ,168 ,0 ,2 ) };struct rte_ether_hdr pkt_eth_hdr;struct udp_hdr pkt_udp_hdr;
app/test/test_lpm.c +38 -38
283 lines not on this page · raw message
app/test/test_lpm_perf.c +5 -5
@@ -285,11 +285,11 @@ static void generate_large_route_rule_table(void)* they are 4 rules with private local IP address and 1 all-zeros prefix * with depth = 8. */ -insert_rule_in_random_pos (IPv4 (0 ,0 ,0 ,0 ),8 ); -insert_rule_in_random_pos (IPv4 (10 ,2 ,23 ,147 ),32 ); -insert_rule_in_random_pos (IPv4 (192 ,168 ,100 ,10 ),24 ); -insert_rule_in_random_pos (IPv4 (192 ,168 ,25 ,100 ),24 ); -insert_rule_in_random_pos (IPv4 (192 ,168 ,129 ,124 ),32 ); +insert_rule_in_random_pos (RTE_IPv4 (0 ,0 ,0 ,0 ),8 ); +insert_rule_in_random_pos (RTE_IPv4 (10 ,2 ,23 ,147 ),32 ); +insert_rule_in_random_pos (RTE_IPv4 (192 ,168 ,100 ,10 ),24 ); +insert_rule_in_random_pos (RTE_IPv4 (192 ,168 ,25 ,100 ),24 ); +insert_rule_in_random_pos (RTE_IPv4 (192 ,168 ,129 ,124 ),32 ); } static void
app/test/test_member.c +10 -10
@@ -41,36 +41,36 @@ struct flow_key {/* Keys used by unit test functions */ static struct flow_key keys[NUM_SAMPLES ] = { { - .ip_src =IPv4 (0x03 ,0x02 ,0x01 ,0x00 ), - .ip_dst =IPv4 (0x07 ,0x06 ,0x05 ,0x04 ), + .ip_src =RTE_IPv4 (0x03 ,0x02 ,0x01 ,0x00 ), + .ip_dst =RTE_IPv4 (0x07 ,0x06 ,0x05 ,0x04 ), .port_src =0x0908 , .port_dst =0x0b0a , .proto =0x0c , }, { - .ip_src =IPv4 (0x13 ,0x12 ,0x11 ,0x10 ), - .ip_dst =IPv4 (0x17 ,0x16 ,0x15 ,0x14 ), + .ip_src =RTE_IPv4 (0x13 ,0x12 ,0x11 ,0x10 ), + .ip_dst =RTE_IPv4 (0x17 ,0x16 ,0x15 ,0x14 ), .port_src =0x1918 , .port_dst =0x1b1a , .proto =0x1c , }, { - .ip_src =IPv4 (0x23 ,0x22 ,0x21 ,0x20 ), - .ip_dst =IPv4 (0x27 ,0x26 ,0x25 ,0x24 ), + .ip_src =RTE_IPv4 (0x23 ,0x22 ,0x21 ,0x20 ), + .ip_dst =RTE_IPv4 (0x27 ,0x26 ,0x25 ,0x24 ), .port_src =0x2928 , .port_dst =0x2b2a , .proto =0x2c , }, { - .ip_src =IPv4 (0x33 ,0x32 ,0x31 ,0x30 ), - .ip_dst =IPv4 (0x37 ,0x36 ,0x35 ,0x34 ), + .ip_src =RTE_IPv4 (0x33 ,0x32 ,0x31 ,0x30 ), + .ip_dst =RTE_IPv4 (0x37 ,0x36 ,0x35 ,0x34 ), .port_src =0x3938 , .port_dst =0x3b3a , .proto =0x3c , }, { - .ip_src =IPv4 (0x43 ,0x42 ,0x41 ,0x40 ), - .ip_dst =IPv4 (0x47 ,0x46 ,0x45 ,0x44 ), + .ip_src =RTE_IPv4 (0x43 ,0x42 ,0x41 ,0x40 ), + .ip_dst =RTE_IPv4 (0x47 ,0x46 ,0x45 ,0x44 ), .port_src =0x4948 , .port_dst =0x4b4a , .proto =0x4c ,
app/test/test_sched.c +1 -1
@@ -96,7 +96,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 (RTE_ETHER_TYPE_IPv4); - ip_hdr->dst_addr =IPv4 (0 ,0 ,TC ,QUEUE ); + ip_hdr->dst_addr =RTE_IPv4 (0 ,0 ,TC ,QUEUE ); rte_sched_port_pkt_write(port, mbuf, SUBPORT, PIPE, TC, QUEUE,
app/test/test_table_acl.c +4 -4
@@ -7,7 +7,7 @@#include "test_table.h" #include "test_table_acl.h" -#define IPv4 (a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) | \ +#define RTE_IPv4 (a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) | \ (((b) & 0xff) << 16) | \ (((c) & 0xff) << 8) | \ ((d) & 0xff))
@@ -116,7 +116,7 @@ parse_ipv4_net(const char *in, uint32_t *addr, uint32_t *mask_len)GET_CB_FIELD (in, d,0 ,UINT8_MAX ,'/' );GET_CB_FIELD (in, m,0 ,sizeof (uint32_t ) *CHAR_BIT ,0 ); - addr[0 ] =IPv4 (a, b, c, d); + addr[0 ] =RTE_IPv4 (a, b, c, d); mask_len[0 ] = m;return 0 ;
@@ -662,8 +662,8 @@ test_pipeline_single_filter(int expected_count) sizeof(struct ipv4_5tuple)); five_tuple.proto = j; - five_tuple.ip_src =rte_bswap32 (IPv4 (192 ,168 , j,1 )); - five_tuple.ip_dst =rte_bswap32 (IPv4 (10 ,4 , j,1 )); + five_tuple.ip_src =rte_bswap32 (RTE_IPv4 (192 ,168 , j,1 )); + five_tuple.ip_dst =rte_bswap32 (RTE_IPv4 (10 ,4 , j,1 )); five_tuple.port_src =rte_bswap16 (100 + j); five_tuple.port_dst =rte_bswap16 (200 + j);
app/test/test_thash.c +5 -5
@@ -59,15 +59,15 @@ struct test_thash_v6 {/*From 82599 Datasheet 7.1.2.8.3 RSS Verification Suite*/ struct test_thash_v4 v4_tbl[] = { -{IPv4 (161 ,142 ,100 ,80 ),IPv4 (66 ,9 ,149 ,187 ), +{RTE_IPv4 (161 ,142 ,100 ,80 ),RTE_IPv4 (66 ,9 ,149 ,187 ),1766 ,2794 ,0x323e8fc2 ,0x51ccc178 }, -{IPv4 (65 ,69 ,140 ,83 ),IPv4 (199 ,92 ,111 ,2 ), +{RTE_IPv4 (65 ,69 ,140 ,83 ),RTE_IPv4 (199 ,92 ,111 ,2 ),4739 ,14230 ,0xd718262a ,0xc626b0ea }, -{IPv4 (12 ,22 ,207 ,184 ),IPv4 (24 ,19 ,198 ,95 ), +{RTE_IPv4 (12 ,22 ,207 ,184 ),RTE_IPv4 (24 ,19 ,198 ,95 ),38024 ,12898 ,0xd2d0a5de ,0x5c2b394a }, -{IPv4 (209 ,142 ,163 ,6 ),IPv4 (38 ,27 ,205 ,30 ), +{RTE_IPv4 (209 ,142 ,163 ,6 ),RTE_IPv4 (38 ,27 ,205 ,30 ),2217 ,48228 ,0x82989176 ,0xafc7327f }, -{IPv4 (202 ,188 ,127 ,2 ),IPv4 (153 ,39 ,163 ,191 ), +{RTE_IPv4 (202 ,188 ,127 ,2 ),RTE_IPv4 (153 ,39 ,163 ,191 ),1303 ,44251 ,0x5d1809c5 ,0x10e828a2 }, };
doc/guides/prog_guide/packet_classif_access_ctrl.rst +3 -3
@@ -419,7 +419,7 @@ Classify with Multiple Categories .data = {.userdata = 1, .category_mask = 3, .priority = 1}, /* destination IPv4 */ - .field[2] = {.value.u32 = IPv4(192,168,0,0),. mask_range.u32 = 16,}, + .field[2] = {.value.u32 = RTE_IPv4(192,168,0,0),. mask_range.u32 = 16,}, /* source port */ .field[3] = {.value.u16 = 0, .mask_range.u16 = 0xffff,},
@@ -433,7 +433,7 @@ Classify with Multiple Categories .data = {.userdata = 2, .category_mask = 1, .priority = 2}, /* destination IPv4 */ - .field[2] = {.value.u32 = IPv4(192,168,1,0),. mask_range.u32 = 24,}, + .field[2] = {.value.u32 = RTE_IPv4(192,168,1,0),. mask_range.u32 = 24,}, /* source port */ .field[3] = {.value.u16 = 0, .mask_range.u16 = 0xffff,},
@@ -447,7 +447,7 @@ Classify with Multiple Categories .data = {.userdata = 3, .category_mask = 2, .priority = 3}, /* source IPv4 */ - .field[1] = {.value.u32 = IPv4(10,1,1,1),. mask_range.u32 = 32,}, + .field[1] = {.value.u32 = RTE_IPv4(10,1,1,1),. mask_range.u32 = 32,}, /* source port */ .field[3] = {.value.u16 = 0, .mask_range.u16 = 0xffff,},
doc/guides/sample_app_ug/ip_frag.rst +8 -8
@@ -104,14 +104,14 @@ The default l3fwd_ipv4_route_array table is: .. code-block:: c struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = { - {IPv4(100, 10, 0, 0), 16, 0}, - {IPv4(100, 20, 0, 0), 16, 1}, - {IPv4(100, 30, 0, 0), 16, 2}, - {IPv4(100, 40, 0, 0), 16, 3}, - {IPv4(100, 50, 0, 0), 16, 4}, - {IPv4(100, 60, 0, 0), 16, 5}, - {IPv4(100, 70, 0, 0), 16, 6}, - {IPv4(100, 80, 0, 0), 16, 7}, + {RTE_IPv4(100, 10, 0, 0), 16, 0}, + {RTE_IPv4(100, 20, 0, 0), 16, 1}, + {RTE_IPv4(100, 30, 0, 0), 16, 2}, + {RTE_IPv4(100, 40, 0, 0), 16, 3}, + {RTE_IPv4(100, 50, 0, 0), 16, 4}, + {RTE_IPv4(100, 60, 0, 0), 16, 5}, + {RTE_IPv4(100, 70, 0, 0), 16, 6}, + {RTE_IPv4(100, 80, 0, 0), 16, 7}, }; The default l3fwd_ipv6_route_array table is:
doc/guides/sample_app_ug/ip_reassembly.rst +8 -8
@@ -107,14 +107,14 @@ The default l3fwd_ipv4_route_array table is: .. code-block:: c struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = { - {IPv4(100, 10, 0, 0), 16, 0}, - {IPv4(100, 20, 0, 0), 16, 1}, - {IPv4(100, 30, 0, 0), 16, 2}, - {IPv4(100, 40, 0, 0), 16, 3}, - {IPv4(100, 50, 0, 0), 16, 4}, - {IPv4(100, 60, 0, 0), 16, 5}, - {IPv4(100, 70, 0, 0), 16, 6}, - {IPv4(100, 80, 0, 0), 16, 7}, + {RTE_IPv4(100, 10, 0, 0), 16, 0}, + {RTE_IPv4(100, 20, 0, 0), 16, 1}, + {RTE_IPv4(100, 30, 0, 0), 16, 2}, + {RTE_IPv4(100, 40, 0, 0), 16, 3}, + {RTE_IPv4(100, 50, 0, 0), 16, 4}, + {RTE_IPv4(100, 60, 0, 0), 16, 5}, + {RTE_IPv4(100, 70, 0, 0), 16, 6}, + {RTE_IPv4(100, 80, 0, 0), 16, 7}, }; The default l3fwd_ipv6_route_array table is:
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
@@ -155,7 +155,7 @@ if the routing table has any ports assigned to the destination address: .. code-block:: c - if (!IS_IPV4_MCAST(dest_addr) || + if (!RTE_IS_IPV4_MCAST(dest_addr) || (hash = rte_fbk_hash_lookup(mcast_hash, dest_addr)) <= 0 || (port_mask = hash & enabled_port_mask) == 0) { rte_pktmbuf_free(m);
drivers/net/bonding/rte_eth_bond_pmd.c +2 -2
@@ -862,8 +862,8 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,if (likely (rte_ipv4_frag_pkt_is_fragmented (ipv4_hdr) ==0 )) { ip_hdr_offset = (ipv4_hdr->version_ihl - &IPV4_HDR_IHL_MASK ) * -IPV4_IHL_MULTIPLIER ; + &RTE_IPV4_HDR_IHL_MASK ) * +RTE_IPV4_IHL_MULTIPLIER ;if (ipv4_hdr->next_proto_id ==IPPROTO_TCP ) { tcp_hdr = (struct tcp_hdr *)
drivers/net/ena/ena_ethdev.c +1 -1
@@ -2158,7 +2158,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, m->l2_len); frag_field =rte_be_to_cpu_16 (ip_hdr->fragment_offset); -if ((frag_field &IPV4_HDR_DF_FLAG ) !=0 ) { +if ((frag_field &RTE_IPV4_HDR_DF_FLAG ) !=0 ) { m->packet_type |=RTE_PTYPE_L4_NONFRAG ;/* If IPv4 header has DF flag enabled and TSO support is
drivers/net/i40e/i40e_flow.c +2 -2
@@ -2606,8 +2606,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,/* Check if it is fragment. */ frag_off = ipv4_spec->hdr.fragment_offset; frag_off =rte_be_to_cpu_16 (frag_off); -if (frag_off &IPV4_HDR_OFFSET_MASK || - frag_off &IPV4_HDR_MF_FLAG ) +if (frag_off &RTE_IPV4_HDR_OFFSET_MASK || + frag_off &RTE_IPV4_HDR_MF_FLAG ) pctype =I40E_FILTER_PCTYPE_FRAG_IPV4 ;/* Get the filter info */
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
@@ -4538,7 +4538,7 @@ ixgbe_get_rscctl_maxdesc(struct rte_mempool *pool)/* MAXDESC * SRRCTL.BSIZEPKT must not exceed 64 KB minus one */ uint16_t maxdesc = -IPV4_MAX_PKT_LEN / +RTE_IPV4_MAX_PKT_LEN / (mp_priv->mbuf_data_room_size -RTE_PKTMBUF_HEADROOM );if (maxdesc >=16 )
drivers/net/mlx5/mlx5_flow_tcf.c +8 -8
@@ -552,7 +552,7 @@ static const struct { }, .ipv6.hdr = { .proto = 0xff, - .vtc_flow = RTE_BE32(0xfful << IPV6_HDR_FL_SHIFT), + .vtc_flow = RTE_BE32(0xfful << RTE_IPV6_HDR_FL_SHIFT), .hop_limits =0xff , .src_addr ="\xff\xff\xff\xff\xff\xff\xff\xff"
@@ -1426,7 +1426,7 @@ flow_tcf_validate_vxlan_encap_ipv6(const struct rte_flow_item *item, " vxlan encapsulation"); } msk6 = (rte_be_to_cpu_32 (mask->hdr.vtc_flow) >> -IPV6_HDR_TC_SHIFT ) &0xff ; +RTE_IPV6_HDR_TC_SHIFT ) &0xff ;if (msk6 && msk6 !=0xff ) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM_MASK, mask,
@@ -2551,7 +2551,7 @@ flow_tcf_get_items_size(const struct rte_flow_attr *attr,if (ipv6 && ipv6->hdr.hop_limits) size +=SZ_NLATTR_TYPE_OF (uint8_t) *2 ;if (ipv6 && (rte_be_to_cpu_32 (ipv6->hdr.vtc_flow) & - (0xfful <<IPV6_HDR_TC_SHIFT ))) + (0xfful <<RTE_IPV6_HDR_TC_SHIFT ))) size +=SZ_NLATTR_TYPE_OF (uint8_t) *2 ;break ; }
@@ -2639,7 +2639,7 @@ flow_tcf_vxlan_encap_size(const struct rte_flow_action *action)if (ipv6 && ipv6->hdr.hop_limits) size +=SZ_NLATTR_TYPE_OF (uint8_t) *2 ;if (ipv6 && (rte_be_to_cpu_32 (ipv6->hdr.vtc_flow) & - (0xfful <<IPV6_HDR_TC_SHIFT ))) + (0xfful <<RTE_IPV6_HDR_TC_SHIFT ))) size +=SZ_NLATTR_TYPE_OF (uint8_t) *2 ;break ; }
@@ -3037,11 +3037,11 @@ flow_tcf_parse_vxlan_encap_ipv6(const struct rte_flow_item_ipv6 *spec,FLOW_TCF_ENCAP_IPV6_DST ;if (mask) {if ((rte_be_to_cpu_32 (mask->hdr.vtc_flow) >> -IPV6_HDR_TC_SHIFT ) &0xff ) { +RTE_IPV6_HDR_TC_SHIFT ) &0xff ) { encap->mask |=FLOW_TCF_ENCAP_IP_TOS ; encap->ip_tos = (rte_be_to_cpu_32 (spec->hdr.vtc_flow) >> -IPV6_HDR_TC_SHIFT ) &0xff ; +RTE_IPV6_HDR_TC_SHIFT ) &0xff ; }if (mask->hdr.hop_limits) { encap->mask |=FLOW_TCF_ENCAP_IP_TTL ;
@@ -3590,11 +3590,11 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, mask.ipv6->hdr.hop_limits); } msk6 = (rte_be_to_cpu_32 (mask.ipv6->hdr.vtc_flow) >> -IPV6_HDR_TC_SHIFT ) &0xff ; +RTE_IPV6_HDR_TC_SHIFT ) &0xff ;if (msk6) { tos6 = (rte_be_to_cpu_32 (spec.ipv6->hdr.vtc_flow) >> -IPV6_HDR_TC_SHIFT ) &0xff ; +RTE_IPV6_HDR_TC_SHIFT ) &0xff ; mnl_attr_put_u8 (nlh, tunnel_outer ? TCA_FLOWER_KEY_ENC_IP_TOS :
drivers/net/mlx5/mlx5_flow_verbs.c +8 -8
@@ -480,17 +480,17 @@ flow_verbs_translate_item_ipv6(struct mlx5_flow *dev_flow, vtc_flow_val =rte_be_to_cpu_32 (spec->hdr.vtc_flow); vtc_flow_mask =rte_be_to_cpu_32 (mask->hdr.vtc_flow); ipv6.val.flow_label = -rte_cpu_to_be_32 ((vtc_flow_val &IPV6_HDR_FL_MASK ) >> -IPV6_HDR_FL_SHIFT ); - ipv6.val.traffic_class = (vtc_flow_val &IPV6_HDR_TC_MASK ) >> -IPV6_HDR_TC_SHIFT ; +rte_cpu_to_be_32 ((vtc_flow_val &RTE_IPV6_HDR_FL_MASK ) >> +RTE_IPV6_HDR_FL_SHIFT ); + ipv6.val.traffic_class = (vtc_flow_val &RTE_IPV6_HDR_TC_MASK ) >> +RTE_IPV6_HDR_TC_SHIFT ; ipv6.val.next_hdr = spec->hdr.proto; ipv6.val.hop_limit = spec->hdr.hop_limits; ipv6.mask.flow_label = -rte_cpu_to_be_32 ((vtc_flow_mask &IPV6_HDR_FL_MASK ) >> -IPV6_HDR_FL_SHIFT ); - ipv6.mask.traffic_class = (vtc_flow_mask &IPV6_HDR_TC_MASK ) >> -IPV6_HDR_TC_SHIFT ; +rte_cpu_to_be_32 ((vtc_flow_mask &RTE_IPV6_HDR_FL_MASK ) >> +RTE_IPV6_HDR_FL_SHIFT ); + ipv6.mask.traffic_class = (vtc_flow_mask &RTE_IPV6_HDR_TC_MASK ) >> +RTE_IPV6_HDR_TC_SHIFT ; ipv6.mask.next_hdr = mask->hdr.proto; ipv6.mask.hop_limit = mask->hdr.hop_limits;/* Remove unwanted bits from values. */
drivers/net/tap/tap_bpf_program.c +3 -3
@@ -19,7 +19,7 @@#include "tap_rss.h" /** Create IPv4 address */ -#define IPv4 (a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \ +#define RTE_IPv4 (a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \ (((b) & 0xff) << 16) | \ (((c) & 0xff) << 8) | \ ((d) & 0xff))
@@ -157,11 +157,11 @@ rss_l3_l4(struct __sk_buff *skb)__u8 *src_dst_addr = data + off + offsetof(struct iphdr , saddr);__u8 *src_dst_port = data + off +sizeof (struct iphdr );struct ipv4_l3_l4_tuple v4_tuple = { - .src_addr =IPv4 (*(src_dst_addr +0 ), + .src_addr =RTE_IPv4 (*(src_dst_addr +0 ), *(src_dst_addr +1 ), *(src_dst_addr +2 ), *(src_dst_addr +3 )), - .dst_addr =IPv4 (*(src_dst_addr +4 ), + .dst_addr =RTE_IPv4 (*(src_dst_addr +4 ), *(src_dst_addr +5 ), *(src_dst_addr +6 ), *(src_dst_addr +7 )),
drivers/net/vmxnet3/vmxnet3_rxtx.c +2 -2
@@ -684,8 +684,8 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, -sizeof (struct tcp_hdr ); ipv4_hdr = (struct rte_ipv4_hdr *)(ptr + hlen); - hlen += (ipv4_hdr->version_ihl &IPV4_HDR_IHL_MASK ) * -IPV4_IHL_MULTIPLIER ; + hlen += (ipv4_hdr->version_ihl &RTE_IPV4_HDR_IHL_MASK ) * +RTE_IPV4_IHL_MULTIPLIER ; }else if (rcd->v6) {if (unlikely (slen < hlen +sizeof (struct rte_ipv6_hdr ))) return hw->mtu - sizeof(struct rte_ipv6_hdr) -
examples/flow_classify/flow_classify.c +1 -1
@@ -379,7 +379,7 @@ parse_ipv4_net(char *in, uint32_t *addr, uint32_t *mask_len)if (get_cb_field (&in, &m,0 ,sizeof (uint32_t ) *CHAR_BIT ,0 ))return -EINVAL ; - addr[0 ] =IPv4 (a, b, c, d); + addr[0 ] =RTE_IPv4 (a, b, c, d); mask_len[0 ] = m;return 0 ; }
examples/ip_fragmentation/main.c +8 -8
@@ -169,14 +169,14 @@ struct l3fwd_ipv4_route { };struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = { - {IPv4 (100 ,10 ,0 ,0 ),16 ,0 }, - {IPv4 (100 ,20 ,0 ,0 ),16 ,1 }, - {IPv4 (100 ,30 ,0 ,0 ),16 ,2 }, - {IPv4 (100 ,40 ,0 ,0 ),16 ,3 }, - {IPv4 (100 ,50 ,0 ,0 ),16 ,4 }, - {IPv4 (100 ,60 ,0 ,0 ),16 ,5 }, - {IPv4 (100 ,70 ,0 ,0 ),16 ,6 }, - {IPv4 (100 ,80 ,0 ,0 ),16 ,7 }, + {RTE_IPv4 (100 ,10 ,0 ,0 ),16 ,0 }, + {RTE_IPv4 (100 ,20 ,0 ,0 ),16 ,1 }, + {RTE_IPv4 (100 ,30 ,0 ,0 ),16 ,2 }, + {RTE_IPv4 (100 ,40 ,0 ,0 ),16 ,3 }, + {RTE_IPv4 (100 ,50 ,0 ,0 ),16 ,4 }, + {RTE_IPv4 (100 ,60 ,0 ,0 ),16 ,5 }, + {RTE_IPv4 (100 ,70 ,0 ,0 ),16 ,6 }, + {RTE_IPv4 (100 ,80 ,0 ,0 ),16 ,7 }, };/*
examples/ip_reassembly/main.c +8 -8
@@ -190,14 +190,14 @@ struct l3fwd_ipv4_route { };struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = { - {IPv4 (100 ,10 ,0 ,0 ),16 ,0 }, - {IPv4 (100 ,20 ,0 ,0 ),16 ,1 }, - {IPv4 (100 ,30 ,0 ,0 ),16 ,2 }, - {IPv4 (100 ,40 ,0 ,0 ),16 ,3 }, - {IPv4 (100 ,50 ,0 ,0 ),16 ,4 }, - {IPv4 (100 ,60 ,0 ,0 ),16 ,5 }, - {IPv4 (100 ,70 ,0 ,0 ),16 ,6 }, - {IPv4 (100 ,80 ,0 ,0 ),16 ,7 }, + {RTE_IPv4 (100 ,10 ,0 ,0 ),16 ,0 }, + {RTE_IPv4 (100 ,20 ,0 ,0 ),16 ,1 }, + {RTE_IPv4 (100 ,30 ,0 ,0 ),16 ,2 }, + {RTE_IPv4 (100 ,40 ,0 ,0 ),16 ,3 }, + {RTE_IPv4 (100 ,50 ,0 ,0 ),16 ,4 }, + {RTE_IPv4 (100 ,60 ,0 ,0 ),16 ,5 }, + {RTE_IPv4 (100 ,70 ,0 ,0 ),16 ,6 }, + {RTE_IPv4 (100 ,80 ,0 ,0 ),16 ,7 }, };/*
examples/ipsec-secgw/sa.c +2 -2
@@ -951,7 +951,7 @@ get_spi_proto(uint32_t spi, enum rte_security_ipsec_sa_direction dir)if (rc6 >=0 ) {RTE_LOG (ERR ,IPSEC ,"%s: SPI %u used simultaeously by " -"IPv4(%d) and IPv6 (%d) SP rules\n" , +"RTE_IPv4(%d) and IPv6 (%d) SP rules\n" , __func__, spi, rc4, rc6);return -EINVAL ; }else
@@ -1040,7 +1040,7 @@ ipsec_sa_init(struct ipsec_sa *lsa, struct rte_ipsec_sa *sa, uint32_t sa_size)struct rte_ipsec_sa_prm prm;struct rte_ipv4_hdr v4 = { .version_ihl =IPVERSION <<4 | -sizeof (v4) /IPV4_IHL_MULTIPLIER , +sizeof (v4) /RTE_IPV4_IHL_MULTIPLIER , .time_to_live =IPDEFTTL , .next_proto_id =IPPROTO_ESP , .src_addr = lsa->src.ip.ip4,
examples/ipv4_multicast/main.c +16 -16
@@ -138,21 +138,21 @@ struct mcast_group_params { };static struct mcast_group_params mcast_group_table[] = { - {IPv4 (224 ,0 ,0 ,101 ),0x1 }, - {IPv4 (224 ,0 ,0 ,102 ),0x2 }, - {IPv4 (224 ,0 ,0 ,103 ),0x3 }, - {IPv4 (224 ,0 ,0 ,104 ),0x4 }, - {IPv4 (224 ,0 ,0 ,105 ),0x5 }, - {IPv4 (224 ,0 ,0 ,106 ),0x6 }, - {IPv4 (224 ,0 ,0 ,107 ),0x7 }, - {IPv4 (224 ,0 ,0 ,108 ),0x8 }, - {IPv4 (224 ,0 ,0 ,109 ),0x9 }, - {IPv4 (224 ,0 ,0 ,110 ),0xA }, - {IPv4 (224 ,0 ,0 ,111 ),0xB }, - {IPv4 (224 ,0 ,0 ,112 ),0xC }, - {IPv4 (224 ,0 ,0 ,113 ),0xD }, - {IPv4 (224 ,0 ,0 ,114 ),0xE }, - {IPv4 (224 ,0 ,0 ,115 ),0xF }, + {RTE_IPv4 (224 ,0 ,0 ,101 ),0x1 }, + {RTE_IPv4 (224 ,0 ,0 ,102 ),0x2 }, + {RTE_IPv4 (224 ,0 ,0 ,103 ),0x3 }, + {RTE_IPv4 (224 ,0 ,0 ,104 ),0x4 }, + {RTE_IPv4 (224 ,0 ,0 ,105 ),0x5 }, + {RTE_IPv4 (224 ,0 ,0 ,106 ),0x6 }, + {RTE_IPv4 (224 ,0 ,0 ,107 ),0x7 }, + {RTE_IPv4 (224 ,0 ,0 ,108 ),0x8 }, + {RTE_IPv4 (224 ,0 ,0 ,109 ),0x9 }, + {RTE_IPv4 (224 ,0 ,0 ,110 ),0xA }, + {RTE_IPv4 (224 ,0 ,0 ,111 ),0xB }, + {RTE_IPv4 (224 ,0 ,0 ,112 ),0xC }, + {RTE_IPv4 (224 ,0 ,0 ,113 ),0xD }, + {RTE_IPv4 (224 ,0 ,0 ,114 ),0xE }, + {RTE_IPv4 (224 ,0 ,0 ,115 ),0xF }, };#define N_MCAST_GROUPS \
@@ -317,7 +317,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)* Check that it is a valid multicast address and * we have some active ports assigned to it. */ -if (!IS_IPV4_MCAST (dest_addr) || +if (!RTE_IS_IPV4_MCAST (dest_addr) || (hash =rte_fbk_hash_lookup (mcast_hash, dest_addr)) <=0 || (port_mask = hash & enabled_port_mask) ==0 ) {rte_pktmbuf_free (m);
examples/l2fwd-crypto/main.c +2 -2
@@ -404,8 +404,8 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, ip_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) + ipdata_offset); - ipdata_offset += (ip_hdr->version_ihl &IPV4_HDR_IHL_MASK ) - *IPV4_IHL_MULTIPLIER ; + ipdata_offset += (ip_hdr->version_ihl &RTE_IPV4_HDR_IHL_MASK ) + *RTE_IPV4_IHL_MULTIPLIER ;/* Zero pad data to be crypto'd so it is block aligned */
examples/l3fwd-acl/main.c +1 -1
@@ -901,7 +901,7 @@ parse_ipv4_net(const char *in, uint32_t *addr, uint32_t *mask_len)GET_CB_FIELD (in, d,0 ,UINT8_MAX ,'/' );GET_CB_FIELD (in, m,0 ,sizeof (uint32_t ) *CHAR_BIT ,0 ); - addr[0 ] =IPv4 (a, b, c, d); + addr[0 ] =RTE_IPv4 (a, b, c, d); mask_len[0 ] = m;return 0 ;
examples/l3fwd-power/main.c +12 -12
@@ -258,10 +258,10 @@ struct ipv6_l3fwd_route { };static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = { - {{IPv4 (100 ,10 ,0 ,1 ),IPv4 (200 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, - {{IPv4 (100 ,20 ,0 ,2 ),IPv4 (200 ,20 ,0 ,2 ),102 ,12 ,IPPROTO_TCP },1 }, - {{IPv4 (100 ,30 ,0 ,3 ),IPv4 (200 ,30 ,0 ,3 ),103 ,13 ,IPPROTO_TCP },2 }, - {{IPv4 (100 ,40 ,0 ,4 ),IPv4 (200 ,40 ,0 ,4 ),104 ,14 ,IPPROTO_TCP },3 }, + {{RTE_IPv4 (100 ,10 ,0 ,1 ),RTE_IPv4 (200 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, + {{RTE_IPv4 (100 ,20 ,0 ,2 ),RTE_IPv4 (200 ,20 ,0 ,2 ),102 ,12 ,IPPROTO_TCP },1 }, + {{RTE_IPv4 (100 ,30 ,0 ,3 ),RTE_IPv4 (200 ,30 ,0 ,3 ),103 ,13 ,IPPROTO_TCP },2 }, + {{RTE_IPv4 (100 ,40 ,0 ,4 ),RTE_IPv4 (200 ,40 ,0 ,4 ),104 ,14 ,IPPROTO_TCP },3 }, };static struct ipv6_l3fwd_route ipv6_l3fwd_route_array[] = {
@@ -300,14 +300,14 @@ struct ipv4_l3fwd_route { };static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = { - {IPv4 (1 ,1 ,1 ,0 ),24 ,0 }, - {IPv4 (2 ,1 ,1 ,0 ),24 ,1 }, - {IPv4 (3 ,1 ,1 ,0 ),24 ,2 }, - {IPv4 (4 ,1 ,1 ,0 ),24 ,3 }, - {IPv4 (5 ,1 ,1 ,0 ),24 ,4 }, - {IPv4 (6 ,1 ,1 ,0 ),24 ,5 }, - {IPv4 (7 ,1 ,1 ,0 ),24 ,6 }, - {IPv4 (8 ,1 ,1 ,0 ),24 ,7 }, + {RTE_IPv4 (1 ,1 ,1 ,0 ),24 ,0 }, + {RTE_IPv4 (2 ,1 ,1 ,0 ),24 ,1 }, + {RTE_IPv4 (3 ,1 ,1 ,0 ),24 ,2 }, + {RTE_IPv4 (4 ,1 ,1 ,0 ),24 ,3 }, + {RTE_IPv4 (5 ,1 ,1 ,0 ),24 ,4 }, + {RTE_IPv4 (6 ,1 ,1 ,0 ),24 ,5 }, + {RTE_IPv4 (7 ,1 ,1 ,0 ),24 ,6 }, + {RTE_IPv4 (8 ,1 ,1 ,0 ),24 ,7 }, };#define IPV4_L3FWD_NUM_ROUTES \
examples/l3fwd-vf/main.c +12 -12
@@ -201,10 +201,10 @@ struct l3fwd_route { };static struct l3fwd_route l3fwd_route_array[] = { - {{IPv4 (100 ,10 ,0 ,1 ),IPv4 (200 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, - {{IPv4 (100 ,20 ,0 ,2 ),IPv4 (200 ,20 ,0 ,2 ),102 ,12 ,IPPROTO_TCP },1 }, - {{IPv4 (100 ,30 ,0 ,3 ),IPv4 (200 ,30 ,0 ,3 ),103 ,13 ,IPPROTO_TCP },2 }, - {{IPv4 (100 ,40 ,0 ,4 ),IPv4 (200 ,40 ,0 ,4 ),104 ,14 ,IPPROTO_TCP },3 }, + {{RTE_IPv4 (100 ,10 ,0 ,1 ),RTE_IPv4 (200 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, + {{RTE_IPv4 (100 ,20 ,0 ,2 ),RTE_IPv4 (200 ,20 ,0 ,2 ),102 ,12 ,IPPROTO_TCP },1 }, + {{RTE_IPv4 (100 ,30 ,0 ,3 ),RTE_IPv4 (200 ,30 ,0 ,3 ),103 ,13 ,IPPROTO_TCP },2 }, + {{RTE_IPv4 (100 ,40 ,0 ,4 ),RTE_IPv4 (200 ,40 ,0 ,4 ),104 ,14 ,IPPROTO_TCP },3 }, };typedef struct rte_hash lookup_struct_t ;
@@ -234,14 +234,14 @@ struct l3fwd_route { };static struct l3fwd_route l3fwd_route_array[] = { - {IPv4 (1 ,1 ,1 ,0 ),24 ,0 }, - {IPv4 (2 ,1 ,1 ,0 ),24 ,1 }, - {IPv4 (3 ,1 ,1 ,0 ),24 ,2 }, - {IPv4 (4 ,1 ,1 ,0 ),24 ,3 }, - {IPv4 (5 ,1 ,1 ,0 ),24 ,4 }, - {IPv4 (6 ,1 ,1 ,0 ),24 ,5 }, - {IPv4 (7 ,1 ,1 ,0 ),24 ,6 }, - {IPv4 (8 ,1 ,1 ,0 ),24 ,7 }, + {RTE_IPv4 (1 ,1 ,1 ,0 ),24 ,0 }, + {RTE_IPv4 (2 ,1 ,1 ,0 ),24 ,1 }, + {RTE_IPv4 (3 ,1 ,1 ,0 ),24 ,2 }, + {RTE_IPv4 (4 ,1 ,1 ,0 ),24 ,3 }, + {RTE_IPv4 (5 ,1 ,1 ,0 ),24 ,4 }, + {RTE_IPv4 (6 ,1 ,1 ,0 ),24 ,5 }, + {RTE_IPv4 (7 ,1 ,1 ,0 ),24 ,6 }, + {RTE_IPv4 (8 ,1 ,1 ,0 ),24 ,7 }, };#define L3FWD_NUM_ROUTES \
examples/l3fwd/l3fwd_em.c +10 -10
@@ -99,10 +99,10 @@ struct ipv6_l3fwd_em_route { };static struct ipv4_l3fwd_em_route ipv4_l3fwd_em_route_array[] = { - {{IPv4 (101 ,0 ,0 ,0 ),IPv4 (100 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, - {{IPv4 (201 ,0 ,0 ,0 ),IPv4 (200 ,20 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },1 }, - {{IPv4 (111 ,0 ,0 ,0 ),IPv4 (100 ,30 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },2 }, - {{IPv4 (211 ,0 ,0 ,0 ),IPv4 (200 ,40 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },3 }, + {{RTE_IPv4 (101 ,0 ,0 ,0 ),RTE_IPv4 (100 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, + {{RTE_IPv4 (201 ,0 ,0 ,0 ),RTE_IPv4 (200 ,20 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },1 }, + {{RTE_IPv4 (111 ,0 ,0 ,0 ),RTE_IPv4 (100 ,30 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },2 }, + {{RTE_IPv4 (211 ,0 ,0 ,0 ),RTE_IPv4 (200 ,40 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },3 }, };static struct ipv6_l3fwd_em_route ipv6_l3fwd_em_route_array[] = {
@@ -426,19 +426,19 @@ populate_ipv4_many_flow_into_table(const struct rte_hash *h,switch (i & (NUMBER_PORT_USED -1 )) {case 0 : entry = ipv4_l3fwd_em_route_array[0 ]; - entry.key.ip_dst =IPv4 (101 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (101 , c, b, a);break ;case 1 : entry = ipv4_l3fwd_em_route_array[1 ]; - entry.key.ip_dst =IPv4 (201 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (201 , c, b, a);break ;case 2 : entry = ipv4_l3fwd_em_route_array[2 ]; - entry.key.ip_dst =IPv4 (111 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (111 , c, b, a);break ;case 3 : entry = ipv4_l3fwd_em_route_array[3 ]; - entry.key.ip_dst =IPv4 (211 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (211 , c, b, a);break ; };convert_ipv4_5tuple (&entry.key, &newkey);
@@ -576,8 +576,8 @@ em_parse_ptype(struct rte_mbuf *m) 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 rte_ipv4_hdr *)l3; - hdr_len = (ipv4_hdr->version_ihl &IPV4_HDR_IHL_MASK ) * -IPV4_IHL_MULTIPLIER ; + hdr_len = (ipv4_hdr->version_ihl &RTE_IPV4_HDR_IHL_MASK ) * +RTE_IPV4_IHL_MULTIPLIER ;if (hdr_len ==sizeof (struct rte_ipv4_hdr )) { packet_type |=RTE_PTYPE_L3_IPV4 ;if (ipv4_hdr->next_proto_id ==IPPROTO_TCP )
examples/l3fwd/l3fwd_lpm.c +8 -8
@@ -43,14 +43,14 @@ struct ipv6_l3fwd_lpm_route {/* 192.18.0.0/16 are set aside for RFC2544 benchmarking. */ static struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = { - {IPv4 (192 ,18 ,0 ,0 ),24 ,0 }, - {IPv4 (192 ,18 ,1 ,0 ),24 ,1 }, - {IPv4 (192 ,18 ,2 ,0 ),24 ,2 }, - {IPv4 (192 ,18 ,3 ,0 ),24 ,3 }, - {IPv4 (192 ,18 ,4 ,0 ),24 ,4 }, - {IPv4 (192 ,18 ,5 ,0 ),24 ,5 }, - {IPv4 (192 ,18 ,6 ,0 ),24 ,6 }, - {IPv4 (192 ,18 ,7 ,0 ),24 ,7 }, + {RTE_IPv4 (192 ,18 ,0 ,0 ),24 ,0 }, + {RTE_IPv4 (192 ,18 ,1 ,0 ),24 ,1 }, + {RTE_IPv4 (192 ,18 ,2 ,0 ),24 ,2 }, + {RTE_IPv4 (192 ,18 ,3 ,0 ),24 ,3 }, + {RTE_IPv4 (192 ,18 ,4 ,0 ),24 ,4 }, + {RTE_IPv4 (192 ,18 ,5 ,0 ),24 ,5 }, + {RTE_IPv4 (192 ,18 ,6 ,0 ),24 ,6 }, + {RTE_IPv4 (192 ,18 ,7 ,0 ),24 ,7 }, };/* 2001:0200::/48 is IANA reserved range for IPv6 benchmarking (RFC5180) */
examples/performance-thread/l3fwd-thread/main.c +16 -16
@@ -380,10 +380,10 @@ struct ipv6_l3fwd_route { };static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = { - {{IPv4 (101 ,0 ,0 ,0 ),IPv4 (100 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, - {{IPv4 (201 ,0 ,0 ,0 ),IPv4 (200 ,20 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },1 }, - {{IPv4 (111 ,0 ,0 ,0 ),IPv4 (100 ,30 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },2 }, - {{IPv4 (211 ,0 ,0 ,0 ),IPv4 (200 ,40 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },3 }, + {{RTE_IPv4 (101 ,0 ,0 ,0 ),RTE_IPv4 (100 ,10 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },0 }, + {{RTE_IPv4 (201 ,0 ,0 ,0 ),RTE_IPv4 (200 ,20 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },1 }, + {{RTE_IPv4 (111 ,0 ,0 ,0 ),RTE_IPv4 (100 ,30 ,0 ,1 ),101 ,11 ,IPPROTO_TCP },2 }, + {{RTE_IPv4 (211 ,0 ,0 ,0 ),RTE_IPv4 (200 ,40 ,0 ,1 ),102 ,12 ,IPPROTO_TCP },3 }, };static struct ipv6_l3fwd_route ipv6_l3fwd_route_array[] = {
@@ -503,14 +503,14 @@ struct ipv6_l3fwd_route { };static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = { - {IPv4 (1 ,1 ,1 ,0 ),24 ,0 }, - {IPv4 (2 ,1 ,1 ,0 ),24 ,1 }, - {IPv4 (3 ,1 ,1 ,0 ),24 ,2 }, - {IPv4 (4 ,1 ,1 ,0 ),24 ,3 }, - {IPv4 (5 ,1 ,1 ,0 ),24 ,4 }, - {IPv4 (6 ,1 ,1 ,0 ),24 ,5 }, - {IPv4 (7 ,1 ,1 ,0 ),24 ,6 }, - {IPv4 (8 ,1 ,1 ,0 ),24 ,7 }, + {RTE_IPv4 (1 ,1 ,1 ,0 ),24 ,0 }, + {RTE_IPv4 (2 ,1 ,1 ,0 ),24 ,1 }, + {RTE_IPv4 (3 ,1 ,1 ,0 ),24 ,2 }, + {RTE_IPv4 (4 ,1 ,1 ,0 ),24 ,3 }, + {RTE_IPv4 (5 ,1 ,1 ,0 ),24 ,4 }, + {RTE_IPv4 (6 ,1 ,1 ,0 ),24 ,5 }, + {RTE_IPv4 (7 ,1 ,1 ,0 ),24 ,6 }, + {RTE_IPv4 (8 ,1 ,1 ,0 ),24 ,7 }, };static struct ipv6_l3fwd_route ipv6_l3fwd_route_array[] = {
@@ -3145,19 +3145,19 @@ populate_ipv4_many_flow_into_table(const struct rte_hash *h,switch (i & (NUMBER_PORT_USED -1 )) {case 0 : entry = ipv4_l3fwd_route_array[0 ]; - entry.key.ip_dst =IPv4 (101 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (101 , c, b, a);break ;case 1 : entry = ipv4_l3fwd_route_array[1 ]; - entry.key.ip_dst =IPv4 (201 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (201 , c, b, a);break ;case 2 : entry = ipv4_l3fwd_route_array[2 ]; - entry.key.ip_dst =IPv4 (111 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (111 , c, b, a);break ;case 3 : entry = ipv4_l3fwd_route_array[3 ]; - entry.key.ip_dst =IPv4 (211 , c, b, a); + entry.key.ip_dst =RTE_IPv4 (211 , c, b, a);break ; };convert_ipv4_5tuple (&entry.key, &newkey);
lib/librte_gro/gro_tcp4.c +1 -1
@@ -239,7 +239,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,* whose DF bit is 1, IPv4 ID is ignored. */ frag_off =rte_be_to_cpu_16 (ipv4_hdr->fragment_offset); - is_atomic = (frag_off &IPV4_HDR_DF_FLAG ) ==IPV4_HDR_DF_FLAG ; + is_atomic = (frag_off &RTE_IPV4_HDR_DF_FLAG ) ==RTE_IPV4_HDR_DF_FLAG ; 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);
lib/librte_gro/gro_vxlan_tcp4.c +3 -2
@@ -348,11 +348,12 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,* whose DF bit is 1, IPv4 ID is ignored. */ frag_off =rte_be_to_cpu_16 (outer_ipv4_hdr->fragment_offset); - outer_is_atomic = (frag_off &IPV4_HDR_DF_FLAG ) ==IPV4_HDR_DF_FLAG ; + outer_is_atomic = + (frag_off &RTE_IPV4_HDR_DF_FLAG ) ==RTE_IPV4_HDR_DF_FLAG ; outer_ip_id = outer_is_atomic ?0 :rte_be_to_cpu_16 (outer_ipv4_hdr->packet_id); frag_off =rte_be_to_cpu_16 (ipv4_hdr->fragment_offset); - is_atomic = (frag_off &IPV4_HDR_DF_FLAG ) ==IPV4_HDR_DF_FLAG ; + is_atomic = (frag_off &RTE_IPV4_HDR_DF_FLAG ) ==RTE_IPV4_HDR_DF_FLAG ; 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);
lib/librte_gso/gso_common.h +2 -2
@@ -12,8 +12,8 @@#include <rte_tcp.h> #include <rte_udp.h> -#define IS_FRAGMENTED (frag_off) (((frag_off) & IPV4_HDR_OFFSET_MASK) != 0 \ - || ((frag_off) & IPV4_HDR_MF_FLAG) == IPV4_HDR_MF_FLAG) +#define IS_FRAGMENTED (frag_off) (((frag_off) & RTE_IPV4_HDR_OFFSET_MASK) != 0 \ + || ((frag_off) & RTE_IPV4_HDR_MF_FLAG) == RTE_IPV4_HDR_MF_FLAG)#define TCP_HDR_PSH_MASK ((uint8_t)0x08)#define TCP_HDR_FIN_MASK ((uint8_t)0x01)
lib/librte_ip_frag/rte_ip_frag.h +2 -2
@@ -309,8 +309,8 @@ rte_ipv4_frag_pkt_is_fragmented(const struct rte_ipv4_hdr *hdr)uint16_t flag_offset, ip_flag, ip_ofs; flag_offset =rte_be_to_cpu_16 (hdr->fragment_offset); - ip_ofs = (uint16_t )(flag_offset &IPV4_HDR_OFFSET_MASK ); - ip_flag = (uint16_t )(flag_offset &IPV4_HDR_MF_FLAG ); + ip_ofs = (uint16_t )(flag_offset &RTE_IPV4_HDR_OFFSET_MASK ); + ip_flag = (uint16_t )(flag_offset &RTE_IPV4_HDR_MF_FLAG );return ip_flag !=0 || ip_ofs !=0 ; }
lib/librte_ip_frag/rte_ipv4_fragmentation.c +8 -8
@@ -12,22 +12,22 @@#include "ip_frag_common.h" /* Fragment Offset */ -#define IPV4_HDR_DF_SHIFT 14 -#define IPV4_HDR_MF_SHIFT 13 -#define IPV4_HDR_FO_SHIFT 3 +#define RTE_IPV4_HDR_DF_SHIFT 14 +#define RTE_IPV4_HDR_MF_SHIFT 13 +#define RTE_IPV4_HDR_FO_SHIFT 3 -#define IPV4_HDR_DF_MASK (1 << IPV4_HDR_DF_SHIFT) -#define IPV4_HDR_MF_MASK (1 << IPV4_HDR_MF_SHIFT) +#define IPV4_HDR_DF_MASK (1 << RTE_IPV4_HDR_DF_SHIFT) +#define IPV4_HDR_MF_MASK (1 << RTE_IPV4_HDR_MF_SHIFT) -#define IPV4_HDR_FO_ALIGN (1 << IPV4_HDR_FO_SHIFT) +#define IPV4_HDR_FO_ALIGN (1 << RTE_IPV4_HDR_FO_SHIFT)static inline void __fill_ipv4hdr_frag (struct rte_ipv4_hdr *dst,const struct rte_ipv4_hdr *src,uint16_t len,uint16_t fofs,uint16_t dofs,uint32_t mf) {rte_memcpy (dst, src,sizeof (*dst)); - fofs = (uint16_t )(fofs + (dofs >>IPV4_HDR_FO_SHIFT )); - fofs = (uint16_t )(fofs | mf <<IPV4_HDR_MF_SHIFT ); + fofs = (uint16_t )(fofs + (dofs >>RTE_IPV4_HDR_FO_SHIFT )); + fofs = (uint16_t )(fofs | mf <<RTE_IPV4_HDR_MF_SHIFT ); dst->fragment_offset =rte_cpu_to_be_16 (fofs); dst->total_length =rte_cpu_to_be_16 (len); dst->hdr_checksum =0 ;
lib/librte_ip_frag/rte_ipv4_reassembly.c +4 -4
@@ -75,7 +75,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp) ip_hdr->total_length =rte_cpu_to_be_16 ((uint16_t )(fp->total_size + m->l3_len)); ip_hdr->fragment_offset = (uint16_t )(ip_hdr->fragment_offset & -rte_cpu_to_be_16 (IPV4_HDR_DF_FLAG )); +rte_cpu_to_be_16 (RTE_IPV4_HDR_DF_FLAG )); ip_hdr->hdr_checksum =0 ;return m;
@@ -109,8 +109,8 @@ rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,int32_t ip_len; flag_offset =rte_be_to_cpu_16 (ip_hdr->fragment_offset); - ip_ofs = (uint16_t )(flag_offset &IPV4_HDR_OFFSET_MASK ); - ip_flag = (uint16_t )(flag_offset &IPV4_HDR_MF_FLAG ); + ip_ofs = (uint16_t )(flag_offset &RTE_IPV4_HDR_OFFSET_MASK ); + ip_flag = (uint16_t )(flag_offset &RTE_IPV4_HDR_MF_FLAG ); psd = (unaligned_uint64_t *)&ip_hdr->src_addr;/* use first 8 bytes only */
@@ -118,7 +118,7 @@ rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl, key.id = ip_hdr->packet_id; key.key_len =IPV4_KEYLEN ; - ip_ofs *=IPV4_HDR_OFFSET_UNITS ; + ip_ofs *=RTE_IPV4_HDR_OFFSET_UNITS ; ip_len =rte_be_to_cpu_16 (ip_hdr->total_length) - mb->l3_len; IP_FRAG_LOG(DEBUG, "%s:%d:\n"
lib/librte_net/rte_ip.h +28 -25
90 lines not on this page · raw message
lib/librte_net/rte_net.c +3 -3
@@ -315,7 +315,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,return pkt_type;if (ip4h->fragment_offset &rte_cpu_to_be_16 ( -IPV4_HDR_OFFSET_MASK |IPV4_HDR_MF_FLAG )) { +RTE_IPV4_HDR_OFFSET_MASK |RTE_IPV4_HDR_MF_FLAG )) { pkt_type |=RTE_PTYPE_L4_FRAG ; hdr_lens->l4_len =0 ;return pkt_type;
@@ -446,8 +446,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,if ((layers &RTE_PTYPE_INNER_L4_MASK ) ==0 )return pkt_type;if (ip4h->fragment_offset & -rte_cpu_to_be_16 (IPV4_HDR_OFFSET_MASK | -IPV4_HDR_MF_FLAG )) { +rte_cpu_to_be_16 (RTE_IPV4_HDR_OFFSET_MASK | +RTE_IPV4_HDR_MF_FLAG )) { pkt_type |=RTE_PTYPE_INNER_L4_FRAG ; hdr_lens->inner_l4_len =0 ;return pkt_type;
lib/librte_port/rte_port_ras.c +2 -2
@@ -156,8 +156,8 @@ process_ipv4(struct rte_port_ring_writer_ras *p, struct rte_mbuf *pkt)/* Get "More fragments" flag and fragment offset */ uint16_t frag_field =rte_be_to_cpu_16 (pkt_hdr->fragment_offset); -uint16_t frag_offset = (uint16_t )(frag_field &IPV4_HDR_OFFSET_MASK ); -uint16_t frag_flag = (uint16_t )(frag_field &IPV4_HDR_MF_FLAG ); +uint16_t frag_offset = (uint16_t )(frag_field &RTE_IPV4_HDR_OFFSET_MASK ); +uint16_t frag_flag = (uint16_t )(frag_field &RTE_IPV4_HDR_MF_FLAG );/* If it is a fragmented packet, then try to reassemble */ if ((frag_flag ==0 ) && (frag_offset ==0 ))
Signature · 1 line
2.11.0
Re: [dpdk-dev] [PATCH 11/15] net: add rte prefix to ip defines
Quoted 29 lines · Olivier Matz
drivers/net/tap/tap_bpf_program.c +3
-3@@ -19,7 +19,7 @@#include "tap_rss.h" /** Create IPv4 address */ -#define IPv4 (a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \ +#define RTE_IPv4 (a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \ (((b) & 0xff) << 16) | \ (((c) & 0xff) << 8) | \ ((d) & 0xff))@@ -157,11 +157,11 @@ rss_l3_l4(struct __sk_buff *skb)__u8 *src_dst_addr = data + off + offsetof(struct iphdr , saddr);__u8 *src_dst_port = data + off +sizeof (struct iphdr );struct ipv4_l3_l4_tuple v4_tuple = { - .src_addr =IPv4 (*(src_dst_addr +0 ), + .src_addr =RTE_IPv4 (*(src_dst_addr +0 ), *(src_dst_addr +1 ), *(src_dst_addr +2 ), *(src_dst_addr +3 )), - .dst_addr = IPv4(*(src_dst_addr + 4), + .dst_addr = RTE_IPv4(*(src_dst_addr + 4), *(src_dst_addr + 5), *(src_dst_addr + 6),
Quoted 3 lines
*(src_dst_addr + 7)),
Idem patch 3.
Signature · 1 line
David Marchand
PATCH 12/15 net: add rte prefix to sctp structure
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct sctp_hdr as struct rte_sctp_hdr.
--- app/test-pmd/csumonly.c | 5 +++-- app/test/packet_burst_generator.c | 6 +++--- app/test/packet_burst_generator.h | 2 +- app/test/test_flow_classify.c | 2 +- drivers/net/e1000/igb_rxtx.c | 3 ++- drivers/net/enic/enic_clsf.c | 8 ++++---- drivers/net/enic/enic_flow.c | 4 ++-- drivers/net/i40e/i40e_fdir.c | 20 ++++++++++---------- drivers/net/i40e/i40e_rxtx.c | 2 +- drivers/net/iavf/iavf_rxtx.c | 2 +- drivers/net/ice/ice_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- examples/tep_termination/vxlan.c | 5 +++-- lib/librte_ethdev/rte_flow.h | 2 +- lib/librte_net/rte_net.c | 4 ++-- lib/librte_net/rte_sctp.h | 2 +- lib/librte_vhost/virtio_net.c | 4 ++-- 17 files changed, 40 insertions(+), 36 deletions(-)
app/test-pmd/csumonly.c +3 -2
@@ -368,7 +368,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;struct udp_hdr *udp_hdr;struct tcp_hdr *tcp_hdr; -struct sctp_hdr *sctp_hdr; +struct rte_sctp_hdr *sctp_hdr;uint64_t ol_flags =0 ;uint32_t max_pkt_len, tso_segsz =0 ;
@@ -435,7 +435,8 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,if (info->gso_enable) ol_flags |=PKT_TX_TCP_SEG ; }else if (info->l4_proto ==IPPROTO_SCTP ) { - sctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len); + sctp_hdr = (struct rte_sctp_hdr *) + ((char *)l3_hdr + info->l3_len); sctp_hdr->cksum =0 ;/* sctp payload must be a multiple of 4 to be * offloaded */
app/test/packet_burst_generator.c +3 -3
@@ -124,7 +124,7 @@ initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port, }uint16_t -initialize_sctp_header (struct sctp_hdr *sctp_hdr,uint16_t src_port, +initialize_sctp_header (struct rte_sctp_hdr *sctp_hdr,uint16_t src_port,uint16_t dst_port,uint16_t pkt_data_len) {uint16_t pkt_len;
@@ -402,7 +402,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,break ;case IPPROTO_SCTP :copy_buf_to_pkt (proto_hdr, -sizeof (struct sctp_hdr ), pkt, +sizeof (struct rte_sctp_hdr ), pkt, eth_hdr_size +sizeof (struct rte_ipv4_hdr ));break ;
@@ -427,7 +427,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,break ;case IPPROTO_SCTP :copy_buf_to_pkt (proto_hdr, -sizeof (struct sctp_hdr ), pkt, +sizeof (struct rte_sctp_hdr ), pkt, eth_hdr_size +sizeof (struct rte_ipv6_hdr ));break ;
app/test/packet_burst_generator.h +1 -1
@@ -43,7 +43,7 @@ initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port, uint16_t dst_port, uint16_t pkt_data_len);uint16_t -initialize_sctp_header (struct sctp_hdr *sctp_hdr,uint16_t src_port, +initialize_sctp_header (struct rte_sctp_hdr *sctp_hdr,uint16_t src_port,uint16_t dst_port,uint16_t pkt_data_len);uint16_t
app/test/test_flow_classify.c +1 -1
@@ -567,7 +567,7 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp, {struct rte_ether_hdr pkt_eth_hdr;struct rte_ipv4_hdr pkt_ipv4_hdr; -struct sctp_hdr pkt_sctp_hdr; +struct rte_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 );uint16_t src_port =10 ;
drivers/net/e1000/igb_rxtx.c +2 -1
@@ -299,7 +299,8 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq,case PKT_TX_SCTP_CKSUM : type_tucmd_mlhl |=E1000_ADVTXD_TUCMD_L4T_SCTP |E1000_ADVTXD_DTYP_CTXT |E1000_ADVTXD_DCMD_DEXT ; - mss_l4len_idx |=sizeof (struct sctp_hdr ) <<E1000_ADVTXD_L4LEN_SHIFT ; + mss_l4len_idx |=sizeof (struct rte_sctp_hdr ) + <<E1000_ADVTXD_L4LEN_SHIFT ;break ;default : type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_RSV |
drivers/net/enic/enic_clsf.c +4 -4
@@ -152,7 +152,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,enic_set_layer (gp,FILTER_GENERIC_1_TCP ,FILTER_GENERIC_1_L4 , &tcp_mask, &tcp_val,sizeof (struct tcp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV4_SCTP ) { -struct sctp_hdr sctp_mask, sctp_val; +struct rte_sctp_hdr sctp_mask, sctp_val;memset (&sctp_mask,0 ,sizeof (sctp_mask));memset (&sctp_val,0 ,sizeof (sctp_val));
@@ -175,7 +175,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,* manually set proto_id=sctp below. */ enic_set_layer (gp,0 ,FILTER_GENERIC_1_L4 , &sctp_mask, - &sctp_val,sizeof (struct sctp_hdr )); + &sctp_val,sizeof (struct rte_sctp_hdr )); } if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_UDP ||
@@ -246,7 +246,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,enic_set_layer (gp,FILTER_GENERIC_1_TCP ,FILTER_GENERIC_1_L4 , &tcp_mask, &tcp_val,sizeof (struct tcp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV6_SCTP ) { -struct sctp_hdr sctp_mask, sctp_val; +struct rte_sctp_hdr sctp_mask, sctp_val;memset (&sctp_mask,0 ,sizeof (sctp_mask));memset (&sctp_val,0 ,sizeof (sctp_val));
@@ -264,7 +264,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, }enic_set_layer (gp,0 ,FILTER_GENERIC_1_L4 , &sctp_mask, - &sctp_val,sizeof (struct sctp_hdr )); + &sctp_val,sizeof (struct rte_sctp_hdr )); } if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_UDP ||
drivers/net/enic/enic_flow.c +2 -2
@@ -910,9 +910,9 @@ enic_copy_item_sctp_v2(struct copy_item_args *arg) mask = &rte_flow_item_sctp_mask;memcpy (gp->layer[FILTER_GENERIC_1_L4 ].mask, &mask->hdr, -sizeof (struct sctp_hdr )); +sizeof (struct rte_sctp_hdr ));memcpy (gp->layer[FILTER_GENERIC_1_L4 ].val, &spec->hdr, -sizeof (struct sctp_hdr )); +sizeof (struct rte_sctp_hdr ));return 0 ; }
drivers/net/i40e/i40e_fdir.c +10 -10
@@ -801,7 +801,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,unsigned char *payload, *ptr;struct udp_hdr *udp;struct tcp_hdr *tcp; -struct sctp_hdr *sctp; +struct rte_sctp_hdr *sctp;uint8_t size, dst =0 ;uint8_t i, pit_idx, set_idx =I40E_FLXPLD_L4_IDX ;/* use l4 by default*/ int len;
@@ -841,8 +841,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,break ;case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP : - sctp = (struct sctp_hdr *)(raw_pkt + len); - payload = (unsigned char *)sctp +sizeof (struct sctp_hdr ); + sctp = (struct rte_sctp_hdr *)(raw_pkt + len); + payload = (unsigned char *)sctp +sizeof (struct rte_sctp_hdr );/* * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -886,8 +886,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,break ;case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP : - sctp = (struct sctp_hdr *)(raw_pkt + len); - payload = (unsigned char *)sctp +sizeof (struct sctp_hdr ); + sctp = (struct rte_sctp_hdr *)(raw_pkt + len); + payload = (unsigned char *)sctp +sizeof (struct rte_sctp_hdr );/* * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -1091,7 +1091,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,unsigned char *ptr;struct udp_hdr *udp;struct tcp_hdr *tcp; -struct sctp_hdr *sctp; +struct rte_sctp_hdr *sctp;struct rte_flow_item_gtp *gtp;struct rte_ipv4_hdr *gtp_ipv4;struct rte_ipv6_hdr *gtp_ipv6;
@@ -1138,8 +1138,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, tcp->dst_port = fdir_input->flow.tcp4_flow.src_port; tcp->data_off =I40E_FDIR_TCP_DEFAULT_DATAOFF ; }else if (pctype ==I40E_FILTER_PCTYPE_NONF_IPV4_SCTP ) { - sctp = (struct sctp_hdr *)(raw_pkt + len); - payload = (unsigned char *)sctp +sizeof (struct sctp_hdr ); + sctp = (struct rte_sctp_hdr *)(raw_pkt + len); + payload = (unsigned char *)sctp +sizeof (struct rte_sctp_hdr );/** * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -1175,8 +1175,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, tcp->src_port = fdir_input->flow.udp6_flow.dst_port; tcp->dst_port = fdir_input->flow.udp6_flow.src_port; }else if (pctype ==I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ) { - sctp = (struct sctp_hdr *)(raw_pkt + len); - payload = (unsigned char *)sctp +sizeof (struct sctp_hdr ); + sctp = (struct rte_sctp_hdr *)(raw_pkt + len); + payload = (unsigned char *)sctp +sizeof (struct rte_sctp_hdr );/** * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -307,7 +307,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,break ;case PKT_TX_SCTP_CKSUM : *td_cmd |=I40E_TX_DESC_CMD_L4T_EOFT_SCTP ; - *td_offset |= (sizeof (struct sctp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_sctp_hdr ) >>2 ) <<I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT ;break ;case PKT_TX_UDP_CKSUM :
drivers/net/iavf/iavf_rxtx.c +1 -1
@@ -1422,7 +1422,7 @@ iavf_txd_enable_checksum(uint64_t ol_flags,break ;case PKT_TX_SCTP_CKSUM : *td_cmd |=IAVF_TX_DESC_CMD_L4T_EOFT_SCTP ; - *td_offset |= (sizeof (struct sctp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_sctp_hdr ) >>2 ) <<IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT ;break ;case PKT_TX_UDP_CKSUM :
drivers/net/ice/ice_rxtx.c +1 -1
@@ -1767,7 +1767,7 @@ ice_txd_enable_checksum(uint64_t ol_flags,break ;case PKT_TX_SCTP_CKSUM : *td_cmd |=ICE_TX_DESC_CMD_L4T_EOFT_SCTP ; - *td_offset |= (sizeof (struct sctp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_sctp_hdr ) >>2 ) <<ICE_TX_DESC_LEN_L4_LEN_S ;break ;case PKT_TX_UDP_CKSUM :
drivers/net/ixgbe/ixgbe_rxtx.c +2 -1
@@ -436,7 +436,8 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,case PKT_TX_SCTP_CKSUM : type_tucmd_mlhl |=IXGBE_ADVTXD_TUCMD_L4T_SCTP |IXGBE_ADVTXD_DTYP_CTXT |IXGBE_ADVTXD_DCMD_DEXT ; - mss_l4len_idx |=sizeof (struct sctp_hdr ) <<IXGBE_ADVTXD_L4LEN_SHIFT ; + mss_l4len_idx |=sizeof (struct rte_sctp_hdr ) + <<IXGBE_ADVTXD_L4LEN_SHIFT ; tx_offload_mask.l2_len |= ~0 ; tx_offload_mask.l3_len |= ~0 ;break ;
examples/tep_termination/vxlan.c +3 -2
@@ -79,7 +79,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr,struct rte_ipv6_hdr *ipv6_hdr;struct udp_hdr *udp_hdr;struct tcp_hdr *tcp_hdr; -struct sctp_hdr *sctp_hdr; +struct rte_sctp_hdr *sctp_hdr;uint64_t ol_flags =0 ; info->l2_len =sizeof (struct rte_ether_hdr );
@@ -129,7 +129,8 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, tcp_hdr->cksum =get_psd_sum (l3_hdr, ethertype, ol_flags); }else if (l4_proto ==IPPROTO_SCTP ) { - sctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len); + sctp_hdr = (struct rte_sctp_hdr *) + ((char *)l3_hdr + info->l3_len); sctp_hdr->cksum =0 ; ol_flags |=PKT_TX_SCTP_CKSUM ; }
lib/librte_ethdev/rte_flow.h +1 -1
@@ -730,7 +730,7 @@ static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {* Matches a SCTP header. */ struct rte_flow_item_sctp { -struct sctp_hdr hdr;/**< SCTP header definition. */ +struct rte_sctp_hdr hdr;/**< SCTP header definition. */ };/** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
lib/librte_net/rte_net.c +2 -2
@@ -370,7 +370,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, hdr_lens->l4_len = (th->data_off &0xf0 ) >>2 ;return pkt_type; }else if ((pkt_type &RTE_PTYPE_L4_MASK ) ==RTE_PTYPE_L4_SCTP ) { - hdr_lens->l4_len =sizeof (struct sctp_hdr ); + hdr_lens->l4_len =sizeof (struct rte_sctp_hdr );return pkt_type; }else {uint32_t prev_off = off;
@@ -506,7 +506,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, hdr_lens->inner_l4_len = (th->data_off &0xf0 ) >>2 ; }else if ((pkt_type &RTE_PTYPE_INNER_L4_MASK ) ==RTE_PTYPE_INNER_L4_SCTP ) { - hdr_lens->inner_l4_len =sizeof (struct sctp_hdr ); + hdr_lens->inner_l4_len =sizeof (struct rte_sctp_hdr ); }else { hdr_lens->inner_l4_len =0 ; }
lib/librte_net/rte_sctp.h +1 -1
@@ -23,7 +23,7 @@ extern "C" {/** * SCTP Header */ -struct sctp_hdr { +struct rte_sctp_hdr {uint16_t src_port;/**< Source port. */ uint16_t dst_port;/**< Destin port. */ uint32_t tag;/**< Validation tag. */
lib/librte_vhost/virtio_net.c +2 -2
@@ -226,7 +226,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) dgram_cksum));break ;case PKT_TX_SCTP_CKSUM : - net_hdr->csum_offset = (offsetof(struct sctp_hdr , + net_hdr->csum_offset = (offsetof(struct rte_sctp_hdr , cksum));break ; }
@@ -1032,7 +1032,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)if (l4_proto ==IPPROTO_UDP ) m->ol_flags |=PKT_TX_UDP_CKSUM ;break ; -case (offsetof(struct sctp_hdr , cksum)): +case (offsetof(struct rte_sctp_hdr , cksum)):if (l4_proto ==IPPROTO_SCTP ) m->ol_flags |=PKT_TX_SCTP_CKSUM ;break ;
Signature · 1 line
2.11.0
PATCH 13/15 net: add rte prefix to tcp structure
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.
--- app/test-pmd/csumonly.c | 14 ++++++++------ app/test/packet_burst_generator.c | 10 +++++----- app/test/packet_burst_generator.h | 2 +- app/test/test_flow_classify.c | 6 +++--- doc/guides/sample_app_ug/flow_classify.rst | 4 ++-- drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++--- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_rxtx.c | 3 ++- drivers/net/ena/ena_ethdev.c | 2 +- drivers/net/enic/enic_clsf.c | 8 ++++---- drivers/net/enic/enic_flow.c | 8 ++++---- drivers/net/i40e/i40e_fdir.c | 20 ++++++++++---------- drivers/net/i40e/i40e_rxtx.c | 2 +- drivers/net/iavf/iavf_rxtx.c | 2 +- drivers/net/ice/ice_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- drivers/net/mlx5/mlx5_flow.c | 8 ++++---- drivers/net/mlx5/mlx5_flow_tcf.c | 4 ++-- drivers/net/qede/qede_filter.c | 12 ++++++------ drivers/net/sfc/sfc_ef10_tx.c | 4 ++-- drivers/net/sfc/sfc_tso.c | 4 ++-- drivers/net/softnic/rte_eth_softnic_pipeline.c | 8 ++++---- drivers/net/tap/rte_eth_tap.c | 2 +- drivers/net/virtio/virtio_rxtx.c | 4 ++-- drivers/net/vmxnet3/vmxnet3_rxtx.c | 15 ++++++++------- examples/flow_classify/flow_classify.c | 4 ++-- examples/ip_pipeline/pipeline.c | 8 ++++---- examples/l3fwd-power/main.c | 8 ++++---- examples/l3fwd-vf/main.c | 4 ++-- examples/tep_termination/vxlan.c | 4 ++-- examples/vhost/main.c | 4 ++-- lib/librte_ethdev/rte_flow.h | 2 +- lib/librte_gro/gro_tcp4.c | 4 ++-- lib/librte_gro/gro_tcp4.h | 10 +++++----- lib/librte_gro/gro_vxlan_tcp4.c | 6 +++--- lib/librte_gso/gso_common.h | 4 ++-- lib/librte_gso/gso_tcp4.c | 4 ++-- lib/librte_gso/gso_tunnel_tcp4.c | 4 ++-- lib/librte_gso/rte_gso.h | 2 +- lib/librte_net/rte_net.c | 8 ++++---- lib/librte_net/rte_net.h | 7 ++++--- lib/librte_net/rte_tcp.h | 2 +- lib/librte_pipeline/rte_table_action.c | 8 ++++---- lib/librte_vhost/virtio_net.c | 6 +++--- 45 files changed, 131 insertions(+), 125 deletions(-)
app/test-pmd/csumonly.c +8 -6
@@ -102,14 +102,15 @@ get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)static void parse_ipv4 (struct rte_ipv4_hdr *ipv4_hdr,struct testpmd_offload_info *info) { -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr; info->l3_len = (ipv4_hdr->version_ihl &0x0f ) *4 ; info->l4_proto = ipv4_hdr->next_proto_id;/* only fill l4_len for TCP, it's useful for TSO */ if (info->l4_proto ==IPPROTO_TCP ) { - tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + info->l3_len); + tcp_hdr = (struct rte_tcp_hdr *) + ((char *)ipv4_hdr + info->l3_len); info->l4_len = (tcp_hdr->data_off &0xf0 ) >>2 ; }else if (info->l4_proto ==IPPROTO_UDP ) info->l4_len =sizeof (struct udp_hdr );
@@ -121,14 +122,15 @@ parse_ipv4(struct rte_ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)static void parse_ipv6 (struct rte_ipv6_hdr *ipv6_hdr,struct testpmd_offload_info *info) { -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_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 */ if (info->l4_proto ==IPPROTO_TCP ) { - tcp_hdr = (struct tcp_hdr *)((char *)ipv6_hdr + info->l3_len); + tcp_hdr = (struct rte_tcp_hdr *) + ((char *)ipv6_hdr + info->l3_len); info->l4_len = (tcp_hdr->data_off &0xf0 ) >>2 ; }else if (info->l4_proto ==IPPROTO_UDP ) info->l4_len =sizeof (struct udp_hdr );
@@ -367,7 +369,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, {struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;struct udp_hdr *udp_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;struct rte_sctp_hdr *sctp_hdr;uint64_t ol_flags =0 ;uint32_t max_pkt_len, tso_segsz =0 ;
@@ -421,7 +423,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,if (info->gso_enable) ol_flags |=PKT_TX_UDP_SEG ; }else if (info->l4_proto ==IPPROTO_TCP ) { - tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len); + tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len); tcp_hdr->cksum =0 ;if (tso_segsz) ol_flags |=PKT_TX_TCP_SEG ;
app/test/packet_burst_generator.c +5 -5
@@ -109,14 +109,14 @@ initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port, }uint16_t -initialize_tcp_header (struct tcp_hdr *tcp_hdr,uint16_t src_port, +initialize_tcp_header (struct rte_tcp_hdr *tcp_hdr,uint16_t src_port,uint16_t dst_port,uint16_t pkt_data_len) {uint16_t pkt_len; - pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct tcp_hdr )); + pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct rte_tcp_hdr )); -memset (tcp_hdr,0 ,sizeof (struct tcp_hdr )); +memset (tcp_hdr,0 ,sizeof (struct rte_tcp_hdr )); tcp_hdr->src_port =rte_cpu_to_be_16 (src_port); tcp_hdr->dst_port =rte_cpu_to_be_16 (dst_port);
@@ -396,7 +396,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,break ;case IPPROTO_TCP :copy_buf_to_pkt (proto_hdr, -sizeof (struct tcp_hdr ), pkt, +sizeof (struct rte_tcp_hdr ), pkt, eth_hdr_size +sizeof (struct rte_ipv4_hdr ));break ;
@@ -421,7 +421,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,break ;case IPPROTO_TCP :copy_buf_to_pkt (proto_hdr, -sizeof (struct tcp_hdr ), pkt, +sizeof (struct rte_tcp_hdr ), pkt, eth_hdr_size +sizeof (struct rte_ipv6_hdr ));break ;
app/test/packet_burst_generator.h +1 -1
@@ -39,7 +39,7 @@ initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port, uint16_t dst_port, uint16_t pkt_data_len);uint16_t -initialize_tcp_header (struct tcp_hdr *tcp_hdr,uint16_t src_port, +initialize_tcp_header (struct rte_tcp_hdr *tcp_hdr,uint16_t src_port,uint16_t dst_port,uint16_t pkt_data_len);uint16_t
app/test/test_flow_classify.c +3 -3
@@ -74,7 +74,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + - offsetof(struct tcp_hdr, src_port), + offsetof(struct rte_tcp_hdr, src_port), }, {/* rte_flow uses a bit mask for protocol ports */
@@ -84,7 +84,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .input_index = SRCP_DESTP_INPUT_IPV4, .offset =sizeof (struct rte_ether_hdr ) +sizeof (struct rte_ipv4_hdr ) + - offsetof(struct tcp_hdr, dst_port), + offsetof(struct rte_tcp_hdr, dst_port), }, };
@@ -530,7 +530,7 @@ init_ipv4_tcp_traffic(struct rte_mempool *mp, {struct rte_ether_hdr pkt_eth_hdr;struct rte_ipv4_hdr pkt_ipv4_hdr; -struct tcp_hdr pkt_tcp_hdr; +struct rte_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 );uint16_t src_port =16 ;
doc/guides/sample_app_ug/flow_classify.rst +2 -2
@@ -126,7 +126,7 @@ initialisation of the ``Flow Classify`` application.. .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + - offsetof(struct tcp_hdr, src_port), + offsetof(struct rte_tcp_hdr, src_port), }, { /* rte_flow uses a bit mask for protocol ports */
@@ -136,7 +136,7 @@ initialisation of the ``Flow Classify`` application.. .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + - offsetof(struct tcp_hdr, dst_port), + offsetof(struct rte_tcp_hdr, dst_port), }, };
drivers/net/bonding/rte_eth_bond_pmd.c +3 -3
@@ -840,7 +840,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,int i;struct udp_hdr *udp_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;uint32_t hash, l3hash, l4hash;for (i =0 ; i < nb_pkts; i++) {
@@ -866,7 +866,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,RTE_IPV4_IHL_MULTIPLIER ;if (ipv4_hdr->next_proto_id ==IPPROTO_TCP ) { - tcp_hdr = (struct tcp_hdr *) + tcp_hdr = (struct rte_tcp_hdr *) ((char *)ipv4_hdr + ip_hdr_offset); if ((size_t)tcp_hdr + sizeof(*tcp_hdr)
@@ -888,7 +888,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, l3hash =ipv6_hash (ipv6_hdr);if (ipv6_hdr->proto ==IPPROTO_TCP ) { - tcp_hdr = (struct tcp_hdr *)(ipv6_hdr +1 ); + tcp_hdr = (struct rte_tcp_hdr *)(ipv6_hdr +1 ); l4hash =HASH_L4_PORTS (tcp_hdr); }else if (ipv6_hdr->proto ==IPPROTO_UDP ) { udp_hdr = (struct udp_hdr *)(ipv6_hdr +1 );
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -219,7 +219,7 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf) 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 + +struct rte_tcp_hdr *tcp_hdr = (struct rte_tcp_hdr *)(l3_hdr + mbuf->l3_len); tcp_hdr->cksum =0 ;if (eth_hdr->ether_type ==htons (RTE_ETHER_TYPE_IPv4))
drivers/net/e1000/em_rxtx.c +1 -1
@@ -249,7 +249,7 @@ em_set_xmit_ctx(struct em_tx_queue* txq,break ;case PKT_TX_TCP_CKSUM : ctx.upper_setup.tcp_fields.tucso = (uint8_t )(ipcse + - offsetof(struct tcp_hdr , cksum)); + offsetof(struct rte_tcp_hdr , cksum)); cmd_len |=E1000_TXD_CMD_TCP ; cmp_mask |=TX_MACIP_LEN_CMP_MASK ;break ;
drivers/net/e1000/igb_rxtx.c +2 -1
@@ -294,7 +294,8 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq,case PKT_TX_TCP_CKSUM : type_tucmd_mlhl |=E1000_ADVTXD_TUCMD_L4T_TCP |E1000_ADVTXD_DTYP_CTXT |E1000_ADVTXD_DCMD_DEXT ; - mss_l4len_idx |=sizeof (struct tcp_hdr ) <<E1000_ADVTXD_L4LEN_SHIFT ; + mss_l4len_idx |=sizeof (struct rte_tcp_hdr ) + <<E1000_ADVTXD_L4LEN_SHIFT ;break ;case PKT_TX_SCTP_CKSUM : type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP |
drivers/net/ena/ena_ethdev.c +1 -1
@@ -75,7 +75,7 @@#define TEST_BIT (val, bit_shift) (val & (1UL << bit_shift))#define GET_L4_HDR_LEN (mbuf) \ - ((rte_pktmbuf_mtod_offset(mbuf, struct tcp_hdr *, \ + ((rte_pktmbuf_mtod_offset(mbuf, struct rte_tcp_hdr *, \ mbuf->l3_len + mbuf->l2_len)->data_off) >> 4)#define ENA_RX_RSS_TABLE_LOG_SIZE 7
drivers/net/enic/enic_clsf.c +4 -4
@@ -136,7 +136,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,enic_set_layer (gp,FILTER_GENERIC_1_UDP ,FILTER_GENERIC_1_L4 , &udp_mask, &udp_val,sizeof (struct udp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV4_TCP ) { -struct tcp_hdr tcp_mask, tcp_val; +struct rte_tcp_hdr tcp_mask, tcp_val;memset (&tcp_mask,0 ,sizeof (tcp_mask));memset (&tcp_val,0 ,sizeof (tcp_val));
@@ -150,7 +150,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, }enic_set_layer (gp,FILTER_GENERIC_1_TCP ,FILTER_GENERIC_1_L4 , - &tcp_mask, &tcp_val,sizeof (struct tcp_hdr )); + &tcp_mask, &tcp_val,sizeof (struct rte_tcp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV4_SCTP ) {struct rte_sctp_hdr sctp_mask, sctp_val;memset (&sctp_mask,0 ,sizeof (sctp_mask));
@@ -231,7 +231,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,enic_set_layer (gp,FILTER_GENERIC_1_UDP ,FILTER_GENERIC_1_L4 , &udp_mask, &udp_val,sizeof (struct udp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV6_TCP ) { -struct tcp_hdr tcp_mask, tcp_val; +struct rte_tcp_hdr tcp_mask, tcp_val;memset (&tcp_mask,0 ,sizeof (tcp_mask));memset (&tcp_val,0 ,sizeof (tcp_val));
@@ -244,7 +244,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, tcp_val.dst_port = input->flow.tcp6_flow.dst_port; }enic_set_layer (gp,FILTER_GENERIC_1_TCP ,FILTER_GENERIC_1_L4 , - &tcp_mask, &tcp_val,sizeof (struct tcp_hdr )); + &tcp_mask, &tcp_val,sizeof (struct rte_tcp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV6_SCTP ) {struct rte_sctp_hdr sctp_mask, sctp_val;memset (&sctp_mask,0 ,sizeof (sctp_mask));
drivers/net/enic/enic_flow.c +4 -4
@@ -488,7 +488,7 @@ enic_copy_item_tcp_v1(struct copy_item_args *arg)const struct rte_flow_item_tcp *spec = item->spec;const struct rte_flow_item_tcp *mask = item->mask;struct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4; -struct tcp_hdr supported_mask = { +struct rte_tcp_hdr supported_mask = { .src_port =0xffff , .dst_port =0xffff , };
@@ -654,7 +654,7 @@ enic_copy_item_inner_tcp_v2(struct copy_item_args *arg) mask = &rte_flow_item_tcp_mask;/* Append tcp header to L5 and set ip proto = tcp */ return copy_inner_common (&arg->filter->u.generic_1, off, - arg->item->spec, mask,sizeof (struct tcp_hdr ), + arg->item->spec, mask,sizeof (struct rte_tcp_hdr ), arg->l3_proto_off,IPPROTO_TCP ,1 ); }
@@ -860,9 +860,9 @@ enic_copy_item_tcp_v2(struct copy_item_args *arg)return ENOTSUP ;memcpy (gp->layer[FILTER_GENERIC_1_L4 ].mask, &mask->hdr, -sizeof (struct tcp_hdr )); +sizeof (struct rte_tcp_hdr ));memcpy (gp->layer[FILTER_GENERIC_1_L4 ].val, &spec->hdr, -sizeof (struct tcp_hdr )); +sizeof (struct rte_tcp_hdr ));return 0 ; }
drivers/net/i40e/i40e_fdir.c +10 -10
@@ -800,7 +800,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, {unsigned char *payload, *ptr;struct udp_hdr *udp; -struct tcp_hdr *tcp; +struct rte_tcp_hdr *tcp;struct rte_sctp_hdr *sctp;uint8_t size, dst =0 ;uint8_t i, pit_idx, set_idx =I40E_FLXPLD_L4_IDX ;/* use l4 by default*/
@@ -828,8 +828,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,break ;case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : - tcp = (struct tcp_hdr *)(raw_pkt + len); - payload = (unsigned char *)tcp +sizeof (struct tcp_hdr ); + tcp = (struct rte_tcp_hdr *)(raw_pkt + len); + payload = (unsigned char *)tcp +sizeof (struct rte_tcp_hdr );/* * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -873,8 +873,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,break ;case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : - tcp = (struct tcp_hdr *)(raw_pkt + len); - payload = (unsigned char *)tcp +sizeof (struct tcp_hdr ); + tcp = (struct rte_tcp_hdr *)(raw_pkt + len); + payload = (unsigned char *)tcp +sizeof (struct rte_tcp_hdr );/* * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -1090,7 +1090,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,unsigned char *payload =NULL ;unsigned char *ptr;struct udp_hdr *udp; -struct tcp_hdr *tcp; +struct rte_tcp_hdr *tcp;struct rte_sctp_hdr *sctp;struct rte_flow_item_gtp *gtp;struct rte_ipv4_hdr *gtp_ipv4;
@@ -1127,8 +1127,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, udp->dst_port = fdir_input->flow.udp4_flow.src_port; udp->dgram_len =rte_cpu_to_be_16 (I40E_FDIR_UDP_DEFAULT_LEN ); }else if (pctype ==I40E_FILTER_PCTYPE_NONF_IPV4_TCP ) { - tcp = (struct tcp_hdr *)(raw_pkt + len); - payload = (unsigned char *)tcp +sizeof (struct tcp_hdr ); + tcp = (struct rte_tcp_hdr *)(raw_pkt + len); + payload = (unsigned char *)tcp +sizeof (struct rte_tcp_hdr );/** * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -1164,8 +1164,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, udp->dst_port = fdir_input->flow.udp6_flow.src_port; udp->dgram_len =rte_cpu_to_be_16 (I40E_FDIR_IPv6_PAYLOAD_LEN); }else if (pctype ==I40E_FILTER_PCTYPE_NONF_IPV6_TCP ) { - tcp = (struct tcp_hdr *)(raw_pkt + len); - payload = (unsigned char *)tcp +sizeof (struct tcp_hdr ); + tcp = (struct rte_tcp_hdr *)(raw_pkt + len); + payload = (unsigned char *)tcp +sizeof (struct rte_tcp_hdr );/** * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -302,7 +302,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,switch (ol_flags &PKT_TX_L4_MASK ) {case PKT_TX_TCP_CKSUM : *td_cmd |=I40E_TX_DESC_CMD_L4T_EOFT_TCP ; - *td_offset |= (sizeof (struct tcp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_tcp_hdr ) >>2 ) <<I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT ;break ;case PKT_TX_SCTP_CKSUM :
drivers/net/iavf/iavf_rxtx.c +1 -1
@@ -1417,7 +1417,7 @@ iavf_txd_enable_checksum(uint64_t ol_flags,switch (ol_flags &PKT_TX_L4_MASK ) {case PKT_TX_TCP_CKSUM : *td_cmd |=IAVF_TX_DESC_CMD_L4T_EOFT_TCP ; - *td_offset |= (sizeof (struct tcp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_tcp_hdr ) >>2 ) <<IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT ;break ;case PKT_TX_SCTP_CKSUM :
drivers/net/ice/ice_rxtx.c +1 -1
@@ -1762,7 +1762,7 @@ ice_txd_enable_checksum(uint64_t ol_flags,switch (ol_flags &PKT_TX_L4_MASK ) {case PKT_TX_TCP_CKSUM : *td_cmd |=ICE_TX_DESC_CMD_L4T_EOFT_TCP ; - *td_offset |= (sizeof (struct tcp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_tcp_hdr ) >>2 ) <<ICE_TX_DESC_LEN_L4_LEN_S ;break ;case PKT_TX_SCTP_CKSUM :
drivers/net/ixgbe/ixgbe_rxtx.c +2 -1
@@ -429,7 +429,8 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,case PKT_TX_TCP_CKSUM : type_tucmd_mlhl |=IXGBE_ADVTXD_TUCMD_L4T_TCP |IXGBE_ADVTXD_DTYP_CTXT |IXGBE_ADVTXD_DCMD_DEXT ; - mss_l4len_idx |=sizeof (struct tcp_hdr ) <<IXGBE_ADVTXD_L4LEN_SHIFT ; + mss_l4len_idx |=sizeof (struct rte_tcp_hdr ) + <<IXGBE_ADVTXD_L4LEN_SHIFT ; tx_offload_mask.l2_len |= ~0 ; tx_offload_mask.l3_len |= ~0 ;break ;
drivers/net/mlx5/mlx5_flow.c +4 -4
@@ -2617,11 +2617,11 @@ flow_fdir_filter_convert(struct rte_eth_dev *dev, };break ;case RTE_ETH_FLOW_NONFRAG_IPV4_TCP : - attributes->l4.tcp.hdr = (struct tcp_hdr ){ + attributes->l4.tcp.hdr = (struct rte_tcp_hdr ){ .src_port = input->flow.tcp4_flow.src_port, .dst_port = input->flow.tcp4_flow.dst_port, }; - attributes->l4_mask.tcp.hdr = (struct tcp_hdr ){ + attributes->l4_mask.tcp.hdr = (struct rte_tcp_hdr ){ .src_port = mask->src_port_mask, .dst_port = mask->dst_port_mask, };
@@ -2647,11 +2647,11 @@ flow_fdir_filter_convert(struct rte_eth_dev *dev, };break ;case RTE_ETH_FLOW_NONFRAG_IPV6_TCP : - attributes->l4.tcp.hdr = (struct tcp_hdr ){ + attributes->l4.tcp.hdr = (struct rte_tcp_hdr ){ .src_port = input->flow.tcp6_flow.src_port, .dst_port = input->flow.tcp6_flow.dst_port, }; - attributes->l4_mask.tcp.hdr = (struct tcp_hdr ){ + attributes->l4_mask.tcp.hdr = (struct rte_tcp_hdr ){ .src_port = mask->src_port_mask, .dst_port = mask->dst_port_mask, };
drivers/net/mlx5/mlx5_flow_tcf.c +2 -2
@@ -776,8 +776,8 @@ flow_tcf_pedit_key_set_tp_port(const struct rte_flow_action *actions,/* offset of src/dst port is same for TCP and UDP */ p_parser->keys[idx].off = actions->type ==RTE_FLOW_ACTION_TYPE_SET_TP_SRC ? - offsetof(struct tcp_hdr , src_port) : - offsetof(struct tcp_hdr , dst_port); + offsetof(struct rte_tcp_hdr , src_port) : + offsetof(struct rte_tcp_hdr , dst_port); p_parser->keys[idx].mask =0xFFFF0000 ; p_parser->keys[idx].val = (__u32)((const struct rte_flow_action_set_tp *)
drivers/net/qede/qede_filter.c +6 -6
@@ -460,7 +460,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,struct rte_ipv4_hdr *ip;struct rte_ipv6_hdr *ip6;struct udp_hdr *udp; -struct tcp_hdr *tcp; +struct rte_tcp_hdr *tcp;uint16_t len; raw_pkt = (uint8_t *)buff;
@@ -496,13 +496,13 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, ip->total_length +=sizeof (struct udp_hdr ); params->udp = true; }else {/* TCP */ - tcp = (struct tcp_hdr *)(raw_pkt + len); + tcp = (struct rte_tcp_hdr *)(raw_pkt + len); tcp->src_port = arfs->tuple.src_port; tcp->dst_port = arfs->tuple.dst_port; tcp->data_off =QEDE_FDIR_TCP_DEFAULT_DATAOFF ; - len +=sizeof (struct tcp_hdr ); + len +=sizeof (struct rte_tcp_hdr );/* adjust ip total_length */ - ip->total_length +=sizeof (struct tcp_hdr ); + ip->total_length +=sizeof (struct rte_tcp_hdr ); params->tcp = true; }break ;
@@ -528,11 +528,11 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, len +=sizeof (struct udp_hdr ); params->udp = true; }else {/* TCP */ - tcp = (struct tcp_hdr *)(raw_pkt + len); + tcp = (struct rte_tcp_hdr *)(raw_pkt + len); tcp->src_port = arfs->tuple.src_port; tcp->dst_port = arfs->tuple.dst_port; tcp->data_off =QEDE_FDIR_TCP_DEFAULT_DATAOFF ; - len +=sizeof (struct tcp_hdr ); + len +=sizeof (struct rte_tcp_hdr ); params->tcp = true; }break ;
drivers/net/sfc/sfc_ef10_tx.c +2 -2
@@ -373,7 +373,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,size_t header_len = tcph_off + m_seg->l4_len;/* Offset of the payload in the last segment that contains the header */ size_t in_off =0 ; -const struct tcp_hdr *th; +const struct rte_tcp_hdr *th;uint16_t packet_id =0 ;uint16_t outer_packet_id =0 ;uint32_t sent_seq;
@@ -489,7 +489,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg, outer_packet_id =sfc_tso_ip4_get_ipid (hdr_addr, first_m_seg->outer_l2_len); - th = (const struct tcp_hdr *)(hdr_addr + tcph_off); + th = (const struct rte_tcp_hdr *)(hdr_addr + tcph_off);rte_memcpy (&sent_seq, &th->sent_seq,sizeof (uint32_t )); sent_seq =rte_be_to_cpu_32 (sent_seq);
drivers/net/sfc/sfc_tso.c +2 -2
@@ -95,7 +95,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx, unsigned int *pkt_descs, size_t *pkt_len) { uint8_t *tsoh; -const struct tcp_hdr *th; +const struct rte_tcp_hdr *th;efsys_dma_addr_t header_paddr;uint16_t packet_id =0 ;uint32_t sent_seq;
@@ -150,7 +150,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx, packet_id =sfc_tso_ip4_get_ipid (tsoh, nh_off);/* Handle TCP header */ - th = (const struct tcp_hdr *)(tsoh + tcph_off); + th = (const struct rte_tcp_hdr *)(tsoh + tcph_off);rte_memcpy (&sent_seq, &th->sent_seq,sizeof (uint32_t )); sent_seq =rte_be_to_cpu_32 (sent_seq);
drivers/net/softnic/rte_eth_softnic_pipeline.c +4 -4
@@ -688,7 +688,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .field_index = 3, .input_index = 3, .offset =sizeof (struct rte_ipv4_hdr ) + - offsetof(struct tcp_hdr, src_port), + offsetof(struct rte_tcp_hdr, src_port), },/* Destination Port */
@@ -698,7 +698,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .field_index = 4, .input_index = 3, .offset = sizeof(struct rte_ipv4_hdr) + - offsetof(struct tcp_hdr, dst_port), + offsetof(struct rte_tcp_hdr, dst_port), }, };
@@ -785,7 +785,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .field_index = 9, .input_index = 9, .offset =sizeof (struct rte_ipv6_hdr ) + - offsetof(struct tcp_hdr, src_port), + offsetof(struct rte_tcp_hdr, src_port), },/* Destination Port */
@@ -795,7 +795,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .field_index = 10, .input_index = 9, .offset = sizeof(struct rte_ipv6_hdr) + - offsetof(struct tcp_hdr, dst_port), + offsetof(struct rte_tcp_hdr, dst_port), }, };
drivers/net/tap/rte_eth_tap.c +1 -1
@@ -510,7 +510,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,if ((ol_flags &PKT_TX_L4_MASK ) ==PKT_TX_UDP_CKSUM ) *l4_cksum = &((struct udp_hdr *)l4_hdr)->dgram_cksum;else if ((ol_flags &PKT_TX_L4_MASK ) ==PKT_TX_TCP_CKSUM ) - *l4_cksum = &((struct tcp_hdr *)l4_hdr)->cksum; + *l4_cksum = &((struct rte_tcp_hdr *)l4_hdr)->cksum;else return ; **l4_cksum =0 ;
drivers/net/virtio/virtio_rxtx.c +2 -2
@@ -481,7 +481,7 @@ virtio_tso_fix_cksum(struct rte_mbuf *m) m->l4_len)) {struct rte_ipv4_hdr *iph;struct rte_ipv6_hdr *ip6h; -struct tcp_hdr *th; +struct rte_tcp_hdr *th;uint16_t prev_cksum, new_cksum, ip_len, ip_paylen;uint32_t tmp;
@@ -546,7 +546,7 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr,case PKT_TX_TCP_CKSUM : hdr->csum_start = cookie->l2_len + cookie->l3_len; - hdr->csum_offset = offsetof(struct tcp_hdr , cksum); + hdr->csum_offset = offsetof(struct rte_tcp_hdr , cksum); hdr->flags =VIRTIO_NET_HDR_F_NEEDS_CSUM ;break ;
drivers/net/vmxnet3/vmxnet3_rxtx.c +8 -7
@@ -541,7 +541,8 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,switch (txm->ol_flags &PKT_TX_L4_MASK ) {case PKT_TX_TCP_CKSUM : - gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct tcp_hdr , cksum); + gdesc->txd.msscof = gdesc->txd.hlen + + offsetof(struct rte_tcp_hdr , cksum);break ;case PKT_TX_UDP_CKSUM : gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct udp_hdr , dgram_cksum);
@@ -669,7 +670,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,uint32_t hlen, slen;struct rte_ipv4_hdr *ipv4_hdr;struct rte_ipv6_hdr *ipv6_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;char *ptr;RTE_ASSERT (rcd->tcp);
@@ -681,7 +682,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,if (rcd->v4) {if (unlikely (slen < hlen +sizeof (struct rte_ipv4_hdr )))return hw->mtu -sizeof (struct rte_ipv4_hdr ) - -sizeof (struct tcp_hdr ); + -sizeof (struct rte_tcp_hdr ); ipv4_hdr = (struct rte_ipv4_hdr *)(ptr + hlen); hlen += (ipv4_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK) *
@@ -689,7 +690,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, }else if (rcd->v6) {if (unlikely (slen < hlen +sizeof (struct rte_ipv6_hdr )))return hw->mtu -sizeof (struct rte_ipv6_hdr ) - -sizeof (struct tcp_hdr ); +sizeof (struct rte_tcp_hdr ); ipv6_hdr = (struct rte_ipv6_hdr *)(ptr + hlen); hlen +=sizeof (struct rte_ipv6_hdr );
@@ -701,11 +702,11 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, } } -if (unlikely (slen < hlen +sizeof (struct tcp_hdr ))) -return hw->mtu - hlen -sizeof (struct tcp_hdr ) + +if (unlikely (slen < hlen +sizeof (struct rte_tcp_hdr ))) +return hw->mtu - hlen -sizeof (struct rte_tcp_hdr ) +sizeof (struct rte_ether_hdr ); - tcp_hdr = (struct tcp_hdr *)(ptr + hlen); + tcp_hdr = (struct rte_tcp_hdr *)(ptr + hlen); hlen += (tcp_hdr->data_off &0xf0 ) >>2 ;if (rxm->udata64 >1 )
examples/flow_classify/flow_classify.c +2 -2
@@ -133,7 +133,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .input_index = SRCP_DESTP_INPUT_IPV4, .offset = sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr) + - offsetof(struct tcp_hdr, src_port), + offsetof(struct rte_tcp_hdr, src_port), }, {/* rte_flow uses a bit mask for protocol ports */
@@ -143,7 +143,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .input_index = SRCP_DESTP_INPUT_IPV4, .offset =sizeof (struct rte_ether_hdr ) +sizeof (struct rte_ipv4_hdr ) + - offsetof(struct tcp_hdr, dst_port), + offsetof(struct rte_tcp_hdr, dst_port), }, };
examples/ip_pipeline/pipeline.c +4 -4
@@ -664,7 +664,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .field_index = 3, .input_index = 3, .offset =sizeof (struct rte_ipv4_hdr ) + - offsetof(struct tcp_hdr, src_port), + offsetof(struct rte_tcp_hdr, src_port), },/* Destination Port */
@@ -674,7 +674,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = { .field_index = 4, .input_index = 3, .offset = sizeof(struct rte_ipv4_hdr) + - offsetof(struct tcp_hdr, dst_port), + offsetof(struct rte_tcp_hdr, dst_port), }, };
@@ -761,7 +761,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .field_index = 9, .input_index = 9, .offset =sizeof (struct rte_ipv6_hdr ) + - offsetof(struct tcp_hdr, src_port), + offsetof(struct rte_tcp_hdr, src_port), },/* Destination Port */
@@ -771,7 +771,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = { .field_index = 10, .input_index = 9, .offset = sizeof(struct rte_ipv6_hdr) + - offsetof(struct tcp_hdr, dst_port), + offsetof(struct rte_tcp_hdr, dst_port), }, };
examples/l3fwd-power/main.c +4 -4
@@ -527,7 +527,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t * ipv4_l3fwd_lookup_struct) {struct ipv4_5tuple key; -struct tcp_hdr *tcp; +struct rte_tcp_hdr *tcp;struct udp_hdr *udp;int ret =0 ;
@@ -537,7 +537,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,switch (ipv4_hdr->next_proto_id) {case IPPROTO_TCP : - tcp = (struct tcp_hdr *)((unsigned char *)ipv4_hdr + + tcp = (struct rte_tcp_hdr *)((unsigned char *)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);
@@ -566,7 +566,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid, lookup_struct_t *ipv6_l3fwd_lookup_struct) {struct ipv6_5tuple key; -struct tcp_hdr *tcp; +struct rte_tcp_hdr *tcp;struct udp_hdr *udp;int ret =0 ;
@@ -577,7 +577,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,switch (ipv6_hdr->proto) {case IPPROTO_TCP : - tcp = (struct tcp_hdr *)((unsigned char *) ipv6_hdr + + tcp = (struct rte_tcp_hdr *)((unsigned char *) 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);
examples/l3fwd-vf/main.c +2 -2
@@ -366,7 +366,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *l3fwd_lookup_struct) {struct ipv4_5tuple key; -struct tcp_hdr *tcp; +struct rte_tcp_hdr *tcp;struct udp_hdr *udp;int ret =0 ;
@@ -376,7 +376,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,switch (ipv4_hdr->next_proto_id) {case IPPROTO_TCP : - tcp = (struct tcp_hdr *)((unsigned char *) ipv4_hdr + + tcp = (struct rte_tcp_hdr *)((unsigned char *) 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);
examples/tep_termination/vxlan.c +2 -2
@@ -78,7 +78,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr,struct rte_ipv4_hdr *ipv4_hdr;struct rte_ipv6_hdr *ipv6_hdr;struct udp_hdr *udp_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;struct rte_sctp_hdr *sctp_hdr;uint64_t ol_flags =0 ;
@@ -115,7 +115,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, udp_hdr->dgram_cksum =get_psd_sum (l3_hdr, ethertype, ol_flags); }else if (l4_proto ==IPPROTO_TCP ) { - tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len); + tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len);/* Put PKT_TX_TCP_SEG bit setting before get_psd_sum(), because * it depends on PKT_TX_TCP_SEG to calculate pseudo-header * checksum.
examples/vhost/main.c +2 -2
@@ -866,7 +866,7 @@ static void virtio_tx_offload(struct rte_mbuf *m) {void *l3_hdr;struct rte_ipv4_hdr *ipv4_hdr =NULL ; -struct tcp_hdr *tcp_hdr =NULL ; +struct rte_tcp_hdr *tcp_hdr =NULL ;struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
@@ -878,7 +878,7 @@ static void virtio_tx_offload(struct rte_mbuf *m) m->ol_flags |=PKT_TX_IP_CKSUM ; } - tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + m->l3_len); + tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + m->l3_len); tcp_hdr->cksum =get_psd_sum (l3_hdr, m->ol_flags); }
lib/librte_ethdev/rte_flow.h +1 -1
@@ -711,7 +711,7 @@ static const struct rte_flow_item_udp rte_flow_item_udp_mask = {* Matches a TCP header. */ struct rte_flow_item_tcp { -struct tcp_hdr hdr;/**< TCP header definition. */ +struct rte_tcp_hdr hdr;/**< TCP header definition. */ };/** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
lib/librte_gro/gro_tcp4.c +2 -2
@@ -196,7 +196,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, {struct rte_ether_hdr *eth_hdr;struct rte_ipv4_hdr *ipv4_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;uint32_t sent_seq;int32_t tcp_dl;uint16_t ip_id, hdr_len, frag_off;
@@ -217,7 +217,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ipv4_hdr = (struct rte_ipv4_hdr *)((char *)eth_hdr + pkt->l2_len); - tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); + tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); hdr_len = pkt->l2_len + pkt->l3_len + pkt->l4_len;/*
lib/librte_gro/gro_tcp4.h +5 -5
@@ -20,7 +20,7 @@/* The maximum TCP header length */ #define MAX_TCP_HLEN 60#define INVALID_TCP_HDRLEN (len) \ - (((len) < sizeof(struct tcp_hdr)) || ((len) > MAX_TCP_HLEN)) + (((len) < sizeof(struct rte_tcp_hdr)) || ((len) > MAX_TCP_HLEN))/* Header fields representing a TCP/IPv4 flow */ struct tcp4_flow_key {
@@ -260,7 +260,7 @@ merge_two_tcp4_packets(struct gro_tcp4_item *item,*/ static inline int check_seq_option(struct gro_tcp4_item *item, - struct tcp_hdr *tcph, + struct rte_tcp_hdr *tcph, uint32_t sent_seq, uint16_t ip_id, uint16_t tcp_hl,
@@ -270,16 +270,16 @@ check_seq_option(struct gro_tcp4_item *item, {struct rte_mbuf *pkt_orig = item->firstseg;struct rte_ipv4_hdr *iph_orig; -struct tcp_hdr *tcph_orig; +struct rte_tcp_hdr *tcph_orig;uint16_t len, tcp_hl_orig; iph_orig = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt_orig, char *) + l2_offset + pkt_orig->l2_len); - tcph_orig = (struct tcp_hdr *)((char *)iph_orig + pkt_orig->l3_len); + tcph_orig = (struct rte_tcp_hdr *)((char *)iph_orig + pkt_orig->l3_len); tcp_hl_orig = pkt_orig->l4_len;/* Check if TCP option fields equal */ - len =RTE_MAX (tcp_hl, tcp_hl_orig) -sizeof (struct tcp_hdr ); + len =RTE_MAX (tcp_hl, tcp_hl_orig) -sizeof (struct rte_tcp_hdr );if ((tcp_hl != tcp_hl_orig) || ((len >0 ) && (memcmp (tcph +1 , tcph_orig +1 , len) !=0 )))
lib/librte_gro/gro_vxlan_tcp4.c +3 -3
@@ -208,7 +208,7 @@ is_same_vxlan_tcp4_flow(struct vxlan_tcp4_flow_key k1, static inline int check_vxlan_seq_option(struct gro_vxlan_tcp4_item *item, - struct tcp_hdr *tcp_hdr, + struct rte_tcp_hdr *tcp_hdr, uint32_t sent_seq, uint16_t outer_ip_id, uint16_t ip_id,
@@ -292,7 +292,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, {struct rte_ether_hdr *outer_eth_hdr, *eth_hdr;struct rte_ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;struct udp_hdr *udp_hdr;struct rte_vxlan_hdr *vxlan_hdr;uint32_t sent_seq;
@@ -324,7 +324,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_hdr +sizeof (struct rte_vxlan_hdr )); ipv4_hdr = (struct rte_ipv4_hdr *)((char *)udp_hdr + pkt->l2_len); - tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); + tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);/* * Don't process the packet which has FIN, SYN, RST, PSH, URG,
lib/librte_gso/gso_common.h +2 -2
@@ -71,9 +71,9 @@ static inline void update_tcp_header(struct rte_mbuf *pkt, uint16_t l4_offset, uint32_t sent_seq, uint8_t non_tail) { - struct tcp_hdr *tcp_hdr; + struct rte_tcp_hdr *tcp_hdr; - tcp_hdr = (struct tcp_hdr *)(rte_pktmbuf_mtod(pkt, char *) + + tcp_hdr = (struct rte_tcp_hdr *)(rte_pktmbuf_mtod(pkt, char *) + l4_offset); tcp_hdr->sent_seq =rte_cpu_to_be_32 (sent_seq);if (likely (non_tail))
lib/librte_gso/gso_tcp4.c +2 -2
@@ -10,7 +10,7 @@ update_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta, struct rte_mbuf **segs, uint16_t nb_segs) {struct rte_ipv4_hdr *ipv4_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;uint32_t sent_seq;uint16_t id, tail_idx, i;uint16_t l3_offset = pkt->l2_len;
@@ -18,7 +18,7 @@ update_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta, ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char*) + l3_offset); - tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); + tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); id =rte_be_to_cpu_16 (ipv4_hdr->packet_id); sent_seq =rte_be_to_cpu_32 (tcp_hdr->sent_seq); tail_idx = nb_segs -1 ;
lib/librte_gso/gso_tunnel_tcp4.c +2 -2
@@ -10,7 +10,7 @@ update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta, struct rte_mbuf **segs, uint16_t nb_segs) {struct rte_ipv4_hdr *ipv4_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;uint32_t sent_seq;uint16_t outer_id, inner_id, tail_idx, i;uint16_t outer_ipv4_offset, inner_ipv4_offset;
@@ -32,7 +32,7 @@ update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta, inner_ipv4_offset); inner_id =rte_be_to_cpu_16 (ipv4_hdr->packet_id); - tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); + tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); sent_seq =rte_be_to_cpu_32 (tcp_hdr->sent_seq); tail_idx = nb_segs -1 ;
lib/librte_gso/rte_gso.h +1 -1
@@ -19,7 +19,7 @@ extern "C" {/* Minimum GSO segment size for TCP based packets. */ #define RTE_GSO_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \ - sizeof(struct rte_ipv4_hdr) + sizeof(struct tcp_hdr) + 1) + sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_tcp_hdr) + 1)/* Minimum GSO segment size for UDP based packets. */ #define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
lib/librte_net/rte_net.c +4 -4
@@ -360,8 +360,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, hdr_lens->l4_len =sizeof (struct udp_hdr );return pkt_type; }else if ((pkt_type &RTE_PTYPE_L4_MASK ) ==RTE_PTYPE_L4_TCP ) { -const struct tcp_hdr *th; -struct tcp_hdr th_copy; +const struct rte_tcp_hdr *th; +struct rte_tcp_hdr th_copy; th =rte_pktmbuf_read (m, off,sizeof (*th), &th_copy);if (unlikely (th ==NULL ))
@@ -496,8 +496,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, hdr_lens->inner_l4_len =sizeof (struct udp_hdr ); }else if ((pkt_type &RTE_PTYPE_INNER_L4_MASK ) ==RTE_PTYPE_INNER_L4_TCP ) { -const struct tcp_hdr *th; -struct tcp_hdr th_copy; +const struct rte_tcp_hdr *th; +struct rte_tcp_hdr th_copy; th =rte_pktmbuf_read (m, off,sizeof (*th), &th_copy);if (unlikely (th ==NULL ))
lib/librte_net/rte_net.h +4 -3
@@ -114,7 +114,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) {struct rte_ipv4_hdr *ipv4_hdr;struct rte_ipv6_hdr *ipv6_hdr; -struct tcp_hdr *tcp_hdr; +struct rte_tcp_hdr *tcp_hdr;struct udp_hdr *udp_hdr;uint64_t inner_l3_offset = m->l2_len;
@@ -170,7 +170,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) (ol_flags & PKT_TX_TCP_SEG)) {if (ol_flags &PKT_TX_IPV4 ) {/* non-TSO tcp or TSO */ - tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + + tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + m->l3_len); tcp_hdr->cksum =rte_ipv4_phdr_cksum (ipv4_hdr, ol_flags);
@@ -178,7 +178,8 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) ipv6_hdr =rte_pktmbuf_mtod_offset (m, struct rte_ipv6_hdr *, inner_l3_offset);/* non-TSO tcp or TSO */ - tcp_hdr = rte_pktmbuf_mtod_offset(m, struct tcp_hdr *, + tcp_hdr =rte_pktmbuf_mtod_offset (m, + struct rte_tcp_hdr *, inner_l3_offset + m->l3_len); tcp_hdr->cksum =rte_ipv6_phdr_cksum (ipv6_hdr, ol_flags);
lib/librte_net/rte_tcp.h +1 -1
@@ -23,7 +23,7 @@ extern "C" {/** * TCP Header */ -struct tcp_hdr { +struct rte_tcp_hdr {uint16_t src_port;/**< TCP source port. */ uint16_t dst_port;/**< TCP destination port. */ uint32_t sent_seq;/**< TX data sequence number. */
lib/librte_pipeline/rte_table_action.c +4 -4
@@ -1348,7 +1348,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip, {if (cfg->source_nat) {if (cfg->proto ==0x6 ) { -struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1 ]; +struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1 ];uint16_t ip_cksum, tcp_cksum; ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1387,7 +1387,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip, } }else {if (cfg->proto ==0x6 ) { -struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1 ]; +struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1 ];uint16_t ip_cksum, tcp_cksum; ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1434,7 +1434,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, {if (cfg->source_nat) {if (cfg->proto ==0x6 ) { -struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1 ]; +struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1 ];uint16_t tcp_cksum; tcp_cksum = nat_ipv6_tcp_udp_checksum_update(tcp->cksum,
@@ -1462,7 +1462,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, } }else {if (cfg->proto ==0x6 ) { -struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1 ]; +struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1 ];uint16_t tcp_cksum; tcp_cksum = nat_ipv6_tcp_udp_checksum_update(tcp->cksum,
lib/librte_vhost/virtio_net.c +3 -3
@@ -218,7 +218,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)switch (csum_l4) {case PKT_TX_TCP_CKSUM : - net_hdr->csum_offset = (offsetof(struct tcp_hdr , + net_hdr->csum_offset = (offsetof(struct rte_tcp_hdr , cksum));break ;case PKT_TX_UDP_CKSUM :
@@ -1015,7 +1015,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m) {uint16_t l4_proto =0 ;void *l4_hdr =NULL ; -struct tcp_hdr *tcp_hdr =NULL ; +struct rte_tcp_hdr *tcp_hdr =NULL ;if (hdr->flags ==0 && hdr->gso_type ==VIRTIO_NET_HDR_GSO_NONE )return ;
@@ -1024,7 +1024,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)if (hdr->flags ==VIRTIO_NET_HDR_F_NEEDS_CSUM ) {if (hdr->csum_start == (m->l2_len + m->l3_len)) {switch (hdr->csum_offset) { -case (offsetof(struct tcp_hdr , cksum)): +case (offsetof(struct rte_tcp_hdr , cksum)):if (l4_proto ==IPPROTO_TCP ) m->ol_flags |=PKT_TX_TCP_CKSUM ;break ;
Signature · 1 line
2.11.0
Quoted 424 lines · On Tue, 21 May 2019 18:13:00 +0200 Olivier Matz <[email protected]> wrote:
The
rte_netheaders conflict with the libc headers, because some definitions are duplicated, sometimes with few differences.This patchset adds the
rte_(orRTE_) prefix to all structures, functions and defines inrte_netlibrary. This is a big changeset, that will break the API of many functions, but not the ABI.This was discussed in [1], and requested by the techboard [2].
patch-v1:
* rease on top of v19.05
* remove uneeded renames indrivers/net/bonding/rte_eth_bond_pmd.candapp/test-pmd/icmpecho.c(arp-related variables)
* do not modify base drivers, except cxgbe, thunderx, enetc, qede:
only files that already contain dpdk definitions are modified.
* fix checkpatch issues when it does not impact the code style too much. Big warnings remain about theRTE_IPv4()macros because arguments are separated by ',' instead of ', '.
* add a release note patch
* tested compilation on x86_64-linux and x86_64-freebsd.rfc-v2:
* rebase on top of v19.05-rc1[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.htmlOlivier Matz (15):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure
doc: announce network api changeapp/pdump/main.c | 2 +- app/test-acl/main.c | 2 +- app/test-eventdev/test_perf_common.c | 2 +- app/test-eventdev/test_pipeline_common.c | 2 +- app/test-pipeline/pipeline_acl.c | 19 +- app/test-pipeline/pipeline_hash.c | 12 +- app/test-pmd/cmdline.c | 90 +++--- app/test-pmd/cmdline_flow.c | 86 +++--- app/test-pmd/config.c | 35 ++- app/test-pmd/csumonly.c | 169 +++++----- app/test-pmd/flowgen.c | 30 +- app/test-pmd/icmpecho.c | 117 +++---- app/test-pmd/ieee1588fwd.c | 18 +- app/test-pmd/macfwd.c | 12 +- app/test-pmd/macswap.h | 12 +- app/test-pmd/macswap_common.h | 4 +- app/test-pmd/macswap_neon.h | 12 +- app/test-pmd/macswap_sse.h | 12 +- app/test-pmd/parameters.c | 6 +- app/test-pmd/testpmd.c | 23 +- app/test-pmd/testpmd.h | 30 +- app/test-pmd/txonly.c | 45 +-- app/test-pmd/util.c | 34 +- app/test/packet_burst_generator.c | 150 ++++----- app/test/packet_burst_generator.h | 33 +- app/test/test_acl.c | 8 +- app/test/test_acl.h | 122 ++++---- app/test/test_cmdline_etheraddr.c | 16 +- app/test/test_efd.c | 20 +- app/test/test_event_eth_rx_adapter.c | 2 +- app/test/test_event_eth_tx_adapter.c | 2 +- app/test/test_flow_classify.c | 70 +++-- app/test/test_hash.c | 20 +- app/test/test_ipsec.c | 13 +- app/test/test_link_bonding.c | 342 ++++++++++++--------- app/test/test_link_bonding_mode4.c | 124 ++++---- app/test/test_link_bonding_rssconf.c | 6 +- app/test/test_lpm.c | 76 ++--- app/test/test_lpm_perf.c | 10 +- app/test/test_member.c | 20 +- app/test/test_pmd_perf.c | 20 +- app/test/test_sched.c | 24 +- app/test/test_table_acl.c | 8 +- app/test/test_thash.c | 12 +- app/test/virtual_pmd.c | 6 +- app/test/virtual_pmd.h | 2 +- doc/guides/nics/kni.rst | 2 +- doc/guides/prog_guide/bbdev.rst | 6 +- .../prog_guide/packet_classif_access_ctrl.rst | 18 +- doc/guides/prog_guide/rte_flow.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 4 - doc/guides/rel_notes/release_19_08.rst | 3 + doc/guides/sample_app_ug/flow_classify.rst | 28 +- doc/guides/sample_app_ug/flow_filtering.rst | 6 +- doc/guides/sample_app_ug/ip_frag.rst | 16 +- doc/guides/sample_app_ug/ip_reassembly.rst | 16 +- doc/guides/sample_app_ug/ipv4_multicast.rst | 16 +- doc/guides/sample_app_ug/l2_forward_job_stats.rst | 6 +- .../sample_app_ug/l2_forward_real_virtual.rst | 6 +- doc/guides/sample_app_ug/l3_forward.rst | 12 +- doc/guides/sample_app_ug/link_status_intr.rst | 6 +- doc/guides/sample_app_ug/ptpclient.rst | 6 +- doc/guides/sample_app_ug/rxtx_callbacks.rst | 2 +- doc/guides/sample_app_ug/server_node_efd.rst | 12 +- doc/guides/sample_app_ug/skeleton.rst | 4 +- doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst | 4 +- drivers/bus/dpaa/include/compat.h | 2 + drivers/bus/dpaa/include/fman.h | 2 +- drivers/bus/dpaa/include/netcfg.h | 4 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 8 +- drivers/net/ark/ark_ethdev.c | 19 +- drivers/net/ark/ark_ext.h | 4 +- drivers/net/ark/ark_global.h | 5 +- drivers/net/atlantic/atl_ethdev.c | 27 +- drivers/net/atlantic/hw_atl/hw_atl_utils.c | 8 +- drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 4 +- drivers/net/avp/avp_ethdev.c | 21 +- drivers/net/avp/rte_avp_common.h | 2 +- drivers/net/axgbe/axgbe_dev.c | 4 +- drivers/net/axgbe/axgbe_ethdev.c | 10 +- drivers/net/axgbe/axgbe_ethdev.h | 4 +- drivers/net/axgbe/axgbe_rxtx.c | 2 +- drivers/net/bnx2x/bnx2x.c | 16 +- drivers/net/bnx2x/bnx2x_ethdev.c | 5 +- drivers/net/bnx2x/bnx2x_ethdev.h | 3 +- drivers/net/bnx2x/bnx2x_vfpf.c | 8 +- drivers/net/bnx2x/bnx2x_vfpf.h | 2 +- drivers/net/bnx2x/ecore_sp.h | 2 +- drivers/net/bnxt/bnxt.h | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 80 ++--- drivers/net/bnxt/bnxt_filter.c | 4 +- drivers/net/bnxt/bnxt_filter.h | 8 +- drivers/net/bnxt/bnxt_flow.c | 27 +- drivers/net/bnxt/bnxt_hwrm.c | 41 +-- drivers/net/bnxt/bnxt_hwrm.h | 2 +- drivers/net/bnxt/bnxt_ring.c | 8 +- drivers/net/bnxt/bnxt_rxq.c | 2 +- drivers/net/bnxt/bnxt_rxr.c | 4 +- drivers/net/bnxt/bnxt_vnic.c | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 14 +- drivers/net/bnxt/rte_pmd_bnxt.h | 4 +- drivers/net/bonding/rte_eth_bond.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 30 +- drivers/net/bonding/rte_eth_bond_8023ad.h | 10 +- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 2 +- drivers/net/bonding/rte_eth_bond_alb.c | 98 +++--- drivers/net/bonding/rte_eth_bond_alb.h | 10 +- drivers/net/bonding/rte_eth_bond_api.c | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 203 ++++++------ drivers/net/bonding/rte_eth_bond_private.h | 8 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe.h | 5 +- drivers/net/cxgbe/cxgbe_compat.h | 1 + drivers/net/cxgbe/cxgbe_ethdev.c | 14 +- drivers/net/cxgbe/cxgbe_filter.h | 2 +- drivers/net/cxgbe/cxgbe_flow.c | 10 +- drivers/net/cxgbe/cxgbe_main.c | 4 +- drivers/net/cxgbe/cxgbe_pfvf.h | 2 +- drivers/net/cxgbe/cxgbevf_main.c | 2 +- drivers/net/cxgbe/l2t.c | 8 +- drivers/net/cxgbe/l2t.h | 2 +- drivers/net/cxgbe/mps_tcam.c | 14 +- drivers/net/cxgbe/mps_tcam.h | 4 +- drivers/net/cxgbe/sge.c | 9 +- drivers/net/dpaa/dpaa_ethdev.c | 20 +- drivers/net/dpaa/dpaa_rxtx.c | 23 +- drivers/net/dpaa2/dpaa2_ethdev.c | 37 +-- drivers/net/dpaa2/dpaa2_flow.c | 18 +- drivers/net/e1000/e1000_ethdev.h | 5 +- drivers/net/e1000/em_ethdev.c | 39 +-- drivers/net/e1000/em_rxtx.c | 24 +- drivers/net/e1000/igb_ethdev.c | 76 ++--- drivers/net/e1000/igb_flow.c | 12 +- drivers/net/e1000/igb_pf.c | 17 +- drivers/net/e1000/igb_rxtx.c | 23 +- drivers/net/ena/ena_ethdev.c | 17 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enetc/base/enetc_hw.h | 4 +- drivers/net/enetc/enetc_ethdev.c | 21 +- drivers/net/enic/enic.h | 4 +- drivers/net/enic/enic_clsf.c | 40 +-- drivers/net/enic/enic_ethdev.c | 29 +- drivers/net/enic/enic_flow.c | 114 +++---- drivers/net/enic/enic_main.c | 4 +- drivers/net/enic/enic_res.c | 5 +- drivers/net/failsafe/failsafe.c | 8 +- drivers/net/failsafe/failsafe_args.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 7 +- drivers/net/failsafe/failsafe_ops.c | 6 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 18 +- drivers/net/i40e/i40e_ethdev.c | 143 +++++---- drivers/net/i40e/i40e_ethdev.h | 23 +- drivers/net/i40e/i40e_ethdev_vf.c | 68 ++-- drivers/net/i40e/i40e_fdir.c | 127 ++++---- drivers/net/i40e/i40e_flow.c | 58 ++-- drivers/net/i40e/i40e_pf.c | 18 +- drivers/net/i40e/i40e_rxtx.c | 28 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 31 +- drivers/net/i40e/rte_pmd_i40e.h | 8 +- drivers/net/iavf/iavf.h | 4 +- drivers/net/iavf/iavf_ethdev.c | 53 ++-- drivers/net/iavf/iavf_rxtx.c | 14 +- drivers/net/iavf/iavf_vchnl.c | 8 +- drivers/net/ice/ice_ethdev.c | 64 ++-- drivers/net/ice/ice_ethdev.h | 6 +- drivers/net/ice/ice_rxtx.c | 28 +- drivers/net/ipn3ke/ipn3ke_ethdev.h | 6 +- drivers/net/ipn3ke/ipn3ke_flow.c | 4 +- drivers/net/ipn3ke/ipn3ke_representor.c | 21 +- drivers/net/ixgbe/ixgbe_ethdev.c | 107 ++++--- drivers/net/ixgbe/ixgbe_ethdev.h | 4 +- drivers/net/ixgbe/ixgbe_flow.c | 22 +- drivers/net/ixgbe/ixgbe_pf.c | 16 +- drivers/net/ixgbe/ixgbe_rxtx.c | 18 +- drivers/net/ixgbe/ixgbe_vf_representor.c | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 11 +- drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +- drivers/net/kni/rte_eth_kni.c | 6 +- drivers/net/liquidio/lio_ethdev.c | 23 +- drivers/net/mlx4/mlx4.c | 4 +- drivers/net/mlx4/mlx4.h | 10 +- drivers/net/mlx4/mlx4_ethdev.c | 12 +- drivers/net/mlx4/mlx4_flow.c | 16 +- drivers/net/mlx4/mlx4_rxtx.c | 2 +- drivers/net/mlx5/mlx5.c | 4 +- drivers/net/mlx5/mlx5.h | 15 +- drivers/net/mlx5/mlx5_flow.c | 22 +- drivers/net/mlx5/mlx5_flow_dv.c | 44 +-- drivers/net/mlx5/mlx5_flow_tcf.c | 66 ++-- drivers/net/mlx5/mlx5_flow_verbs.c | 30 +- drivers/net/mlx5/mlx5_mac.c | 18 +- drivers/net/mlx5/mlx5_nl.c | 28 +- drivers/net/mlx5/mlx5_rxtx.c | 6 +- drivers/net/mlx5/mlx5_rxtx.h | 2 +- drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 8 +- drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 10 +- drivers/net/mlx5/mlx5_trigger.c | 6 +- drivers/net/mvneta/mvneta_ethdev.c | 22 +- drivers/net/mvneta/mvneta_ethdev.h | 6 +- drivers/net/mvpp2/mrvl_ethdev.c | 22 +- drivers/net/mvpp2/mrvl_ethdev.h | 6 +- drivers/net/mvpp2/mrvl_flow.c | 4 +- drivers/net/netvsc/hn_ethdev.c | 4 +- drivers/net/netvsc/hn_nvs.c | 2 +- drivers/net/netvsc/hn_rndis.c | 2 +- drivers/net/netvsc/hn_rxtx.c | 12 +- drivers/net/netvsc/hn_var.h | 4 +- drivers/net/netvsc/hn_vf.c | 8 +- drivers/net/nfb/nfb_ethdev.c | 16 +- drivers/net/nfp/nfp_net.c | 22 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 6 +- drivers/net/octeontx/octeontx_ethdev.c | 9 +- drivers/net/octeontx/octeontx_ethdev.h | 2 +- drivers/net/pcap/rte_eth_pcap.c | 22 +- drivers/net/qede/base/bcm_osal.h | 4 +- drivers/net/qede/qede_ethdev.c | 71 +++-- drivers/net/qede/qede_ethdev.h | 6 +- drivers/net/qede/qede_filter.c | 68 ++-- drivers/net/qede/qede_if.h | 4 +- drivers/net/qede/qede_main.c | 6 +- drivers/net/qede/qede_rxtx.c | 34 +- drivers/net/qede/qede_rxtx.h | 2 +- drivers/net/ring/rte_eth_ring.c | 4 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ef10_tx.c | 4 +- drivers/net/sfc/sfc_ethdev.c | 24 +- drivers/net/sfc/sfc_flow.c | 12 +- drivers/net/sfc/sfc_port.c | 8 +- drivers/net/sfc/sfc_tso.c | 4 +- drivers/net/sfc/sfc_tso.h | 4 +- drivers/net/softnic/parser.c | 18 +- drivers/net/softnic/parser.h | 2 +- drivers/net/softnic/rte_eth_softnic.c | 2 +- drivers/net/softnic/rte_eth_softnic_flow.c | 4 +- drivers/net/softnic/rte_eth_softnic_pipeline.c | 40 +-- drivers/net/szedata2/rte_eth_szedata2.c | 8 +- drivers/net/tap/rte_eth_tap.c | 68 ++-- drivers/net/tap/rte_eth_tap.h | 4 +- drivers/net/tap/tap_bpf_program.c | 14 +- drivers/net/tap/tap_flow.c | 16 +- drivers/net/thunderx/base/nicvf_plat.h | 5 +- drivers/net/thunderx/nicvf_ethdev.c | 19 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 16 +- drivers/net/vhost/rte_eth_vhost.c | 12 +- drivers/net/virtio/virtio_ethdev.c | 78 ++--- drivers/net/virtio/virtio_pci.h | 4 +- drivers/net/virtio/virtio_rxtx.c | 33 +- drivers/net/virtio/virtio_user/vhost_kernel_tap.c | 2 +- drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +- drivers/net/virtio/virtio_user/virtio_user_dev.h | 2 +- drivers/net/virtio/virtio_user_ethdev.c | 8 +- drivers/net/virtio/virtqueue.h | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 12 +- drivers/net/vmxnet3/vmxnet3_ethdev.h | 2 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 47 +-- examples/bbdev_app/main.c | 41 +-- examples/bond/main.c | 83 ++--- examples/distributor/main.c | 4 +- examples/ethtool/ethtool-app/ethapp.c | 8 +- examples/ethtool/ethtool-app/main.c | 10 +- examples/ethtool/lib/rte_ethtool.c | 8 +- examples/ethtool/lib/rte_ethtool.h | 7 +- examples/eventdev_pipeline/main.c | 4 +- examples/eventdev_pipeline/pipeline_common.h | 10 +- examples/flow_classify/flow_classify.c | 30 +- examples/flow_filtering/main.c | 10 +- examples/ip_fragmentation/main.c | 69 +++-- examples/ip_pipeline/cli.c | 4 +- examples/ip_pipeline/kni.c | 2 +- examples/ip_pipeline/parser.c | 18 +- examples/ip_pipeline/parser.h | 2 +- examples/ip_pipeline/pipeline.c | 40 +-- examples/ip_reassembly/main.c | 51 +-- examples/ipsec-secgw/esp.c | 47 +-- examples/ipsec-secgw/ipsec-secgw.c | 43 +-- examples/ipsec-secgw/ipsec.h | 2 +- examples/ipsec-secgw/parser.c | 4 +- examples/ipsec-secgw/sa.c | 16 +- examples/ipv4_multicast/main.c | 60 ++-- examples/kni/main.c | 14 +- examples/l2fwd-cat/l2fwd-cat.c | 4 +- examples/l2fwd-crypto/main.c | 26 +- examples/l2fwd-jobstats/main.c | 8 +- examples/l2fwd-keepalive/main.c | 8 +- examples/l2fwd/main.c | 8 +- examples/l3fwd-acl/main.c | 106 ++++--- examples/l3fwd-power/main.c | 102 +++--- examples/l3fwd-vf/main.c | 68 ++-- examples/l3fwd/l3fwd.h | 8 +- examples/l3fwd/l3fwd_altivec.h | 26 +- examples/l3fwd/l3fwd_common.h | 4 +- examples/l3fwd/l3fwd_em.c | 46 +-- examples/l3fwd/l3fwd_em.h | 22 +- examples/l3fwd/l3fwd_em_hlm.h | 19 +- examples/l3fwd/l3fwd_em_hlm_neon.h | 20 +- examples/l3fwd/l3fwd_em_hlm_sse.h | 16 +- examples/l3fwd/l3fwd_em_sequential.h | 19 +- examples/l3fwd/l3fwd_lpm.c | 50 +-- examples/l3fwd/l3fwd_lpm.h | 22 +- examples/l3fwd/l3fwd_lpm_altivec.h | 20 +- examples/l3fwd/l3fwd_lpm_neon.h | 30 +- examples/l3fwd/l3fwd_lpm_sse.h | 20 +- examples/l3fwd/l3fwd_neon.h | 26 +- examples/l3fwd/l3fwd_sse.h | 26 +- examples/l3fwd/main.c | 20 +- examples/link_status_interrupt/main.c | 8 +- examples/load_balancer/runtime.c | 8 +- .../client_server_mp/mp_server/main.c | 2 +- examples/packet_ordering/main.c | 2 +- examples/performance-thread/l3fwd-thread/main.c | 337 ++++++++++---------- examples/ptpclient/ptpclient.c | 32 +- examples/qos_meter/main.c | 5 +- examples/qos_sched/init.c | 2 +- examples/quota_watermark/qw/main.c | 8 +- examples/rxtx_callbacks/main.c | 4 +- examples/server_node_efd/node/node.c | 6 +- examples/server_node_efd/server/main.c | 8 +- examples/skeleton/basicfwd.c | 4 +- examples/tep_termination/main.c | 2 +- examples/tep_termination/main.h | 2 +- examples/tep_termination/vxlan.c | 115 +++---- examples/tep_termination/vxlan.h | 8 +- examples/tep_termination/vxlan_setup.c | 32 +- examples/tep_termination/vxlan_setup.h | 2 +- examples/vhost/main.c | 42 +-- examples/vhost/main.h | 2 +- examples/vm_power_manager/channel_monitor.c | 12 +- .../guest_cli/vm_power_cli_guest.c | 2 +- examples/vm_power_manager/main.c | 6 +- examples/vmdq/main.c | 12 +- examples/vmdq_dcb/main.c | 12 +- lib/librte_ethdev/rte_class_eth.c | 4 +- lib/librte_ethdev/rte_eth_ctrl.h | 12 +- lib/librte_ethdev/rte_ethdev.c | 59 ++-- lib/librte_ethdev/rte_ethdev.h | 15 +- lib/librte_ethdev/rte_ethdev_core.h | 12 +- lib/librte_ethdev/rte_flow.h | 34 +- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 33 +- lib/librte_gro/gro_tcp4.c | 26 +- lib/librte_gro/gro_tcp4.h | 22 +- lib/librte_gro/gro_vxlan_tcp4.c | 66 ++-- lib/librte_gro/gro_vxlan_tcp4.h | 6 +- lib/librte_gso/gso_common.h | 16 +- lib/librte_gso/gso_tcp4.c | 12 +- lib/librte_gso/gso_tunnel_tcp4.c | 14 +- lib/librte_gso/gso_udp4.c | 10 +- lib/librte_gso/rte_gso.h | 8 +- lib/librte_hash/rte_thash.h | 3 +- lib/librte_ip_frag/rte_ip_frag.h | 13 +- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 42 +-- lib/librte_ip_frag/rte_ipv4_reassembly.c | 14 +- lib/librte_ip_frag/rte_ipv6_fragmentation.c | 28 +- lib/librte_ip_frag/rte_ipv6_reassembly.c | 6 +- lib/librte_ipsec/crypto.h | 2 +- lib/librte_ipsec/esp_inb.c | 10 +- lib/librte_ipsec/esp_outb.c | 8 +- lib/librte_ipsec/iph.h | 8 +- lib/librte_ipsec/sa.c | 10 +- lib/librte_kni/rte_kni.c | 4 +- lib/librte_kni/rte_kni.h | 2 +- lib/librte_net/rte_arp.c | 33 +- lib/librte_net/rte_arp.h | 36 +-- lib/librte_net/rte_esp.h | 2 +- lib/librte_net/rte_ether.h | 189 ++++++------ lib/librte_net/rte_gre.h | 2 +- lib/librte_net/rte_icmp.h | 6 +- lib/librte_net/rte_ip.h | 75 ++--- lib/librte_net/rte_net.c | 94 +++--- lib/librte_net/rte_net.h | 28 +- lib/librte_net/rte_sctp.h | 2 +- lib/librte_net/rte_tcp.h | 2 +-
Quoted 9 lines
lib/librte_net/rte_udp.h | 2 +- lib/librte_pipeline/rte_table_action.c | 242 ++++++++------- lib/librte_pipeline/rte_table_action.h | 4 +- lib/librte_port/rte_port_ras.c | 10 +- lib/librte_port/rte_port_source_sink.c | 6 +- lib/librte_vhost/vhost.h | 2 +- lib/librte_vhost/virtio_net.c | 43 +-- 385 files changed, 4563 insertions(+), 4234 deletions(-)
Looks good
PATCH 14/15 net: add rte prefix to udp structure
In reply to Olivier MatzAdd 'rte_' prefix to structures:
- rename struct udp_hdr as struct rte_udp_hdr.
--- app/test-pmd/csumonly.c | 27 ++++++++++++++------------- app/test-pmd/flowgen.c | 4 ++-- app/test-pmd/txonly.c | 8 ++++---- app/test-pmd/util.c | 6 +++--- app/test/packet_burst_generator.c | 12 ++++++------ app/test/packet_burst_generator.h | 4 ++-- app/test/test_flow_classify.c | 2 +- app/test/test_link_bonding.c | 4 ++-- app/test/test_link_bonding_mode4.c | 2 +- app/test/test_pmd_perf.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 6 +++--- drivers/net/dpaa/dpaa_rxtx.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_rxtx.c | 3 ++- drivers/net/enic/enic_clsf.c | 8 ++++---- drivers/net/enic/enic_flow.c | 24 ++++++++++++------------ drivers/net/i40e/i40e_fdir.c | 25 +++++++++++++------------ drivers/net/i40e/i40e_rxtx.c | 2 +- drivers/net/iavf/iavf_rxtx.c | 2 +- drivers/net/ice/ice_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 3 ++- drivers/net/mlx5/mlx5_flow.c | 8 ++++---- drivers/net/mlx5/mlx5_flow_dv.c | 4 ++-- drivers/net/qede/qede_filter.c | 14 +++++++------- drivers/net/tap/rte_eth_tap.c | 2 +- drivers/net/virtio/virtio_rxtx.c | 2 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 4 +++- examples/l3fwd-power/main.c | 8 ++++---- examples/l3fwd-vf/main.c | 4 ++-- examples/tep_termination/vxlan.c | 16 ++++++++-------- lib/librte_ethdev/rte_flow.h | 2 +- lib/librte_gro/gro_vxlan_tcp4.c | 10 +++++----- lib/librte_gso/gso_common.h | 4 ++-- lib/librte_gso/rte_gso.h | 2 +- lib/librte_net/rte_ether.h | 4 ++-- lib/librte_net/rte_net.c | 4 ++-- lib/librte_net/rte_net.h | 7 ++++--- lib/librte_net/rte_udp.h | 2 +- lib/librte_pipeline/rte_table_action.c | 32 ++++++++++++++++---------------- lib/librte_vhost/virtio_net.c | 6 +++--- 40 files changed, 146 insertions(+), 139 deletions(-)
app/test-pmd/csumonly.c +14 -13
@@ -113,7 +113,7 @@ parse_ipv4(struct rte_ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info) ((char *)ipv4_hdr + info->l3_len); info->l4_len = (tcp_hdr->data_off &0xf0 ) >>2 ; }else if (info->l4_proto ==IPPROTO_UDP ) - info->l4_len =sizeof (struct udp_hdr ); + info->l4_len =sizeof (struct rte_udp_hdr );else info->l4_len =0 ; }
@@ -133,7 +133,7 @@ parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info) ((char *)ipv6_hdr + info->l3_len); info->l4_len = (tcp_hdr->data_off &0xf0 ) >>2 ; }else if (info->l4_proto ==IPPROTO_UDP ) - info->l4_len =sizeof (struct udp_hdr ); + info->l4_len =sizeof (struct rte_udp_hdr );else info->l4_len =0 ; }
@@ -181,7 +181,7 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)/* Parse a vxlan header */ static void -parse_vxlan (struct udp_hdr *udp_hdr, +parse_vxlan (struct rte_udp_hdr *udp_hdr,struct testpmd_offload_info *info,uint32_t pkt_type) {
@@ -201,7 +201,7 @@ parse_vxlan(struct udp_hdr *udp_hdr, info->outer_l4_proto = info->l4_proto; eth_hdr = (struct rte_ether_hdr *)((char *)udp_hdr + -sizeof (struct udp_hdr ) + +sizeof (struct rte_udp_hdr ) +sizeof (struct rte_vxlan_hdr ));parse_ethernet (eth_hdr, info);
@@ -210,7 +210,7 @@ parse_vxlan(struct udp_hdr *udp_hdr,/* Parse a vxlan-gpe header */ static void -parse_vxlan_gpe (struct udp_hdr *udp_hdr, +parse_vxlan_gpe (struct rte_udp_hdr *udp_hdr,struct testpmd_offload_info *info) {struct rte_ether_hdr *eth_hdr;
@@ -224,7 +224,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,return ; vxlan_gpe_hdr = (struct rte_vxlan_gpe_hdr *)((char *)udp_hdr + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr ));if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==RTE_VXLAN_GPE_TYPE_IPV4 ) {
@@ -368,7 +368,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info, uint64_t tx_offloads) {struct rte_ipv4_hdr *ipv4_hdr = l3_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;struct rte_tcp_hdr *tcp_hdr;struct rte_sctp_hdr *sctp_hdr;uint64_t ol_flags =0 ;
@@ -408,7 +408,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,return 0 ;/* packet type not supported, nothing to do */ if (info->l4_proto ==IPPROTO_UDP ) { - udp_hdr = (struct udp_hdr *)((char *)l3_hdr + info->l3_len); + udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len);/* do not recalculate udp cksum if it was 0 */ if (udp_hdr->dgram_cksum !=0 ) { udp_hdr->dgram_cksum =0 ;
@@ -461,7 +461,7 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info, {struct rte_ipv4_hdr *ipv4_hdr = outer_l3_hdr;struct rte_ipv6_hdr *ipv6_hdr = outer_l3_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;uint64_t ol_flags =0 ;if (info->outer_ethertype ==_htons (RTE_ETHER_TYPE_IPv4)) {
@@ -484,7 +484,8 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,return ol_flags; } - udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len); + udp_hdr = (struct rte_udp_hdr *) + ((char *)outer_l3_hdr + info->outer_l3_len);/* outer UDP checksum is done in software. In the other side, for * UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
@@ -782,10 +783,10 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)/* check if it's a supported tunnel */ if (txp->parse_tunnel) {if (info.l4_proto ==IPPROTO_UDP ) { -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr; - udp_hdr = (struct udp_hdr *)((char *)l3_hdr + - info.l3_len); + udp_hdr = (struct rte_udp_hdr *) + ((char *)l3_hdr + info.l3_len);parse_vxlan_gpe (udp_hdr, &info);if (info.is_tunnel) { tx_ol_flags |=PKT_TX_TUNNEL_VXLAN_GPE ;
app/test-pmd/flowgen.c +2 -2
@@ -121,7 +121,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)struct rte_mbuf *pkt;struct rte_ether_hdr *eth_hdr;struct rte_ipv4_hdr *ip_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;uint16_t vlan_tci, vlan_tci_outer;uint64_t ol_flags =0 ;uint16_t nb_rx;
@@ -193,7 +193,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) sizeof(*ip_hdr));/* Initialize UDP header. */ - udp_hdr = (struct udp_hdr *)(ip_hdr +1 ); + udp_hdr = (struct rte_udp_hdr *)(ip_hdr +1 ); udp_hdr->src_port =rte_cpu_to_be_16 (cfg_udp_src); udp_hdr->dst_port =rte_cpu_to_be_16 (cfg_udp_dst); udp_hdr->dgram_cksum =0 ;/* No UDP checksum. */
app/test-pmd/txonly.c +4 -4
@@ -55,7 +55,7 @@ uint32_t tx_ip_dst_addr = (192U << 24) | (18 << 16) | (0 << 8) | 2;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. */ +static struct rte_udp_hdr pkt_udp_hdr;/**< UDP header of tx packets. */ static void copy_buf_to_pkt_segs(void* buf, unsigned len, struct rte_mbuf *pkt,
@@ -96,7 +96,7 @@ copy_buf_to_pkt(void* buf, unsigned len, struct rte_mbuf *pkt, unsigned offset)static void setup_pkt_udp_ip_headers (struct rte_ipv4_hdr *ip_hdr, -struct udp_hdr *udp_hdr, +struct rte_udp_hdr *udp_hdr,uint16_t pkt_data_len) {uint16_t *ptr16;
@@ -106,7 +106,7 @@ setup_pkt_udp_ip_headers(struct rte_ipv4_hdr *ip_hdr,/* * Initialize UDP header. */ - pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct udp_hdr )); + pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct rte_udp_hdr )); udp_hdr->src_port =rte_cpu_to_be_16 (tx_udp_src_port); udp_hdr->dst_port =rte_cpu_to_be_16 (tx_udp_dst_port); udp_hdr->dgram_len =RTE_CPU_TO_BE_16 (pkt_len);
@@ -350,7 +350,7 @@ tx_only_begin(__attribute__((unused)) portid_t pi) pkt_data_len = (uint16_t ) (tx_pkt_length - (sizeof (struct rte_ether_hdr ) +sizeof (struct rte_ipv4_hdr ) + -sizeof (struct udp_hdr ))); +sizeof (struct rte_udp_hdr )));setup_pkt_udp_ip_headers (&pkt_ip_hdr, &pkt_udp_hdr, pkt_data_len); }
app/test-pmd/util.c +3 -3
@@ -105,7 +105,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],if (is_encapsulation) {struct rte_ipv4_hdr *ipv4_hdr;struct rte_ipv6_hdr *ipv6_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;uint8_t l2_len;uint8_t l3_len;uint8_t l4_len;
@@ -130,9 +130,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], }if (l4_proto ==IPPROTO_UDP ) { udp_hdr =rte_pktmbuf_mtod_offset (mb, - struct udp_hdr *, + struct rte_udp_hdr *, l2_len + l3_len); - l4_len =sizeof (struct udp_hdr ); + l4_len =sizeof (struct rte_udp_hdr ); vxlan_hdr =rte_pktmbuf_mtod_offset (mb, struct rte_vxlan_hdr *, l2_len + l3_len + l4_len);
app/test/packet_burst_generator.c +6 -6
@@ -93,12 +93,12 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, }uint16_t -initialize_udp_header (struct udp_hdr *udp_hdr,uint16_t src_port, +initialize_udp_header (struct rte_udp_hdr *udp_hdr,uint16_t src_port,uint16_t dst_port,uint16_t pkt_data_len) {uint16_t pkt_len; - pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct udp_hdr )); + pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct rte_udp_hdr )); udp_hdr->src_port =rte_cpu_to_be_16 (src_port); udp_hdr->dst_port =rte_cpu_to_be_16 (dst_port);
@@ -129,7 +129,7 @@ initialize_sctp_header(struct rte_sctp_hdr *sctp_hdr, uint16_t src_port, {uint16_t pkt_len; - pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct udp_hdr )); + pkt_len = (uint16_t ) (pkt_data_len +sizeof (struct rte_udp_hdr )); sctp_hdr->src_port =rte_cpu_to_be_16 (src_port); sctp_hdr->dst_port =rte_cpu_to_be_16 (dst_port);
@@ -260,7 +260,7 @@ initialize_ipv4_header_proto(struct rte_ipv4_hdr *ip_hdr, uint32_t src_addr,int generate_packet_burst (struct rte_mempool *mp,struct rte_mbuf **pkts_burst,struct rte_ether_hdr *eth_hdr,uint8_t vlan_enabled, -void *ip_hdr,uint8_t ipv4,struct udp_hdr *udp_hdr, +void *ip_hdr,uint8_t ipv4,struct rte_udp_hdr *udp_hdr,int nb_pkt_per_burst,uint8_t pkt_len,uint8_t nb_pkt_segs) {int i, nb_pkt =0 ;
@@ -390,7 +390,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,switch (proto) {case IPPROTO_UDP :copy_buf_to_pkt (proto_hdr, -sizeof (struct udp_hdr ), pkt, +sizeof (struct rte_udp_hdr ), pkt, eth_hdr_size +sizeof (struct rte_ipv4_hdr ));break ;
@@ -415,7 +415,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,switch (proto) {case IPPROTO_UDP :copy_buf_to_pkt (proto_hdr, -sizeof (struct udp_hdr ), pkt, +sizeof (struct rte_udp_hdr ), pkt, eth_hdr_size +sizeof (struct rte_ipv6_hdr ));break ;
app/test/packet_burst_generator.h +2 -2
@@ -35,7 +35,7 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, uint32_t src_ip, uint32_t dst_ip, uint32_t opcode);uint16_t -initialize_udp_header (struct udp_hdr *udp_hdr,uint16_t src_port, +initialize_udp_header (struct rte_udp_hdr *udp_hdr,uint16_t src_port,uint16_t dst_port,uint16_t pkt_data_len);uint16_t
@@ -61,7 +61,7 @@ initialize_ipv4_header_proto(struct rte_ipv4_hdr *ip_hdr, uint32_t src_addr,int generate_packet_burst (struct rte_mempool *mp,struct rte_mbuf **pkts_burst,struct rte_ether_hdr *eth_hdr,uint8_t vlan_enabled, -void *ip_hdr,uint8_t ipv4,struct udp_hdr *udp_hdr, +void *ip_hdr,uint8_t ipv4,struct rte_udp_hdr *udp_hdr,int nb_pkt_per_burst,uint8_t pkt_len,uint8_t nb_pkt_segs);int
app/test/test_flow_classify.c +1 -1
@@ -493,7 +493,7 @@ init_ipv4_udp_traffic(struct rte_mempool *mp, {struct rte_ether_hdr pkt_eth_hdr;struct rte_ipv4_hdr pkt_ipv4_hdr; -struct udp_hdr pkt_udp_hdr; +struct rte_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 );uint16_t src_port =32 ;
app/test/test_link_bonding.c +2 -2
@@ -80,13 +80,13 @@ struct link_bonding_unittest_params {struct rte_ether_hdr *pkt_eth_hdr;struct rte_ipv4_hdr *pkt_ipv4_hdr;struct rte_ipv6_hdr *pkt_ipv6_hdr; -struct udp_hdr *pkt_udp_hdr; +struct rte_udp_hdr *pkt_udp_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 rte_udp_hdr pkt_udp_hdr;static struct link_bonding_unittest_params default_params = { .bonded_port_id =-1 ,
app/test/test_link_bonding_mode4.c +1 -1
@@ -733,7 +733,7 @@ generate_packets(struct rte_ether_addr *src_mac,uint32_t ip_dst[4 ] = { [0 ...2 ] =0xFEEDFACE , [3 ] =RTE_IPv4 (192 ,168 ,0 ,2 ) };struct rte_ether_hdr pkt_eth_hdr; -struct udp_hdr pkt_udp_hdr; +struct rte_udp_hdr pkt_udp_hdr;union {struct rte_ipv4_hdr v4;struct rte_ipv6_hdr v6;
app/test/test_pmd_perf.c +1 -1
@@ -184,7 +184,7 @@ init_traffic(struct rte_mempool *mp, {struct rte_ether_hdr pkt_eth_hdr;struct rte_ipv4_hdr pkt_ipv4_hdr; -struct udp_hdr pkt_udp_hdr; +struct rte_udp_hdr pkt_udp_hdr;uint32_t pktlen;static uint8_t src_mac[] = {0x00 ,0xFF ,0xAA ,0xFF ,0xAA ,0xFF };static uint8_t dst_mac[] = {0x00 ,0xAA ,0xFF ,0xAA ,0xFF ,0xAA };
drivers/net/bonding/rte_eth_bond_pmd.c +3 -3
@@ -839,7 +839,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,size_t vlan_offset;int i; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;struct rte_tcp_hdr *tcp_hdr;uint32_t hash, l3hash, l4hash;
@@ -874,7 +874,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, l4hash =HASH_L4_PORTS (tcp_hdr); }else if (ipv4_hdr->next_proto_id ==IPPROTO_UDP ) { - udp_hdr = (struct udp_hdr *) + udp_hdr = (struct rte_udp_hdr *) ((char *)ipv4_hdr + ip_hdr_offset); if ((size_t)udp_hdr + sizeof(*udp_hdr)
@@ -891,7 +891,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, tcp_hdr = (struct rte_tcp_hdr *)(ipv6_hdr +1 ); l4hash =HASH_L4_PORTS (tcp_hdr); }else if (ipv6_hdr->proto ==IPPROTO_UDP ) { - udp_hdr = (struct udp_hdr *)(ipv6_hdr +1 ); + udp_hdr = (struct rte_udp_hdr *)(ipv6_hdr +1 ); l4hash =HASH_L4_PORTS (udp_hdr); } }
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -230,7 +230,7 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf) tcp_hdr); }else if ((mbuf->packet_type &RTE_PTYPE_L4_MASK ) ==RTE_PTYPE_L4_UDP ) { -struct udp_hdr *udp_hdr = (struct udp_hdr *)(l3_hdr + +struct rte_udp_hdr *udp_hdr = (struct rte_udp_hdr *)(l3_hdr + mbuf->l3_len); udp_hdr->dgram_cksum =0 ;if (eth_hdr->ether_type ==htons (RTE_ETHER_TYPE_IPv4))
drivers/net/e1000/em_rxtx.c +1 -1
@@ -244,7 +244,7 @@ em_set_xmit_ctx(struct em_tx_queue* txq,switch (flags &PKT_TX_L4_MASK ) {case PKT_TX_UDP_CKSUM : ctx.upper_setup.tcp_fields.tucso = (uint8_t )(ipcse + - offsetof(struct udp_hdr , dgram_cksum)); + offsetof(struct rte_udp_hdr , dgram_cksum)); cmp_mask |=TX_MACIP_LEN_CMP_MASK ;break ;case PKT_TX_TCP_CKSUM :
drivers/net/e1000/igb_rxtx.c +2 -1
@@ -289,7 +289,8 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq,case PKT_TX_UDP_CKSUM : type_tucmd_mlhl |=E1000_ADVTXD_TUCMD_L4T_UDP |E1000_ADVTXD_DTYP_CTXT |E1000_ADVTXD_DCMD_DEXT ; - mss_l4len_idx |=sizeof (struct udp_hdr ) <<E1000_ADVTXD_L4LEN_SHIFT ; + mss_l4len_idx |=sizeof (struct rte_udp_hdr ) + <<E1000_ADVTXD_L4LEN_SHIFT ;break ;case PKT_TX_TCP_CKSUM : type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP |
drivers/net/enic/enic_clsf.c +4 -4
@@ -120,7 +120,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input,memset (gp,0 ,sizeof (*gp));if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV4_UDP ) { -struct udp_hdr udp_mask, udp_val; +struct rte_udp_hdr udp_mask, udp_val;memset (&udp_mask,0 ,sizeof (udp_mask));memset (&udp_val,0 ,sizeof (udp_val));
@@ -134,7 +134,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, }enic_set_layer (gp,FILTER_GENERIC_1_UDP ,FILTER_GENERIC_1_L4 , - &udp_mask, &udp_val,sizeof (struct udp_hdr )); + &udp_mask, &udp_val,sizeof (struct rte_udp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV4_TCP ) {struct rte_tcp_hdr tcp_mask, tcp_val;memset (&tcp_mask,0 ,sizeof (tcp_mask));
@@ -216,7 +216,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, }if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV6_UDP ) { -struct udp_hdr udp_mask, udp_val; +struct rte_udp_hdr udp_mask, udp_val;memset (&udp_mask,0 ,sizeof (udp_mask));memset (&udp_val,0 ,sizeof (udp_val));
@@ -229,7 +229,7 @@ copy_fltr_v2(struct filter_v2 *fltr, const struct rte_eth_fdir_input *input, udp_val.dst_port = input->flow.udp6_flow.dst_port; }enic_set_layer (gp,FILTER_GENERIC_1_UDP ,FILTER_GENERIC_1_L4 , - &udp_mask, &udp_val,sizeof (struct udp_hdr )); + &udp_mask, &udp_val,sizeof (struct rte_udp_hdr )); }else if (input->flow_type ==RTE_ETH_FLOW_NONFRAG_IPV6_TCP ) {struct rte_tcp_hdr tcp_mask, tcp_val;memset (&tcp_mask,0 ,sizeof (tcp_mask));
drivers/net/enic/enic_flow.c +12 -12
@@ -449,7 +449,7 @@ enic_copy_item_udp_v1(struct copy_item_args *arg)const struct rte_flow_item_udp *spec = item->spec;const struct rte_flow_item_udp *mask = item->mask;struct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4; -struct udp_hdr supported_mask = { +struct rte_udp_hdr supported_mask = { .src_port =0xffff , .dst_port =0xffff , };
@@ -639,7 +639,7 @@ enic_copy_item_inner_udp_v2(struct copy_item_args *arg) mask = &rte_flow_item_udp_mask;/* Append udp header to L5 and set ip proto = udp */ return copy_inner_common (&arg->filter->u.generic_1, off, - arg->item->spec, mask,sizeof (struct udp_hdr ), + arg->item->spec, mask,sizeof (struct rte_udp_hdr ), arg->l3_proto_off,IPPROTO_UDP ,1 ); }
@@ -831,9 +831,9 @@ enic_copy_item_udp_v2(struct copy_item_args *arg) mask = &rte_flow_item_udp_mask;memcpy (gp->layer[FILTER_GENERIC_1_L4 ].mask, &mask->hdr, -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr ));memcpy (gp->layer[FILTER_GENERIC_1_L4 ].val, &spec->hdr, -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr ));return 0 ; }
@@ -925,7 +925,7 @@ enic_copy_item_vxlan_v2(struct copy_item_args *arg)const struct rte_flow_item_vxlan *spec = item->spec;const struct rte_flow_item_vxlan *mask = item->mask;struct filter_generic_1 *gp = &enic_filter->u.generic_1; -struct udp_hdr *udp; +struct rte_udp_hdr *udp;FLOW_TRACE ();
@@ -935,9 +935,9 @@ enic_copy_item_vxlan_v2(struct copy_item_args *arg)*/ gp->mask_flags |=FILTER_GENERIC_1_UDP ; gp->val_flags |=FILTER_GENERIC_1_UDP ; - udp = (struct udp_hdr *)gp->layer[FILTER_GENERIC_1_L4 ].mask; + udp = (struct rte_udp_hdr *)gp->layer[FILTER_GENERIC_1_L4 ].mask; udp->dst_port =0xffff ; - udp = (struct udp_hdr *)gp->layer[FILTER_GENERIC_1_L4 ].val; + udp = (struct rte_udp_hdr *)gp->layer[FILTER_GENERIC_1_L4 ].val; udp->dst_port =RTE_BE16 (4789 );/* Match all if no spec */ if (!spec)
@@ -983,7 +983,7 @@ enic_copy_item_raw_v2(struct copy_item_args *arg)return EINVAL ;/* Need non-null pattern that fits within the NIC's filter pattern */ if (spec->length ==0 || - spec->length +sizeof (struct udp_hdr ) >FILTER_GENERIC_1_KEY_LEN || + spec->length +sizeof (struct rte_udp_hdr ) >FILTER_GENERIC_1_KEY_LEN || !spec->pattern || !mask->pattern)return EINVAL ;/*
@@ -996,9 +996,9 @@ enic_copy_item_raw_v2(struct copy_item_args *arg)*/ if (mask->length !=0 && mask->length < spec->length)return EINVAL ; -memcpy (gp->layer[FILTER_GENERIC_1_L4 ].mask +sizeof (struct udp_hdr ), +memcpy (gp->layer[FILTER_GENERIC_1_L4 ].mask +sizeof (struct rte_udp_hdr ), mask->pattern, spec->length); -memcpy (gp->layer[FILTER_GENERIC_1_L4 ].val +sizeof (struct udp_hdr ), +memcpy (gp->layer[FILTER_GENERIC_1_L4 ].val +sizeof (struct rte_udp_hdr ), spec->pattern, spec->length);return 0 ;
@@ -1052,9 +1052,9 @@ fixup_l5_layer(struct enic *enic, struct filter_generic_1 *gp,return ;FLOW_TRACE (); vxlan =sizeof (struct rte_vxlan_hdr ); -memcpy (gp->layer[FILTER_GENERIC_1_L4 ].mask +sizeof (struct udp_hdr ), +memcpy (gp->layer[FILTER_GENERIC_1_L4 ].mask +sizeof (struct rte_udp_hdr ), gp->layer[FILTER_GENERIC_1_L5 ].mask, vxlan); -memcpy (gp->layer[FILTER_GENERIC_1_L4 ].val +sizeof (struct udp_hdr ), +memcpy (gp->layer[FILTER_GENERIC_1_L4 ].val +sizeof (struct rte_udp_hdr ), gp->layer[FILTER_GENERIC_1_L5 ].val, vxlan); inner = inner_ofst - vxlan;memset (layer,0 ,sizeof (layer));
drivers/net/i40e/i40e_fdir.c +13 -12
@@ -799,7 +799,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, unsigned char *raw_pkt) {unsigned char *payload, *ptr; -struct udp_hdr *udp; +struct rte_udp_hdr *udp;struct rte_tcp_hdr *tcp;struct rte_sctp_hdr *sctp;uint8_t size, dst =0 ;
@@ -815,8 +815,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,/* fill the L4 head */ switch (fdir_input->flow_type) {case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : - udp = (struct udp_hdr *)(raw_pkt + len); - payload = (unsigned char *)udp +sizeof (struct udp_hdr ); + udp = (struct rte_udp_hdr *)(raw_pkt + len); + payload = (unsigned char *)udp +sizeof (struct rte_udp_hdr );/* * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -860,8 +860,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,break ;case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : - udp = (struct udp_hdr *)(raw_pkt + len); - payload = (unsigned char *)udp +sizeof (struct udp_hdr ); + udp = (struct rte_udp_hdr *)(raw_pkt + len); + payload = (unsigned char *)udp +sizeof (struct rte_udp_hdr );/* * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -1089,7 +1089,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, {unsigned char *payload =NULL ;unsigned char *ptr; -struct udp_hdr *udp; +struct rte_udp_hdr *udp;struct rte_tcp_hdr *tcp;struct rte_sctp_hdr *sctp;struct rte_flow_item_gtp *gtp;
@@ -1116,8 +1116,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,/* fill the L4 head */ if (pctype ==I40E_FILTER_PCTYPE_NONF_IPV4_UDP ) { - udp = (struct udp_hdr *)(raw_pkt + len); - payload = (unsigned char *)udp +sizeof (struct udp_hdr ); + udp = (struct rte_udp_hdr *)(raw_pkt + len); + payload = (unsigned char *)udp +sizeof (struct rte_udp_hdr );/** * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -1153,8 +1153,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, payload = raw_pkt + len; set_idx =I40E_FLXPLD_L3_IDX ; }else if (pctype ==I40E_FILTER_PCTYPE_NONF_IPV6_UDP ) { - udp = (struct udp_hdr *)(raw_pkt + len); - payload = (unsigned char *)udp +sizeof (struct udp_hdr ); + udp = (struct rte_udp_hdr *)(raw_pkt + len); + payload = (unsigned char *)udp +sizeof (struct rte_udp_hdr );/** * The source and destination fields in the transmitted packet * need to be presented in a reversed order with respect
@@ -1206,12 +1206,13 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf, cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 || cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 || cus_pctype->index == I40E_CUSTOMIZED_GTPU) { - udp = (struct udp_hdr *)(raw_pkt + len); + udp = (struct rte_udp_hdr *)(raw_pkt + len); udp->dgram_len =rte_cpu_to_be_16 (I40E_FDIR_UDP_DEFAULT_LEN ); gtp = (struct rte_flow_item_gtp *) - ((unsigned char *)udp +sizeof (struct udp_hdr )); + ((unsigned char *)udp + +sizeof (struct rte_udp_hdr )); gtp->msg_len =rte_cpu_to_be_16 (I40E_FDIR_GTP_DEFAULT_LEN ); gtp->teid = fdir_input->flow.gtp_flow.teid;
drivers/net/i40e/i40e_rxtx.c +1 -1
@@ -312,7 +312,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,break ;case PKT_TX_UDP_CKSUM : *td_cmd |=I40E_TX_DESC_CMD_L4T_EOFT_UDP ; - *td_offset |= (sizeof (struct udp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_udp_hdr ) >>2 ) <<I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT ;break ;default :
drivers/net/iavf/iavf_rxtx.c +1 -1
@@ -1427,7 +1427,7 @@ iavf_txd_enable_checksum(uint64_t ol_flags,break ;case PKT_TX_UDP_CKSUM : *td_cmd |=IAVF_TX_DESC_CMD_L4T_EOFT_UDP ; - *td_offset |= (sizeof (struct udp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_udp_hdr ) >>2 ) <<IAVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT ;break ;default :
drivers/net/ice/ice_rxtx.c +1 -1
@@ -1772,7 +1772,7 @@ ice_txd_enable_checksum(uint64_t ol_flags,break ;case PKT_TX_UDP_CKSUM : *td_cmd |=ICE_TX_DESC_CMD_L4T_EOFT_UDP ; - *td_offset |= (sizeof (struct udp_hdr ) >>2 ) << + *td_offset |= (sizeof (struct rte_udp_hdr ) >>2 ) <<ICE_TX_DESC_LEN_L4_LEN_S ;break ;default :
drivers/net/ixgbe/ixgbe_rxtx.c +2 -1
@@ -422,7 +422,8 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,case PKT_TX_UDP_CKSUM : type_tucmd_mlhl |=IXGBE_ADVTXD_TUCMD_L4T_UDP |IXGBE_ADVTXD_DTYP_CTXT |IXGBE_ADVTXD_DCMD_DEXT ; - mss_l4len_idx |=sizeof (struct udp_hdr ) <<IXGBE_ADVTXD_L4LEN_SHIFT ; + mss_l4len_idx |=sizeof (struct rte_udp_hdr ) + <<IXGBE_ADVTXD_L4LEN_SHIFT ; tx_offload_mask.l2_len |= ~0 ; tx_offload_mask.l3_len |= ~0 ;break ;
drivers/net/mlx5/mlx5_flow.c +4 -4
@@ -2602,11 +2602,11 @@ flow_fdir_filter_convert(struct rte_eth_dev *dev,/* Handle L4. */ switch (fdir_filter->input.flow_type) {case RTE_ETH_FLOW_NONFRAG_IPV4_UDP : - attributes->l4.udp.hdr = (struct udp_hdr ){ + attributes->l4.udp.hdr = (struct rte_udp_hdr ){ .src_port = input->flow.udp4_flow.src_port, .dst_port = input->flow.udp4_flow.dst_port, }; - attributes->l4_mask.udp.hdr = (struct udp_hdr ){ + attributes->l4_mask.udp.hdr = (struct rte_udp_hdr ){ .src_port = mask->src_port_mask, .dst_port = mask->dst_port_mask, };
@@ -2632,11 +2632,11 @@ flow_fdir_filter_convert(struct rte_eth_dev *dev, };break ;case RTE_ETH_FLOW_NONFRAG_IPV6_UDP : - attributes->l4.udp.hdr = (struct udp_hdr ){ + attributes->l4.udp.hdr = (struct rte_udp_hdr ){ .src_port = input->flow.udp6_flow.src_port, .dst_port = input->flow.udp6_flow.dst_port, }; - attributes->l4_mask.udp.hdr = (struct udp_hdr ){ + attributes->l4_mask.udp.hdr = (struct rte_udp_hdr ){ .src_port = mask->src_port_mask, .dst_port = mask->dst_port_mask, };
drivers/net/mlx5/mlx5_flow_dv.c +2 -2
@@ -1215,7 +1215,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf,struct rte_vlan_hdr *vlan =NULL ;struct rte_ipv4_hdr *ipv4 =NULL ;struct rte_ipv6_hdr *ipv6 =NULL ; -struct udp_hdr *udp =NULL ; +struct rte_udp_hdr *udp =NULL ;struct rte_vxlan_hdr *vxlan =NULL ;struct rte_vxlan_gpe_hdr *vxlan_gpe =NULL ;struct rte_gre_hdr *gre =NULL ;
@@ -1286,7 +1286,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, ipv6->hop_limits =MLX5_ENCAP_IPV6_HOP_LIMIT ;break ;case RTE_FLOW_ITEM_TYPE_UDP : - udp = (struct udp_hdr *)&buf[temp_size]; + udp = (struct rte_udp_hdr *)&buf[temp_size];if (!ipv4 && !ipv6) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
drivers/net/qede/qede_filter.c +7 -7
@@ -459,7 +459,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,uint8_t *raw_pkt;struct rte_ipv4_hdr *ip;struct rte_ipv6_hdr *ip6; -struct udp_hdr *udp; +struct rte_udp_hdr *udp;struct rte_tcp_hdr *tcp;uint16_t len;
@@ -487,13 +487,13 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, raw_pkt = (uint8_t *)buff;/* UDP */ if (arfs->tuple.ip_proto ==IPPROTO_UDP ) { - udp = (struct udp_hdr *)(raw_pkt + len); + udp = (struct rte_udp_hdr *)(raw_pkt + len); udp->dst_port = arfs->tuple.dst_port; udp->src_port = arfs->tuple.src_port; - udp->dgram_len =sizeof (struct udp_hdr ); - len +=sizeof (struct udp_hdr ); + udp->dgram_len =sizeof (struct rte_udp_hdr ); + len +=sizeof (struct rte_udp_hdr );/* adjust ip total_length */ - ip->total_length +=sizeof (struct udp_hdr ); + ip->total_length +=sizeof (struct rte_udp_hdr ); params->udp = true; }else {/* TCP */ tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
@@ -522,10 +522,10 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, raw_pkt = (uint8_t *)buff;/* UDP */ if (arfs->tuple.ip_proto ==IPPROTO_UDP ) { - udp = (struct udp_hdr *)(raw_pkt + len); + udp = (struct rte_udp_hdr *)(raw_pkt + len); udp->src_port = arfs->tuple.src_port; udp->dst_port = arfs->tuple.dst_port; - len +=sizeof (struct udp_hdr ); + len +=sizeof (struct rte_udp_hdr ); params->udp = true; }else {/* TCP */ tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
drivers/net/tap/rte_eth_tap.c +1 -1
@@ -508,7 +508,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len, l4_hdr = packet + l2_len + l3_len;if ((ol_flags &PKT_TX_L4_MASK ) ==PKT_TX_UDP_CKSUM ) - *l4_cksum = &((struct udp_hdr *)l4_hdr)->dgram_cksum; + *l4_cksum = &((struct rte_udp_hdr *)l4_hdr)->dgram_cksum;else if ((ol_flags &PKT_TX_L4_MASK ) ==PKT_TX_TCP_CKSUM ) *l4_cksum = &((struct rte_tcp_hdr *)l4_hdr)->cksum;else
drivers/net/virtio/virtio_rxtx.c +1 -1
@@ -539,7 +539,7 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr,switch (cookie->ol_flags &PKT_TX_L4_MASK ) {case PKT_TX_UDP_CKSUM : hdr->csum_start = cookie->l2_len + cookie->l3_len; - hdr->csum_offset = offsetof(struct udp_hdr , + hdr->csum_offset = offsetof(struct rte_udp_hdr , dgram_cksum); hdr->flags =VIRTIO_NET_HDR_F_NEEDS_CSUM ;break ;
drivers/net/vmxnet3/vmxnet3_rxtx.c +3 -1
@@ -545,7 +545,9 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, offsetof(struct rte_tcp_hdr , cksum);break ;case PKT_TX_UDP_CKSUM : - gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct udp_hdr , dgram_cksum); + gdesc->txd.msscof = gdesc->txd.hlen + + offsetof(struct rte_udp_hdr , + dgram_cksum);break ;default : PMD_TX_LOG(WARNING, "requested cksum offload not supported %#llx",
examples/l3fwd-power/main.c +4 -4
@@ -528,7 +528,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid, {struct ipv4_5tuple key;struct rte_tcp_hdr *tcp; -struct udp_hdr *udp; +struct rte_udp_hdr *udp;int ret =0 ; key.ip_dst =rte_be_to_cpu_32 (ipv4_hdr->dst_addr);
@@ -544,7 +544,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,break ;case IPPROTO_UDP : - udp = (struct udp_hdr *)((unsigned char *)ipv4_hdr + + udp = (struct rte_udp_hdr *)((unsigned char *)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);
@@ -567,7 +567,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid, {struct ipv6_5tuple key;struct rte_tcp_hdr *tcp; -struct udp_hdr *udp; +struct rte_udp_hdr *udp;int ret =0 ;memcpy (key.ip_dst, ipv6_hdr->dst_addr,IPV6_ADDR_LEN );
@@ -584,7 +584,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,break ;case IPPROTO_UDP : - udp = (struct udp_hdr *)((unsigned char *) ipv6_hdr + + udp = (struct rte_udp_hdr *)((unsigned char *) 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);
examples/l3fwd-vf/main.c +2 -2
@@ -367,7 +367,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid, {struct ipv4_5tuple key;struct rte_tcp_hdr *tcp; -struct udp_hdr *udp; +struct rte_udp_hdr *udp;int ret =0 ; key.ip_dst =rte_be_to_cpu_32 (ipv4_hdr->dst_addr);
@@ -383,7 +383,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,break ;case IPPROTO_UDP : - udp = (struct udp_hdr *)((unsigned char *) ipv4_hdr + + udp = (struct rte_udp_hdr *)((unsigned char *) 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);
examples/tep_termination/vxlan.c +8 -8
@@ -77,7 +77,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr,uint16_t ethertype;struct rte_ipv4_hdr *ipv4_hdr;struct rte_ipv6_hdr *ipv6_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;struct rte_tcp_hdr *tcp_hdr;struct rte_sctp_hdr *sctp_hdr;uint64_t ol_flags =0 ;
@@ -110,7 +110,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr,return 0 ;/* packet type not supported, nothing to do */ if (l4_proto ==IPPROTO_UDP ) { - udp_hdr = (struct udp_hdr *)((char *)l3_hdr + info->l3_len); + udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len); ol_flags |=PKT_TX_UDP_CKSUM ; udp_hdr->dgram_cksum =get_psd_sum (l3_hdr, ethertype, ol_flags);
@@ -143,7 +143,7 @@ decapsulation(struct rte_mbuf *pkt) {uint8_t l4_proto =0 ;uint16_t outer_header_len; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;union tunnel_offload_info info = { .data =0 };struct rte_ether_hdr *phdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
@@ -153,7 +153,7 @@ decapsulation(struct rte_mbuf *pkt)if (l4_proto !=IPPROTO_UDP )return -1 ; - udp_hdr = (struct udp_hdr *)((char *)phdr + + udp_hdr = (struct rte_udp_hdr *)((char *)phdr + info.outer_l2_len + info.outer_l3_len);/** check udp destination port, 4789 is the default vxlan port
@@ -163,7 +163,7 @@ decapsulation(struct rte_mbuf *pkt) (pkt->packet_type & RTE_PTYPE_TUNNEL_MASK) == 0)return -1 ; outer_header_len = info.outer_l2_len + info.outer_l3_len - +sizeof (struct udp_hdr ) +sizeof (struct rte_vxlan_hdr ); + +sizeof (struct rte_udp_hdr ) +sizeof (struct rte_vxlan_hdr );rte_pktmbuf_adj (pkt, outer_header_len);
@@ -184,10 +184,10 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)struct rte_ether_hdr *pneth = (struct rte_ether_hdr *)rte_pktmbuf_prepend (m,sizeof (struct rte_ether_hdr ) +sizeof (struct rte_ipv4_hdr ) - +sizeof (struct udp_hdr ) +sizeof (struct rte_vxlan_hdr )); + +sizeof (struct rte_udp_hdr ) +sizeof (struct rte_vxlan_hdr ));struct rte_ipv4_hdr *ip = (struct rte_ipv4_hdr *) &pneth[1 ]; -struct udp_hdr *udp = (struct udp_hdr *) &ip[1 ]; +struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1 ];struct rte_vxlan_hdr *vxlan = (struct rte_vxlan_hdr *) &udp[1 ];/* convert TX queue ID to vport ID */
@@ -231,7 +231,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)/*UDP HEADER*/ udp->dgram_cksum =0 ; udp->dgram_len =rte_cpu_to_be_16 (old_len - +sizeof (struct udp_hdr ) + +sizeof (struct rte_udp_hdr ) +sizeof (struct rte_vxlan_hdr )); udp->dst_port =rte_cpu_to_be_16 (vxdev.dst_port);
lib/librte_ethdev/rte_flow.h +1 -1
@@ -692,7 +692,7 @@ static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {* Matches a UDP header. */ struct rte_flow_item_udp { -struct udp_hdr hdr;/**< UDP header definition. */ +struct rte_udp_hdr hdr;/**< UDP header definition. */ };/** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
lib/librte_gro/gro_vxlan_tcp4.c +5 -5
@@ -264,7 +264,7 @@ static inline void update_vxlan_header(struct gro_vxlan_tcp4_item *item) {struct rte_ipv4_hdr *ipv4_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;struct rte_mbuf *pkt = item->inner_item.firstseg;uint16_t len;
@@ -276,7 +276,7 @@ update_vxlan_header(struct gro_vxlan_tcp4_item *item)/* Update the outer UDP header. */ len -= pkt->outer_l3_len; - udp_hdr = (struct udp_hdr *)((char *)ipv4_hdr + pkt->outer_l3_len); + udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr + pkt->outer_l3_len); udp_hdr->dgram_len =rte_cpu_to_be_16 (len);/* Update the inner IPv4 header. */
@@ -293,7 +293,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,struct rte_ether_hdr *outer_eth_hdr, *eth_hdr;struct rte_ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr;struct rte_tcp_hdr *tcp_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;struct rte_vxlan_hdr *vxlan_hdr;uint32_t sent_seq;int32_t tcp_dl;
@@ -317,10 +317,10 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, outer_eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); outer_ipv4_hdr = (struct rte_ipv4_hdr *)((char *)outer_eth_hdr + pkt->outer_l2_len); - udp_hdr = (struct udp_hdr *)((char *)outer_ipv4_hdr + + udp_hdr = (struct rte_udp_hdr *)((char *)outer_ipv4_hdr + pkt->outer_l3_len); vxlan_hdr = (struct rte_vxlan_hdr *)((char *)udp_hdr + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr )); eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_hdr +sizeof (struct rte_vxlan_hdr )); ipv4_hdr = (struct rte_ipv4_hdr *)((char *)udp_hdr + pkt->l2_len);
lib/librte_gso/gso_common.h +2 -2
@@ -46,9 +46,9 @@static inline void update_udp_header (struct rte_mbuf *pkt,uint16_t udp_offset) { -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr; - udp_hdr = (struct udp_hdr *)(rte_pktmbuf_mtod(pkt, char *) + + udp_hdr = (struct rte_udp_hdr *)(rte_pktmbuf_mtod(pkt, char *) + udp_offset); udp_hdr->dgram_len =rte_cpu_to_be_16 (pkt->pkt_len - udp_offset); }
lib/librte_gso/rte_gso.h +1 -1
@@ -23,7 +23,7 @@ extern "C" {/* Minimum GSO segment size for UDP based packets. */ #define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \ - sizeof(struct rte_ipv4_hdr) + sizeof(struct udp_hdr) + 1) + sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_udp_hdr) + 1)/* GSO flags for rte_gso_ctx. */ #define RTE_GSO_FLAG_IPID_FIXED (1ULL << 0)
lib/librte_net/rte_ether.h +2 -2
@@ -316,7 +316,7 @@ struct rte_vxlan_hdr {#define RTE_ETHER_TYPE_MPLSM 0x8848/**< MPLS multicast ethertype. */ #define RTE_ETHER_VXLAN_HLEN \ - (sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr)) + (sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr))/**< VXLAN tunnel header length. */ /**
@@ -340,7 +340,7 @@ struct rte_vxlan_gpe_hdr {#define RTE_VXLAN_GPE_TYPE_GBP 6/**< GBP Protocol. */ #define RTE_VXLAN_GPE_TYPE_VBNG 7/**< vBNG Protocol. */ -#define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \ +#define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \ sizeof(struct rte_vxlan_gpe_hdr))/**< VXLAN-GPE tunnel header length. */
lib/librte_net/rte_net.c +2 -2
@@ -357,7 +357,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, }if ((pkt_type &RTE_PTYPE_L4_MASK ) ==RTE_PTYPE_L4_UDP ) { - hdr_lens->l4_len =sizeof (struct udp_hdr ); + hdr_lens->l4_len =sizeof (struct rte_udp_hdr );return pkt_type; }else if ((pkt_type &RTE_PTYPE_L4_MASK ) ==RTE_PTYPE_L4_TCP ) {const struct rte_tcp_hdr *th;
@@ -493,7 +493,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, }if ((pkt_type &RTE_PTYPE_INNER_L4_MASK ) ==RTE_PTYPE_INNER_L4_UDP ) { - hdr_lens->inner_l4_len =sizeof (struct udp_hdr ); + hdr_lens->inner_l4_len =sizeof (struct rte_udp_hdr ); }else if ((pkt_type &RTE_PTYPE_INNER_L4_MASK ) ==RTE_PTYPE_INNER_L4_TCP ) {const struct rte_tcp_hdr *th;
lib/librte_net/rte_net.h +4 -3
@@ -115,7 +115,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)struct rte_ipv4_hdr *ipv4_hdr;struct rte_ipv6_hdr *ipv6_hdr;struct rte_tcp_hdr *tcp_hdr; -struct udp_hdr *udp_hdr; +struct rte_udp_hdr *udp_hdr;uint64_t inner_l3_offset = m->l2_len;#ifdef RTE_LIBRTE_ETHDEV_DEBUG
@@ -153,7 +153,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)if ((ol_flags &PKT_TX_UDP_CKSUM ) ==PKT_TX_UDP_CKSUM ) {if (ol_flags &PKT_TX_IPV4 ) { - udp_hdr = (struct udp_hdr *)((char *)ipv4_hdr + + udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr + m->l3_len); udp_hdr->dgram_cksum =rte_ipv4_phdr_cksum (ipv4_hdr, ol_flags);
@@ -161,7 +161,8 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags) ipv6_hdr =rte_pktmbuf_mtod_offset (m, struct rte_ipv6_hdr *, inner_l3_offset);/* non-TSO udp */ - udp_hdr = rte_pktmbuf_mtod_offset(m, struct udp_hdr *, + udp_hdr =rte_pktmbuf_mtod_offset (m, + struct rte_udp_hdr *, inner_l3_offset + m->l3_len); udp_hdr->dgram_cksum =rte_ipv6_phdr_cksum (ipv6_hdr, ol_flags);
lib/librte_net/rte_udp.h +1 -1
@@ -23,7 +23,7 @@ extern "C" {/** * UDP Header */ -struct udp_hdr { +struct rte_udp_hdr {uint16_t src_port;/**< UDP source port. */ uint16_t dst_port;/**< UDP destination port. */ uint16_t dgram_len;/**< UDP datagram length */
lib/librte_pipeline/rte_table_action.c +16 -16
@@ -492,7 +492,7 @@ struct encap_pppoe_data {struct encap_vxlan_ipv4_data {struct rte_ether_hdr ether;struct rte_ipv4_hdr ipv4; -struct udp_hdr udp; +struct rte_udp_hdr udp;struct rte_vxlan_hdr vxlan; } __attribute__((__packed__ ));
@@ -500,14 +500,14 @@ struct encap_vxlan_ipv4_vlan_data {struct rte_ether_hdr ether;struct rte_vlan_hdr vlan;struct rte_ipv4_hdr ipv4; -struct udp_hdr udp; +struct rte_udp_hdr udp;struct rte_vxlan_hdr vxlan; } __attribute__((__packed__));struct encap_vxlan_ipv6_data {struct rte_ether_hdr ether;struct rte_ipv6_hdr ipv6; -struct udp_hdr udp; +struct rte_udp_hdr udp;struct rte_vxlan_hdr vxlan; } __attribute__((__packed__ ));
@@ -515,7 +515,7 @@ struct encap_vxlan_ipv6_vlan_data {struct rte_ether_hdr ether;struct rte_vlan_hdr vlan;struct rte_ipv6_hdr ipv6; -struct udp_hdr udp; +struct rte_udp_hdr udp;struct rte_vxlan_hdr vxlan; } __attribute__((__packed__));
@@ -1006,13 +1006,13 @@ pkt_work_encap_vxlan_ipv4(struct rte_mbuf *mbuf, ether_length = (uint16_t )mbuf->pkt_len; ipv4_total_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr ) + +sizeof (struct rte_udp_hdr ) +sizeof (struct rte_ipv4_hdr )); ipv4_hdr_cksum =encap_vxlan_ipv4_checksum_update (vxlan_tbl->ipv4.hdr_checksum,rte_htons (ipv4_total_length)); udp_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr )); vxlan_pkt =encap (ether, vxlan_tbl,sizeof (*vxlan_tbl)); vxlan_pkt->ipv4.total_length =rte_htons (ipv4_total_length);
@@ -1036,13 +1036,13 @@ pkt_work_encap_vxlan_ipv4_vlan(struct rte_mbuf *mbuf, ether_length = (uint16_t )mbuf->pkt_len; ipv4_total_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr ) + +sizeof (struct rte_udp_hdr ) +sizeof (struct rte_ipv4_hdr )); ipv4_hdr_cksum =encap_vxlan_ipv4_checksum_update (vxlan_tbl->ipv4.hdr_checksum,rte_htons (ipv4_total_length)); udp_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr )); vxlan_pkt =encap (ether, vxlan_tbl,sizeof (*vxlan_tbl)); vxlan_pkt->ipv4.total_length =rte_htons (ipv4_total_length);
@@ -1066,10 +1066,10 @@ pkt_work_encap_vxlan_ipv6(struct rte_mbuf *mbuf, ether_length = (uint16_t )mbuf->pkt_len; ipv6_payload_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr )); udp_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr )); vxlan_pkt =encap (ether, vxlan_tbl,sizeof (*vxlan_tbl)); vxlan_pkt->ipv6.payload_len =rte_htons (ipv6_payload_length);
@@ -1092,10 +1092,10 @@ pkt_work_encap_vxlan_ipv6_vlan(struct rte_mbuf *mbuf, ether_length = (uint16_t )mbuf->pkt_len; ipv6_payload_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr )); udp_length = ether_length + (sizeof (struct rte_vxlan_hdr ) + -sizeof (struct udp_hdr )); +sizeof (struct rte_udp_hdr )); vxlan_pkt =encap (ether, vxlan_tbl,sizeof (*vxlan_tbl)); vxlan_pkt->ipv6.payload_len =rte_htons (ipv6_payload_length);
@@ -1366,7 +1366,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip, tcp->src_port = data->port; tcp->cksum = tcp_cksum; }else { -struct udp_hdr *udp = (struct udp_hdr *) &ip[1 ]; +struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1 ];uint16_t ip_cksum, udp_cksum; ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1405,7 +1405,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip, tcp->dst_port = data->port; tcp->cksum = tcp_cksum; }else { -struct udp_hdr *udp = (struct udp_hdr *) &ip[1 ]; +struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1 ];uint16_t ip_cksum, udp_cksum; ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1447,7 +1447,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, tcp->src_port = data->port; tcp->cksum = tcp_cksum; }else { -struct udp_hdr *udp = (struct udp_hdr *) &ip[1 ]; +struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1 ];uint16_t udp_cksum; udp_cksum = nat_ipv6_tcp_udp_checksum_update(udp->dgram_cksum,
@@ -1475,7 +1475,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip, tcp->dst_port = data->port; tcp->cksum = tcp_cksum; }else { -struct udp_hdr *udp = (struct udp_hdr *) &ip[1 ]; +struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1 ];uint16_t udp_cksum; udp_cksum = nat_ipv6_tcp_udp_checksum_update(udp->dgram_cksum,
lib/librte_vhost/virtio_net.c +3 -3
@@ -222,7 +222,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr) cksum));break ;case PKT_TX_UDP_CKSUM : - net_hdr->csum_offset = (offsetof(struct udp_hdr , + net_hdr->csum_offset = (offsetof(struct rte_udp_hdr , dgram_cksum));break ;case PKT_TX_SCTP_CKSUM :
@@ -1028,7 +1028,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)if (l4_proto ==IPPROTO_TCP ) m->ol_flags |=PKT_TX_TCP_CKSUM ;break ; -case (offsetof(struct udp_hdr , dgram_cksum)): +case (offsetof(struct rte_udp_hdr , dgram_cksum)):if (l4_proto ==IPPROTO_UDP ) m->ol_flags |=PKT_TX_UDP_CKSUM ;break ;
@@ -1054,7 +1054,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)case VIRTIO_NET_HDR_GSO_UDP : m->ol_flags |=PKT_TX_UDP_SEG ; m->tso_segsz = hdr->gso_size; - m->l4_len =sizeof (struct udp_hdr ); + m->l4_len =sizeof (struct rte_udp_hdr );break ;default : RTE_LOG(WARNING, VHOST_DATA,
Signature · 1 line
2.11.0
PATCH 15/15 doc: announce network api change
In reply to Olivier Matz--- doc/guides/rel_notes/deprecation.rst | 4 ---- doc/guides/rel_notes/release_19_08.rst | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -4
@@ -17,10 +17,6 @@ Deprecation Notices can be got using the ``pip``, or ``pip3``, tool for downloading python packages. -* network includes: Network structures, definitions and functions will - be prefixed by ``rte_`` to resolve conflicts with libc headers. - This change will break many DPDK APIs. - * kvargs: The function ``rte_kvargs_process`` will get a new parameter for returning key match count. It will ease handling of no-match case.
doc/guides/rel_notes/release_19_08.rst +3 -0
@@ -83,6 +83,9 @@ API Changes Also, make sure to start the actual text at the margin. ========================================================= +* The network structures, definitions and functions have + been prefixed by ``rte_`` to resolve conflicts with libc headers. + ABI Changes -----------
Signature · 1 line
2.11.0
Quoted 424 lines · Olivier Matz
The
rte_netheaders conflict with the libc headers, because some definitions are duplicated, sometimes with few differences.This patchset adds the
rte_(orRTE_) prefix to all structures, functions and defines inrte_netlibrary. This is a big changeset, that will break the API of many functions, but not the ABI.This was discussed in [1], and requested by the techboard [2].
patch-v1:
* rease on top of v19.05
* remove uneeded renames indrivers/net/bonding/rte_eth_bond_pmd.candapp/test-pmd/icmpecho.c(arp-related variables)
* do not modify base drivers, except cxgbe, thunderx, enetc, qede:
only files that already contain dpdk definitions are modified.
* fix checkpatch issues when it does not impact the code style too much. Big warnings remain about theRTE_IPv4()macros because arguments are separated by ',' instead of ', '.
* add a release note patch
* tested compilation on x86_64-linux and x86_64-freebsd.rfc-v2:
* rebase on top of v19.05-rc1[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.htmlOlivier Matz (15):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure
doc: announce network api changeapp/pdump/main.c | 2 +- app/test-acl/main.c | 2 +- app/test-eventdev/test_perf_common.c | 2 +- app/test-eventdev/test_pipeline_common.c | 2 +- app/test-pipeline/pipeline_acl.c | 19 +- app/test-pipeline/pipeline_hash.c | 12 +- app/test-pmd/cmdline.c | 90 +++--- app/test-pmd/cmdline_flow.c | 86 +++--- app/test-pmd/config.c | 35 ++- app/test-pmd/csumonly.c | 169 +++++----- app/test-pmd/flowgen.c | 30 +- app/test-pmd/icmpecho.c | 117 +++---- app/test-pmd/ieee1588fwd.c | 18 +- app/test-pmd/macfwd.c | 12 +- app/test-pmd/macswap.h | 12 +- app/test-pmd/macswap_common.h | 4 +- app/test-pmd/macswap_neon.h | 12 +- app/test-pmd/macswap_sse.h | 12 +- app/test-pmd/parameters.c | 6 +- app/test-pmd/testpmd.c | 23 +- app/test-pmd/testpmd.h | 30 +- app/test-pmd/txonly.c | 45 +-- app/test-pmd/util.c | 34 +- app/test/packet_burst_generator.c | 150 ++++----- app/test/packet_burst_generator.h | 33 +- app/test/test_acl.c | 8 +- app/test/test_acl.h | 122 ++++---- app/test/test_cmdline_etheraddr.c | 16 +- app/test/test_efd.c | 20 +- app/test/test_event_eth_rx_adapter.c | 2 +- app/test/test_event_eth_tx_adapter.c | 2 +- app/test/test_flow_classify.c | 70 +++-- app/test/test_hash.c | 20 +- app/test/test_ipsec.c | 13 +- app/test/test_link_bonding.c | 342 ++++++++++++--------- app/test/test_link_bonding_mode4.c | 124 ++++---- app/test/test_link_bonding_rssconf.c | 6 +- app/test/test_lpm.c | 76 ++--- app/test/test_lpm_perf.c | 10 +- app/test/test_member.c | 20 +- app/test/test_pmd_perf.c | 20 +- app/test/test_sched.c | 24 +- app/test/test_table_acl.c | 8 +- app/test/test_thash.c | 12 +- app/test/virtual_pmd.c | 6 +- app/test/virtual_pmd.h | 2 +- doc/guides/nics/kni.rst | 2 +- doc/guides/prog_guide/bbdev.rst | 6 +- .../prog_guide/packet_classif_access_ctrl.rst | 18 +- doc/guides/prog_guide/rte_flow.rst | 4 +- doc/guides/rel_notes/deprecation.rst | 4 - doc/guides/rel_notes/release_19_08.rst | 3 + doc/guides/sample_app_ug/flow_classify.rst | 28 +- doc/guides/sample_app_ug/flow_filtering.rst | 6 +- doc/guides/sample_app_ug/ip_frag.rst | 16 +- doc/guides/sample_app_ug/ip_reassembly.rst | 16 +- doc/guides/sample_app_ug/ipv4_multicast.rst | 16 +- doc/guides/sample_app_ug/l2_forward_job_stats.rst | 6 +- .../sample_app_ug/l2_forward_real_virtual.rst | 6 +- doc/guides/sample_app_ug/l3_forward.rst | 12 +- doc/guides/sample_app_ug/link_status_intr.rst | 6 +- doc/guides/sample_app_ug/ptpclient.rst | 6 +- doc/guides/sample_app_ug/rxtx_callbacks.rst | 2 +- doc/guides/sample_app_ug/server_node_efd.rst | 12 +- doc/guides/sample_app_ug/skeleton.rst | 4 +- doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst | 4 +- drivers/bus/dpaa/include/compat.h | 2 + drivers/bus/dpaa/include/fman.h | 2 +- drivers/bus/dpaa/include/netcfg.h | 4 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 8 +- drivers/net/ark/ark_ethdev.c | 19 +- drivers/net/ark/ark_ext.h | 4 +- drivers/net/ark/ark_global.h | 5 +- drivers/net/atlantic/atl_ethdev.c | 27 +- drivers/net/atlantic/hw_atl/hw_atl_utils.c | 8 +- drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c | 4 +- drivers/net/avp/avp_ethdev.c | 21 +- drivers/net/avp/rte_avp_common.h | 2 +- drivers/net/axgbe/axgbe_dev.c | 4 +- drivers/net/axgbe/axgbe_ethdev.c | 10 +- drivers/net/axgbe/axgbe_ethdev.h | 4 +- drivers/net/axgbe/axgbe_rxtx.c | 2 +- drivers/net/bnx2x/bnx2x.c | 16 +- drivers/net/bnx2x/bnx2x_ethdev.c | 5 +- drivers/net/bnx2x/bnx2x_ethdev.h | 3 +- drivers/net/bnx2x/bnx2x_vfpf.c | 8 +- drivers/net/bnx2x/bnx2x_vfpf.h | 2 +- drivers/net/bnx2x/ecore_sp.h | 2 +- drivers/net/bnxt/bnxt.h | 4 +- drivers/net/bnxt/bnxt_ethdev.c | 80 ++--- drivers/net/bnxt/bnxt_filter.c | 4 +- drivers/net/bnxt/bnxt_filter.h | 8 +- drivers/net/bnxt/bnxt_flow.c | 27 +- drivers/net/bnxt/bnxt_hwrm.c | 41 +-- drivers/net/bnxt/bnxt_hwrm.h | 2 +- drivers/net/bnxt/bnxt_ring.c | 8 +- drivers/net/bnxt/bnxt_rxq.c | 2 +- drivers/net/bnxt/bnxt_rxr.c | 4 +- drivers/net/bnxt/bnxt_vnic.c | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 14 +- drivers/net/bnxt/rte_pmd_bnxt.h | 4 +- drivers/net/bonding/rte_eth_bond.h | 2 +- drivers/net/bonding/rte_eth_bond_8023ad.c | 30 +- drivers/net/bonding/rte_eth_bond_8023ad.h | 10 +- drivers/net/bonding/rte_eth_bond_8023ad_private.h | 2 +- drivers/net/bonding/rte_eth_bond_alb.c | 98 +++--- drivers/net/bonding/rte_eth_bond_alb.h | 10 +- drivers/net/bonding/rte_eth_bond_api.c | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 203 ++++++------ drivers/net/bonding/rte_eth_bond_private.h | 8 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe.h | 5 +- drivers/net/cxgbe/cxgbe_compat.h | 1 + drivers/net/cxgbe/cxgbe_ethdev.c | 14 +- drivers/net/cxgbe/cxgbe_filter.h | 2 +- drivers/net/cxgbe/cxgbe_flow.c | 10 +- drivers/net/cxgbe/cxgbe_main.c | 4 +- drivers/net/cxgbe/cxgbe_pfvf.h | 2 +- drivers/net/cxgbe/cxgbevf_main.c | 2 +- drivers/net/cxgbe/l2t.c | 8 +- drivers/net/cxgbe/l2t.h | 2 +- drivers/net/cxgbe/mps_tcam.c | 14 +- drivers/net/cxgbe/mps_tcam.h | 4 +- drivers/net/cxgbe/sge.c | 9 +- drivers/net/dpaa/dpaa_ethdev.c | 20 +- drivers/net/dpaa/dpaa_rxtx.c | 23 +- drivers/net/dpaa2/dpaa2_ethdev.c | 37 +-- drivers/net/dpaa2/dpaa2_flow.c | 18 +- drivers/net/e1000/e1000_ethdev.h | 5 +- drivers/net/e1000/em_ethdev.c | 39 +-- drivers/net/e1000/em_rxtx.c | 24 +- drivers/net/e1000/igb_ethdev.c | 76 ++--- drivers/net/e1000/igb_flow.c | 12 +- drivers/net/e1000/igb_pf.c | 17 +- drivers/net/e1000/igb_rxtx.c | 23 +- drivers/net/ena/ena_ethdev.c | 17 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enetc/base/enetc_hw.h | 4 +- drivers/net/enetc/enetc_ethdev.c | 21 +- drivers/net/enic/enic.h | 4 +- drivers/net/enic/enic_clsf.c | 40 +-- drivers/net/enic/enic_ethdev.c | 29 +- drivers/net/enic/enic_flow.c | 114 +++---- drivers/net/enic/enic_main.c | 4 +- drivers/net/enic/enic_res.c | 5 +- drivers/net/failsafe/failsafe.c | 8 +- drivers/net/failsafe/failsafe_args.c | 4 +- drivers/net/failsafe/failsafe_ether.c | 7 +- drivers/net/failsafe/failsafe_ops.c | 6 +- drivers/net/failsafe/failsafe_private.h | 4 +- drivers/net/fm10k/fm10k.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 18 +- drivers/net/i40e/i40e_ethdev.c | 143 +++++---- drivers/net/i40e/i40e_ethdev.h | 23 +- drivers/net/i40e/i40e_ethdev_vf.c | 68 ++-- drivers/net/i40e/i40e_fdir.c | 127 ++++---- drivers/net/i40e/i40e_flow.c | 58 ++-- drivers/net/i40e/i40e_pf.c | 18 +- drivers/net/i40e/i40e_rxtx.c | 28 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/i40e/rte_pmd_i40e.c | 31 +- drivers/net/i40e/rte_pmd_i40e.h | 8 +- drivers/net/iavf/iavf.h | 4 +- drivers/net/iavf/iavf_ethdev.c | 53 ++-- drivers/net/iavf/iavf_rxtx.c | 14 +- drivers/net/iavf/iavf_vchnl.c | 8 +- drivers/net/ice/ice_ethdev.c | 64 ++-- drivers/net/ice/ice_ethdev.h | 6 +- drivers/net/ice/ice_rxtx.c | 28 +- drivers/net/ipn3ke/ipn3ke_ethdev.h | 6 +- drivers/net/ipn3ke/ipn3ke_flow.c | 4 +- drivers/net/ipn3ke/ipn3ke_representor.c | 21 +- drivers/net/ixgbe/ixgbe_ethdev.c | 107 ++++--- drivers/net/ixgbe/ixgbe_ethdev.h | 4 +- drivers/net/ixgbe/ixgbe_flow.c | 22 +- drivers/net/ixgbe/ixgbe_pf.c | 16 +- drivers/net/ixgbe/ixgbe_rxtx.c | 18 +- drivers/net/ixgbe/ixgbe_vf_representor.c | 4 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 11 +- drivers/net/ixgbe/rte_pmd_ixgbe.h | 2 +- drivers/net/kni/rte_eth_kni.c | 6 +- drivers/net/liquidio/lio_ethdev.c | 23 +- drivers/net/mlx4/mlx4.c | 4 +- drivers/net/mlx4/mlx4.h | 10 +- drivers/net/mlx4/mlx4_ethdev.c | 12 +- drivers/net/mlx4/mlx4_flow.c | 16 +- drivers/net/mlx4/mlx4_rxtx.c | 2 +- drivers/net/mlx5/mlx5.c | 4 +- drivers/net/mlx5/mlx5.h | 15 +- drivers/net/mlx5/mlx5_flow.c | 22 +- drivers/net/mlx5/mlx5_flow_dv.c | 44 +-- drivers/net/mlx5/mlx5_flow_tcf.c | 66 ++-- drivers/net/mlx5/mlx5_flow_verbs.c | 30 +- drivers/net/mlx5/mlx5_mac.c | 18 +- drivers/net/mlx5/mlx5_nl.c | 28 +- drivers/net/mlx5/mlx5_rxtx.c | 6 +- drivers/net/mlx5/mlx5_rxtx.h | 2 +- drivers/net/mlx5/mlx5_rxtx_vec_neon.h | 8 +- drivers/net/mlx5/mlx5_rxtx_vec_sse.h | 10 +- drivers/net/mlx5/mlx5_trigger.c | 6 +- drivers/net/mvneta/mvneta_ethdev.c | 22 +- drivers/net/mvneta/mvneta_ethdev.h | 6 +- drivers/net/mvpp2/mrvl_ethdev.c | 22 +- drivers/net/mvpp2/mrvl_ethdev.h | 6 +- drivers/net/mvpp2/mrvl_flow.c | 4 +- drivers/net/netvsc/hn_ethdev.c | 4 +- drivers/net/netvsc/hn_nvs.c | 2 +- drivers/net/netvsc/hn_rndis.c | 2 +- drivers/net/netvsc/hn_rxtx.c | 12 +- drivers/net/netvsc/hn_var.h | 4 +- drivers/net/netvsc/hn_vf.c | 8 +- drivers/net/nfb/nfb_ethdev.c | 16 +- drivers/net/nfp/nfp_net.c | 22 +- drivers/net/nfp/nfp_net_pmd.h | 2 +- drivers/net/null/rte_eth_null.c | 6 +- drivers/net/octeontx/octeontx_ethdev.c | 9 +- drivers/net/octeontx/octeontx_ethdev.h | 2 +- drivers/net/pcap/rte_eth_pcap.c | 22 +- drivers/net/qede/base/bcm_osal.h | 4 +- drivers/net/qede/qede_ethdev.c | 71 +++-- drivers/net/qede/qede_ethdev.h | 6 +- drivers/net/qede/qede_filter.c | 68 ++-- drivers/net/qede/qede_if.h | 4 +- drivers/net/qede/qede_main.c | 6 +- drivers/net/qede/qede_rxtx.c | 34 +- drivers/net/qede/qede_rxtx.h | 2 +- drivers/net/ring/rte_eth_ring.c | 4 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ef10_tx.c | 4 +- drivers/net/sfc/sfc_ethdev.c | 24 +- drivers/net/sfc/sfc_flow.c | 12 +- drivers/net/sfc/sfc_port.c | 8 +- drivers/net/sfc/sfc_tso.c | 4 +- drivers/net/sfc/sfc_tso.h | 4 +- drivers/net/softnic/parser.c | 18 +- drivers/net/softnic/parser.h | 2 +- drivers/net/softnic/rte_eth_softnic.c | 2 +- drivers/net/softnic/rte_eth_softnic_flow.c | 4 +- drivers/net/softnic/rte_eth_softnic_pipeline.c | 40 +-- drivers/net/szedata2/rte_eth_szedata2.c | 8 +- drivers/net/tap/rte_eth_tap.c | 68 ++-- drivers/net/tap/rte_eth_tap.h | 4 +- drivers/net/tap/tap_bpf_program.c | 14 +- drivers/net/tap/tap_flow.c | 16 +- drivers/net/thunderx/base/nicvf_plat.h | 5 +- drivers/net/thunderx/nicvf_ethdev.c | 19 +- drivers/net/thunderx/nicvf_struct.h | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 16 +- drivers/net/vhost/rte_eth_vhost.c | 12 +- drivers/net/virtio/virtio_ethdev.c | 78 ++--- drivers/net/virtio/virtio_pci.h | 4 +- drivers/net/virtio/virtio_rxtx.c | 33 +- drivers/net/virtio/virtio_user/vhost_kernel_tap.c | 2 +- drivers/net/virtio/virtio_user/virtio_user_dev.c | 6 +- drivers/net/virtio/virtio_user/virtio_user_dev.h | 2 +- drivers/net/virtio/virtio_user_ethdev.c | 8 +- drivers/net/virtio/virtqueue.h | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 12 +- drivers/net/vmxnet3/vmxnet3_ethdev.h | 2 +- drivers/net/vmxnet3/vmxnet3_rxtx.c | 47 +-- examples/bbdev_app/main.c | 41 +-- examples/bond/main.c | 83 ++--- examples/distributor/main.c | 4 +- examples/ethtool/ethtool-app/ethapp.c | 8 +- examples/ethtool/ethtool-app/main.c | 10 +- examples/ethtool/lib/rte_ethtool.c | 8 +- examples/ethtool/lib/rte_ethtool.h | 7 +- examples/eventdev_pipeline/main.c | 4 +- examples/eventdev_pipeline/pipeline_common.h | 10 +- examples/flow_classify/flow_classify.c | 30 +- examples/flow_filtering/main.c | 10 +- examples/ip_fragmentation/main.c | 69 +++-- examples/ip_pipeline/cli.c | 4 +- examples/ip_pipeline/kni.c | 2 +- examples/ip_pipeline/parser.c | 18 +- examples/ip_pipeline/parser.h | 2 +- examples/ip_pipeline/pipeline.c | 40 +-- examples/ip_reassembly/main.c | 51 +-- examples/ipsec-secgw/esp.c | 47 +-- examples/ipsec-secgw/ipsec-secgw.c | 43 +-- examples/ipsec-secgw/ipsec.h | 2 +- examples/ipsec-secgw/parser.c | 4 +- examples/ipsec-secgw/sa.c | 16 +- examples/ipv4_multicast/main.c | 60 ++-- examples/kni/main.c | 14 +- examples/l2fwd-cat/l2fwd-cat.c | 4 +- examples/l2fwd-crypto/main.c | 26 +- examples/l2fwd-jobstats/main.c | 8 +- examples/l2fwd-keepalive/main.c | 8 +- examples/l2fwd/main.c | 8 +- examples/l3fwd-acl/main.c | 106 ++++--- examples/l3fwd-power/main.c | 102 +++--- examples/l3fwd-vf/main.c | 68 ++-- examples/l3fwd/l3fwd.h | 8 +- examples/l3fwd/l3fwd_altivec.h | 26 +- examples/l3fwd/l3fwd_common.h | 4 +- examples/l3fwd/l3fwd_em.c | 46 +-- examples/l3fwd/l3fwd_em.h | 22 +- examples/l3fwd/l3fwd_em_hlm.h | 19 +- examples/l3fwd/l3fwd_em_hlm_neon.h | 20 +- examples/l3fwd/l3fwd_em_hlm_sse.h | 16 +- examples/l3fwd/l3fwd_em_sequential.h | 19 +- examples/l3fwd/l3fwd_lpm.c | 50 +-- examples/l3fwd/l3fwd_lpm.h | 22 +- examples/l3fwd/l3fwd_lpm_altivec.h | 20 +- examples/l3fwd/l3fwd_lpm_neon.h | 30 +- examples/l3fwd/l3fwd_lpm_sse.h | 20 +- examples/l3fwd/l3fwd_neon.h | 26 +- examples/l3fwd/l3fwd_sse.h | 26 +- examples/l3fwd/main.c | 20 +- examples/link_status_interrupt/main.c | 8 +- examples/load_balancer/runtime.c | 8 +- .../client_server_mp/mp_server/main.c | 2 +- examples/packet_ordering/main.c | 2 +- examples/performance-thread/l3fwd-thread/main.c | 337 ++++++++++---------- examples/ptpclient/ptpclient.c | 32 +- examples/qos_meter/main.c | 5 +- examples/qos_sched/init.c | 2 +- examples/quota_watermark/qw/main.c | 8 +- examples/rxtx_callbacks/main.c | 4 +- examples/server_node_efd/node/node.c | 6 +- examples/server_node_efd/server/main.c | 8 +- examples/skeleton/basicfwd.c | 4 +- examples/tep_termination/main.c | 2 +- examples/tep_termination/main.h | 2 +- examples/tep_termination/vxlan.c | 115 +++---- examples/tep_termination/vxlan.h | 8 +- examples/tep_termination/vxlan_setup.c | 32 +- examples/tep_termination/vxlan_setup.h | 2 +- examples/vhost/main.c | 42 +-- examples/vhost/main.h | 2 +- examples/vm_power_manager/channel_monitor.c | 12 +- .../guest_cli/vm_power_cli_guest.c | 2 +- examples/vm_power_manager/main.c | 6 +- examples/vmdq/main.c | 12 +- examples/vmdq_dcb/main.c | 12 +- lib/librte_ethdev/rte_class_eth.c | 4 +- lib/librte_ethdev/rte_eth_ctrl.h | 12 +- lib/librte_ethdev/rte_ethdev.c | 59 ++-- lib/librte_ethdev/rte_ethdev.h | 15 +- lib/librte_ethdev/rte_ethdev_core.h | 12 +- lib/librte_ethdev/rte_flow.h | 34 +- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 33 +- lib/librte_gro/gro_tcp4.c | 26 +- lib/librte_gro/gro_tcp4.h | 22 +- lib/librte_gro/gro_vxlan_tcp4.c | 66 ++-- lib/librte_gro/gro_vxlan_tcp4.h | 6 +- lib/librte_gso/gso_common.h | 16 +- lib/librte_gso/gso_tcp4.c | 12 +- lib/librte_gso/gso_tunnel_tcp4.c | 14 +- lib/librte_gso/gso_udp4.c | 10 +- lib/librte_gso/rte_gso.h | 8 +- lib/librte_hash/rte_thash.h | 3 +- lib/librte_ip_frag/rte_ip_frag.h | 13 +- lib/librte_ip_frag/rte_ipv4_fragmentation.c | 42 +-- lib/librte_ip_frag/rte_ipv4_reassembly.c | 14 +- lib/librte_ip_frag/rte_ipv6_fragmentation.c | 28 +- lib/librte_ip_frag/rte_ipv6_reassembly.c | 6 +- lib/librte_ipsec/crypto.h | 2 +- lib/librte_ipsec/esp_inb.c | 10 +- lib/librte_ipsec/esp_outb.c | 8 +- lib/librte_ipsec/iph.h | 8 +- lib/librte_ipsec/sa.c | 10 +- lib/librte_kni/rte_kni.c | 4 +- lib/librte_kni/rte_kni.h | 2 +- lib/librte_net/rte_arp.c | 33 +- lib/librte_net/rte_arp.h | 36 +-- lib/librte_net/rte_esp.h | 2 +- lib/librte_net/rte_ether.h | 189 ++++++------ lib/librte_net/rte_gre.h | 2 +- lib/librte_net/rte_icmp.h | 6 +- lib/librte_net/rte_ip.h | 75 ++--- lib/librte_net/rte_net.c | 94 +++--- lib/librte_net/rte_net.h | 28 +- lib/librte_net/rte_sctp.h | 2 +- lib/librte_net/rte_tcp.h | 2 +-
Quoted 9 lines
lib/librte_net/rte_udp.h | 2 +- lib/librte_pipeline/rte_table_action.c | 242 ++++++++------- lib/librte_pipeline/rte_table_action.h | 4 +- lib/librte_port/rte_port_ras.c | 10 +- lib/librte_port/rte_port_source_sink.c | 6 +- lib/librte_vhost/vhost.h | 2 +- lib/librte_vhost/virtio_net.c | 43 +-- 385 files changed, 4563 insertions(+), 4234 deletions(-)
Thanks,
Maxime
Quoted 29 lines · Olivier Matz
The
rte_netheaders conflict with the libc headers, because some definitions are duplicated, sometimes with few differences.This patchset adds the
rte_(orRTE_) prefix to all structures, functions and defines inrte_netlibrary. This is a big changeset, that will break the API of many functions, but not the ABI.This was discussed in [1], and requested by the techboard [2].
patch-v1:
* rease on top of v19.05
* remove uneeded renames indrivers/net/bonding/rte_eth_bond_pmd.candapp/test-pmd/icmpecho.c(arp-related variables)
* do not modify base drivers, except cxgbe, thunderx, enetc, qede:
only files that already contain dpdk definitions are modified.
* fix checkpatch issues when it does not impact the code style too much. Big warnings remain about theRTE_IPv4()macros because arguments are separated by ',' instead of ', '.
* add a release note patch
* tested compilation on x86_64-linux and x86_64-freebsd.rfc-v2:
* rebase on top of v19.05-rc1[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.html
Quoted 16 lines
Olivier Matz (15):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure
doc: announce network api change
For series,
Series applied to dpdk-next-net/master, thanks.
Quoted 47 lines · Ferruh Yigit
Quoted 29 lines · Olivier Matz
The
rte_netheaders conflict with the libc headers, because some definitions are duplicated, sometimes with few differences.This patchset adds the
rte_(orRTE_) prefix to all structures, functions and defines inrte_netlibrary. This is a big changeset, that will break the API of many functions, but not the ABI.This was discussed in [1], and requested by the techboard [2].
patch-v1:
* rease on top of v19.05
* remove uneeded renames indrivers/net/bonding/rte_eth_bond_pmd.candapp/test-pmd/icmpecho.c(arp-related variables)
* do not modify base drivers, except cxgbe, thunderx, enetc, qede:
only files that already contain dpdk definitions are modified.
* fix checkpatch issues when it does not impact the code style too much. Big warnings remain about theRTE_IPv4()macros because arguments are separated by ',' instead of ', '.
* add a release note patch
* tested compilation on x86_64-linux and x86_64-freebsd.rfc-v2:
* rebase on top of v19.05-rc1[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.htmlQuoted 16 lines
Olivier Matz (15):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure
doc: announce network api change
Quoted 8 lines
Reviewed-by Stephen Hemminger <[email protected]>Reviewed-by Maxime Coquelin <[email protected]>For series,
Reviewed-by Ferruh Yigit <[email protected]>Series applied to dpdk-next-net/master, thanks.
Sorry, late to the party...
Since we change those defines, we might as well avoid these warnings:
CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv4> CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv6>
I can send a patch.
Signature · 1 line
David Marchand
Quoted 58 lines · David Marchand
Quoted 47 lines · Ferruh Yigit
Quoted 29 lines · Olivier Matz
The
rte_netheaders conflict with the libc headers, because some definitions are duplicated, sometimes with few differences.This patchset adds the
rte_(orRTE_) prefix to all structures, functions and defines inrte_netlibrary. This is a big changeset, that will break the API of many functions, but not the ABI.This was discussed in [1], and requested by the techboard [2].
patch-v1:
* rease on top of v19.05
* remove uneeded renames indrivers/net/bonding/rte_eth_bond_pmd.candapp/test-pmd/icmpecho.c(arp-related variables)
* do not modify base drivers, except cxgbe, thunderx, enetc, qede:
only files that already contain dpdk definitions are modified.
* fix checkpatch issues when it does not impact the code style too much. Big warnings remain about theRTE_IPv4()macros because arguments are separated by ',' instead of ', '.
* add a release note patch
* tested compilation on x86_64-linux and x86_64-freebsd.rfc-v2:
* rebase on top of v19.05-rc1[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.htmlQuoted 16 lines
Olivier Matz (15):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure
doc: announce network api changeQuoted 8 lines
Reviewed-by Stephen Hemminger <[email protected]>Reviewed-by Maxime Coquelin <[email protected]>For series,
Reviewed-by Ferruh Yigit <[email protected]>Series applied to dpdk-next-net/master, thanks.
Quoted 7 lines
Sorry, late to the party...
Since we change those defines, we might as well avoid these warnings:
CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv4> CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv6>I can send a patch.
Thanks.
By the way, here is below a script that can be used to ease the porting of an application. It includes modifications proposed by David [1].
It is probably not 100% reliable, but it will do most of the job.
Olivier
[1] https://mails.dpdk.org/archives/dev/2019-May/133060.html
-----------------------
#!/bin/bash
# Prefix network structure/defines/functions with "rte_".
set -e
if [ $# = 0 ]; then
echo 'usage: $0 <files>' exit 1
fi
files="$@"
# $1: pattern
# $2: replacementreplace()
{
local pattern="$1"
local replace="$2"
sed -i -e "s,${pattern},${replace},g" ${files}
}# $*: function namesreplace_function()
{
for i in $*; do
replace "\<$i\>(" "rte_$i("
done
}# $*: define namesreplace_define()
{
for i in $*; do
local pattern
case "$i" in
*'(')
pattern="\<${i%(}\>("
;;
*)
pattern="\<${i}\>"
;;
esac
replace "$pattern" "RTE_${i^^}"
done
}# $*: struct namesreplace_struct()
{
for i in $*; do
replace "struct\([ ][ ]*\)\<$i\>" "struct\1rte_$i"
done
}replace arp_hrd arp_hardware
replace arp_pro arp_protocol
replace arp_hln arp_hlen
replace arp_pln arp_plen
replace arp_op arp_opcodereplace_struct arp_hdr arp_ipv4replace_define ARP_HRD_ETHER ARP_OP_REQUEST ARP_OP_REPLY ARP_OP_REVREQUEST \
ARP_OP_REVREPLY ARP_OP_INVREQUEST ARP_OP_INVREPLYreplace_struct ether_addr ether_hdr vlan_hdr vxlan_hdr vxlan_gpe_hdr
replace_function is_same_ether_addr is_zero_ether_addr is_unicast_ether_addr \ is_multicast_ether_addr is_broadcast_ether_addr \ is_universal_ether_addr is_local_admin_ether_addr \ is_valid_assigned_ether_addr eth_random_addr ether_addr_copy \ ether_format_addr replace_define ETHER_ADDR_LEN ETHER_TYPE_LEN ETHER_CRC_LEN ETHER_HDR_LEN \ ETHER_MIN_LEN ETHER_MAX_LEN ETHER_MTU ETHER_MAX_VLAN_FRAME_LEN \ ETHER_MAX_VLAN_ID ETHER_MAX_JUMBO_FRAME_LEN ETHER_MIN_MTU \ ETHER_LOCAL_ADMIN_ADDR ETHER_GROUP_ADDR ETHER_TYPE_IPv4 \ ETHER_TYPE_IPv6 ETHER_TYPE_ARP ETHER_TYPE_VLAN ETHER_TYPE_RARP \ ETHER_TYPE_QINQ ETHER_TYPE_ETAG ETHER_TYPE_1588 ETHER_TYPE_SLOW \ ETHER_TYPE_TEB ETHER_TYPE_LLDP ETHER_TYPE_MPLS ETHER_TYPE_MPLSM \ ETHER_VXLAN_HLEN ETHER_ADDR_FMT_SIZE VXLAN_GPE_TYPE_IPV4 \ VXLAN_GPE_TYPE_IPV6 VXLAN_GPE_TYPE_ETH VXLAN_GPE_TYPE_NSH \ VXLAN_GPE_TYPE_MPLS VXLAN_GPE_TYPE_GBP VXLAN_GPE_TYPE_VBNG \ ETHER_VXLAN_GPE_HLEN
replace_struct esp_hdrreplace_struct gre_hdrreplace_struct icmp_hdrreplace_define IP_ICMP_ECHO_REPLY IP_ICMP_ECHO_REQUEST replace_struct ipv4_hdr ipv6_hdr
replace_define "IPv4(" IPV4_MAX_PKT_LEN IPV4_HDR_IHL_MASK IPV4_IHL_MULTIPLIER \
IPV4_HDR_DF_SHIFT IPV4_HDR_MF_SHIFT IPV4_HDR_FO_SHIFT \
IPV4_HDR_DF_FLAG IPV4_HDR_MF_FLAG IPV4_HDR_OFFSET_MASK \
IPV4_HDR_OFFSET_UNITS IPV4_ANY IPV4_LOOPBACK IPV4_BROADCAST \
IPV4_ALLHOSTS_GROUP IPV4_ALLRTRS_GROUP IPV4_MAX_LOCAL_GROUP \
IPV4_MIN_MCAST IPV4_MAX_MCAST IS_IPV4_MCAST IPV6_HDR_FL_SHIFT \
IPV6_HDR_TC_SHIFT IPV6_HDR_FL_MASK IPV6_HDR_TC_MASKreplace_struct sctp_hdrreplace_struct tcp_hdrreplace_struct udp_hdr
Quoted 182 lines · Olivier Matz
Quoted 1 line · David Marchand
On Fri, May 24, 2019 at 1:38 PM Ferruh Yigit <[email protected]>
Quoted 6 lines · wrote:
Quoted 6 lines · Olivier Matz
Quoted 4 lines
The
rte_netheaders conflict with the libc headers, because some definitions are duplicated, sometimes with few differences.This patchset adds the
rte_(orRTE_) prefix to all structures,functions
Quoted 51 lines
Quoted 42 lines
Quoted 25 lines
and defines in
rte_netlibrary. This is a big changeset, that will break the API of many functions, but not the ABI.This was discussed in [1], and requested by the techboard [2].
patch-v1:
* rease on top of v19.05
* remove uneeded renames indrivers/net/bonding/rte_eth_bond_pmd.candapp/test-pmd/icmpecho.c(arp-related variables)
* do not modify base drivers, except cxgbe, thunderx, enetc, qede:
only files that already contain dpdk definitions are modified.
* fix checkpatch issues when it does not impact the code style too much. Big warnings remain about theRTE_IPv4()macros because arguments are separated by ',' instead of ', '.
* add a release note patch
* tested compilation on x86_64-linux and x86_64-freebsd.rfc-v2:
* rebase on top of v19.05-rc1[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.htmlQuoted 16 lines
Olivier Matz (15):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure
doc: announce network api changeQuoted 8 lines
Reviewed-by Stephen Hemminger <[email protected]>Reviewed-by Maxime Coquelin <[email protected]>For series,
Reviewed-by Ferruh Yigit <[email protected]>Series applied to dpdk-next-net/master, thanks.
Quoted 7 lines
Sorry, late to the party...
Since we change those defines, we might as well avoid these warnings:
CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv4> CHECK:CAMELCASE: Avoid CamelCase: <RTE_ETHER_TYPE_IPv6>I can send a patch.
Thanks.
By the way, here is below a script that can be used to ease the porting of an application. It includes modifications proposed by David [1].
It is probably not 100% reliable, but it will do most of the job.
Olivier
[1] https://mails.dpdk.org/archives/dev/2019-May/133060.html
-----------------------
#!/bin/bash# Prefix network structure/defines/functions with "
rte_".set -e
if [ $# = 0 ]; then
echo 'usage: $0 <files>' exit 1fi
files="$@"
# $1: pattern
# $2: replacementreplace(){ local pattern="$1" local replace="$2" sed -i -e "s,${pattern},${replace},g" ${files} }# $*: function names
replace_function()
{
for i in $*; do
replace "\<$i\>(" "rte_$i("
done
}# $*: define names
replace_define(){ for i in $*; do local pattern case "$i" in *'(') pattern="\<${i%(}\>(" ;; *) pattern="\<${i}\>" ;; esac replace "$pattern" "RTE_${i^^}" done }# $*: struct names
replace_struct()
{
for i in $*; do
replace "struct\([ ][ ]*\)\<$i\>"
"struct\1rte_$i"
done
}replace
arp_hrdarp_hardware
replacearp_proarp_protocol
replacearp_hlnarp_hlen
replacearp_plnarp_plen
replacearp_oparp_opcodereplace_structarp_hdrarp_ipv4replace_defineARP_HRD_ETHERARP_OP_REQUESTARP_OP_REPLYARP_OP_REVREQUEST\
ARP_OP_REVREPLYARP_OP_INVREQUESTARP_OP_INVREPLYreplace_structether_addrether_hdrvlan_hdrvxlan_hdrvxlan_gpe_hdrreplace_functionis_same_ether_addris_zero_ether_addris_unicast_ether_addr \ is_multicast_ether_addr is_broadcast_ether_addr \ is_universal_ether_addr is_local_admin_ether_addr \ is_valid_assigned_ether_addr eth_random_addr
ether_addr_copy\
ether_format_addrreplace_defineETHER_ADDR_LENETHER_TYPE_LENETHER_CRC_LENETHER_HDR_LEN\
ETHER_MIN_LENETHER_MAX_LENETHER_MTUETHER_MAX_VLAN_FRAME_LEN \ ETHER_MAX_VLAN_ID ETHER_MAX_JUMBO_FRAME_LEN ETHER_MIN_MTU \ ETHER_LOCAL_ADMIN_ADDR ETHER_GROUP_ADDR ETHER_TYPE_IPv4 \ ETHER_TYPE_IPv6 ETHER_TYPE_ARP ETHER_TYPE_VLAN
ETHER_TYPE_RARP\
ETHER_TYPE_QINQETHER_TYPE_ETAGETHER_TYPE_1588ETHER_TYPE_SLOW\
ETHER_TYPE_TEBETHER_TYPE_LLDPETHER_TYPE_MPLSETHER_TYPE_MPLSM \ ETHER_VXLAN_HLEN ETHER_ADDR_FMT_SIZE VXLAN_GPE_TYPE_IPV4 \ VXLAN_GPE_TYPE_IPV6 VXLAN_GPE_TYPE_ETH VXLAN_GPE_TYPE_NSH \ VXLAN_GPE_TYPE_MPLS VXLAN_GPE_TYPE_GBP VXLAN_GPE_TYPE_VBNG \ ETHER_VXLAN_GPE_HLEN
replace_structesp_hdrreplace_structgre_hdrreplace_structicmp_hdrreplace_defineIP_ICMP_ECHO_REPLYIP_ICMP_ECHO_REQUESTreplace_structipv4_hdripv6_hdrreplace_define"IPv4("IPV4_MAX_PKT_LENIPV4_HDR_IHL_MASKIPV4_IHL_MULTIPLIER \ IPV4_HDR_DF_SHIFT IPV4_HDR_MF_SHIFT IPV4_HDR_FO_SHIFT \ IPV4_HDR_DF_FLAG IPV4_HDR_MF_FLAG IPV4_HDR_OFFSET_MASK \ IPV4_HDR_OFFSET_UNITS IPV4_ANY IPV4_LOOPBACK IPV4_BROADCAST
Quoted 10 lines
\
IPV4_ALLHOSTS_GROUPIPV4_ALLRTRS_GROUPIPV4_MAX_LOCAL_GROUP
\
IPV4_MIN_MCASTIPV4_MAX_MCASTIS_IPV4_MCASTIPV6_HDR_FL_SHIFT\
IPV6_HDR_TC_SHIFTIPV6_HDR_FL_MASKIPV6_HDR_TC_MASKreplace_structsctp_hdrreplace_structtcp_hdrreplace_structudp_hdr
Thanks Olivier.
I tested this script against OVS dpdk-latest branch and did not catch any false positive, so I will submit the changes to OVS ml once my latest changes are in.
Signature · 1 line
David Marchand
29/05/2019 19:29, David Marchand:
Quoted 5 lines · Olivier Matz
Quoted 4 lines
By the way, here is below a script that can be used to ease the porting of an application. It includes modifications proposed by David [1].
Quoted 7 lines
Quoted 1 line
It is probably not 100% reliable, but it will do most of the job.
Thanks Olivier.
I tested this script against OVS dpdk-latest branch and did not catch any false positive, so I will submit the changes to OVS ml once my latest changes are in.
Should we get this script in DPDK?