From: Olivier Matz Date: Tue, 21 May 2019 16:13:03 +0000 (+0200) Subject: net: add rte prefix to ether structures X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1;p=dpdk.git net: add rte prefix to ether structures Add 'rte_' prefix to structures: - rename struct ether_addr as struct rte_ether_addr. - rename struct ether_hdr as struct rte_ether_hdr. - rename struct vlan_hdr as struct rte_vlan_hdr. - rename struct vxlan_hdr as struct rte_vxlan_hdr. - rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz Reviewed-by: Stephen Hemminger Reviewed-by: Maxime Coquelin Reviewed-by: Ferruh Yigit --- diff --git a/app/pdump/main.c b/app/pdump/main.c index 3d208548fa..80dc924cfa 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -549,7 +549,7 @@ signal_handler(int sig_num) static inline int configure_vdev(uint16_t port_id) { - struct ether_addr addr; + struct rte_ether_addr addr; const uint16_t rxRings = 0, txRings = 1; int ret; uint16_t q; diff --git a/app/test-pipeline/pipeline_acl.c b/app/test-pipeline/pipeline_acl.c index 524d2212d9..e53e5ecef0 100644 --- a/app/test-pipeline/pipeline_acl.c +++ b/app/test-pipeline/pipeline_acl.c @@ -39,7 +39,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint8_t), .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, next_proto_id), }, { @@ -47,7 +47,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = SRC_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, src_addr), }, { @@ -55,7 +55,7 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = DST_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, dst_addr), }, { @@ -63,15 +63,16 @@ struct rte_acl_field_def ipv4_field_formats[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr), + .offset = sizeof(struct rte_ether_hdr) + + sizeof(struct ipv4_hdr), }, { .type = RTE_ACL_FIELD_TYPE_RANGE, .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_FIELD_IPV4, - .offset = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) + - sizeof(uint16_t), + .offset = sizeof(struct rte_ether_hdr) + + sizeof(struct ipv4_hdr) + sizeof(uint16_t), }, }; diff --git a/app/test-pipeline/pipeline_hash.c b/app/test-pipeline/pipeline_hash.c index c20147234e..3e4a0a1bb2 100644 --- a/app/test-pipeline/pipeline_hash.c +++ b/app/test-pipeline/pipeline_hash.c @@ -441,14 +441,14 @@ app_main_loop_rx_metadata(void) { if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) { ip_hdr = (struct ipv4_hdr *) - &m_data[sizeof(struct ether_hdr)]; + &m_data[sizeof(struct rte_ether_hdr)]; ip_dst = ip_hdr->dst_addr; k32 = (uint32_t *) key; k32[0] = ip_dst & 0xFFFFFF00; } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) { ipv6_hdr = (struct ipv6_hdr *) - &m_data[sizeof(struct ether_hdr)]; + &m_data[sizeof(struct rte_ether_hdr)]; ipv6_dst = ipv6_hdr->dst_addr; memcpy(key, ipv6_dst, 16); diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index c1042dd982..90e35022ee 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -6124,7 +6124,7 @@ struct cmd_set_bond_mac_addr_result { cmdline_fixed_string_t bonding; cmdline_fixed_string_t mac_addr; uint16_t port_num; - struct ether_addr address; + struct rte_ether_addr address; }; static void cmd_set_bond_mac_addr_parsed(void *parsed_result, @@ -7897,7 +7897,7 @@ struct cmd_mac_addr_result { cmdline_fixed_string_t mac_addr_cmd; cmdline_fixed_string_t what; uint16_t port_num; - struct ether_addr address; + struct rte_ether_addr address; }; static void cmd_mac_addr_parsed(void *parsed_result, @@ -8096,7 +8096,7 @@ struct cmd_set_uc_hash_table { cmdline_fixed_string_t port; portid_t port_id; cmdline_fixed_string_t what; - struct ether_addr address; + struct rte_ether_addr address; cmdline_fixed_string_t mode; }; @@ -8220,7 +8220,7 @@ struct cmd_set_vf_macvlan_filter { portid_t port_id; cmdline_fixed_string_t vf; uint8_t vf_id; - struct ether_addr address; + struct rte_ether_addr address; cmdline_fixed_string_t filter_type; cmdline_fixed_string_t mode; }; @@ -8479,7 +8479,7 @@ struct cmd_vf_mac_addr_result { uint16_t port_num; cmdline_fixed_string_t vf; uint8_t vf_num; - struct ether_addr address; + struct rte_ether_addr address; }; static void cmd_vf_mac_addr_parsed(void *parsed_result, @@ -8792,8 +8792,8 @@ struct cmd_tunnel_filter_result { cmdline_fixed_string_t cmd; cmdline_fixed_string_t what; portid_t port_id; - struct ether_addr outer_mac; - struct ether_addr inner_mac; + struct rte_ether_addr outer_mac; + struct rte_ether_addr inner_mac; cmdline_ipaddr_t ip_value; uint16_t inner_vlan; cmdline_fixed_string_t tunnel_type; @@ -10583,7 +10583,7 @@ struct cmd_ethertype_filter_result { portid_t port_id; cmdline_fixed_string_t ops; cmdline_fixed_string_t mac; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; cmdline_fixed_string_t ethertype; uint16_t ethertype_value; cmdline_fixed_string_t drop; @@ -10643,7 +10643,7 @@ cmd_ethertype_filter_parsed(void *parsed_result, if (!strcmp(res->mac, "mac_addr")) { filter.flags |= RTE_ETHTYPE_FLAGS_MAC; rte_memcpy(&filter.mac_addr, &res->mac_addr, - sizeof(struct ether_addr)); + sizeof(struct rte_ether_addr)); } if (!strcmp(res->drop, "drop")) filter.flags |= RTE_ETHTYPE_FLAGS_DROP; @@ -10722,7 +10722,7 @@ struct cmd_flow_director_result { cmdline_fixed_string_t fd_id; uint32_t fd_id_value; cmdline_fixed_string_t mac; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; cmdline_fixed_string_t tunnel; cmdline_fixed_string_t tunnel_type; cmdline_fixed_string_t tunnel_id; @@ -11025,12 +11025,12 @@ cmd_flow_director_filter_parsed(void *parsed_result, if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_MAC_VLAN) rte_memcpy(&entry.input.flow.mac_vlan_flow.mac_addr, &res->mac_addr, - sizeof(struct ether_addr)); + sizeof(struct rte_ether_addr)); if (fdir_conf.mode == RTE_FDIR_MODE_PERFECT_TUNNEL) { rte_memcpy(&entry.input.flow.tunnel_flow.mac_addr, &res->mac_addr, - sizeof(struct ether_addr)); + sizeof(struct rte_ether_addr)); entry.input.flow.tunnel_flow.tunnel_type = str2fdir_tunneltype(res->tunnel_type); entry.input.flow.tunnel_flow.tunnel_id = @@ -12463,7 +12463,7 @@ struct cmd_mcast_addr_result { cmdline_fixed_string_t mcast_addr_cmd; cmdline_fixed_string_t what; uint16_t port_num; - struct ether_addr mc_addr; + struct rte_ether_addr mc_addr; }; static void cmd_mcast_addr_parsed(void *parsed_result, @@ -13882,7 +13882,7 @@ struct cmd_set_vf_mac_addr_result { cmdline_fixed_string_t addr; portid_t port_id; uint16_t vf_id; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; }; @@ -14187,7 +14187,7 @@ struct cmd_macsec_sc_result { cmdline_fixed_string_t sc; cmdline_fixed_string_t tx_rx; portid_t port_id; - struct ether_addr mac; + struct rte_ether_addr mac; uint16_t pi; }; @@ -15188,8 +15188,8 @@ struct cmd_set_vxlan_result { uint16_t tci; uint8_t tos; uint8_t ttl; - struct ether_addr eth_src; - struct ether_addr eth_dst; + struct rte_ether_addr eth_src; + struct rte_ether_addr eth_dst; }; cmdline_parse_token_string_t cmd_set_vxlan_set = @@ -15411,8 +15411,8 @@ struct cmd_set_nvgre_result { cmdline_ipaddr_t ip_src; cmdline_ipaddr_t ip_dst; uint16_t tci; - struct ether_addr eth_src; - struct ether_addr eth_dst; + struct rte_ether_addr eth_src; + struct rte_ether_addr eth_dst; }; cmdline_parse_token_string_t cmd_set_nvgre_set = @@ -15557,8 +15557,8 @@ struct cmd_set_l2_encap_result { cmdline_fixed_string_t ip_version; uint32_t vlan_present:1; uint16_t tci; - struct ether_addr eth_src; - struct ether_addr eth_dst; + struct rte_ether_addr eth_src; + struct rte_ether_addr eth_dst; }; cmdline_parse_token_string_t cmd_set_l2_encap_set = @@ -15714,8 +15714,8 @@ struct cmd_set_mplsogre_encap_result { cmdline_ipaddr_t ip_src; cmdline_ipaddr_t ip_dst; uint16_t tci; - struct ether_addr eth_src; - struct ether_addr eth_dst; + struct rte_ether_addr eth_src; + struct rte_ether_addr eth_dst; }; cmdline_parse_token_string_t cmd_set_mplsogre_encap_set = @@ -15938,8 +15938,8 @@ struct cmd_set_mplsoudp_encap_result { cmdline_ipaddr_t ip_src; cmdline_ipaddr_t ip_dst; uint16_t tci; - struct ether_addr eth_src; - struct ether_addr eth_dst; + struct rte_ether_addr eth_src; + struct rte_ether_addr eth_dst; }; cmdline_parse_token_string_t cmd_set_mplsoudp_encap_set = diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 3070e0e0dc..2e274f9b14 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -4613,7 +4613,7 @@ parse_mac_addr(struct context *ctx, const struct token *token, void *buf, unsigned int size) { const struct arg *arg = pop_args(ctx); - struct ether_addr tmp; + struct rte_ether_addr tmp; int ret; (void)token; diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f9cb129648..03ce502bac 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -108,7 +108,7 @@ const struct rss_type_info rss_type_table[] = { }; static void -print_ethaddr(const char *name, struct ether_addr *eth_addr) +print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); @@ -391,7 +391,7 @@ void port_infos_display(portid_t port_id) { struct rte_port *port; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; struct rte_eth_link link; struct rte_eth_dev_info dev_info; int vlan_offload; @@ -538,7 +538,7 @@ port_summary_header_display(void) void port_summary_display(portid_t port_id) { - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; struct rte_eth_link link; struct rte_eth_dev_info dev_info; char name[RTE_ETH_NAME_MAX_LEN]; @@ -2519,7 +2519,8 @@ set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) * Check that each segment length is greater or equal than * the mbuf data sise. * Check also that the total packet length is greater or equal than the - * size of an empty UDP/IP packet (sizeof(struct ether_hdr) + 20 + 8). + * size of an empty UDP/IP packet (sizeof(struct rte_ether_hdr) + + * 20 + 8). */ tx_pkt_len = 0; for (i = 0; i < nb_segs; i++) { @@ -2530,10 +2531,10 @@ set_tx_pkt_segments(unsigned *seg_lengths, unsigned nb_segs) } tx_pkt_len = (uint16_t)(tx_pkt_len + seg_lengths[i]); } - if (tx_pkt_len < (sizeof(struct ether_hdr) + 20 + 8)) { + if (tx_pkt_len < (sizeof(struct rte_ether_hdr) + 20 + 8)) { printf("total packet length=%u < %d - give up\n", (unsigned) tx_pkt_len, - (int)(sizeof(struct ether_hdr) + 20 + 8)); + (int)(sizeof(struct rte_ether_hdr) + 20 + 8)); return; } @@ -3453,7 +3454,7 @@ set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk) static int mcast_addr_pool_extend(struct rte_port *port) { - struct ether_addr *mc_pool; + struct rte_ether_addr *mc_pool; size_t mc_pool_size; /* @@ -3470,9 +3471,9 @@ mcast_addr_pool_extend(struct rte_port *port) * The previous test guarantees that port->mc_addr_nb is a multiple * of MCAST_POOL_INC. */ - mc_pool_size = sizeof(struct ether_addr) * (port->mc_addr_nb + + mc_pool_size = sizeof(struct rte_ether_addr) * (port->mc_addr_nb + MCAST_POOL_INC); - mc_pool = (struct ether_addr *) realloc(port->mc_addr_pool, + mc_pool = (struct rte_ether_addr *) realloc(port->mc_addr_pool, mc_pool_size); if (mc_pool == NULL) { printf("allocation of pool of %u multicast addresses failed\n", @@ -3501,7 +3502,7 @@ mcast_addr_pool_remove(struct rte_port *port, uint32_t addr_idx) } memmove(&port->mc_addr_pool[addr_idx], &port->mc_addr_pool[addr_idx + 1], - sizeof(struct ether_addr) * (port->mc_addr_nb - addr_idx)); + sizeof(struct rte_ether_addr) * (port->mc_addr_nb - addr_idx)); } static void @@ -3520,7 +3521,7 @@ eth_port_multicast_addr_list_set(portid_t port_id) } void -mcast_addr_add(portid_t port_id, struct ether_addr *mc_addr) +mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr) { struct rte_port *port; uint32_t i; @@ -3548,7 +3549,7 @@ mcast_addr_add(portid_t port_id, struct ether_addr *mc_addr) } void -mcast_addr_remove(portid_t port_id, struct ether_addr *mc_addr) +mcast_addr_remove(portid_t port_id, struct rte_ether_addr *mc_addr) { struct rte_port *port; uint32_t i; diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index f4f2a7b298..481b91a26a 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -142,18 +142,19 @@ parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info) * header. The l4_len argument is only set in case of TCP (useful for TSO). */ static void -parse_ethernet(struct ether_hdr *eth_hdr, struct testpmd_offload_info *info) +parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info) { struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; - info->l2_len = sizeof(struct ether_hdr); + info->l2_len = sizeof(struct rte_ether_hdr); info->ethertype = eth_hdr->ether_type; if (info->ethertype == _htons(ETHER_TYPE_VLAN)) { - struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); + struct rte_vlan_hdr *vlan_hdr = ( + struct rte_vlan_hdr *)(eth_hdr + 1); - info->l2_len += sizeof(struct vlan_hdr); + info->l2_len += sizeof(struct rte_vlan_hdr); info->ethertype = vlan_hdr->eth_proto; } @@ -180,7 +181,7 @@ parse_vxlan(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info, uint32_t pkt_type) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; /* check udp destination port, 4789 is the default vxlan port * (rfc7348) or that the rx offload flag is set (i40e only @@ -195,9 +196,9 @@ parse_vxlan(struct udp_hdr *udp_hdr, info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - eth_hdr = (struct ether_hdr *)((char *)udp_hdr + + eth_hdr = (struct rte_ether_hdr *)((char *)udp_hdr + sizeof(struct udp_hdr) + - sizeof(struct vxlan_hdr)); + sizeof(struct rte_vxlan_hdr)); parse_ethernet(eth_hdr, info); info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */ @@ -208,17 +209,17 @@ static void parse_vxlan_gpe(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; - struct vxlan_gpe_hdr *vxlan_gpe_hdr; + struct rte_vxlan_gpe_hdr *vxlan_gpe_hdr; uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr); /* Check udp destination port. */ if (udp_hdr->dst_port != _htons(vxlan_gpe_udp_port)) return; - vxlan_gpe_hdr = (struct vxlan_gpe_hdr *)((char *)udp_hdr + + vxlan_gpe_hdr = (struct rte_vxlan_gpe_hdr *)((char *)udp_hdr + sizeof(struct udp_hdr)); if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto == @@ -257,7 +258,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr, info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - eth_hdr = (struct ether_hdr *)((char *)vxlan_gpe_hdr + + eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_gpe_hdr + vxlan_gpe_len); parse_ethernet(eth_hdr, info); @@ -271,7 +272,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr, static void parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; uint8_t gre_len = 0; @@ -318,7 +319,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info) info->outer_l3_len = info->l3_len; info->outer_l4_proto = info->l4_proto; - eth_hdr = (struct ether_hdr *)((char *)gre_hdr + gre_len); + eth_hdr = (struct rte_ether_hdr *)((char *)gre_hdr + gre_len); parse_ethernet(eth_hdr, info); } else @@ -691,7 +692,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) struct rte_mbuf **tx_pkts_burst; struct rte_port *txp; struct rte_mbuf *m, *p; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; void *l3_hdr = NULL, *outer_l3_hdr = NULL; /* can be IPv4 or IPv6 */ void **gro_ctx; uint16_t gro_pkts_num; @@ -765,7 +766,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs) /* step 1: dissect packet, parsing optional vlan, ip4/ip6, vxlan * and inner headers */ - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_addr_copy(&peer_eth_addrs[fs->peer_addr], ð_hdr->d_addr); ether_addr_copy(&ports[fs->tx_port].eth_addr, diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c index 3214e3c958..ac56ca1d85 100644 --- a/app/test-pmd/flowgen.c +++ b/app/test-pmd/flowgen.c @@ -76,9 +76,9 @@ static uint32_t cfg_ip_src = IPv4(10, 254, 0, 0); static uint32_t cfg_ip_dst = IPv4(10, 253, 0, 0); static uint16_t cfg_udp_src = 1000; static uint16_t cfg_udp_dst = 1001; -static struct ether_addr cfg_ether_src = +static struct rte_ether_addr cfg_ether_src = {{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x00 }}; -static struct ether_addr cfg_ether_dst = +static struct rte_ether_addr cfg_ether_dst = {{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x01 }}; #define IP_DEFTTL 64 /* from RFC 1340. */ @@ -119,7 +119,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_mempool *mbp; struct rte_mbuf *pkt; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ip_hdr; struct udp_hdr *udp_hdr; uint16_t vlan_tci, vlan_tci_outer; @@ -170,7 +170,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) pkt->next = NULL; /* Initialize Ethernet header. */ - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ether_addr_copy(&cfg_ether_dst, ð_hdr->d_addr); ether_addr_copy(&cfg_ether_src, ð_hdr->s_addr); eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); @@ -205,7 +205,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs) pkt->ol_flags = ol_flags; pkt->vlan_tci = vlan_tci; pkt->vlan_tci_outer = vlan_tci_outer; - pkt->l2_len = sizeof(struct ether_hdr); + pkt->l2_len = sizeof(struct rte_ether_hdr); pkt->l3_len = sizeof(struct ipv4_hdr); pkts_burst[nb_pkt] = pkt; diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index b0767f22bd..3cc4d25a46 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -221,7 +221,7 @@ ipv4_addr_to_dot(uint32_t be_ipv4_addr, char *buf) } static void -ether_addr_dump(const char *what, const struct ether_addr *ea) +ether_addr_dump(const char *what, const struct rte_ether_addr *ea) { char buf[ETHER_ADDR_FMT_SIZE]; @@ -275,12 +275,12 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) { struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_mbuf *pkt; - struct ether_hdr *eth_h; - struct vlan_hdr *vlan_h; + struct rte_ether_hdr *eth_h; + struct rte_vlan_hdr *vlan_h; struct rte_arp_hdr *arp_h; struct ipv4_hdr *ip_h; struct icmp_hdr *icmp_h; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; uint32_t retry; uint32_t ip_addr; uint16_t nb_rx; @@ -321,9 +321,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], void *)); pkt = pkts_burst[i]; - eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); eth_type = RTE_BE_TO_CPU_16(eth_h->ether_type); - l2_len = sizeof(struct ether_hdr); + l2_len = sizeof(struct rte_ether_hdr); if (verbose_level > 0) { printf("\nPort %d pkt-len=%u nb-segs=%u\n", fs->rx_port, pkt->pkt_len, pkt->nb_segs); @@ -331,9 +331,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs) ether_addr_dump(" dst=", ð_h->d_addr); } if (eth_type == ETHER_TYPE_VLAN) { - vlan_h = (struct vlan_hdr *) - ((char *)eth_h + sizeof(struct ether_hdr)); - l2_len += sizeof(struct vlan_hdr); + vlan_h = (struct rte_vlan_hdr *) + ((char *)eth_h + sizeof(struct rte_ether_hdr)); + l2_len += sizeof(struct rte_vlan_hdr); eth_type = rte_be_to_cpu_16(vlan_h->eth_proto); if (verbose_level > 0) { vlan_id = rte_be_to_cpu_16(vlan_h->vlan_tci) diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 6ae802c867..c6aa3c6189 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -93,8 +93,8 @@ static void ieee1588_packet_fwd(struct fwd_stream *fs) { struct rte_mbuf *mb; - struct ether_hdr *eth_hdr; - struct ether_addr addr; + struct rte_ether_hdr *eth_hdr; + struct rte_ether_addr addr; struct ptpv2_msg *ptp_hdr; uint16_t eth_type; uint32_t timesync_index; @@ -111,7 +111,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) * Check that the received packet is a PTP packet that was detected * by the hardware. */ - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); eth_type = rte_be_to_cpu_16(eth_hdr->ether_type); if (! (mb->ol_flags & PKT_RX_IEEE1588_PTP)) { @@ -141,7 +141,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs) * PTP_SYNC_MESSAGE. */ ptp_hdr = (struct ptpv2_msg *) (rte_pktmbuf_mtod(mb, char *) + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); if (ptp_hdr->version != 0x02) { printf("Port %u Received PTP V2 Ethernet frame with wrong PTP" " protocol version 0x%x (should be 0x02)\n", diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c index 7cac757a00..631f86f3e4 100644 --- a/app/test-pmd/macfwd.c +++ b/app/test-pmd/macfwd.c @@ -49,7 +49,7 @@ pkt_burst_mac_forward(struct fwd_stream *fs) struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; struct rte_port *txp; struct rte_mbuf *mb; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t retry; uint16_t nb_rx; uint16_t nb_tx; @@ -91,14 +91,14 @@ pkt_burst_mac_forward(struct fwd_stream *fs) rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i + 1], void *)); mb = pkts_burst[i]; - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); ether_addr_copy(&peer_eth_addrs[fs->peer_addr], ð_hdr->d_addr); ether_addr_copy(&ports[fs->tx_port].eth_addr, ð_hdr->s_addr); mb->ol_flags &= IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF; mb->ol_flags |= ol_flags; - mb->l2_len = sizeof(struct ether_hdr); + mb->l2_len = sizeof(struct rte_ether_hdr); mb->l3_len = sizeof(struct ipv4_hdr); mb->vlan_tci = txp->tx_vlan_id; mb->vlan_tci_outer = txp->tx_vlan_id_outer; diff --git a/app/test-pmd/macswap.h b/app/test-pmd/macswap.h index bfa9b0edac..d53e5d482f 100644 --- a/app/test-pmd/macswap.h +++ b/app/test-pmd/macswap.h @@ -11,9 +11,9 @@ static inline void do_macswap(struct rte_mbuf *pkts[], uint16_t nb, struct rte_port *txp) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct rte_mbuf *mb; - struct ether_addr addr; + struct rte_ether_addr addr; uint64_t ol_flags; int i; @@ -26,7 +26,7 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, rte_prefetch0(rte_pktmbuf_mtod(pkts[i+1], void *)); mb = pkts[i]; - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); /* Swap dest and src mac addresses. */ ether_addr_copy(ð_hdr->d_addr, &addr); diff --git a/app/test-pmd/macswap_common.h b/app/test-pmd/macswap_common.h index 19754cdd10..56f86baad6 100644 --- a/app/test-pmd/macswap_common.h +++ b/app/test-pmd/macswap_common.h @@ -39,7 +39,7 @@ mbuf_field_set(struct rte_mbuf *mb, uint64_t ol_flags) { mb->ol_flags &= IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF; mb->ol_flags |= ol_flags; - mb->l2_len = sizeof(struct ether_hdr); + mb->l2_len = sizeof(struct rte_ether_hdr); mb->l3_len = sizeof(struct ipv4_hdr); } diff --git a/app/test-pmd/macswap_neon.h b/app/test-pmd/macswap_neon.h index bdf416aa26..df6c260cd4 100644 --- a/app/test-pmd/macswap_neon.h +++ b/app/test-pmd/macswap_neon.h @@ -16,7 +16,7 @@ static inline void do_macswap(struct rte_mbuf *pkts[], uint16_t nb, struct rte_port *txp) { - struct ether_hdr *eth_hdr[4]; + struct rte_ether_hdr *eth_hdr[4]; struct rte_mbuf *mb[4]; uint64_t ol_flags; int i; @@ -46,16 +46,16 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, } mb[0] = pkts[i++]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *); mb[1] = pkts[i++]; - eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct ether_hdr *); + eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct rte_ether_hdr *); mb[2] = pkts[i++]; - eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct ether_hdr *); + eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct rte_ether_hdr *); mb[3] = pkts[i++]; - eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct ether_hdr *); + eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct rte_ether_hdr *); v0 = vld1q_u8((uint8_t const *)eth_hdr[0]); v1 = vld1q_u8((uint8_t const *)eth_hdr[1]); @@ -83,7 +83,7 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, if (i < nb - 1) rte_prefetch0(rte_pktmbuf_mtod(pkts[i+1], void *)); mb[0] = pkts[i]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *); /* Swap dest and src mac addresses. */ v0 = vld1q_u8((uint8_t const *)eth_hdr[0]); diff --git a/app/test-pmd/macswap_sse.h b/app/test-pmd/macswap_sse.h index 2b6e7324da..223f87a539 100644 --- a/app/test-pmd/macswap_sse.h +++ b/app/test-pmd/macswap_sse.h @@ -11,7 +11,7 @@ static inline void do_macswap(struct rte_mbuf *pkts[], uint16_t nb, struct rte_port *txp) { - struct ether_hdr *eth_hdr[4]; + struct rte_ether_hdr *eth_hdr[4]; struct rte_mbuf *mb[4]; uint64_t ol_flags; int i; @@ -43,20 +43,20 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, } mb[0] = pkts[i++]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *); addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]); mb[1] = pkts[i++]; - eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct ether_hdr *); + eth_hdr[1] = rte_pktmbuf_mtod(mb[1], struct rte_ether_hdr *); addr1 = _mm_loadu_si128((__m128i *)eth_hdr[1]); mb[2] = pkts[i++]; - eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct ether_hdr *); + eth_hdr[2] = rte_pktmbuf_mtod(mb[2], struct rte_ether_hdr *); addr2 = _mm_loadu_si128((__m128i *)eth_hdr[2]); mb[3] = pkts[i++]; - eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct ether_hdr *); + eth_hdr[3] = rte_pktmbuf_mtod(mb[3], struct rte_ether_hdr *); addr3 = _mm_loadu_si128((__m128i *)eth_hdr[3]); addr0 = _mm_shuffle_epi8(addr0, shfl_msk); @@ -80,7 +80,7 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb, if (i < nb - 1) rte_prefetch0(rte_pktmbuf_mtod(pkts[i+1], void *)); mb[0] = pkts[i]; - eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(mb[0], struct rte_ether_hdr *); /* Swap dest and src mac addresses. */ addr0 = _mm_loadu_si128((__m128i *)eth_hdr[0]); diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index f0061d99f9..2c736ecac3 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -137,7 +137,7 @@ uint8_t txring_numa[RTE_MAX_ETHPORTS]; * Must be instantiated with the ethernet addresses of peer traffic generator * ports. */ -struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS]; +struct rte_ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS]; portid_t nb_peer_eth_addrs = 0; /* @@ -2018,7 +2018,7 @@ start_port(portid_t pid) portid_t pi; queueid_t qi; struct rte_port *port; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; if (port_id_is_invalid(pid, ENABLED_WARN)) return 0; diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 1d9b7a2458..abee0a952a 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -162,7 +162,7 @@ struct softnic_port { struct rte_port { struct rte_eth_dev_info dev_info; /**< PCI info + driver name */ struct rte_eth_conf dev_conf; /**< Port configuration. */ - struct ether_addr eth_addr; /**< Port ethernet address */ + struct rte_ether_addr eth_addr; /**< Port ethernet address */ struct rte_eth_stats stats; /**< Last port statistics */ unsigned int socket_id; /**< For NUMA support */ uint16_t parse_tunnel:1; /**< Parse internal headers */ @@ -182,7 +182,7 @@ struct rte_port { uint16_t nb_tx_desc[MAX_QUEUE_ID+1]; /**< per queue tx desc number */ struct rte_eth_rxconf rx_conf[MAX_QUEUE_ID+1]; /**< per queue rx configuration */ struct rte_eth_txconf tx_conf[MAX_QUEUE_ID+1]; /**< per queue tx configuration */ - struct ether_addr *mc_addr_pool; /**< pool of multicast addrs */ + struct rte_ether_addr *mc_addr_pool; /**< pool of multicast addrs */ uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool */ uint8_t slave_flag; /**< bonding slave port */ struct port_flow *flow_list; /**< Associated flows. */ @@ -460,7 +460,7 @@ extern struct fwd_stream **fwd_streams; extern uint16_t vxlan_gpe_udp_port; /**< UDP port of tunnel VXLAN-GPE. */ extern portid_t nb_peer_eth_addrs; /**< Number of peer ethernet addresses. */ -extern struct ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS]; +extern struct rte_ether_addr peer_eth_addrs[RTE_MAX_ETHPORTS]; extern uint32_t burst_tx_delay_time; /**< Burst tx delay time(us) for mac-retry. */ extern uint32_t burst_tx_retry_num; /**< Burst tx retry number for mac-retry. */ @@ -819,8 +819,8 @@ void show_gro(portid_t port_id); void setup_gso(const char *mode, portid_t port_id); /* Functions to manage the set of filtered Multicast MAC addresses */ -void mcast_addr_add(portid_t port_id, struct ether_addr *mc_addr); -void mcast_addr_remove(portid_t port_id, struct ether_addr *mc_addr); +void mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr); +void mcast_addr_remove(portid_t port_id, struct rte_ether_addr *mc_addr); void port_dcb_info_display(portid_t port_id); uint8_t *open_file(const char *file_path, uint32_t *size); diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c index fdfca14cbd..e558b40185 100644 --- a/app/test-pmd/txonly.c +++ b/app/test-pmd/txonly.c @@ -152,7 +152,7 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr, static inline bool pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, - struct ether_hdr *eth_hdr, const uint16_t vlan_tci, + struct rte_ether_hdr *eth_hdr, const uint16_t vlan_tci, const uint16_t vlan_tci_outer, const uint64_t ol_flags) { struct rte_mbuf *pkt_segs[RTE_MAX_SEGS_PER_PKT]; @@ -176,7 +176,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, pkt->ol_flags = ol_flags; pkt->vlan_tci = vlan_tci; pkt->vlan_tci_outer = vlan_tci_outer; - pkt->l2_len = sizeof(struct ether_hdr); + pkt->l2_len = sizeof(struct rte_ether_hdr); pkt->l3_len = sizeof(struct ipv4_hdr); pkt_len = pkt->data_len; @@ -193,14 +193,14 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, */ copy_buf_to_pkt(eth_hdr, sizeof(*eth_hdr), pkt, 0); copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); if (txonly_multi_flow) { struct ipv4_hdr *ip_hdr; uint32_t addr; ip_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); /* * Generate multiple flows by varying IP src addr. This * enables packets are well distributed by RSS in @@ -212,7 +212,7 @@ pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp, ip_hdr->src_addr = rte_cpu_to_be_32(addr); } copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr)); /* * Complete first mbuf of packet and append it to the @@ -234,7 +234,7 @@ pkt_burst_transmit(struct fwd_stream *fs) struct rte_port *txp; struct rte_mbuf *pkt; struct rte_mempool *mbp; - struct ether_hdr eth_hdr; + struct rte_ether_hdr eth_hdr; uint16_t nb_tx; uint16_t nb_pkt; uint16_t vlan_tci, vlan_tci_outer; @@ -347,9 +347,10 @@ tx_only_begin(__attribute__((unused)) portid_t pi) { uint16_t pkt_data_len; - pkt_data_len = (uint16_t) (tx_pkt_length - (sizeof(struct ether_hdr) + - sizeof(struct ipv4_hdr) + - sizeof(struct udp_hdr))); + pkt_data_len = (uint16_t) (tx_pkt_length - ( + sizeof(struct rte_ether_hdr) + + sizeof(struct ipv4_hdr) + + sizeof(struct udp_hdr))); setup_pkt_udp_ip_headers(&pkt_ip_hdr, &pkt_udp_hdr, pkt_data_len); } diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c index 6b0791daab..0544b8e536 100644 --- a/app/test-pmd/util.c +++ b/app/test-pmd/util.c @@ -14,7 +14,7 @@ #include "testpmd.h" static inline void -print_ether_addr(const char *what, struct ether_addr *eth_addr) +print_ether_addr(const char *what, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); @@ -26,7 +26,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint16_t nb_pkts, int is_rx) { struct rte_mbuf *mb; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t eth_type; uint64_t ol_flags; uint16_t i, packet_type; @@ -46,7 +46,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], (unsigned int) nb_pkts); for (i = 0; i < nb_pkts; i++) { mb = pkts[i]; - eth_hdr = rte_pktmbuf_mtod(mb, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *); eth_type = RTE_BE_TO_CPU_16(eth_hdr->ether_type); ol_flags = mb->ol_flags; packet_type = mb->packet_type; @@ -110,9 +110,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], uint8_t l3_len; uint8_t l4_len; uint8_t l4_proto; - struct vxlan_hdr *vxlan_hdr; + struct rte_vxlan_hdr *vxlan_hdr; - l2_len = sizeof(struct ether_hdr); + l2_len = sizeof(struct rte_ether_hdr); /* Do not support ipv4 option field */ if (RTE_ETH_IS_IPV4_HDR(packet_type)) { @@ -134,7 +134,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], l2_len + l3_len); l4_len = sizeof(struct udp_hdr); vxlan_hdr = rte_pktmbuf_mtod_offset(mb, - struct vxlan_hdr *, + struct rte_vxlan_hdr *, l2_len + l3_len + l4_len); udp_port = RTE_BE_TO_CPU_16(udp_hdr->dst_port); vx_vni = rte_be_to_cpu_32(vxlan_hdr->vx_vni); diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c index ccc0bd5919..a05e3c86ca 100644 --- a/app/test/packet_burst_generator.c +++ b/app/test/packet_burst_generator.c @@ -53,16 +53,17 @@ copy_buf_to_pkt(void *buf, unsigned len, struct rte_mbuf *pkt, unsigned offset) } void -initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac, - struct ether_addr *dst_mac, uint16_t ether_type, +initialize_eth_header(struct rte_ether_hdr *eth_hdr, + struct rte_ether_addr *src_mac, + struct rte_ether_addr *dst_mac, uint16_t ether_type, uint8_t vlan_enabled, uint16_t van_id) { ether_addr_copy(dst_mac, ð_hdr->d_addr); ether_addr_copy(src_mac, ð_hdr->s_addr); if (vlan_enabled) { - struct vlan_hdr *vhdr = (struct vlan_hdr *)((uint8_t *)eth_hdr + - sizeof(struct ether_hdr)); + struct rte_vlan_hdr *vhdr = (struct rte_vlan_hdr *)( + (uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr)); eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_VLAN); @@ -74,8 +75,10 @@ initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac, } void -initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct ether_addr *src_mac, - struct ether_addr *dst_mac, uint32_t src_ip, uint32_t dst_ip, +initialize_arp_header(struct rte_arp_hdr *arp_hdr, + struct rte_ether_addr *src_mac, + struct rte_ether_addr *dst_mac, + uint32_t src_ip, uint32_t dst_ip, uint32_t opcode) { arp_hdr->arp_hardware = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER); @@ -256,9 +259,9 @@ initialize_ipv4_header_proto(struct ipv4_hdr *ip_hdr, uint32_t src_addr, int generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, - struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr, - uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst, - uint8_t pkt_len, uint8_t nb_pkt_segs) + struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, + void *ip_hdr, uint8_t ipv4, struct udp_hdr *udp_hdr, + int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs) { int i, nb_pkt = 0; size_t eth_hdr_size; @@ -293,9 +296,10 @@ nomore_mbuf: * Copy headers in first packet segment(s). */ if (vlan_enabled) - eth_hdr_size = sizeof(struct ether_hdr) + sizeof(struct vlan_hdr); + eth_hdr_size = sizeof(struct rte_ether_hdr) + + sizeof(struct rte_vlan_hdr); else - eth_hdr_size = sizeof(struct ether_hdr); + eth_hdr_size = sizeof(struct rte_ether_hdr); copy_buf_to_pkt(eth_hdr, eth_hdr_size, pkt, 0); @@ -333,8 +337,8 @@ nomore_mbuf: int generate_packet_burst_proto(struct rte_mempool *mp, - struct rte_mbuf **pkts_burst, - struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr, + struct rte_mbuf **pkts_burst, struct rte_ether_hdr *eth_hdr, + uint8_t vlan_enabled, void *ip_hdr, uint8_t ipv4, uint8_t proto, void *proto_hdr, int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs) { @@ -371,10 +375,10 @@ nomore_mbuf: * Copy headers in first packet segment(s). */ if (vlan_enabled) - eth_hdr_size = sizeof(struct ether_hdr) + - sizeof(struct vlan_hdr); + eth_hdr_size = sizeof(struct rte_ether_hdr) + + sizeof(struct rte_vlan_hdr); else - eth_hdr_size = sizeof(struct ether_hdr); + eth_hdr_size = sizeof(struct rte_ether_hdr); copy_buf_to_pkt(eth_hdr, eth_hdr_size, pkt, 0); diff --git a/app/test/packet_burst_generator.h b/app/test/packet_burst_generator.h index b6e013a11c..744e21a1f4 100644 --- a/app/test/packet_burst_generator.h +++ b/app/test/packet_burst_generator.h @@ -24,14 +24,15 @@ extern "C" { #define PACKET_BURST_GEN_PKT_LEN_128 128 void -initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac, - struct ether_addr *dst_mac, uint16_t ether_type, +initialize_eth_header(struct rte_ether_hdr *eth_hdr, + struct rte_ether_addr *src_mac, + struct rte_ether_addr *dst_mac, uint16_t ether_type, uint8_t vlan_enabled, uint16_t van_id); void -initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct ether_addr *src_mac, - struct ether_addr *dst_mac, uint32_t src_ip, uint32_t dst_ip, - uint32_t opcode); +initialize_arp_header(struct rte_arp_hdr *arp_hdr, + struct rte_ether_addr *src_mac, struct rte_ether_addr *dst_mac, + uint32_t src_ip, uint32_t dst_ip, uint32_t opcode); uint16_t initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port, @@ -59,14 +60,14 @@ initialize_ipv4_header_proto(struct ipv4_hdr *ip_hdr, uint32_t src_addr, int generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, - struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr, - uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst, - uint8_t pkt_len, uint8_t nb_pkt_segs); + struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, + void *ip_hdr, uint8_t ipv4, struct udp_hdr *udp_hdr, + int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs); int generate_packet_burst_proto(struct rte_mempool *mp, - struct rte_mbuf **pkts_burst, - struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr, + struct rte_mbuf **pkts_burst, struct rte_ether_hdr *eth_hdr, + uint8_t vlan_enabled, void *ip_hdr, uint8_t ipv4, uint8_t proto, void *proto_hdr, int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs); diff --git a/app/test/test_cmdline_etheraddr.c b/app/test/test_cmdline_etheraddr.c index 086108ab29..90943c2b46 100644 --- a/app/test/test_cmdline_etheraddr.c +++ b/app/test/test_cmdline_etheraddr.c @@ -82,7 +82,7 @@ const char * ether_addr_invalid_strs[] = { static int -is_addr_different(const struct ether_addr addr, uint64_t num) +is_addr_different(const struct rte_ether_addr addr, uint64_t num) { int i; for (i = 0; i < ETHER_ADDR_LEN; i++, num >>= 8) @@ -97,7 +97,7 @@ int test_parse_etheraddr_invalid_param(void) { char buf[CMDLINE_TEST_BUFSIZE]; - struct ether_addr result; + struct rte_ether_addr result; int ret = 0; /* try all null */ @@ -148,12 +148,12 @@ test_parse_etheraddr_invalid_data(void) { int ret = 0; unsigned i; - struct ether_addr result; + struct rte_ether_addr result; /* test full strings */ for (i = 0; i < ETHERADDR_INVALID_STRS_SIZE; i++) { - memset(&result, 0, sizeof(struct ether_addr)); + memset(&result, 0, sizeof(struct rte_ether_addr)); ret = cmdline_parse_etheraddr(NULL, ether_addr_invalid_strs[i], (void*)&result, sizeof(result)); @@ -173,12 +173,12 @@ test_parse_etheraddr_valid(void) { int ret = 0; unsigned i; - struct ether_addr result; + struct rte_ether_addr result; /* test full strings */ for (i = 0; i < ETHERADDR_VALID_STRS_SIZE; i++) { - memset(&result, 0, sizeof(struct ether_addr)); + memset(&result, 0, sizeof(struct rte_ether_addr)); ret = cmdline_parse_etheraddr(NULL, ether_addr_valid_strs[i].str, (void*)&result, sizeof(result)); @@ -197,7 +197,7 @@ test_parse_etheraddr_valid(void) /* test garbage strings */ for (i = 0; i < ETHERADDR_GARBAGE_STRS_SIZE; i++) { - memset(&result, 0, sizeof(struct ether_addr)); + memset(&result, 0, sizeof(struct rte_ether_addr)); ret = cmdline_parse_etheraddr(NULL, ether_addr_garbage_strs[i], (void*)&result, sizeof(result)); diff --git a/app/test/test_event_eth_rx_adapter.c b/app/test/test_event_eth_rx_adapter.c index 38f5c039fe..953b827456 100644 --- a/app/test/test_event_eth_rx_adapter.c +++ b/app/test/test_event_eth_rx_adapter.c @@ -78,7 +78,7 @@ port_init_common(uint16_t port, const struct rte_eth_conf *port_conf, return retval; /* Display the port MAC address. */ - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c index c26c5152c2..208d20c538 100644 --- a/app/test/test_event_eth_tx_adapter.c +++ b/app/test/test_event_eth_tx_adapter.c @@ -84,7 +84,7 @@ port_init_common(uint8_t port, const struct rte_eth_conf *port_conf, return retval; /* Display the port MAC address. */ - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", diff --git a/app/test/test_flow_classify.c b/app/test/test_flow_classify.c index 5f5beeee75..f81bbba3ac 100644 --- a/app/test/test_flow_classify.c +++ b/app/test/test_flow_classify.c @@ -39,7 +39,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint8_t), .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, next_proto_id), }, /* next input field (IPv4 source address) - 4 consecutive bytes. */ @@ -49,7 +49,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, src_addr), }, /* next input field (IPv4 destination address) - 4 consecutive bytes. */ @@ -59,7 +59,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, dst_addr), }, /* @@ -72,7 +72,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, src_port), }, @@ -82,7 +82,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), }, @@ -489,7 +489,7 @@ static int init_ipv4_udp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr; struct ipv4_hdr pkt_ipv4_hdr; struct udp_hdr pkt_udp_hdr; uint32_t src_addr = IPV4_ADDR(2, 2, 2, 3); @@ -503,9 +503,9 @@ init_ipv4_udp_traffic(struct rte_mempool *mp, printf("Set up IPv4 UDP traffic\n"); initialize_eth_header(&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); - pktlen = (uint16_t)(sizeof(struct ether_hdr)); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); + pktlen = (uint16_t)(sizeof(struct rte_ether_hdr)); printf("ETH pktlen %u\n", pktlen); pktlen = initialize_ipv4_header(&pkt_ipv4_hdr, src_addr, dst_addr, @@ -526,7 +526,7 @@ static int init_ipv4_tcp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr; struct ipv4_hdr pkt_ipv4_hdr; struct tcp_hdr pkt_tcp_hdr; uint32_t src_addr = IPV4_ADDR(1, 2, 3, 4); @@ -540,9 +540,9 @@ init_ipv4_tcp_traffic(struct rte_mempool *mp, printf("Set up IPv4 TCP traffic\n"); initialize_eth_header(&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); - pktlen = (uint16_t)(sizeof(struct ether_hdr)); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); + pktlen = (uint16_t)(sizeof(struct rte_ether_hdr)); printf("ETH pktlen %u\n", pktlen); pktlen = initialize_ipv4_header_proto(&pkt_ipv4_hdr, src_addr, @@ -563,7 +563,7 @@ static int init_ipv4_sctp_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr; struct ipv4_hdr pkt_ipv4_hdr; struct sctp_hdr pkt_sctp_hdr; uint32_t src_addr = IPV4_ADDR(11, 12, 13, 14); @@ -577,9 +577,9 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp, printf("Set up IPv4 SCTP traffic\n"); initialize_eth_header(&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); - pktlen = (uint16_t)(sizeof(struct ether_hdr)); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); + pktlen = (uint16_t)(sizeof(struct rte_ether_hdr)); printf("ETH pktlen %u\n", pktlen); pktlen = initialize_ipv4_header_proto(&pkt_ipv4_hdr, src_addr, diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c index 451c693d6a..e4946dccad 100644 --- a/app/test/test_link_bonding.c +++ b/app/test/test_link_bonding.c @@ -73,11 +73,11 @@ struct link_bonding_unittest_params { struct rte_mempool *mbuf_pool; - struct ether_addr *default_slave_mac; - struct ether_addr *default_bonded_mac; + struct rte_ether_addr *default_slave_mac; + struct rte_ether_addr *default_bonded_mac; /* Packet Headers */ - struct ether_hdr *pkt_eth_hdr; + struct rte_ether_hdr *pkt_eth_hdr; struct ipv4_hdr *pkt_ipv4_hdr; struct ipv6_hdr *pkt_ipv6_hdr; struct udp_hdr *pkt_udp_hdr; @@ -99,8 +99,8 @@ static struct link_bonding_unittest_params default_params = { .mbuf_pool = NULL, - .default_slave_mac = (struct ether_addr *)slave_mac, - .default_bonded_mac = (struct ether_addr *)bonded_mac, + .default_slave_mac = (struct rte_ether_addr *)slave_mac, + .default_bonded_mac = (struct rte_ether_addr *)bonded_mac, .pkt_eth_hdr = NULL, .pkt_ipv4_hdr = &pkt_ipv4_hdr, @@ -211,12 +211,12 @@ static int test_setup(void) { int i, nb_mbuf_per_pool; - struct ether_addr *mac_addr = (struct ether_addr *)slave_mac; + struct rte_ether_addr *mac_addr = (struct rte_ether_addr *)slave_mac; /* Allocate ethernet packet header with space for VLAN header */ if (test_params->pkt_eth_hdr == NULL) { - test_params->pkt_eth_hdr = malloc(sizeof(struct ether_hdr) + - sizeof(struct vlan_hdr)); + test_params->pkt_eth_hdr = malloc(sizeof(struct rte_ether_hdr) + + sizeof(struct rte_vlan_hdr)); TEST_ASSERT_NOT_NULL(test_params->pkt_eth_hdr, "Ethernet header struct allocation failed!"); @@ -377,7 +377,7 @@ static int test_remove_slave_from_bonded_device(void) { int current_slave_count; - struct ether_addr read_mac_addr, *mac_addr; + struct rte_ether_addr read_mac_addr, *mac_addr; uint16_t slaves[RTE_MAX_ETHPORTS]; TEST_ASSERT_SUCCESS(rte_eth_bond_slave_remove(test_params->bonded_port_id, @@ -395,7 +395,7 @@ test_remove_slave_from_bonded_device(void) current_slave_count, test_params->bonded_slave_count - 1); - mac_addr = (struct ether_addr *)slave_mac; + mac_addr = (struct rte_ether_addr *)slave_mac; mac_addr->addr_bytes[ETHER_ADDR_LEN-1] = test_params->bonded_slave_count-1; @@ -700,8 +700,8 @@ static int test_set_primary_slave(void) { int i, j, retval; - struct ether_addr read_mac_addr; - struct ether_addr *expected_mac_addr; + struct rte_ether_addr read_mac_addr; + struct rte_ether_addr *expected_mac_addr; /* Add 4 slaves to bonded device */ for (i = test_params->bonded_slave_count; i < 4; i++) @@ -751,7 +751,7 @@ test_set_primary_slave(void) "Failed to start bonded port %d", test_params->bonded_port_id); - expected_mac_addr = (struct ether_addr *)&slave_mac; + expected_mac_addr = (struct rte_ether_addr *)&slave_mac; expected_mac_addr->addr_bytes[ETHER_ADDR_LEN-1] = i; /* Check primary slave MAC */ @@ -802,12 +802,12 @@ static int test_set_explicit_bonded_mac(void) { int i; - struct ether_addr read_mac_addr; - struct ether_addr *mac_addr; + struct rte_ether_addr read_mac_addr; + struct rte_ether_addr *mac_addr; uint8_t explicit_bonded_mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x01 }; - mac_addr = (struct ether_addr *)explicit_bonded_mac; + mac_addr = (struct rte_ether_addr *)explicit_bonded_mac; /* Invalid port ID */ TEST_ASSERT_FAIL(rte_eth_bond_mac_address_set(INVALID_PORT_ID, mac_addr), @@ -880,11 +880,11 @@ test_set_bonded_port_initialization_mac_assignment(void) static int bonded_port_id = -1; static int slave_port_ids[BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT]; - struct ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; + struct rte_ether_addr slave_mac_addr, bonded_mac_addr, read_mac_addr; /* Initialize default values for MAC addresses */ - memcpy(&slave_mac_addr, slave_mac, sizeof(struct ether_addr)); - memcpy(&bonded_mac_addr, slave_mac, sizeof(struct ether_addr)); + memcpy(&slave_mac_addr, slave_mac, sizeof(struct rte_ether_addr)); + memcpy(&bonded_mac_addr, slave_mac, sizeof(struct rte_ether_addr)); /* * 1. a - Create / configure bonded / slave ethdevs @@ -1277,11 +1277,13 @@ generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size, if (toggle_dst_mac) initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_1, + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac_1, ether_type, vlan, vlan_id); else initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_0, + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac_0, ether_type, vlan, vlan_id); @@ -1672,7 +1674,8 @@ test_roundrobin_rx_burst_on_multiple_slaves(void) static int test_roundrobin_verify_mac_assignment(void) { - struct ether_addr read_mac_addr, expected_mac_addr_0, expected_mac_addr_2; + struct rte_ether_addr read_mac_addr; + struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_2; int i; @@ -1731,7 +1734,8 @@ test_roundrobin_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, (struct ether_addr *)bonded_mac), + test_params->bonded_port_id, + (struct rte_ether_addr *)bonded_mac), "Failed to set MAC"); rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr); @@ -1940,7 +1944,8 @@ int polling_test_slaves[TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT] = { -1, -1 }; static int test_roundrobin_verfiy_polling_slave_link_status_change(void) { - struct ether_addr *mac_addr = (struct ether_addr *)polling_slave_mac; + struct rte_ether_addr *mac_addr = + (struct rte_ether_addr *)polling_slave_mac; char slave_name[RTE_ETH_NAME_MAX_LEN]; int i; @@ -2039,7 +2044,8 @@ test_activebackup_tx_burst(void) "Failed to initialize bonded device with slaves"); initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_0, + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac_0, ETHER_TYPE_IPv4, 0, 0); pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port, dst_port_0, 16); @@ -2246,7 +2252,8 @@ test_activebackup_verify_promiscuous_enable_disable(void) static int test_activebackup_verify_mac_assignment(void) { - struct ether_addr read_mac_addr, expected_mac_addr_0, expected_mac_addr_1; + struct rte_ether_addr read_mac_addr; + struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0); rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1); @@ -2328,7 +2335,8 @@ test_activebackup_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, (struct ether_addr *)bonded_mac), + test_params->bonded_port_id, + (struct rte_ether_addr *)bonded_mac), "failed to set MAC address"); rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr); @@ -2573,7 +2581,8 @@ test_balance_l2_tx_burst(void) "Failed to set balance xmit policy."); initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_0, + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac_0, ETHER_TYPE_IPv4, 0, 0); pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port, dst_port_0, 16); @@ -2588,7 +2597,8 @@ test_balance_l2_tx_burst(void) "failed to generate packet burst"); initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_1, + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac_1, ETHER_TYPE_IPv4, 0, 0); /* Generate a burst 2 of packets to transmit */ @@ -3138,7 +3148,8 @@ test_balance_verify_promiscuous_enable_disable(void) static int test_balance_verify_mac_assignment(void) { - struct ether_addr read_mac_addr, expected_mac_addr_0, expected_mac_addr_1; + struct rte_ether_addr read_mac_addr; + struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0); rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1); @@ -3220,7 +3231,8 @@ test_balance_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, (struct ether_addr *)bonded_mac), + test_params->bonded_port_id, + (struct rte_ether_addr *)bonded_mac), "failed to set MAC"); rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr); @@ -3411,7 +3423,8 @@ test_broadcast_tx_burst(void) "Failed to initialise bonded device"); initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)src_mac, (struct ether_addr *)dst_mac_0, + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac_0, ETHER_TYPE_IPv4, 0, 0); pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port, @@ -3722,7 +3735,8 @@ test_broadcast_verify_promiscuous_enable_disable(void) static int test_broadcast_verify_mac_assignment(void) { - struct ether_addr read_mac_addr, expected_mac_addr_0, expected_mac_addr_1; + struct rte_ether_addr read_mac_addr; + struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; int i; @@ -3783,7 +3797,8 @@ test_broadcast_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, (struct ether_addr *)bonded_mac), + test_params->bonded_port_id, + (struct rte_ether_addr *)bonded_mac), "Failed to set MAC address"); rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr); @@ -3994,12 +4009,14 @@ test_tlb_tx_burst(void) /*test two types of mac src own(bonding) and others */ if (i % 2 == 0) { initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac_0, ETHER_TYPE_IPv4, 0, 0); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac_0, + ETHER_TYPE_IPv4, 0, 0); } else { initialize_eth_header(test_params->pkt_eth_hdr, - (struct ether_addr *)test_params->default_slave_mac, - (struct ether_addr *)dst_mac_0, ETHER_TYPE_IPv4, 0, 0); + (struct rte_ether_addr *)test_params->default_slave_mac, + (struct rte_ether_addr *)dst_mac_0, + ETHER_TYPE_IPv4, 0, 0); } pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port, dst_port_0, 16); @@ -4210,7 +4227,8 @@ test_tlb_verify_promiscuous_enable_disable(void) static int test_tlb_verify_mac_assignment(void) { - struct ether_addr read_mac_addr, expected_mac_addr_0, expected_mac_addr_1; + struct rte_ether_addr read_mac_addr; + struct rte_ether_addr expected_mac_addr_0, expected_mac_addr_1; rte_eth_macaddr_get(test_params->slave_port_ids[0], &expected_mac_addr_0); rte_eth_macaddr_get(test_params->slave_port_ids[1], &expected_mac_addr_1); @@ -4293,7 +4311,8 @@ test_tlb_verify_mac_assignment(void) /* Set explicit MAC address */ TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set( - test_params->bonded_port_id, (struct ether_addr *)bonded_mac), + test_params->bonded_port_id, + (struct rte_ether_addr *)bonded_mac), "failed to set MAC address"); rte_eth_macaddr_get(test_params->bonded_port_id, &read_mac_addr); @@ -4468,14 +4487,14 @@ test_alb_change_mac_in_reply_sent(void) struct rte_mbuf *pkt; struct rte_mbuf *pkts_sent[MAX_PKT_BURST]; - struct ether_hdr *eth_pkt; + struct rte_ether_hdr *eth_pkt; struct rte_arp_hdr *arp_pkt; int slave_idx, nb_pkts, pkt_idx; int retval = 0; - struct ether_addr bond_mac, client_mac; - struct ether_addr *slave_mac1, *slave_mac2; + struct rte_ether_addr bond_mac, client_mac; + struct rte_ether_addr *slave_mac1, *slave_mac2; TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves(BONDING_MODE_ALB, @@ -4501,44 +4520,44 @@ test_alb_change_mac_in_reply_sent(void) */ pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client1, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client1, RTE_ARP_OP_REPLY); rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client2, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client2, RTE_ARP_OP_REPLY); rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client3, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client3, RTE_ARP_OP_REPLY); rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client4, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client4, RTE_ARP_OP_REPLY); rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1); @@ -4558,9 +4577,10 @@ test_alb_change_mac_in_reply_sent(void) MAX_PKT_BURST); for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) { - eth_pkt = rte_pktmbuf_mtod(pkts_sent[pkt_idx], struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod( + pkts_sent[pkt_idx], struct rte_ether_hdr *); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); if (slave_idx%2 == 0) { if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) { @@ -4584,7 +4604,7 @@ test_end: static int test_alb_reply_from_client(void) { - struct ether_hdr *eth_pkt; + struct rte_ether_hdr *eth_pkt; struct rte_arp_hdr *arp_pkt; struct rte_mbuf *pkt; @@ -4593,8 +4613,8 @@ test_alb_reply_from_client(void) int slave_idx, nb_pkts, pkt_idx, nb_pkts_sum = 0; int retval = 0; - struct ether_addr bond_mac, client_mac; - struct ether_addr *slave_mac1, *slave_mac2; + struct rte_ether_addr bond_mac, client_mac; + struct rte_ether_addr *slave_mac1, *slave_mac2; TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves(BONDING_MODE_ALB, @@ -4619,11 +4639,11 @@ test_alb_reply_from_client(void) */ pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client1, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host, RTE_ARP_OP_REPLY); virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, @@ -4631,11 +4651,11 @@ test_alb_reply_from_client(void) pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client2, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client2, ip_host, RTE_ARP_OP_REPLY); virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, @@ -4643,11 +4663,11 @@ test_alb_reply_from_client(void) pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client3, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client3, ip_host, RTE_ARP_OP_REPLY); virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, @@ -4655,11 +4675,11 @@ test_alb_reply_from_client(void) pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client4, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0, 0); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client4, ip_host, RTE_ARP_OP_REPLY); virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt, @@ -4684,9 +4704,10 @@ test_alb_reply_from_client(void) nb_pkts_sum += nb_pkts; for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) { - eth_pkt = rte_pktmbuf_mtod(pkts_sent[pkt_idx], struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod( + pkts_sent[pkt_idx], struct rte_ether_hdr *); arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); if (slave_idx%2 == 0) { if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) { @@ -4716,8 +4737,8 @@ test_end: static int test_alb_receive_vlan_reply(void) { - struct ether_hdr *eth_pkt; - struct vlan_hdr *vlan_pkt; + struct rte_ether_hdr *eth_pkt; + struct rte_vlan_hdr *vlan_pkt; struct rte_arp_hdr *arp_pkt; struct rte_mbuf *pkt; @@ -4726,7 +4747,7 @@ test_alb_receive_vlan_reply(void) int slave_idx, nb_pkts, pkt_idx; int retval = 0; - struct ether_addr bond_mac, client_mac; + struct rte_ether_addr bond_mac, client_mac; TEST_ASSERT_SUCCESS( initialize_bonded_device_with_slaves(BONDING_MODE_ALB, @@ -4750,10 +4771,10 @@ test_alb_receive_vlan_reply(void) */ pkt = rte_pktmbuf_alloc(test_params->mbuf_pool); memcpy(client_mac.addr_bytes, mac_client1, ETHER_ADDR_LEN); - eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_VLAN, 0, 0); - vlan_pkt = (struct vlan_hdr *)((char *)(eth_pkt + 1)); + vlan_pkt = (struct rte_vlan_hdr *)((char *)(eth_pkt + 1)); vlan_pkt->vlan_tci = rte_cpu_to_be_16(1); vlan_pkt->eth_proto = rte_cpu_to_be_16(ETHER_TYPE_VLAN); vlan_pkt = vlan_pkt+1; @@ -4777,8 +4798,10 @@ test_alb_receive_vlan_reply(void) MAX_PKT_BURST); for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) { - eth_pkt = rte_pktmbuf_mtod(pkts_sent[pkt_idx], struct ether_hdr *); - vlan_pkt = (struct vlan_hdr *)((char *)(eth_pkt + 1)); + eth_pkt = rte_pktmbuf_mtod( + pkts_sent[pkt_idx], struct rte_ether_hdr *); + vlan_pkt = (struct rte_vlan_hdr *)( + (char *)(eth_pkt + 1)); if (vlan_pkt->vlan_tci != rte_cpu_to_be_16(1)) { retval = -1; goto test_end; diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c index e539f078dd..de23dd9590 100644 --- a/app/test/test_link_bonding_mode4.c +++ b/app/test/test_link_bonding_mode4.c @@ -54,19 +54,19 @@ #define INVALID_PORT_ID (0xFF) #define INVALID_BONDING_MODE (-1) -static const struct ether_addr slave_mac_default = { +static const struct rte_ether_addr slave_mac_default = { { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; -static const struct ether_addr parnter_mac_default = { +static const struct rte_ether_addr parnter_mac_default = { { 0x22, 0xBB, 0xFF, 0xBB, 0x00, 0x00 } }; -static const struct ether_addr parnter_system = { +static const struct rte_ether_addr parnter_system = { { 0x33, 0xFF, 0xBB, 0xFF, 0x00, 0x00 } }; -static const struct ether_addr slow_protocol_mac_addr = { +static const struct rte_ether_addr slow_protocol_mac_addr = { { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x02 } }; @@ -80,8 +80,8 @@ struct slave_conf { }; struct ether_vlan_hdr { - struct ether_hdr pkt_eth_hdr; - struct vlan_hdr vlan_hdr; + struct rte_ether_hdr pkt_eth_hdr; + struct rte_vlan_hdr vlan_hdr; }; struct link_bonding_unittest_params { @@ -224,7 +224,7 @@ configure_ethdev(uint16_t port_id, uint8_t start) static int add_slave(struct slave_conf *slave, uint8_t start) { - struct ether_addr addr, addr_check; + struct rte_ether_addr addr, addr_check; /* Some sanity check */ RTE_VERIFY(test_params.slave_ports <= slave && @@ -293,12 +293,12 @@ remove_slave(struct slave_conf *slave) static void lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt) { - struct ether_hdr *hdr; + struct rte_ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; RTE_VERIFY(lacp_pkt != NULL); - hdr = rte_pktmbuf_mtod(lacp_pkt, struct ether_hdr *); + hdr = rte_pktmbuf_mtod(lacp_pkt, struct rte_ether_hdr *); RTE_VERIFY(hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_SLOW)); slow_hdr = rte_pktmbuf_mtod(lacp_pkt, struct slow_protocol_frame *); @@ -474,12 +474,12 @@ testsuite_teardown(void) static int make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt) { - struct ether_hdr *hdr; + struct rte_ether_hdr *hdr; struct slow_protocol_frame *slow_hdr; struct lacpdu *lacp; /* look for LACP */ - hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); if (hdr->ether_type != rte_cpu_to_be_16(ETHER_TYPE_SLOW)) return 1; @@ -718,8 +718,8 @@ test_mode4_agg_mode_selection(void) } static int -generate_packets(struct ether_addr *src_mac, - struct ether_addr *dst_mac, uint16_t count, struct rte_mbuf **buf) +generate_packets(struct rte_ether_addr *src_mac, + struct rte_ether_addr *dst_mac, uint16_t count, struct rte_mbuf **buf) { uint16_t pktlen = PACKET_BURST_GEN_PKT_LEN; uint8_t vlan_enable = 0; @@ -731,7 +731,7 @@ generate_packets(struct ether_addr *src_mac, 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) }; - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr; struct udp_hdr pkt_udp_hdr; union { struct ipv4_hdr v4; @@ -765,8 +765,9 @@ generate_packets(struct ether_addr *src_mac, } static int -generate_and_put_packets(struct slave_conf *slave, struct ether_addr *src_mac, - struct ether_addr *dst_mac, uint16_t count) +generate_and_put_packets(struct slave_conf *slave, + struct rte_ether_addr *src_mac, + struct rte_ether_addr *dst_mac, uint16_t count) { struct rte_mbuf *pkts[MAX_PKT_BURST]; int retval; @@ -796,11 +797,12 @@ test_mode4_rx(void) int retval; unsigned delay; - struct ether_hdr *hdr; + struct rte_ether_hdr *hdr; - struct ether_addr src_mac = { { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; - struct ether_addr dst_mac; - struct ether_addr bonded_mac; + struct rte_ether_addr src_mac = { + { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; + struct rte_ether_addr dst_mac; + struct rte_ether_addr bonded_mac; retval = initialize_bonded_device_with_slaves(TEST_PROMISC_SLAVE_COUNT, 0); @@ -844,7 +846,7 @@ test_mode4_rx(void) int cnt[2] = { 0, 0 }; for (i = 0; i < expected_pkts_cnt; i++) { - hdr = rte_pktmbuf_mtod(pkts[i], struct ether_hdr *); + hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); cnt[is_same_ether_addr(&hdr->d_addr, &bonded_mac)]++; } @@ -888,7 +890,7 @@ test_mode4_rx(void) int eq_cnt = 0; for (i = 0; i < expected_pkts_cnt; i++) { - hdr = rte_pktmbuf_mtod(pkts[i], struct ether_hdr *); + hdr = rte_pktmbuf_mtod(pkts[i], struct rte_ether_hdr *); eq_cnt += is_same_ether_addr(&hdr->d_addr, &bonded_mac); } @@ -977,8 +979,9 @@ test_mode4_tx_burst(void) int retval; unsigned delay; - struct ether_addr dst_mac = { { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; - struct ether_addr bonded_mac; + struct rte_ether_addr dst_mac = { + { 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00 } }; + struct rte_ether_addr bonded_mac; retval = initialize_bonded_device_with_slaves(TEST_TX_SLAVE_COUNT, 0); TEST_ASSERT_SUCCESS(retval, "Failed to initialize bonded device"); @@ -1351,7 +1354,7 @@ test_mode4_ext_ctrl(void) uint8_t i; struct rte_mbuf *lacp_tx_buf[SLAVE_COUNT]; - struct ether_addr src_mac, dst_mac; + struct rte_ether_addr src_mac, dst_mac; struct lacpdu_header lacpdu = { .lacpdu = { .subtype = SLOW_SUBTYPE_LACP, @@ -1405,7 +1408,7 @@ test_mode4_ext_lacp(void) struct rte_mbuf *lacp_tx_buf[SLAVE_COUNT]; struct rte_mbuf *buf[SLAVE_COUNT]; - struct ether_addr src_mac, dst_mac; + struct rte_ether_addr src_mac, dst_mac; struct lacpdu_header lacpdu = { .lacpdu = { .subtype = SLOW_SUBTYPE_LACP, diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c index d82de2cef5..4392522ea2 100644 --- a/app/test/test_link_bonding_rssconf.c +++ b/app/test/test_link_bonding_rssconf.c @@ -495,7 +495,7 @@ test_setup(void) int port_id; char name[256]; struct slave_conf *port; - struct ether_addr mac_addr = { .addr_bytes = {0} }; + struct rte_ether_addr mac_addr = { .addr_bytes = {0} }; if (test_params.mbuf_pool == NULL) { diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c index ed8524a176..b85da914c2 100644 --- a/app/test/test_pmd_perf.c +++ b/app/test/test_pmd_perf.c @@ -58,7 +58,7 @@ static struct rte_mempool *mbufpool[NB_SOCKETS]; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; static struct rte_eth_conf port_conf = { .rxmode = { @@ -171,7 +171,7 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); @@ -182,7 +182,7 @@ static int init_traffic(struct rte_mempool *mp, struct rte_mbuf **pkts_burst, uint32_t burst_size) { - struct ether_hdr pkt_eth_hdr; + struct rte_ether_hdr pkt_eth_hdr; struct ipv4_hdr pkt_ipv4_hdr; struct udp_hdr pkt_udp_hdr; uint32_t pktlen; @@ -191,8 +191,8 @@ init_traffic(struct rte_mempool *mp, initialize_eth_header(&pkt_eth_hdr, - (struct ether_addr *)src_mac, - (struct ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); + (struct rte_ether_addr *)src_mac, + (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0); pktlen = initialize_ipv4_header(&pkt_ipv4_hdr, IPV4_ADDR(10, 0, 0, 1), diff --git a/app/test/test_sched.c b/app/test/test_sched.c index 4eed8dbdee..a782bf3e5d 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -78,16 +78,20 @@ create_mempool(void) static void prepare_pkt(struct rte_sched_port *port, struct rte_mbuf *mbuf) { - struct ether_hdr *eth_hdr; - struct vlan_hdr *vlan1, *vlan2; + struct rte_ether_hdr *eth_hdr; + struct rte_vlan_hdr *vlan1, *vlan2; struct ipv4_hdr *ip_hdr; /* Simulate a classifier */ - eth_hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr *); - vlan1 = (struct vlan_hdr *)(ð_hdr->ether_type ); - vlan2 = (struct vlan_hdr *)((uintptr_t)ð_hdr->ether_type + sizeof(struct vlan_hdr)); - eth_hdr = (struct ether_hdr *)((uintptr_t)ð_hdr->ether_type + 2 *sizeof(struct vlan_hdr)); - ip_hdr = (struct ipv4_hdr *)((uintptr_t)eth_hdr + sizeof(eth_hdr->ether_type)); + eth_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *); + vlan1 = (struct rte_vlan_hdr *)(ð_hdr->ether_type); + vlan2 = (struct rte_vlan_hdr *)( + (uintptr_t)ð_hdr->ether_type + sizeof(struct rte_vlan_hdr)); + eth_hdr = (struct rte_ether_hdr *)( + (uintptr_t)ð_hdr->ether_type + + 2 * sizeof(struct rte_vlan_hdr)); + ip_hdr = (struct ipv4_hdr *)( + (uintptr_t)eth_hdr + sizeof(eth_hdr->ether_type)); vlan1->vlan_tci = rte_cpu_to_be_16(SUBPORT); vlan2->vlan_tci = rte_cpu_to_be_16(PIPE); diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index f8ddc2db82..15ce64445c 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -218,7 +218,7 @@ virtual_ethdev_promiscuous_mode_disable(struct rte_eth_dev *dev __rte_unused) static int virtual_ethdev_mac_address_set(__rte_unused struct rte_eth_dev *dev, - __rte_unused struct ether_addr *addr) + __rte_unused struct rte_ether_addr *addr) { return 0; } @@ -496,7 +496,7 @@ virtual_ethdev_get_mbufs_from_tx_queue(uint16_t port_id, int -virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, +virtual_ethdev_create(const char *name, struct rte_ether_addr *mac_addr, uint8_t socket_id, uint8_t isr_support) { struct rte_pci_device *pci_dev = NULL; diff --git a/app/test/virtual_pmd.h b/app/test/virtual_pmd.h index 5ca02bb503..120b58b273 100644 --- a/app/test/virtual_pmd.h +++ b/app/test/virtual_pmd.h @@ -15,7 +15,7 @@ int virtual_ethdev_init(void); int -virtual_ethdev_create(const char *name, struct ether_addr *mac_addr, +virtual_ethdev_create(const char *name, struct rte_ether_addr *mac_addr, uint8_t socket_id, uint8_t isr_support); void diff --git a/doc/guides/prog_guide/bbdev.rst b/doc/guides/prog_guide/bbdev.rst index 658ffd400a..038bc6ed1d 100644 --- a/doc/guides/prog_guide/bbdev.rst +++ b/doc/guides/prog_guide/bbdev.rst @@ -752,12 +752,12 @@ buffers using (**sw_turbo**) bbdev PMD. for (j = 0; j < op_num; j++) { /* Append the size of the ethernet header */ rte_pktmbuf_append(input_pkts_burst[j], - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); /* set op */ ops_burst[j]->turbo_enc.input.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); ops_burst[j]->turbo_enc->input.length = rte_pktmbuf_pkt_len(bbdev_pkts[j]); @@ -766,7 +766,7 @@ buffers using (**sw_turbo**) bbdev PMD. input_pkts_burst[j]; ops_burst[j]->turbo_enc->output.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); ops_burst[j]->turbo_enc->output.data = output_pkts_burst[j]; diff --git a/doc/guides/sample_app_ug/flow_classify.rst b/doc/guides/sample_app_ug/flow_classify.rst index a6383b3c70..9582b93760 100644 --- a/doc/guides/sample_app_ug/flow_classify.rst +++ b/doc/guides/sample_app_ug/flow_classify.rst @@ -91,7 +91,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint8_t), .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, next_proto_id), }, /* next input field (IPv4 source address) - 4 consecutive bytes. */ @@ -101,7 +101,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, src_addr), }, /* next input field (IPv4 destination address) - 4 consecutive bytes. */ @@ -111,7 +111,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, dst_addr), }, /* @@ -124,7 +124,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, src_port), }, @@ -134,7 +134,7 @@ initialisation of the ``Flow Classify`` application.. .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), }, @@ -275,7 +275,7 @@ Forwarding application is shown below: { struct rte_eth_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; - struct ether_addr addr; + struct rte_ether_addr addr; int retval; uint16_t q; diff --git a/doc/guides/sample_app_ug/flow_filtering.rst b/doc/guides/sample_app_ug/flow_filtering.rst index be3d63f904..02fc675506 100644 --- a/doc/guides/sample_app_ug/flow_filtering.rst +++ b/doc/guides/sample_app_ug/flow_filtering.rst @@ -304,7 +304,7 @@ looks like the following: main_loop(void) { struct rte_mbuf *mbufs[32]; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t nb_rx; uint16_t i; uint16_t j; @@ -318,7 +318,7 @@ looks like the following: struct rte_mbuf *m = mbufs[j]; eth_hdr = rte_pktmbuf_mtod(m, - struct ether_hdr *); + struct rte_ether_hdr *); print_ether_addr("src=", ð_hdr->s_addr); print_ether_addr(" - dst=", @@ -348,7 +348,7 @@ queues and printing for each packet the destination queue: if (nb_rx) { for (j = 0; j < nb_rx; j++) { struct rte_mbuf *m = mbufs[j]; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); print_ether_addr("src=", ð_hdr->s_addr); print_ether_addr(" - dst=", ð_hdr->d_addr); printf(" - queue=0x%x", (unsigned int)i); diff --git a/doc/guides/sample_app_ug/ipv4_multicast.rst b/doc/guides/sample_app_ug/ipv4_multicast.rst index f6efa7f6f4..1fe6bf1131 100644 --- a/doc/guides/sample_app_ug/ipv4_multicast.rst +++ b/doc/guides/sample_app_ug/ipv4_multicast.rst @@ -146,7 +146,7 @@ Firstly, the Ethernet* header is removed from the packet and the IPv4 address is /* Remove the Ethernet header from the input packet */ - iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct ether_hdr)); + iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct rte_ether_hdr)); RTE_ASSERT(iphdr != NULL); dest_addr = rte_be_to_cpu_32(iphdr->dst_addr); @@ -216,14 +216,14 @@ The actual packet transmission is done in the mcast_send_pkt() function: .. code-block:: c - static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port) + static inline void mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port) { - struct ether_hdr *ethdr; + struct rte_ether_hdr *ethdr; uint16_t len; /* Construct Ethernet header. */ - ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t) sizeof(*ethdr)); + ethdr = (struct rte_ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t) sizeof(*ethdr)); RTE_ASSERT(ethdr != NULL); diff --git a/doc/guides/sample_app_ug/l2_forward_job_stats.rst b/doc/guides/sample_app_ug/l2_forward_job_stats.rst index dfc1ed9ca0..02c1367f51 100644 --- a/doc/guides/sample_app_ug/l2_forward_job_stats.rst +++ b/doc/guides/sample_app_ug/l2_forward_job_stats.rst @@ -451,13 +451,13 @@ Naturally, the number of ports in the portmask must be even, otherwise, the appl static void l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; unsigned dst_port; dst_port = l2fwd_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ diff --git a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst index e5b28e425e..54e5b8022d 100644 --- a/doc/guides/sample_app_ug/l2_forward_real_virtual.rst +++ b/doc/guides/sample_app_ug/l2_forward_real_virtual.rst @@ -367,13 +367,13 @@ Naturally, the number of ports in the portmask must be even, otherwise, the appl static void l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; unsigned dst_port; dst_port = l2fwd_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst index 670918c573..2d759170ca 100644 --- a/doc/guides/sample_app_ug/l3_forward.rst +++ b/doc/guides/sample_app_ug/l3_forward.rst @@ -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 ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); - data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[0] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[0], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); + data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); key[0].xmm = _mm_and_si128(data[0], mask0); key[1].xmm = _mm_and_si128(data[1], mask0); diff --git a/doc/guides/sample_app_ug/link_status_intr.rst b/doc/guides/sample_app_ug/link_status_intr.rst index 571cd2d605..3fd043e82e 100644 --- a/doc/guides/sample_app_ug/link_status_intr.rst +++ b/doc/guides/sample_app_ug/link_status_intr.rst @@ -311,11 +311,11 @@ The processing is very simple: processes the TX port from the RX port and then r static void lsi_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; unsigned dst_port = lsi_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ diff --git a/doc/guides/sample_app_ug/ptpclient.rst b/doc/guides/sample_app_ug/ptpclient.rst index 9d7446d5f9..12b4f13d5b 100644 --- a/doc/guides/sample_app_ug/ptpclient.rst +++ b/doc/guides/sample_app_ug/ptpclient.rst @@ -212,17 +212,17 @@ PTP IEEE1588 L2 functionality. void parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) { struct ptp_header *ptp_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t eth_type; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); eth_type = rte_be_to_cpu_16(eth_hdr->ether_type); if (eth_type == PTP_PROTOCOL) { ptp_data.m = m; ptp_data.portid = portid; ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(m, char *) - + sizeof(struct ether_hdr)); + + sizeof(struct rte_ether_hdr)); switch (ptp_hdr->msgtype) { case SYNC: diff --git a/doc/guides/sample_app_ug/rxtx_callbacks.rst b/doc/guides/sample_app_ug/rxtx_callbacks.rst index 81463d28da..1ca959c557 100644 --- a/doc/guides/sample_app_ug/rxtx_callbacks.rst +++ b/doc/guides/sample_app_ug/rxtx_callbacks.rst @@ -79,7 +79,7 @@ comments: { struct rte_eth_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; - struct ether_addr addr; + struct rte_ether_addr addr; int retval; uint16_t q; diff --git a/doc/guides/sample_app_ug/server_node_efd.rst b/doc/guides/sample_app_ug/server_node_efd.rst index adf258c0da..f7dab9e980 100644 --- a/doc/guides/sample_app_ug/server_node_efd.rst +++ b/doc/guides/sample_app_ug/server_node_efd.rst @@ -197,7 +197,7 @@ which tells the node where the packet has to be distributed. for (i = 0; i < rx_count; i++) { /* Handle IPv4 header.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = (void *)&ipv4_dst_ip[i]; } @@ -357,7 +357,7 @@ flow is not handled by the node. for (i = 0; i < num_packets; i++) { /* Handle IPv4 header.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = &ipv4_dst_ip[i]; } diff --git a/doc/guides/sample_app_ug/skeleton.rst b/doc/guides/sample_app_ug/skeleton.rst index 11ee521b3c..715f5e91a5 100644 --- a/doc/guides/sample_app_ug/skeleton.rst +++ b/doc/guides/sample_app_ug/skeleton.rst @@ -115,7 +115,7 @@ Forwarding application is shown below: { struct rte_eth_conf port_conf = port_conf_default; const uint16_t rx_rings = 1, tx_rings = 1; - struct ether_addr addr; + struct rte_ether_addr addr; int retval; uint16_t q; diff --git a/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst b/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst index 707afe91a5..8e1774d9e2 100644 --- a/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst +++ b/doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst @@ -165,7 +165,7 @@ the MAC of VMDQ pool 2 on port 1 is 52:54:00:12:01:02. }; /* pool mac addr template, pool mac addr is like: 52 54 00 12 port# pool# */ - static struct ether_addr pool_addr_template = { + static struct rte_ether_addr pool_addr_template = { .addr_bytes = {0x52, 0x54, 0x00, 0x12, 0x00, 0x00} }; @@ -225,7 +225,7 @@ the MAC of VMDQ pool 2 on port 1 is 52:54:00:12:01:02. /* Set mac for each pool.*/ for (q = 0; q < num_pools; q++) { - struct ether_addr mac; + struct rte_ether_addr mac; mac = pool_addr_template; mac.addr_bytes[4] = port; mac.addr_bytes[5] = q; diff --git a/drivers/bus/dpaa/include/fman.h b/drivers/bus/dpaa/include/fman.h index 15bf73a408..d6eebc877a 100644 --- a/drivers/bus/dpaa/include/fman.h +++ b/drivers/bus/dpaa/include/fman.h @@ -314,7 +314,7 @@ struct fman_if { /* The index of this MAC (within the Fman it belongs to) */ uint8_t mac_idx; /* The MAC address */ - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; /* The Qman channel to schedule Tx FQs to */ u16 tx_channel_id; /* The hard-coded FQIDs for this interface. Note: this doesn't cover diff --git a/drivers/bus/dpaa/include/netcfg.h b/drivers/bus/dpaa/include/netcfg.h index 7818de68b4..bf7bfae8cb 100644 --- a/drivers/bus/dpaa/include/netcfg.h +++ b/drivers/bus/dpaa/include/netcfg.h @@ -30,8 +30,8 @@ struct netcfg_info { struct interface_info { char *name; - struct ether_addr mac_addr; - struct ether_addr peer_mac; + struct rte_ether_addr mac_addr; + struct rte_ether_addr peer_mac; int mac_present; int fman_enabled_mac_interface; }; diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 99e13fe48a..b5c4befce4 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -73,7 +73,7 @@ struct pmd_internals { int if_index; char *if_name; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; struct tpacket_req req; diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 35c72272c9..893c9ed9fb 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -109,7 +109,7 @@ struct pmd_internals { int if_index; char if_name[IFNAMSIZ]; uint16_t queue_idx; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; struct xsk_umem_info *umem; struct rte_mempool *mb_pool_share; @@ -798,7 +798,7 @@ free_kvlist: static int get_iface_info(const char *if_name, - struct ether_addr *eth_addr, + struct rte_ether_addr *eth_addr, int *if_index) { struct ifreq ifr; diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index 4f52e2bd1f..6a1530aa2f 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -41,9 +41,9 @@ static int eth_ark_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats); static void eth_ark_dev_stats_reset(struct rte_eth_dev *dev); static int eth_ark_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int eth_ark_macaddr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool); static void eth_ark_macaddr_remove(struct rte_eth_dev *dev, @@ -220,14 +220,14 @@ check_for_ext(struct ark_adapter *ark) (void (*)(struct rte_eth_dev *, void *)) dlsym(ark->d_handle, "stats_reset"); ark->user_ext.mac_addr_add = - (void (*)(struct rte_eth_dev *, struct ether_addr *, uint32_t, - uint32_t, void *)) + (void (*)(struct rte_eth_dev *, struct rte_ether_addr *, + uint32_t, uint32_t, void *)) dlsym(ark->d_handle, "mac_addr_add"); ark->user_ext.mac_addr_remove = (void (*)(struct rte_eth_dev *, uint32_t, void *)) dlsym(ark->d_handle, "mac_addr_remove"); ark->user_ext.mac_addr_set = - (void (*)(struct rte_eth_dev *, struct ether_addr *, + (void (*)(struct rte_eth_dev *, struct rte_ether_addr *, void *)) dlsym(ark->d_handle, "mac_addr_set"); ark->user_ext.set_mtu = @@ -833,7 +833,7 @@ eth_ark_dev_stats_reset(struct rte_eth_dev *dev) static int eth_ark_macaddr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool) { @@ -864,7 +864,7 @@ eth_ark_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) static int eth_ark_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct ark_adapter *ark = (struct ark_adapter *)dev->data->dev_private; diff --git a/drivers/net/ark/ark_ext.h b/drivers/net/ark/ark_ext.h index f5af215380..5a987e4d67 100644 --- a/drivers/net/ark/ark_ext.h +++ b/drivers/net/ark/ark_ext.h @@ -70,7 +70,7 @@ void stats_reset(struct rte_eth_dev *dev, void *user_data); void mac_addr_add(struct rte_eth_dev *dev, - struct ether_addr *macadr, + struct rte_ether_addr *macadr, uint32_t index, uint32_t pool, void *user_data); @@ -80,7 +80,7 @@ void mac_addr_remove(struct rte_eth_dev *dev, void *user_data); void mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, void *user_data); int set_mtu(struct rte_eth_dev *dev, diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h index f820091d7a..403df5900b 100644 --- a/drivers/net/ark/ark_global.h +++ b/drivers/net/ark/ark_global.h @@ -71,12 +71,13 @@ struct ark_user_ext { int (*stats_get)(struct rte_eth_dev *, struct rte_eth_stats *, void *); void (*stats_reset)(struct rte_eth_dev *, void *); void (*mac_addr_add)(struct rte_eth_dev *, - struct ether_addr *, + struct rte_ether_addr *, uint32_t, uint32_t, void *); void (*mac_addr_remove)(struct rte_eth_dev *, uint32_t, void *); - void (*mac_addr_set)(struct rte_eth_dev *, struct ether_addr *, void *); + void (*mac_addr_set)(struct rte_eth_dev *, struct rte_ether_addr *, + void *); int (*set_mtu)(struct rte_eth_dev *, uint16_t, void *); }; diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index c9c1795a16..9460318aea 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -93,14 +93,14 @@ static void atl_dev_interrupt_handler(void *param); static int atl_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool); static void atl_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index); static int atl_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int atl_dev_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); /* RSS */ @@ -1575,7 +1575,7 @@ atl_update_mac_addr(struct rte_eth_dev *dev, uint32_t index, } static int -atl_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +atl_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index __rte_unused, uint32_t pool __rte_unused) { if (is_zero_ether_addr(mac_addr)) { @@ -1593,7 +1593,7 @@ atl_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index) } static int -atl_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) +atl_set_default_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr) { atl_remove_mac_addr(dev, 0); atl_add_mac_addr(dev, addr, 0, 0); @@ -1760,7 +1760,7 @@ atl_vlan_strip_queue_set(struct rte_eth_dev *dev, uint16_t queue_id, int on) static int atl_dev_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/atlantic/hw_atl/hw_atl_utils.c index b399ae392d..26a53a2031 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c @@ -657,8 +657,8 @@ static int hw_atl_utils_get_mac_permanent(struct aq_hw_s *self, mac_addr[1] = rte_constant_bswap32(mac_addr[1]); } - ether_addr_copy((struct ether_addr *)mac_addr, - (struct ether_addr *)mac); + ether_addr_copy((struct rte_ether_addr *)mac_addr, + (struct rte_ether_addr *)mac); if ((mac[0] & 0x01U) || ((mac[0] | mac[1] | mac[2]) == 0x00U)) { /* chip revision */ @@ -868,8 +868,8 @@ static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac) prpc->msg_wol.pattern_id = 1U; prpc->msg_wol.wol_packet_type = 2U; /* Magic Packet */ - ether_addr_copy((struct ether_addr *)mac, - (struct ether_addr *)&prpc->msg_wol.wol_pattern); + ether_addr_copy((struct rte_ether_addr *)mac, + (struct rte_ether_addr *)&prpc->msg_wol.wol_pattern); } else { rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_del_id); diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c index 5927d90f18..55b5ce3e3d 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c @@ -228,8 +228,8 @@ int aq_fw2x_get_mac_permanent(struct aq_hw_s *self, u8 *mac) mac_addr[1] = rte_constant_bswap32(mac_addr[1]); } - ether_addr_copy((struct ether_addr *)mac_addr, - (struct ether_addr *)mac); + ether_addr_copy((struct rte_ether_addr *)mac_addr, + (struct rte_ether_addr *)mac); if ((mac[0] & 0x01U) || ((mac[0] | mac[1] | mac[2]) == 0x00U)) { unsigned int rnd = (uint32_t)rte_rand(); diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index 09388d05f8..69a70d2ccf 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -159,7 +159,7 @@ static const struct eth_dev_ops avp_eth_dev_ops = { struct avp_dev { uint32_t magic; /**< Memory validation marker */ uint64_t device_id; /**< Unique system identifier */ - struct ether_addr ethaddr; /**< Host specified MAC address */ + struct rte_ether_addr ethaddr; /**< Host specified MAC address */ struct rte_eth_dev_data *dev_data; /**< Back pointer to ethernet device data */ volatile uint32_t flags; /**< Device operational flags */ @@ -1199,7 +1199,7 @@ avp_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, } static inline int -_avp_cmp_ether_addr(struct ether_addr *a, struct ether_addr *b) +_avp_cmp_ether_addr(struct rte_ether_addr *a, struct rte_ether_addr *b) { uint16_t *_a = (uint16_t *)&a->addr_bytes[0]; uint16_t *_b = (uint16_t *)&b->addr_bytes[0]; @@ -1209,7 +1209,7 @@ _avp_cmp_ether_addr(struct ether_addr *a, struct ether_addr *b) static inline int _avp_mac_filter(struct avp_dev *avp, struct rte_mbuf *m) { - struct ether_hdr *eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + struct rte_ether_hdr *eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); if (likely(_avp_cmp_ether_addr(&avp->ethaddr, ð->d_addr) == 0)) { /* allow all packets destined to our address */ diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_ethdev.h index b1cd2980b2..810ac4a749 100644 --- a/drivers/net/axgbe/axgbe_ethdev.h +++ b/drivers/net/axgbe/axgbe_ethdev.h @@ -539,7 +539,7 @@ struct axgbe_port { /* Hardware features of the device */ struct axgbe_hw_features hw_feat; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; /* Software Tx/Rx structure pointers*/ void **rx_queues; diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 3e705c7a10..17b6817b61 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -2197,8 +2197,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) tx_start_bd->vlan_or_ethertype = rte_cpu_to_le_16(pkt_prod); else { - struct ether_hdr *eh = - rte_pktmbuf_mtod(m0, struct ether_hdr *); + struct rte_ether_hdr *eh = + rte_pktmbuf_mtod(m0, struct rte_ether_hdr *); tx_start_bd->vlan_or_ethertype = rte_cpu_to_le_16(rte_be_to_cpu_16(eh->ether_type)); @@ -2208,8 +2208,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) bd_prod = NEXT_TX_BD(bd_prod); if (IS_VF(sc)) { struct eth_tx_parse_bd_e2 *tx_parse_bd; - const struct ether_hdr *eh = - rte_pktmbuf_mtod(m0, struct ether_hdr *); + const struct rte_ether_hdr *eh = + rte_pktmbuf_mtod(m0, struct rte_ether_hdr *); uint8_t mac_type = UNICAST_ADDRESS; tx_parse_bd = diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index 3063aea647..567dc55603 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -501,7 +501,7 @@ bnx2x_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) } static int -bnx2x_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +bnx2x_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool) { struct bnx2x_softc *sc = dev->data->dev_private; @@ -654,7 +654,8 @@ bnx2x_common_dev_init(struct rte_eth_dev *eth_dev, int is_vf) } } - eth_dev->data->mac_addrs = (struct ether_addr *)sc->link_params.mac_addr; + eth_dev->data->mac_addrs = + (struct rte_ether_addr *)sc->link_params.mac_addr; if (IS_VF(sc)) { rte_spinlock_init(&sc->vf2pf_lock); diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h index 45958db9ae..bd3ef143b6 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.h +++ b/drivers/net/bnx2x/bnx2x_ethdev.h @@ -75,7 +75,8 @@ typedef int bool; /* MAC address operations */ struct bnx2x_mac_ops { - void (*mac_addr_add)(struct rte_eth_dev *dev, struct ether_addr *addr, + void (*mac_addr_add)(struct rte_eth_dev *dev, + struct rte_ether_addr *addr, uint16_t index, uint32_t pool); /* not implemented yet */ void (*mac_addr_remove)(struct rte_eth_dev *dev, uint16_t index); /* not implemented yet */ }; diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c index 048bf126f0..cd5522d035 100644 --- a/drivers/net/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/bnx2x/bnx2x_vfpf.c @@ -302,7 +302,7 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_ if (is_valid_assigned_ether_addr(&sc_resp.resc.current_mac_addr)) ether_addr_copy(&sc_resp.resc.current_mac_addr, - (struct ether_addr *)sc->link_params.mac_addr); + (struct rte_ether_addr *)sc->link_params.mac_addr); else eth_random_addr(sc->link_params.mac_addr); diff --git a/drivers/net/bnx2x/bnx2x_vfpf.h b/drivers/net/bnx2x/bnx2x_vfpf.h index cc6fef956f..6964c9d989 100644 --- a/drivers/net/bnx2x/bnx2x_vfpf.h +++ b/drivers/net/bnx2x/bnx2x_vfpf.h @@ -115,7 +115,7 @@ struct vf_resc { uint8_t num_vlan_filters; uint8_t num_mc_filters; uint8_t permanent_mac_addr[ETH_ALEN]; - struct ether_addr current_mac_addr; + struct rte_ether_addr current_mac_addr; uint16_t pf_link_speed; uint32_t pf_link_supported; }; diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index da0de211d6..c643150538 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -760,7 +760,7 @@ static void bnxt_mac_addr_remove_op(struct rte_eth_dev *eth_dev, } static int bnxt_mac_addr_add_op(struct rte_eth_dev *eth_dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool) { struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; @@ -1451,7 +1451,8 @@ bnxt_vlan_offload_set_op(struct rte_eth_dev *dev, int mask) } static int -bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, struct ether_addr *addr) +bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, + struct rte_ether_addr *addr) { struct bnxt *bp = (struct bnxt *)dev->data->dev_private; /* Default Filter is tied to VNIC 0 */ @@ -1489,7 +1490,7 @@ bnxt_set_default_mac_addr_op(struct rte_eth_dev *dev, struct ether_addr *addr) static int bnxt_dev_set_mc_addr_list_op(struct rte_eth_dev *eth_dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private; diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index eb5c41ebb0..59e75b0bec 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -2578,7 +2578,7 @@ static void add_random_mac_if_needed(struct bnxt *bp, struct hwrm_func_cfg_input *cfg_req, int vf) { - struct ether_addr mac; + struct rte_ether_addr mac; if (bnxt_hwrm_func_qcfg_vf_default_mac(bp, vf, &mac)) return; @@ -3112,7 +3112,7 @@ int bnxt_hwrm_reject_fwd_resp(struct bnxt *bp, uint16_t target_id, } int bnxt_hwrm_func_qcfg_vf_default_mac(struct bnxt *bp, uint16_t vf, - struct ether_addr *mac) + struct rte_ether_addr *mac) { struct hwrm_func_qcfg_input req = {0}; struct hwrm_func_qcfg_output *resp = bp->hwrm_cmd_resp_addr; diff --git a/drivers/net/bnxt/bnxt_hwrm.h b/drivers/net/bnxt/bnxt_hwrm.h index ec9b3e0075..53d79f0461 100644 --- a/drivers/net/bnxt/bnxt_hwrm.h +++ b/drivers/net/bnxt/bnxt_hwrm.h @@ -130,7 +130,7 @@ int bnxt_hwrm_func_bw_cfg(struct bnxt *bp, uint16_t vf, uint16_t max_bw, uint16_t enables); int bnxt_hwrm_set_vf_vlan(struct bnxt *bp, int vf); int bnxt_hwrm_func_qcfg_vf_default_mac(struct bnxt *bp, uint16_t vf, - struct ether_addr *mac); + struct rte_ether_addr *mac); int bnxt_hwrm_func_qcfg_current_vf_vlan(struct bnxt *bp, int vf); int bnxt_hwrm_tunnel_dst_port_alloc(struct bnxt *bp, uint16_t port, uint8_t tunnel_type); diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index c298de83c2..5e3d1bfb1f 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -132,7 +132,7 @@ int rte_pmd_bnxt_set_all_queues_drop_en(uint16_t port, uint8_t on) } int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct rte_eth_dev *dev; struct rte_eth_dev_info dev_info; @@ -647,7 +647,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, count); } -int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *addr, uint32_t vf_id) { struct rte_eth_dev *dev; @@ -655,7 +655,7 @@ int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *addr, struct bnxt *bp; struct bnxt_filter_info *filter; struct bnxt_vnic_info vnic; - struct ether_addr dflt_mac; + struct rte_ether_addr dflt_mac; int rc; dev = &rte_eth_devices[port]; diff --git a/drivers/net/bnxt/rte_pmd_bnxt.h b/drivers/net/bnxt/rte_pmd_bnxt.h index 68fbe34d69..2e893cc7bf 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.h +++ b/drivers/net/bnxt/rte_pmd_bnxt.h @@ -67,7 +67,7 @@ int rte_pmd_bnxt_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ int rte_pmd_bnxt_set_vf_mac_addr(uint16_t port, uint16_t vf, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /** * Enable/Disable vf vlan strip for all queues in a pool @@ -303,7 +303,7 @@ int rte_pmd_bnxt_get_vf_tx_drop_count(uint16_t port, uint16_t vf_id, * - (-ENOTSUP) Ethernet device is not a PF * - (-ENOMEM) on an allocation failure */ -int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct ether_addr *mac_addr, +int rte_pmd_bnxt_mac_addr_add(uint16_t port, struct rte_ether_addr *mac_addr, uint32_t vf_id); /** diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index b668ff9ad5..874aa91a5f 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -225,7 +225,7 @@ rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], */ int rte_eth_bond_mac_address_set(uint16_t bonded_port_id, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /** * Reset bonded device to use MAC from primary slave on bonded device and it's diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 1e6a3fc7c6..51bf3f52e4 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -126,7 +126,7 @@ bond_print_lacp(struct lacpdu *l) #define MODE4_DEBUG(fmt, ...) do { } while (0) #endif -static const struct ether_addr lacp_mac_addr = { +static const struct rte_ether_addr lacp_mac_addr = { .addr_bytes = { 0x01, 0x80, 0xC2, 0x00, 0x00, 0x02 } }; @@ -810,7 +810,7 @@ bond_mode_8023ad_periodic_cb(void *arg) struct bond_dev_private *internals = bond_dev->data->dev_private; struct port *port; struct rte_eth_link link_info; - struct ether_addr slave_addr; + struct rte_ether_addr slave_addr; struct rte_mbuf *lacp_pkt = NULL; uint16_t slave_id; uint16_t i; @@ -1044,7 +1044,7 @@ void bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) { struct bond_dev_private *internals = bond_dev->data->dev_private; - struct ether_addr slave_addr; + struct rte_ether_addr slave_addr; struct port *slave, *agg_slave; uint16_t slave_id, i, j; diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.h b/drivers/net/bonding/rte_eth_bond_8023ad.h index d8b5dbc212..cbad59aa7c 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad.h @@ -58,14 +58,14 @@ struct slow_protocol { /** Generic slow protocol frame type structure */ struct slow_protocol_frame { - struct ether_hdr eth_hdr; + struct rte_ether_hdr eth_hdr; struct slow_protocol slow_protocol; } __attribute__((__packed__)); struct port_params { uint16_t system_priority; /**< System priority (unused in current implementation) */ - struct ether_addr system; + struct rte_ether_addr system; /**< System ID - Slave MAC address, same as bonding MAC address */ uint16_t key; /**< Speed information (implementation dependednt) and duplex. */ @@ -103,7 +103,7 @@ struct lacpdu { /** LACPDU frame: Contains ethernet header and LACPDU. */ struct lacpdu_header { - struct ether_hdr eth_hdr; + struct rte_ether_hdr eth_hdr; struct lacpdu lacpdu; } __attribute__((__packed__)); @@ -114,7 +114,7 @@ struct marker { uint8_t tlv_type_marker; uint8_t info_length; uint16_t requester_port; - struct ether_addr requester_system; + struct rte_ether_addr requester_system; uint32_t requester_transaction_id; uint8_t reserved_2[2]; @@ -124,7 +124,7 @@ struct marker { } __attribute__((__packed__)); struct marker_header { - struct ether_hdr eth_hdr; + struct rte_ether_hdr eth_hdr; struct marker marker; } __attribute__((__packed__)); diff --git a/drivers/net/bonding/rte_eth_bond_8023ad_private.h b/drivers/net/bonding/rte_eth_bond_8023ad_private.h index f91902ebd7..d905de4259 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad_private.h +++ b/drivers/net/bonding/rte_eth_bond_8023ad_private.h @@ -150,7 +150,7 @@ struct mode8023ad_private { uint64_t update_timeout_us; rte_eth_bond_8023ad_ext_slowrx_fn slowrx_cb; uint8_t external_sm; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; struct rte_eth_link slave_link; /***< slave link properties */ diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index f16ae8f217..da0b062a03 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -72,8 +72,9 @@ mempool_alloc_error: return -ENOMEM; } -void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, - struct bond_dev_private *internals) { +void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset, + struct bond_dev_private *internals) +{ struct rte_arp_hdr *arp; struct client_data *hash_table = internals->mode6.client_table; @@ -102,7 +103,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, client_info->app_ip != arp->arp_data.arp_tip || client_info->cli_ip != arp->arp_data.arp_sip || !is_same_ether_addr(&client_info->cli_mac, &arp->arp_data.arp_sha) || - client_info->vlan_count != offset / sizeof(struct vlan_hdr) || + client_info->vlan_count != offset / sizeof(struct rte_vlan_hdr) || memcmp(client_info->vlan, eth_h + 1, offset) != 0 ) { client_info->in_use = 1; @@ -113,14 +114,14 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac); ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_tha); memcpy(client_info->vlan, eth_h + 1, offset); - client_info->vlan_count = offset / sizeof(struct vlan_hdr); + client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); } internals->mode6.ntt = 1; rte_spinlock_unlock(&internals->mode6.lock); } uint16_t -bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, +bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals) { struct rte_arp_hdr *arp; @@ -130,7 +131,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, uint8_t hash_index; - struct ether_addr bonding_mac; + struct rte_ether_addr bonding_mac; arp = (struct rte_arp_hdr *)((char *)(eth_h + 1) + offset); @@ -163,7 +164,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, &client_info->app_mac); ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_sha); memcpy(client_info->vlan, eth_h + 1, offset); - client_info->vlan_count = offset / sizeof(struct vlan_hdr); + client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); return client_info->slave_idx; } @@ -179,7 +180,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac); ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_sha); memcpy(client_info->vlan, eth_h + 1, offset); - client_info->vlan_count = offset / sizeof(struct vlan_hdr); + client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); return client_info->slave_idx; } @@ -195,12 +196,12 @@ uint16_t bond_mode_alb_arp_upd(struct client_data *client_info, struct rte_mbuf *pkt, struct bond_dev_private *internals) { - struct ether_hdr *eth_h; + struct rte_ether_hdr *eth_h; struct rte_arp_hdr *arp_h; uint16_t slave_idx; rte_spinlock_lock(&internals->mode6.lock); - eth_h = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ether_addr_copy(&client_info->app_mac, ð_h->s_addr); ether_addr_copy(&client_info->cli_mac, ð_h->d_addr); @@ -209,11 +210,12 @@ bond_mode_alb_arp_upd(struct client_data *client_info, else eth_h->ether_type = rte_cpu_to_be_16(ETHER_TYPE_ARP); - arp_h = (struct rte_arp_hdr *)((char *)eth_h + sizeof(struct ether_hdr) - + client_info->vlan_count * sizeof(struct vlan_hdr)); + arp_h = (struct rte_arp_hdr *)( + (char *)eth_h + sizeof(struct rte_ether_hdr) + + client_info->vlan_count * sizeof(struct rte_vlan_hdr)); memcpy(eth_h + 1, client_info->vlan, - client_info->vlan_count * sizeof(struct vlan_hdr)); + client_info->vlan_count * sizeof(struct rte_vlan_hdr)); ether_addr_copy(&client_info->app_mac, &arp_h->arp_data.arp_sha); arp_h->arp_data.arp_sip = client_info->app_ip; diff --git a/drivers/net/bonding/rte_eth_bond_alb.h b/drivers/net/bonding/rte_eth_bond_alb.h index 4640fd24e4..386e70c594 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.h +++ b/drivers/net/bonding/rte_eth_bond_alb.h @@ -13,11 +13,11 @@ struct client_data { /** ARP data of single client */ - struct ether_addr app_mac; + struct rte_ether_addr app_mac; /**< MAC address of application running DPDK */ uint32_t app_ip; /**< IP address of application running DPDK */ - struct ether_addr cli_mac; + struct rte_ether_addr cli_mac; /**< Client MAC address */ uint32_t cli_ip; /**< Client IP address */ @@ -29,7 +29,7 @@ struct client_data { uint8_t ntt; /**< Flag indicating if we need to send update to this client on next tx */ - struct vlan_hdr vlan[2]; + struct rte_vlan_hdr vlan[2]; /**< Content of vlan headers */ uint8_t vlan_count; /**< Number of nested vlan headers */ @@ -68,7 +68,7 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev); * @param internals Bonding data. */ void -bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, +bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals); /** @@ -85,7 +85,7 @@ bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset, * Index of slave on which packet should be sent. */ uint16_t -bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset, +bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, struct bond_dev_private *internals); /** diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index a23988dc79..0fc4c5eda5 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -840,7 +840,7 @@ rte_eth_bond_active_slaves_get(uint16_t bonded_port_id, uint16_t slaves[], int rte_eth_bond_mac_address_set(uint16_t bonded_port_id, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct rte_eth_dev *bonded_eth_dev; struct bond_dev_private *internals; diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index b60fde6a86..01bbb06c1a 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -282,7 +282,7 @@ bond_ethdev_parse_bond_mac_addr_kvarg(const char *key __rte_unused, /* Parse MAC */ return cmdline_parse_etheraddr(NULL, value, extra_args, - sizeof(struct ether_addr)); + sizeof(struct rte_ether_addr)); } int diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index f04719e593..99506350fa 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -33,21 +33,22 @@ static uint64_t tlb_last_obytets[RTE_MAX_ETHPORTS]; static inline size_t -get_vlan_offset(struct ether_hdr *eth_hdr, uint16_t *proto) +get_vlan_offset(struct rte_ether_hdr *eth_hdr, uint16_t *proto) { size_t vlan_offset = 0; if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto || rte_cpu_to_be_16(ETHER_TYPE_QINQ) == *proto) { - struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); + struct rte_vlan_hdr *vlan_hdr = + (struct rte_vlan_hdr *)(eth_hdr + 1); - vlan_offset = sizeof(struct vlan_hdr); + vlan_offset = sizeof(struct rte_vlan_hdr); *proto = vlan_hdr->eth_proto; if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) { vlan_hdr = vlan_hdr + 1; *proto = vlan_hdr->eth_proto; - vlan_offset += sizeof(struct vlan_hdr); + vlan_offset += sizeof(struct rte_vlan_hdr); } } return vlan_offset; @@ -394,8 +395,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, struct bond_dev_private *internals = bd_rx_q->dev_private; struct rte_eth_dev *bonded_eth_dev = &rte_eth_devices[internals->port_id]; - struct ether_addr *bond_mac = bonded_eth_dev->data->mac_addrs; - struct ether_hdr *hdr; + struct rte_ether_addr *bond_mac = bonded_eth_dev->data->mac_addrs; + struct rte_ether_hdr *hdr; const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW); uint16_t num_rx_total = 0; /* Total number of received packets */ @@ -444,7 +445,7 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, if (j + 3 < num_rx_total) rte_prefetch0(rte_pktmbuf_mtod(bufs[j + 3], void *)); - hdr = rte_pktmbuf_mtod(bufs[j], struct ether_hdr *); + hdr = rte_pktmbuf_mtod(bufs[j], struct rte_ether_hdr *); subtype = ((struct slow_protocol_frame *)hdr)->slow_protocol.subtype; /* Remove packet from array if it is slow packet or slave is not @@ -584,8 +585,9 @@ update_client_stats(uint32_t addr, uint16_t port, uint32_t *TXorRXindicator) #endif static void -mode6_debug(const char __attribute__((unused)) *info, struct ether_hdr *eth_h, - uint16_t port, uint32_t __attribute__((unused)) *burstnumber) +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; #ifdef RTE_LIBRTE_BOND_DEBUG_ALB @@ -630,7 +632,7 @@ bond_ethdev_rx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) { struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; struct bond_dev_private *internals = bd_tx_q->dev_private; - struct ether_hdr *eth_h; + struct rte_ether_hdr *eth_h; uint16_t ether_type, offset; uint16_t nb_recv_pkts; int i; @@ -638,7 +640,7 @@ bond_ethdev_rx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) nb_recv_pkts = bond_ethdev_rx_burst(queue, bufs, nb_pkts); for (i = 0; i < nb_recv_pkts; i++) { - eth_h = rte_pktmbuf_mtod(bufs[i], struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(bufs[i], struct rte_ether_hdr *); ether_type = eth_h->ether_type; offset = get_vlan_offset(eth_h, ðer_type); @@ -738,7 +740,7 @@ bond_ethdev_tx_burst_active_backup(void *queue, } static inline uint16_t -ether_hash(struct ether_hdr *eth_hdr) +ether_hash(struct rte_ether_hdr *eth_hdr) { unaligned_uint16_t *word_src_addr = (unaligned_uint16_t *)eth_hdr->s_addr.addr_bytes; @@ -775,12 +777,12 @@ void burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts, uint16_t slave_count, uint16_t *slaves) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t hash; int i; for (i = 0; i < nb_pkts; i++) { - eth_hdr = rte_pktmbuf_mtod(buf[i], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(buf[i], struct rte_ether_hdr *); hash = ether_hash(eth_hdr); @@ -793,13 +795,13 @@ burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts, uint16_t slave_count, uint16_t *slaves) { uint16_t i; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t proto; size_t vlan_offset; uint32_t hash, l3hash; for (i = 0; i < nb_pkts; i++) { - eth_hdr = rte_pktmbuf_mtod(buf[i], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(buf[i], struct rte_ether_hdr *); l3hash = 0; proto = eth_hdr->ether_type; @@ -830,7 +832,7 @@ void burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, uint16_t slave_count, uint16_t *slaves) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t proto; size_t vlan_offset; int i; @@ -840,7 +842,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts, uint32_t hash, l3hash, l4hash; for (i = 0; i < nb_pkts; i++) { - eth_hdr = rte_pktmbuf_mtod(buf[i], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(buf[i], struct rte_ether_hdr *); size_t pkt_end = (size_t)eth_hdr + rte_pktmbuf_data_len(buf[i]); proto = eth_hdr->ether_type; vlan_offset = get_vlan_offset(eth_hdr, &proto); @@ -1008,9 +1010,9 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) uint16_t num_of_slaves = internals->active_slave_count; uint16_t slaves[RTE_MAX_ETHPORTS]; - struct ether_hdr *ether_hdr; - struct ether_addr primary_slave_addr; - struct ether_addr active_slave_addr; + struct rte_ether_hdr *ether_hdr; + struct rte_ether_addr primary_slave_addr; + struct rte_ether_addr active_slave_addr; if (num_of_slaves < 1) return num_tx_total; @@ -1032,7 +1034,8 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) if (j + 3 < nb_pkts) rte_prefetch0(rte_pktmbuf_mtod(bufs[j+3], void*)); - ether_hdr = rte_pktmbuf_mtod(bufs[j], struct ether_hdr *); + ether_hdr = rte_pktmbuf_mtod(bufs[j], + struct rte_ether_hdr *); if (is_same_ether_addr(ðer_hdr->s_addr, &primary_slave_addr)) ether_addr_copy(&active_slave_addr, ðer_hdr->s_addr); #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) @@ -1068,7 +1071,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) struct bond_tx_queue *bd_tx_q = (struct bond_tx_queue *)queue; struct bond_dev_private *internals = bd_tx_q->dev_private; - struct ether_hdr *eth_h; + struct rte_ether_hdr *eth_h; uint16_t ether_type, offset; struct client_data *client_info; @@ -1098,7 +1101,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) /* Search tx buffer for ARP packets and forward them to alb */ for (i = 0; i < nb_pkts; i++) { - eth_h = rte_pktmbuf_mtod(bufs[i], struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(bufs[i], struct rte_ether_hdr *); ether_type = eth_h->ether_type; offset = get_vlan_offset(eth_h, ðer_type); @@ -1132,10 +1135,10 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) "Failed to allocate ARP packet from pool"); continue; } - pkt_size = sizeof(struct ether_hdr) + + pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct rte_arp_hdr) + client_info->vlan_count * - sizeof(struct vlan_hdr); + sizeof(struct rte_vlan_hdr); upd_pkt->data_len = pkt_size; upd_pkt->pkt_len = pkt_size; @@ -1166,7 +1169,8 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) /* Print TX stats including update packets */ for (j = 0; j < slave_bufs_pkts[i]; j++) { - eth_h = rte_pktmbuf_mtod(slave_bufs[i][j], struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(slave_bufs[i][j], + struct rte_ether_hdr *); mode6_debug("TX ARP:", eth_h, i, &burstnumberTX); } #endif @@ -1183,7 +1187,8 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) } #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) for (j = 0; j < update_bufs_pkts[i]; j++) { - eth_h = rte_pktmbuf_mtod(update_bufs[i][j], struct ether_hdr *); + eth_h = rte_pktmbuf_mtod(update_bufs[i][j], + struct rte_ether_hdr *); mode6_debug("TX ARPupd:", eth_h, i, &burstnumberTX); } #endif @@ -1501,9 +1506,10 @@ link_properties_valid(struct rte_eth_dev *ethdev, } int -mac_address_get(struct rte_eth_dev *eth_dev, struct ether_addr *dst_mac_addr) +mac_address_get(struct rte_eth_dev *eth_dev, + struct rte_ether_addr *dst_mac_addr) { - struct ether_addr *mac_addr; + struct rte_ether_addr *mac_addr; if (eth_dev == NULL) { RTE_BOND_LOG(ERR, "NULL pointer eth_dev specified"); @@ -1522,9 +1528,10 @@ mac_address_get(struct rte_eth_dev *eth_dev, struct ether_addr *dst_mac_addr) } int -mac_address_set(struct rte_eth_dev *eth_dev, struct ether_addr *new_mac_addr) +mac_address_set(struct rte_eth_dev *eth_dev, + struct rte_ether_addr *new_mac_addr) { - struct ether_addr *mac_addr; + struct rte_ether_addr *mac_addr; if (eth_dev == NULL) { RTE_BOND_LOG(ERR, "NULL pointer eth_dev specified"); @@ -1545,7 +1552,7 @@ mac_address_set(struct rte_eth_dev *eth_dev, struct ether_addr *new_mac_addr) return 0; } -static const struct ether_addr null_mac_addr; +static const struct rte_ether_addr null_mac_addr; /* * Add additional MAC addresses to the slave @@ -1555,7 +1562,7 @@ slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, uint16_t slave_port_id) { int i, ret; - struct ether_addr *mac_addr; + struct rte_ether_addr *mac_addr; for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) { mac_addr = &bonded_eth_dev->data->mac_addrs[i]; @@ -1583,7 +1590,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, uint16_t slave_port_id) { int i, rc, ret; - struct ether_addr *mac_addr; + struct rte_ether_addr *mac_addr; rc = 0; for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) { @@ -2006,7 +2013,7 @@ slave_add(struct bond_dev_private *internals, slave_details->link_status_wait_to_complete = 0; /* clean tlb_last_obytes when adding port for bonding device */ memcpy(&(slave_details->persisted_mac_addr), slave_eth_dev->data->mac_addrs, - sizeof(struct ether_addr)); + sizeof(struct rte_ether_addr)); } void @@ -2052,7 +2059,7 @@ bond_ethdev_start(struct rte_eth_dev *eth_dev) } if (internals->user_defined_mac == 0) { - struct ether_addr *new_mac_addr = NULL; + struct rte_ether_addr *new_mac_addr = NULL; for (i = 0; i < internals->slave_count; i++) if (internals->slaves[i].port_id == internals->primary_port) @@ -2938,7 +2945,8 @@ bond_ethdev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) } static int -bond_ethdev_mac_address_set(struct rte_eth_dev *dev, struct ether_addr *addr) +bond_ethdev_mac_address_set(struct rte_eth_dev *dev, + struct rte_ether_addr *addr) { if (mac_address_set(dev, addr)) { RTE_BOND_LOG(ERR, "Failed to update MAC address"); @@ -2960,8 +2968,9 @@ bond_filter_ctrl(struct rte_eth_dev *dev __rte_unused, } static int -bond_ethdev_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, - __rte_unused uint32_t index, uint32_t vmdq) +bond_ethdev_mac_addr_add(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr, + __rte_unused uint32_t index, uint32_t vmdq) { struct rte_eth_dev *slave_eth_dev; struct bond_dev_private *internals = dev->data->dev_private; @@ -3011,7 +3020,7 @@ bond_ethdev_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) goto end; } - struct ether_addr *mac_addr = &dev->data->mac_addrs[index]; + struct rte_ether_addr *mac_addr = &dev->data->mac_addrs[index]; for (i = 0; i < internals->slave_count; i++) rte_eth_dev_mac_addr_remove(internals->slaves[i].port_id, @@ -3389,7 +3398,7 @@ bond_ethdev_configure(struct rte_eth_dev *dev) /* Parse MAC address for bonded device */ arg_count = rte_kvargs_count(kvlist, PMD_BOND_MAC_ADDR_KVARG); if (arg_count == 1) { - struct ether_addr bond_mac; + struct rte_ether_addr bond_mac; if (rte_kvargs_process(kvlist, PMD_BOND_MAC_ADDR_KVARG, &bond_ethdev_parse_bond_mac_addr_kvarg, &bond_mac) < 0) { diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h index 8afef39baa..55c0b227b7 100644 --- a/drivers/net/bonding/rte_eth_bond_private.h +++ b/drivers/net/bonding/rte_eth_bond_private.h @@ -85,7 +85,7 @@ struct bond_slave_details { uint8_t link_status_wait_to_complete; uint8_t last_link_status; /**< Port Id of slave eth_dev */ - struct ether_addr persisted_mac_addr; + struct rte_ether_addr persisted_mac_addr; uint16_t reta_size; }; @@ -223,10 +223,12 @@ void activate_slave(struct rte_eth_dev *eth_dev, uint16_t port_id); int -mac_address_set(struct rte_eth_dev *eth_dev, struct ether_addr *new_mac_addr); +mac_address_set(struct rte_eth_dev *eth_dev, + struct rte_ether_addr *new_mac_addr); int -mac_address_get(struct rte_eth_dev *eth_dev, struct ether_addr *dst_mac_addr); +mac_address_get(struct rte_eth_dev *eth_dev, + struct rte_ether_addr *dst_mac_addr); int mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev); diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h index fb8af52507..b54f75ebc0 100644 --- a/drivers/net/cxgbe/base/adapter.h +++ b/drivers/net/cxgbe/base/adapter.h @@ -671,7 +671,7 @@ static inline void t4_os_set_hw_addr(struct adapter *adapter, int port_idx, { struct port_info *pi = adap2pinfo(adapter, port_idx); - ether_addr_copy((struct ether_addr *)hw_addr, + ether_addr_copy((struct rte_ether_addr *)hw_addr, &pi->eth_dev->data->mac_addrs[0]); } diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index 01d256da01..e36936959e 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -1056,7 +1056,7 @@ static int cxgbe_get_regs(struct rte_eth_dev *eth_dev, return 0; } -int cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *addr) +int cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *addr) { struct port_info *pi = (struct port_info *)(dev->data->dev_private); int ret; diff --git a/drivers/net/cxgbe/cxgbe_pfvf.h b/drivers/net/cxgbe/cxgbe_pfvf.h index 8d0a105aa1..03145cea6d 100644 --- a/drivers/net/cxgbe/cxgbe_pfvf.h +++ b/drivers/net/cxgbe/cxgbe_pfvf.h @@ -16,7 +16,7 @@ void cxgbe_dev_promiscuous_enable(struct rte_eth_dev *eth_dev); void cxgbe_dev_promiscuous_disable(struct rte_eth_dev *eth_dev); void cxgbe_dev_allmulticast_enable(struct rte_eth_dev *eth_dev); void cxgbe_dev_allmulticast_disable(struct rte_eth_dev *eth_dev); -int cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *addr); +int cxgbe_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *addr); int cxgbe_dev_configure(struct rte_eth_dev *eth_dev); int cxgbe_dev_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t queue_idx, uint16_t nb_desc, unsigned int socket_id, diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 2e043feb26..0e1dc1ae8f 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -934,7 +934,7 @@ dpaa_flow_ctrl_get(struct rte_eth_dev *dev, static int dpaa_dev_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr, + struct rte_ether_addr *addr, uint32_t index, __rte_unused uint32_t pool) { @@ -964,7 +964,7 @@ dpaa_dev_remove_mac_addr(struct rte_eth_dev *dev, static int dpaa_dev_set_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { int ret; struct dpaa_if *dpaa_intf = dev->data->dev_private; diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index a4085f47e1..7f174f7fbc 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -198,7 +198,8 @@ static inline void dpaa_eth_packet_info(struct rte_mbuf *m, void *fd_virt_addr) static inline void dpaa_checksum(struct rte_mbuf *mbuf) { - struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr *); + struct rte_ether_hdr *eth_hdr = + rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *); char *l3_hdr = (char *)eth_hdr + mbuf->l2_len; struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)l3_hdr; struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)l3_hdr; diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 900182f667..ae4d7e1cca 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1124,7 +1124,7 @@ dpaa2_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int dpaa2_dev_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr, + struct rte_ether_addr *addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { @@ -1155,7 +1155,7 @@ dpaa2_dev_remove_mac_addr(struct rte_eth_dev *dev, struct dpaa2_dev_priv *priv = dev->data->dev_private; struct fsl_mc_io *dpni = (struct fsl_mc_io *)priv->hw; struct rte_eth_dev_data *data = dev->data; - struct ether_addr *macaddr; + struct rte_ether_addr *macaddr; PMD_INIT_FUNC_TRACE(); @@ -1175,7 +1175,7 @@ dpaa2_dev_remove_mac_addr(struct rte_eth_dev *dev, static int dpaa2_dev_set_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { int ret; struct dpaa2_dev_priv *priv = dev->data->dev_private; @@ -1992,13 +1992,13 @@ static struct eth_dev_ops dpaa2_ethdev_ops = { */ static int populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, - struct ether_addr *mac_entry) + struct rte_ether_addr *mac_entry) { int ret; - struct ether_addr phy_mac, prime_mac; + struct rte_ether_addr phy_mac, prime_mac; - memset(&phy_mac, 0, sizeof(struct ether_addr)); - memset(&prime_mac, 0, sizeof(struct ether_addr)); + memset(&phy_mac, 0, sizeof(struct rte_ether_addr)); + memset(&prime_mac, 0, sizeof(struct rte_ether_addr)); /* Get the physical device MAC address */ ret = dpni_get_port_mac_addr(dpni_dev, CMD_PRI_LOW, priv->token, @@ -2032,7 +2032,8 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, ret); goto cleanup; } - memcpy(&prime_mac, &phy_mac, sizeof(struct ether_addr)); + memcpy(&prime_mac, &phy_mac, + sizeof(struct rte_ether_addr)); } } else if (is_zero_ether_addr(&prime_mac)) { /* In case phys and prime, both are zero, create random MAC */ @@ -2047,7 +2048,7 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, } /* prime_mac the final MAC address */ - memcpy(mac_entry, &prime_mac, sizeof(struct ether_addr)); + memcpy(mac_entry, &prime_mac, sizeof(struct rte_ether_addr)); return 0; cleanup: diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index 9ef46d47ec..572eb84625 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -214,27 +214,27 @@ dpaa2_configure_flow_eth(struct rte_flow *flow, /* Key rule */ key_iova = flow->rule.key_iova + DPAA2_CLS_RULE_OFFSET_ETH; memcpy((void *)key_iova, (const void *)(spec->src.addr_bytes), - sizeof(struct ether_addr)); - key_iova += sizeof(struct ether_addr); + sizeof(struct rte_ether_addr)); + key_iova += sizeof(struct rte_ether_addr); memcpy((void *)key_iova, (const void *)(spec->dst.addr_bytes), - sizeof(struct ether_addr)); - key_iova += sizeof(struct ether_addr); + sizeof(struct rte_ether_addr)); + key_iova += sizeof(struct rte_ether_addr); memcpy((void *)key_iova, (const void *)(&spec->type), sizeof(rte_be16_t)); /* Key mask */ mask_iova = flow->rule.mask_iova + DPAA2_CLS_RULE_OFFSET_ETH; memcpy((void *)mask_iova, (const void *)(mask->src.addr_bytes), - sizeof(struct ether_addr)); - mask_iova += sizeof(struct ether_addr); + sizeof(struct rte_ether_addr)); + mask_iova += sizeof(struct rte_ether_addr); memcpy((void *)mask_iova, (const void *)(mask->dst.addr_bytes), - sizeof(struct ether_addr)); - mask_iova += sizeof(struct ether_addr); + sizeof(struct rte_ether_addr)); + mask_iova += sizeof(struct rte_ether_addr); memcpy((void *)mask_iova, (const void *)(&mask->type), sizeof(rte_be16_t)); flow->rule.key_size = (DPAA2_CLS_RULE_OFFSET_ETH + - ((2 * sizeof(struct ether_addr)) + + ((2 * sizeof(struct rte_ether_addr)) + sizeof(rte_be16_t))); return device_configured; } diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 8230824e73..b2fdb5e10d 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -89,14 +89,15 @@ static int eth_em_led_on(struct rte_eth_dev *dev); static int eth_em_led_off(struct rte_eth_dev *dev); static int em_get_rx_buffer_size(struct e1000_hw *hw); -static int eth_em_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, - uint32_t index, uint32_t pool); +static int eth_em_rar_set(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr, + uint32_t index, uint32_t pool); static void eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index); static int eth_em_default_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *addr); + struct rte_ether_addr *addr); static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); #define EM_FC_PAUSE_TIME 0x0680 @@ -293,7 +294,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev) } /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *) hw->mac.addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, eth_dev->data->mac_addrs); /* initialize the vfta */ @@ -1735,7 +1736,7 @@ eth_em_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) } static int -eth_em_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +eth_em_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, __rte_unused uint32_t pool) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1756,7 +1757,7 @@ eth_em_rar_clear(struct rte_eth_dev *dev, uint32_t index) static int eth_em_default_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { eth_em_rar_clear(dev, 0); @@ -1806,7 +1807,7 @@ eth_em_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int eth_em_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct e1000_hw *hw; diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index d3a8f5bf4c..e21a772fb0 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -145,11 +145,11 @@ static int eth_igb_led_off(struct rte_eth_dev *dev); static void igb_intr_disable(struct rte_eth_dev *dev); static int igb_get_rx_buffer_size(struct e1000_hw *hw); static int eth_igb_rar_set(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool); static void eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index); static int eth_igb_default_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *addr); + struct rte_ether_addr *addr); static void igbvf_intr_disable(struct e1000_hw *hw); static int igbvf_dev_configure(struct rte_eth_dev *dev); @@ -174,7 +174,7 @@ static int igbvf_vlan_filter_set(struct rte_eth_dev *dev, static int igbvf_set_vfta(struct e1000_hw *hw, uint16_t vid, bool on); static void igbvf_set_vfta_all(struct rte_eth_dev *dev, bool on); static int igbvf_default_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *addr); + struct rte_ether_addr *addr); static int igbvf_get_reg_length(struct rte_eth_dev *dev); static int igbvf_get_regs(struct rte_eth_dev *dev, struct rte_dev_reg_info *regs); @@ -231,7 +231,7 @@ static int eth_igb_get_module_info(struct rte_eth_dev *dev, static int eth_igb_get_module_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *info); static int eth_igb_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); static int igb_timesync_enable(struct rte_eth_dev *dev); static int igb_timesync_disable(struct rte_eth_dev *dev); @@ -840,7 +840,8 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev) } /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); + ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + ð_dev->data->mac_addrs[0]); /* initialize the vfta */ memset(shadow_vfta, 0, sizeof(*shadow_vfta)); @@ -983,7 +984,8 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); int diag; - struct ether_addr *perm_addr = (struct ether_addr *)hw->mac.perm_addr; + struct rte_ether_addr *perm_addr = + (struct rte_ether_addr *)hw->mac.perm_addr; PMD_INIT_FUNC_TRACE(); @@ -1057,7 +1059,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) return diag; } /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *) hw->mac.perm_addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, ð_dev->data->mac_addrs[0]); PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x " @@ -3119,7 +3121,7 @@ eth_igb_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) #define E1000_RAH_POOLSEL_SHIFT (18) static int -eth_igb_rar_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +eth_igb_rar_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -3145,7 +3147,7 @@ eth_igb_rar_clear(struct rte_eth_dev *dev, uint32_t index) static int eth_igb_default_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { eth_igb_rar_clear(dev, 0); eth_igb_rar_set(dev, (void *)addr, 0, 0); @@ -3358,7 +3360,7 @@ igbvf_dev_close(struct rte_eth_dev *dev) struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct e1000_adapter *adapter = E1000_DEV_PRIVATE(dev->data->dev_private); - struct ether_addr addr; + struct rte_ether_addr addr; PMD_INIT_FUNC_TRACE(); @@ -3503,7 +3505,7 @@ igbvf_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) } static int -igbvf_default_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *addr) +igbvf_default_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *addr) { struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -4905,7 +4907,7 @@ eth_igb_filter_ctrl(struct rte_eth_dev *dev, static int eth_igb_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct e1000_hw *hw; diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c index b9f2e53911..9f1521350d 100644 --- a/drivers/net/e1000/igb_pf.c +++ b/drivers/net/e1000/igb_pf.c @@ -306,8 +306,8 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); int rah; - if (is_unicast_ether_addr((struct ether_addr *)new_mac)) { - if (!is_zero_ether_addr((struct ether_addr *)new_mac)) + if (is_unicast_ether_addr((struct rte_ether_addr *)new_mac)) { + if (!is_zero_ether_addr((struct rte_ether_addr *)new_mac)) rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, sizeof(vfinfo[vf].vf_mac_addresses)); hw->mac.ops.rar_set(hw, new_mac, rar_entry); diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 3eb38165cc..1d832f91fc 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1813,9 +1813,9 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev) ENA_ADMIN_FEATURE_OFFLOAD_DESC_RX_L4_IPV4_CSUM_MASK) != 0; /* Copy MAC address and point DPDK to it */ - eth_dev->data->mac_addrs = (struct ether_addr *)adapter->mac_addr; - ether_addr_copy((struct ether_addr *)get_feat_ctx.dev_attr.mac_addr, - (struct ether_addr *)adapter->mac_addr); + eth_dev->data->mac_addrs = (struct rte_ether_addr *)adapter->mac_addr; + ether_addr_copy((struct rte_ether_addr *)get_feat_ctx.dev_attr.mac_addr, + (struct rte_ether_addr *)adapter->mac_addr); /* * Pass the information to the rte_eth_dev_close() that it should also @@ -2151,7 +2151,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, * length of the ethernet header. */ if (unlikely(m->l2_len == 0)) - m->l2_len = sizeof(struct ether_hdr); + m->l2_len = sizeof(struct rte_ether_hdr); ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len); diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index 362e0740c2..2f473358db 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -840,7 +840,7 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) } /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *)hw->mac.addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); /* Set MTU */ diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 9193fb0381..20080af6f0 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -197,7 +197,7 @@ struct enic { /* Multicast MAC addresses added to the NIC */ uint32_t mc_count; - struct ether_addr mc_addrs[ENIC_MULTICAST_PERFECT_FILTERS]; + struct rte_ether_addr mc_addrs[ENIC_MULTICAST_PERFECT_FILTERS]; }; /* Compute ethdev's max packet size from MTU */ diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 8d14d8ac7d..71e1b9c7d6 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -604,7 +604,7 @@ static void enicpmd_dev_allmulticast_disable(struct rte_eth_dev *eth_dev) } static int enicpmd_add_mac_addr(struct rte_eth_dev *eth_dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { struct enic *enic = pmd_priv(eth_dev); @@ -629,7 +629,7 @@ static void enicpmd_remove_mac_addr(struct rte_eth_dev *eth_dev, uint32_t index) } static int enicpmd_set_mac_addr(struct rte_eth_dev *eth_dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { struct enic *enic = pmd_priv(eth_dev); int ret; @@ -644,7 +644,7 @@ static int enicpmd_set_mac_addr(struct rte_eth_dev *eth_dev, return enic_set_mac_address(enic, addr->addr_bytes); } -static void debug_log_add_del_addr(struct ether_addr *addr, bool add) +static void debug_log_add_del_addr(struct rte_ether_addr *addr, bool add) { char mac_str[ETHER_ADDR_FMT_SIZE]; @@ -654,12 +654,12 @@ static void debug_log_add_del_addr(struct ether_addr *addr, bool add) } static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct enic *enic = pmd_priv(eth_dev); char mac_str[ETHER_ADDR_FMT_SIZE]; - struct ether_addr *addr; + struct rte_ether_addr *addr; uint32_t i, j; int ret; @@ -730,7 +730,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, } /* Keep a copy so we can flush/apply later on.. */ memcpy(enic->mc_addrs, mc_addr_set, - nb_mc_addr * sizeof(struct ether_addr)); + nb_mc_addr * sizeof(struct rte_ether_addr)); enic->mc_count = nb_mc_addr; return 0; } diff --git a/drivers/net/enic/enic_flow.c b/drivers/net/enic/enic_flow.c index 511c177f4c..9bddfb9416 100644 --- a/drivers/net/enic/enic_flow.c +++ b/drivers/net/enic/enic_flow.c @@ -572,9 +572,9 @@ enic_copy_item_inner_eth_v2(struct copy_item_args *arg) FLOW_TRACE(); if (!mask) mask = &rte_flow_item_eth_mask; - arg->l2_proto_off = *off + offsetof(struct ether_hdr, ether_type); + arg->l2_proto_off = *off + offsetof(struct rte_ether_hdr, ether_type); return copy_inner_common(&arg->filter->u.generic_1, off, - arg->item->spec, mask, sizeof(struct ether_hdr), + arg->item->spec, mask, sizeof(struct rte_ether_hdr), 0 /* no previous protocol */, 0, 0); } @@ -590,9 +590,9 @@ enic_copy_item_inner_vlan_v2(struct copy_item_args *arg) mask = &rte_flow_item_vlan_mask; /* Append vlan header to L5 and set ether type = TPID */ eth_type_off = arg->l2_proto_off; - arg->l2_proto_off = *off + offsetof(struct vlan_hdr, eth_proto); + 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 vlan_hdr), + arg->item->spec, mask, sizeof(struct rte_vlan_hdr), eth_type_off, rte_cpu_to_be_16(ETHER_TYPE_VLAN), 2); } @@ -663,8 +663,8 @@ enic_copy_item_eth_v2(struct copy_item_args *arg) { const struct rte_flow_item *item = arg->item; struct filter_v2 *enic_filter = arg->filter; - struct ether_hdr enic_spec; - struct ether_hdr enic_mask; + struct rte_ether_hdr enic_spec; + struct rte_ether_hdr enic_mask; const struct rte_flow_item_eth *spec = item->spec; const struct rte_flow_item_eth *mask = item->mask; struct filter_generic_1 *gp = &enic_filter->u.generic_1; @@ -692,9 +692,9 @@ enic_copy_item_eth_v2(struct copy_item_args *arg) /* outer header */ memcpy(gp->layer[FILTER_GENERIC_1_L2].mask, &enic_mask, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); memcpy(gp->layer[FILTER_GENERIC_1_L2].val, &enic_spec, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); return 0; } @@ -706,8 +706,8 @@ enic_copy_item_vlan_v2(struct copy_item_args *arg) const struct rte_flow_item_vlan *spec = item->spec; const struct rte_flow_item_vlan *mask = item->mask; struct filter_generic_1 *gp = &enic_filter->u.generic_1; - struct ether_hdr *eth_mask; - struct ether_hdr *eth_val; + struct rte_ether_hdr *eth_mask; + struct rte_ether_hdr *eth_val; FLOW_TRACE(); @@ -734,11 +734,11 @@ enic_copy_item_vlan_v2(struct copy_item_args *arg) * vlan tag remains in the L2 buffer. */ if (!arg->enic->vxlan && !arg->enic->ig_vlan_strip_en) { - struct vlan_hdr *vlan; + struct rte_vlan_hdr *vlan; - vlan = (struct vlan_hdr *)(eth_mask + 1); + vlan = (struct rte_vlan_hdr *)(eth_mask + 1); vlan->eth_proto = mask->inner_type; - vlan = (struct vlan_hdr *)(eth_val + 1); + vlan = (struct rte_vlan_hdr *)(eth_val + 1); vlan->eth_proto = spec->inner_type; } else { eth_mask->ether_type = mask->inner_type; @@ -947,11 +947,11 @@ enic_copy_item_vxlan_v2(struct copy_item_args *arg) mask = &rte_flow_item_vxlan_mask; memcpy(gp->layer[FILTER_GENERIC_1_L5].mask, mask, - sizeof(struct vxlan_hdr)); + sizeof(struct rte_vxlan_hdr)); memcpy(gp->layer[FILTER_GENERIC_1_L5].val, spec, - sizeof(struct vxlan_hdr)); + sizeof(struct rte_vxlan_hdr)); - *inner_ofst = sizeof(struct vxlan_hdr); + *inner_ofst = sizeof(struct rte_vxlan_hdr); return 0; } @@ -1051,7 +1051,7 @@ fixup_l5_layer(struct enic *enic, struct filter_generic_1 *gp, if (!(inner_ofst > 0 && enic->vxlan)) return; FLOW_TRACE(); - vxlan = sizeof(struct vxlan_hdr); + vxlan = sizeof(struct rte_vxlan_hdr); memcpy(gp->layer[FILTER_GENERIC_1_L4].mask + sizeof(struct udp_hdr), gp->layer[FILTER_GENERIC_1_L5].mask, vxlan); memcpy(gp->layer[FILTER_GENERIC_1_L4].val + sizeof(struct udp_hdr), diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index ea9eb2edfb..6b76839148 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1667,13 +1667,13 @@ static int enic_dev_init(struct enic *enic) enic_fdir_info(enic); eth_dev->data->mac_addrs = rte_zmalloc("enic_mac_addr", - sizeof(struct ether_addr) * + sizeof(struct rte_ether_addr) * ENIC_UNICAST_PERFECT_FILTERS, 0); if (!eth_dev->data->mac_addrs) { dev_err(enic, "mac addr storage alloc failed, aborting.\n"); return -1; } - ether_addr_copy((struct ether_addr *) enic->mac_addr, + ether_addr_copy((struct rte_ether_addr *)enic->mac_addr, eth_dev->data->mac_addrs); vnic_dev_set_reset_flag(enic->vdev, 0); diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 42dfaca30e..8f7d911699 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -166,7 +166,7 @@ static int fs_eth_dev_create(struct rte_vdev_device *vdev) { struct rte_eth_dev *dev; - struct ether_addr *mac; + struct rte_ether_addr *mac; struct fs_priv *priv; struct sub_device *sdev; const char *params; diff --git a/drivers/net/failsafe/failsafe_args.c b/drivers/net/failsafe/failsafe_args.c index 3351c5bcab..5fc6be403d 100644 --- a/drivers/net/failsafe/failsafe_args.c +++ b/drivers/net/failsafe/failsafe_args.c @@ -367,7 +367,7 @@ static int fs_get_mac_addr_arg(const char *key __rte_unused, const char *value, void *out) { - struct ether_addr *ea = out; + struct rte_ether_addr *ea = out; int ret; if ((value == NULL) || (out == NULL)) diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index 7ac23d49a3..549ee6bb80 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -166,7 +166,7 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev, DEBUG("Configure additional MAC address%s", (PRIV(dev)->nb_mac_addr > 2 ? "es" : "")); for (i = 1; i < PRIV(dev)->nb_mac_addr; i++) { - struct ether_addr *ea; + struct rte_ether_addr *ea; ea = &dev->data->mac_addrs[i]; ret = rte_eth_dev_mac_addr_add(PORT_ID(sdev), ea, diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 43d6a828ff..c900eccb29 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -1082,7 +1082,7 @@ fs_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) static int fs_mac_addr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq) { @@ -1111,7 +1111,7 @@ fs_mac_addr_add(struct rte_eth_dev *dev, } static int -fs_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +fs_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct sub_device *sdev; uint8_t i; @@ -1135,7 +1135,7 @@ fs_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) static int fs_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct sub_device *sdev; uint8_t i; diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index 4f58a5c918..231b89edd9 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -152,10 +152,10 @@ struct fs_priv { TAILQ_HEAD(sub_flows, rte_flow) flow_list; /* current number of mac_addr slots allocated. */ uint32_t nb_mac_addr; - struct ether_addr mac_addrs[FAILSAFE_MAX_ETHADDR]; + struct rte_ether_addr mac_addrs[FAILSAFE_MAX_ETHADDR]; uint32_t mac_addr_pool[FAILSAFE_MAX_ETHADDR]; uint32_t nb_mcast_addr; - struct ether_addr *mcast_addrs; + struct rte_ether_addr *mcast_addrs; /* current capabilities */ struct rte_eth_dev_info infos; struct rte_eth_dev_owner my_owner; /* Unique owner. */ diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index d24c4c5baf..e4f9f93849 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -614,7 +614,7 @@ fm10k_dev_mq_rx_configure(struct rte_eth_dev *dev) /* reset MAC/VLAN as it's based on VMDQ or PF main VSI */ memset(dev->data->mac_addrs, 0, ETHER_ADDR_LEN * FM10K_MAX_MACADDR_NUM); - ether_addr_copy((const struct ether_addr *)hw->mac.addr, + ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0]); memset(macvlan, 0, sizeof(*macvlan)); macvlan->nb_queue_pools = nb_queue_pools; @@ -1673,7 +1673,7 @@ static void fm10k_MAC_filter_set(struct rte_eth_dev *dev, /* Add a MAC address, and update filters */ static int fm10k_macaddr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool) { @@ -3090,7 +3090,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) diag = fm10k_read_mac_addr(hw); - ether_addr_copy((const struct ether_addr *)hw->mac.addr, + ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0]); if (diag != FM10K_SUCCESS || @@ -3099,7 +3099,7 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) /* Generate a random addr */ eth_random_addr(hw->mac.addr); memcpy(hw->mac.perm_addr, hw->mac.addr, ETH_ALEN); - ether_addr_copy((const struct ether_addr *)hw->mac.addr, + ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0]); } diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 815baa1a65..85fdf35d10 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -265,7 +265,7 @@ static int i40e_flow_ctrl_set(struct rte_eth_dev *dev, static int i40e_priority_flow_ctrl_set(struct rte_eth_dev *dev, struct rte_eth_pfc_conf *pfc_conf); static int i40e_macaddr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool); static void i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index); @@ -379,7 +379,7 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *info); static int i40e_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int i40e_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); @@ -1469,8 +1469,8 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) goto err_get_mac_addr; } /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *) hw->mac.addr, - (struct ether_addr *) hw->mac.perm_addr); + ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + (struct rte_ether_addr *)hw->mac.perm_addr); /* Disable flow control */ hw->fc.requested_mode = I40E_FC_NONE; @@ -1521,7 +1521,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) "Failed to allocated memory for storing mac address"); goto err_mac_alloc; } - ether_addr_copy((struct ether_addr *)hw->mac.perm_addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, &dev->data->mac_addrs[0]); /* Init dcb to sw mode by default */ @@ -4012,7 +4012,7 @@ i40e_priority_flow_ctrl_set(__rte_unused struct rte_eth_dev *dev, /* Add a MAC address, and update filters */ static int i40e_macaddr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, __rte_unused uint32_t index, uint32_t pool) { @@ -4063,7 +4063,7 @@ i40e_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct i40e_vsi *vsi; struct rte_eth_dev_data *data = dev->data; - struct ether_addr *macaddr; + struct rte_ether_addr *macaddr; int ret; uint32_t i; uint64_t pool_sel; @@ -4104,8 +4104,8 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, { struct i40e_hw *hw; struct i40e_mac_filter_info mac_filter; - struct ether_addr old_mac; - struct ether_addr *new_mac; + struct rte_ether_addr old_mac; + struct rte_ether_addr *new_mac; struct i40e_pf_vf *vf = NULL; uint16_t vf_id; int ret; @@ -4166,7 +4166,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, /* Clear device address as it has been removed */ if (is_same_ether_addr(&(pf->dev_addr), new_mac)) - memset(&pf->dev_addr, 0, sizeof(struct ether_addr)); + memset(&pf->dev_addr, 0, sizeof(struct rte_ether_addr)); } return 0; @@ -5343,7 +5343,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) ret = i40e_aq_remove_macvlan(hw, vsi->seid, &def_filter, 1, NULL); if (ret != I40E_SUCCESS) { struct i40e_mac_filter *f; - struct ether_addr *mac; + struct rte_ether_addr *mac; PMD_DRV_LOG(DEBUG, "Cannot remove the default macvlan filter"); @@ -5363,7 +5363,7 @@ i40e_update_default_filter_setting(struct i40e_vsi *vsi) return ret; } rte_memcpy(&filter.mac_addr, - (struct ether_addr *)(hw->mac.perm_addr), ETH_ADDR_LEN); + (struct rte_ether_addr *)(hw->mac.perm_addr), ETH_ADDR_LEN); filter.filter_type = RTE_MACVLAN_PERFECT_MATCH; return i40e_vsi_add_mac(vsi, &filter); } @@ -5481,7 +5481,7 @@ i40e_vsi_setup(struct i40e_pf *pf, struct i40e_mac_filter_info filter; int ret; struct i40e_vsi_context ctxt; - struct ether_addr broadcast = + struct rte_ether_addr broadcast = {.addr_bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}}; if (type != I40E_VSI_MAIN && type != I40E_VSI_SRIOV && @@ -6908,7 +6908,7 @@ DONE: /* Find out specific MAC filter */ static struct i40e_mac_filter * i40e_find_mac_filter(struct i40e_vsi *vsi, - struct ether_addr *macaddr) + struct rte_ether_addr *macaddr) { struct i40e_mac_filter *f; @@ -6992,7 +6992,7 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi, int i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi, struct i40e_macvlan_filter *mv_f, - int num, struct ether_addr *addr) + int num, struct rte_ether_addr *addr) { int i; uint32_t j, k; @@ -7286,7 +7286,7 @@ DONE: } int -i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct ether_addr *addr) +i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr) { struct i40e_mac_filter *f; struct i40e_macvlan_filter *mv_f; @@ -7586,10 +7586,10 @@ i40e_tunnel_filter_convert( struct i40e_aqc_cloud_filters_element_bb *cld_filter, struct i40e_tunnel_filter *tunnel_filter) { - ether_addr_copy((struct ether_addr *)&cld_filter->element.outer_mac, - (struct ether_addr *)&tunnel_filter->input.outer_mac); - ether_addr_copy((struct ether_addr *)&cld_filter->element.inner_mac, - (struct ether_addr *)&tunnel_filter->input.inner_mac); + ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.outer_mac, + (struct rte_ether_addr *)&tunnel_filter->input.outer_mac); + ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.inner_mac, + (struct rte_ether_addr *)&tunnel_filter->input.inner_mac); tunnel_filter->input.inner_vlan = cld_filter->element.inner_vlan; if ((rte_le_to_cpu_16(cld_filter->element.flags) & I40E_AQC_ADD_CLOUD_FLAGS_IPV6) == @@ -7698,9 +7698,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, pfilter = cld_filter; ether_addr_copy(&tunnel_filter->outer_mac, - (struct ether_addr *)&pfilter->element.outer_mac); + (struct rte_ether_addr *)&pfilter->element.outer_mac); ether_addr_copy(&tunnel_filter->inner_mac, - (struct ether_addr *)&pfilter->element.inner_mac); + (struct rte_ether_addr *)&pfilter->element.inner_mac); pfilter->element.inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); @@ -8145,9 +8145,9 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, pfilter = cld_filter; ether_addr_copy(&tunnel_filter->outer_mac, - (struct ether_addr *)&pfilter->element.outer_mac); + (struct rte_ether_addr *)&pfilter->element.outer_mac); ether_addr_copy(&tunnel_filter->inner_mac, - (struct ether_addr *)&pfilter->element.inner_mac); + (struct rte_ether_addr *)&pfilter->element.inner_mac); pfilter->element.inner_vlan = rte_cpu_to_le_16(tunnel_filter->inner_vlan); @@ -11951,7 +11951,7 @@ static int i40e_get_module_eeprom(struct rte_eth_dev *dev, } static int i40e_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -12084,10 +12084,10 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf) vsi = vf->vsi; } memset(&cld_filter, 0, sizeof(cld_filter)); - ether_addr_copy((struct ether_addr *)&f->input.outer_mac, - (struct ether_addr *)&cld_filter.element.outer_mac); - ether_addr_copy((struct ether_addr *)&f->input.inner_mac, - (struct ether_addr *)&cld_filter.element.inner_mac); + ether_addr_copy((struct rte_ether_addr *)&f->input.outer_mac, + (struct rte_ether_addr *)&cld_filter.element.outer_mac); + ether_addr_copy((struct rte_ether_addr *)&f->input.inner_mac, + (struct rte_ether_addr *)&cld_filter.element.inner_mac); cld_filter.element.inner_vlan = f->input.inner_vlan; cld_filter.element.flags = f->input.flags; cld_filter.element.tenant_id = f->input.tenant_id; diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h index 98550380e0..ffaa7b9493 100644 --- a/drivers/net/i40e/i40e_ethdev.h +++ b/drivers/net/i40e/i40e_ethdev.h @@ -277,7 +277,7 @@ struct i40e_adapter; */ struct i40e_mac_filter_info { enum rte_mac_filter_type filter_type; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; }; TAILQ_HEAD(i40e_mac_filter_list, i40e_mac_filter); @@ -330,7 +330,7 @@ struct i40e_veb { /* i40e MACVLAN filter structure */ struct i40e_macvlan_filter { - struct ether_addr macaddr; + struct rte_ether_addr macaddr; enum rte_mac_filter_type filter_type; uint16_t vlan_id; }; @@ -421,7 +421,7 @@ struct i40e_pf_vf { uint16_t vf_idx; /* VF index in pf->vfs */ uint16_t lan_nb_qps; /* Actual queues allocated */ uint16_t reset_cnt; /* Total vf reset times */ - struct ether_addr mac_addr; /* Default MAC address */ + struct rte_ether_addr mac_addr; /* Default MAC address */ /* version of the virtchnl from VF */ struct virtchnl_version_info version; uint32_t request_caps; /* offload caps requested from VF */ @@ -641,7 +641,7 @@ struct i40e_fdir_info { /* Ethertype filter struct */ struct i40e_ethertype_filter_input { - struct ether_addr mac_addr; /* Mac address to match */ + struct rte_ether_addr mac_addr; /* Mac address to match */ uint16_t ether_type; /* Ether type to match */ }; @@ -759,8 +759,8 @@ enum i40e_tunnel_type { * Tunneling Packet filter configuration. */ struct i40e_tunnel_filter_conf { - struct ether_addr outer_mac; /**< Outer MAC address to match. */ - struct ether_addr inner_mac; /**< Inner MAC address to match. */ + struct rte_ether_addr outer_mac; /**< Outer MAC address to match. */ + struct rte_ether_addr inner_mac; /**< Inner MAC address to match. */ uint16_t inner_vlan; /**< Inner VLAN to match. */ uint32_t outer_vlan; /**< Outer VLAN to match */ enum i40e_tunnel_iptype ip_type; /**< IP address type. */ @@ -919,7 +919,7 @@ struct i40e_pf { bool offset_loaded; struct rte_eth_dev_data *dev_data; /* Pointer to the device data */ - struct ether_addr dev_addr; /* PF device mac address */ + struct rte_ether_addr dev_addr; /* PF device mac address */ uint64_t flags; /* PF feature flags */ /* All kinds of queue pair setting for different VSIs */ struct i40e_pf_vf *vfs; @@ -1023,7 +1023,8 @@ struct i40e_vf { uint16_t promisc_flags; /* Promiscuous setting */ uint32_t vlan[I40E_VFTA_SIZE]; /* VLAN bit map */ - struct ether_addr mc_addrs[I40E_NUM_MACADDR_MAX]; /* Multicast addrs */ + /* Multicast addrs */ + struct rte_ether_addr mc_addrs[I40E_NUM_MACADDR_MAX]; uint16_t mc_addrs_num; /* Multicast mac addresses number */ /* Event from pf */ @@ -1131,7 +1132,7 @@ int i40e_switch_tx_queue(struct i40e_hw *hw, uint16_t q_idx, bool on); int i40e_vsi_add_vlan(struct i40e_vsi *vsi, uint16_t vlan); int i40e_vsi_delete_vlan(struct i40e_vsi *vsi, uint16_t vlan); int i40e_vsi_add_mac(struct i40e_vsi *vsi, struct i40e_mac_filter_info *filter); -int i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct ether_addr *addr); +int i40e_vsi_delete_mac(struct i40e_vsi *vsi, struct rte_ether_addr *addr); void i40e_update_vsi_stats(struct i40e_vsi *vsi); void i40e_pf_disable_irq0(struct i40e_hw *hw); void i40e_pf_enable_irq0(struct i40e_hw *hw); @@ -1206,7 +1207,7 @@ int i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, int i40e_fdir_flush(struct rte_eth_dev *dev); int i40e_find_all_vlan_for_mac(struct i40e_vsi *vsi, struct i40e_macvlan_filter *mv_f, - int num, struct ether_addr *addr); + int num, struct rte_ether_addr *addr); int i40e_remove_macvlan_filters(struct i40e_vsi *vsi, struct i40e_macvlan_filter *filter, int total); diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index a348972935..0b05ddb34a 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -106,7 +106,7 @@ static int i40evf_dev_tx_queue_start(struct rte_eth_dev *dev, static int i40evf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id); static int i40evf_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr, + struct rte_ether_addr *addr, uint32_t index, uint32_t pool); static void i40evf_del_mac_addr(struct rte_eth_dev *dev, uint32_t index); @@ -123,7 +123,7 @@ static int i40evf_dev_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); static int i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int i40evf_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int i40evf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id); static int @@ -134,10 +134,11 @@ static void i40evf_handle_pf_event(struct rte_eth_dev *dev, static int i40evf_add_del_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr, bool add); static int -i40evf_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addr_set, +i40evf_set_mc_addr_list(struct rte_eth_dev *dev, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); /* Default hash key buffer for RSS */ @@ -776,7 +777,7 @@ i40evf_stop_queues(struct rte_eth_dev *dev) static int i40evf_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr, + struct rte_ether_addr *addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { @@ -818,7 +819,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev, static void i40evf_del_mac_addr_by_addr(struct rte_eth_dev *dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { struct virtchnl_ether_addr_list *list; struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); @@ -859,7 +860,7 @@ static void i40evf_del_mac_addr(struct rte_eth_dev *dev, uint32_t index) { struct rte_eth_dev_data *data = dev->data; - struct ether_addr *addr; + struct rte_ether_addr *addr; addr = &data->mac_addrs[index]; @@ -1273,7 +1274,7 @@ i40evf_init_vf(struct rte_eth_dev *dev) vf->vsi.adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); /* Store the MAC address configured by host, or generate random one */ - if (is_valid_assigned_ether_addr((struct ether_addr *)hw->mac.addr)) + if (is_valid_assigned_ether_addr((struct rte_ether_addr *)hw->mac.addr)) vf->flags |= I40E_FLAG_VF_MAC_BY_PF; else eth_random_addr(hw->mac.addr); /* Generate a random one */ @@ -1511,7 +1512,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX); return -ENOMEM; } - ether_addr_copy((struct ether_addr *)hw->mac.addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); return 0; @@ -1929,7 +1930,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) int next_begin = 0; int begin = 0; uint32_t len; - struct ether_addr *addr; + struct rte_ether_addr *addr; struct vf_cmd_info args; do { @@ -2701,7 +2702,7 @@ i40evf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int i40evf_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -2714,18 +2715,18 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev, if (vf->flags & I40E_FLAG_VF_MAC_BY_PF) return -EPERM; - i40evf_del_mac_addr_by_addr(dev, (struct ether_addr *)hw->mac.addr); + i40evf_del_mac_addr_by_addr(dev, (struct rte_ether_addr *)hw->mac.addr); if (i40evf_add_mac_addr(dev, mac_addr, 0, 0) != 0) return -EIO; - ether_addr_copy(mac_addr, (struct ether_addr *)hw->mac.addr); + ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); return 0; } static int i40evf_add_del_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addrs, + struct rte_ether_addr *mc_addrs, uint32_t mc_addrs_num, bool add) { struct virtchnl_ether_addr_list *list; @@ -2779,7 +2780,8 @@ i40evf_add_del_mc_addr_list(struct rte_eth_dev *dev, } static int -i40evf_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addrs, +i40evf_set_mc_addr_list(struct rte_eth_dev *dev, + struct rte_ether_addr *mc_addrs, uint32_t mc_addrs_num) { struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 4b32fee1e1..dd940cecb1 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -685,7 +685,7 @@ 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 ether_addr); + uint8_t len = 2 * sizeof(struct rte_ether_addr); struct ipv4_hdr *ip; struct ipv6_hdr *ip6; static const uint8_t next_proto[] = { @@ -701,7 +701,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input, [RTE_ETH_FLOW_NONFRAG_IPV6_OTHER] = IPPROTO_NONE, }; - raw_pkt += 2 * sizeof(struct ether_addr); + raw_pkt += 2 * sizeof(struct rte_ether_addr); if (vlan && fdir_input->flow_ext.vlan_tci) { rte_memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame)); rte_memcpy(raw_pkt + sizeof(uint16_t), @@ -959,7 +959,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf, struct i40e_customized_pctype *cus_pctype = NULL; static uint8_t vlan_frame[] = {0x81, 0, 0, 0}; uint16_t *ether_type; - uint8_t len = 2 * sizeof(struct ether_addr); + uint8_t len = 2 * sizeof(struct rte_ether_addr); struct ipv4_hdr *ip; struct ipv6_hdr *ip6; uint8_t pctype = fdir_input->pctype; @@ -977,7 +977,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf, [I40E_FILTER_PCTYPE_NONF_IPV6_OTHER] = IPPROTO_NONE, }; - raw_pkt += 2 * sizeof(struct ether_addr); + raw_pkt += 2 * sizeof(struct rte_ether_addr); if (vlan && fdir_input->flow_ext.vlan_tci) { rte_memcpy(raw_pkt, vlan_frame, sizeof(vlan_frame)); rte_memcpy(raw_pkt + sizeof(uint16_t), diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index bca93b641f..559ca92ee0 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -4810,10 +4810,10 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf, int ret = 0; memset(&cld_filter, 0, sizeof(cld_filter)); - ether_addr_copy((struct ether_addr *)&filter->input.outer_mac, - (struct ether_addr *)&cld_filter.element.outer_mac); - ether_addr_copy((struct ether_addr *)&filter->input.inner_mac, - (struct ether_addr *)&cld_filter.element.inner_mac); + ether_addr_copy((struct rte_ether_addr *)&filter->input.outer_mac, + (struct rte_ether_addr *)&cld_filter.element.outer_mac); + ether_addr_copy((struct rte_ether_addr *)&filter->input.inner_mac, + (struct rte_ether_addr *)&cld_filter.element.inner_mac); cld_filter.element.inner_vlan = filter->input.inner_vlan; cld_filter.element.flags = filter->input.flags; cld_filter.element.tenant_id = filter->input.tenant_id; diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 91be45027a..4d7001df5f 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -349,7 +349,7 @@ i40e_pf_host_process_cmd_get_vf_resource(struct i40e_pf_vf *vf, uint8_t *msg, vf_res->vsi_res[0].vsi_id = vf->vsi->vsi_id; vf_res->vsi_res[0].num_queue_pairs = vf->vsi->nb_qps; ether_addr_copy(&vf->mac_addr, - (struct ether_addr *)vf_res->vsi_res[0].default_mac_addr); + (struct rte_ether_addr *)vf_res->vsi_res[0].default_mac_addr); send_msg: i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_GET_VF_RESOURCES, @@ -823,7 +823,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf, (struct virtchnl_ether_addr_list *)msg; struct i40e_mac_filter_info filter; int i; - struct ether_addr *mac; + struct rte_ether_addr *mac; if (!b_op) { i40e_pf_host_send_msg_to_vf( @@ -842,7 +842,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf, } for (i = 0; i < addr_list->num_elements; i++) { - mac = (struct ether_addr *)(addr_list->list[i].addr); + mac = (struct rte_ether_addr *)(addr_list->list[i].addr); rte_memcpy(&filter.mac_addr, mac, ETHER_ADDR_LEN); filter.filter_type = RTE_MACVLAN_PERFECT_MATCH; if (is_zero_ether_addr(mac) || @@ -869,7 +869,7 @@ i40e_pf_host_process_cmd_del_ether_address(struct i40e_pf_vf *vf, struct virtchnl_ether_addr_list *addr_list = (struct virtchnl_ether_addr_list *)msg; int i; - struct ether_addr *mac; + struct rte_ether_addr *mac; if (!b_op) { i40e_pf_host_send_msg_to_vf( @@ -886,7 +886,7 @@ i40e_pf_host_process_cmd_del_ether_address(struct i40e_pf_vf *vf, } for (i = 0; i < addr_list->num_elements; i++) { - mac = (struct ether_addr *)(addr_list->list[i].addr); + mac = (struct rte_ether_addr *)(addr_list->list[i].addr); if(is_zero_ether_addr(mac) || i40e_vsi_delete_mac(vf->vsi, mac)) { ret = I40E_ERR_INVALID_MAC_ADDR; diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c index 45a15d3ab4..633dca6c3a 100644 --- a/drivers/net/i40e/i40e_vf_representor.c +++ b/drivers/net/i40e/i40e_vf_representor.c @@ -324,7 +324,7 @@ i40e_vf_representor_mac_addr_remove(struct rte_eth_dev *ethdev, uint32_t index) static int i40e_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct i40e_vf_representor *representor = ethdev->data->dev_private; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index 7ae78e426a..8e562553a9 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -529,7 +529,7 @@ rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, uint16_t vf_id, uint8_t on) int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct i40e_mac_filter *f; struct rte_eth_dev *dev; @@ -571,11 +571,11 @@ rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, return 0; } -static const struct ether_addr null_mac_addr; +static const struct rte_ether_addr null_mac_addr; int rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct rte_eth_dev *dev; struct i40e_pf_vf *vf; @@ -724,7 +724,7 @@ int rte_pmd_i40e_set_vf_broadcast(uint16_t port, uint16_t vf_id, struct i40e_vsi *vsi; struct i40e_hw *hw; struct i40e_mac_filter_info filter; - struct ether_addr broadcast = { + struct rte_ether_addr broadcast = { .addr_bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} }; int ret; @@ -2355,7 +2355,7 @@ int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct rte_eth_dev *dev; struct i40e_pf_vf *vf; @@ -2492,10 +2492,11 @@ rte_pmd_i40e_flow_type_mapping_update( } int -rte_pmd_i40e_query_vfid_by_mac(uint16_t port, const struct ether_addr *vf_mac) +rte_pmd_i40e_query_vfid_by_mac(uint16_t port, + const struct rte_ether_addr *vf_mac) { struct rte_eth_dev *dev; - struct ether_addr *mac; + struct rte_ether_addr *mac; struct i40e_pf *pf; int vf_id; struct i40e_pf_vf *vf; diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h index a1313146b6..faac9e2e2c 100644 --- a/drivers/net/i40e/rte_pmd_i40e.h +++ b/drivers/net/i40e/rte_pmd_i40e.h @@ -453,7 +453,7 @@ int rte_pmd_i40e_set_vf_multicast_promisc(uint16_t port, * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /** * Remove the VF MAC address. @@ -471,7 +471,7 @@ int rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, */ int rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /** * Enable/Disable vf vlan strip for all queues in a pool @@ -854,7 +854,7 @@ int rte_pmd_i40e_ptype_mapping_replace(uint16_t port, * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ int rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); #define RTE_PMD_I40E_PCTYPE_MAX 64 #define RTE_PMD_I40E_FLOW_TYPE_MAX 64 @@ -924,7 +924,7 @@ int rte_pmd_i40e_flow_type_mapping_reset(uint16_t port); * -ENOTSUP: i40e not supported for this port. */ int rte_pmd_i40e_query_vfid_by_mac(uint16_t port, - const struct ether_addr *vf_mac); + const struct rte_ether_addr *vf_mac); /** * Do RSS queue region configuration for that port as diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h index 3470e0305e..1227259f5d 100644 --- a/drivers/net/iavf/iavf.h +++ b/drivers/net/iavf/iavf.h @@ -217,6 +217,6 @@ int iavf_query_stats(struct iavf_adapter *adapter, int iavf_config_promisc(struct iavf_adapter *adapter, bool enable_unicast, bool enable_multicast); int iavf_add_del_eth_addr(struct iavf_adapter *adapter, - struct ether_addr *addr, bool add); + struct rte_ether_addr *addr, bool add); int iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add); #endif /* _IAVF_ETHDEV_H_ */ diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 4072a7b790..c983550253 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -48,7 +48,7 @@ static void iavf_dev_promiscuous_disable(struct rte_eth_dev *dev); static void iavf_dev_allmulticast_enable(struct rte_eth_dev *dev); static void iavf_dev_allmulticast_disable(struct rte_eth_dev *dev); static int iavf_dev_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *addr, + struct rte_ether_addr *addr, uint32_t index, uint32_t pool); static void iavf_dev_del_mac_addr(struct rte_eth_dev *dev, uint32_t index); @@ -67,7 +67,7 @@ static int iavf_dev_rss_hash_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); static int iavf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu); static int iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int iavf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id); static int iavf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev, @@ -697,7 +697,7 @@ iavf_dev_allmulticast_disable(struct rte_eth_dev *dev) } static int -iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr, +iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { @@ -728,7 +728,7 @@ iavf_dev_del_mac_addr(struct rte_eth_dev *dev, uint32_t index) struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct ether_addr *addr; + struct rte_ether_addr *addr; int err; addr = &dev->data->mac_addrs[index]; @@ -940,16 +940,16 @@ iavf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct iavf_adapter *adapter = IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(adapter); - struct ether_addr *perm_addr, *old_addr; + struct rte_ether_addr *perm_addr, *old_addr; int ret; - old_addr = (struct ether_addr *)hw->mac.addr; - perm_addr = (struct ether_addr *)hw->mac.perm_addr; + old_addr = (struct rte_ether_addr *)hw->mac.addr; + perm_addr = (struct rte_ether_addr *)hw->mac.perm_addr; if (is_same_ether_addr(mac_addr, old_addr)) return 0; @@ -983,7 +983,7 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, if (ret) return -EIO; - ether_addr_copy(mac_addr, (struct ether_addr *)hw->mac.addr); + ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); return 0; } @@ -1317,9 +1317,10 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) /* If the MAC address is not configured by host, * generate a random one. */ - if (!is_valid_assigned_ether_addr((struct ether_addr *)hw->mac.addr)) + if (!is_valid_assigned_ether_addr( + (struct rte_ether_addr *)hw->mac.addr)) eth_random_addr(hw->mac.addr); - ether_addr_copy((struct ether_addr *)hw->mac.addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); /* register callback func to eal lib */ diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index da6401d35c..a705dbdfc5 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -636,7 +636,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) { struct virtchnl_ether_addr_list *list; struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); - struct ether_addr *addr; + struct rte_ether_addr *addr; struct iavf_cmd_info args; int len, err, i, j; int next_begin = 0; @@ -753,7 +753,7 @@ iavf_config_promisc(struct iavf_adapter *adapter, } int -iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct ether_addr *addr, +iavf_add_del_eth_addr(struct iavf_adapter *adapter, struct rte_ether_addr *addr, bool add) { struct virtchnl_ether_addr_list *list; diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 19fbbc3fc4..d09d172814 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -58,9 +58,9 @@ static int ice_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on); static int ice_macaddr_set(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int ice_macaddr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, __rte_unused uint32_t index, uint32_t pool); static void ice_macaddr_remove(struct rte_eth_dev *dev, uint32_t index); @@ -486,29 +486,30 @@ ice_init_mac_address(struct rte_eth_dev *dev) struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); if (!is_unicast_ether_addr - ((struct ether_addr *)hw->port_info[0].mac.lan_addr)) { + ((struct rte_ether_addr *)hw->port_info[0].mac.lan_addr)) { PMD_INIT_LOG(ERR, "Invalid MAC address"); return -EINVAL; } - ether_addr_copy((struct ether_addr *)hw->port_info[0].mac.lan_addr, - (struct ether_addr *)hw->port_info[0].mac.perm_addr); + ether_addr_copy((struct rte_ether_addr *)hw->port_info[0].mac.lan_addr, + (struct rte_ether_addr *)hw->port_info[0].mac.perm_addr); - dev->data->mac_addrs = rte_zmalloc(NULL, sizeof(struct ether_addr), 0); + dev->data->mac_addrs = + rte_zmalloc(NULL, sizeof(struct rte_ether_addr), 0); if (!dev->data->mac_addrs) { PMD_INIT_LOG(ERR, "Failed to allocate memory to store mac address"); return -ENOMEM; } /* store it to dev data */ - ether_addr_copy((struct ether_addr *)hw->port_info[0].mac.perm_addr, + ether_addr_copy((struct rte_ether_addr *)hw->port_info[0].mac.perm_addr, &dev->data->mac_addrs[0]); return 0; } /* Find out specific MAC filter */ static struct ice_mac_filter * -ice_find_mac_filter(struct ice_vsi *vsi, struct ether_addr *macaddr) +ice_find_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *macaddr) { struct ice_mac_filter *f; @@ -521,7 +522,7 @@ ice_find_mac_filter(struct ice_vsi *vsi, struct ether_addr *macaddr) } static int -ice_add_mac_filter(struct ice_vsi *vsi, struct ether_addr *mac_addr) +ice_add_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *mac_addr) { struct ice_fltr_list_entry *m_list_itr = NULL; struct ice_mac_filter *f; @@ -580,7 +581,7 @@ DONE: } static int -ice_remove_mac_filter(struct ice_vsi *vsi, struct ether_addr *mac_addr) +ice_remove_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *mac_addr) { struct ice_fltr_list_entry *m_list_itr = NULL; struct ice_mac_filter *f; @@ -1133,9 +1134,9 @@ ice_setup_vsi(struct ice_pf *pf, enum ice_vsi_type type) struct ice_vsi *vsi = NULL; struct ice_vsi_ctx vsi_ctx; int ret; - struct ether_addr broadcast = { + struct rte_ether_addr broadcast = { .addr_bytes = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} }; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; uint16_t max_txqs[ICE_MAX_TRAFFIC_CLASS] = { 0 }; uint8_t tc_bitmap = 0x1; @@ -2347,7 +2348,7 @@ ice_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) } static int ice_macaddr_set(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); @@ -2394,7 +2395,7 @@ static int ice_macaddr_set(struct rte_eth_dev *dev, /* Add a MAC address, and update filters */ static int ice_macaddr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { @@ -2418,7 +2419,7 @@ ice_macaddr_remove(struct rte_eth_dev *dev, uint32_t index) struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private); struct ice_vsi *vsi = pf->main_vsi; struct rte_eth_dev_data *data = dev->data; - struct ether_addr *macaddr; + struct rte_ether_addr *macaddr; int ret; macaddr = &data->mac_addrs[index]; diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index f3ed02e731..4baaf94985 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -130,7 +130,7 @@ struct ice_adapter; * MAC filter structure */ struct ice_mac_filter_info { - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; }; TAILQ_HEAD(ice_mac_filter_list, ice_mac_filter); @@ -247,7 +247,7 @@ struct ice_pf { struct ice_res_pool_info qp_pool; /*Queue pair pool */ struct ice_res_pool_info msix_pool; /* MSIX interrupt pool */ struct rte_eth_dev_data *dev_data; /* Pointer to the device data */ - struct ether_addr dev_addr; /* PF device mac address */ + struct rte_ether_addr dev_addr; /* PF device mac address */ uint64_t flags; /* PF feature flags */ uint16_t hash_lut_size; /* The size of hash lookup table */ uint16_t lan_nb_qp_max; diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h b/drivers/net/ipn3ke/ipn3ke_ethdev.h index bfda9d508c..566bc7607c 100644 --- a/drivers/net/ipn3ke/ipn3ke_ethdev.h +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h @@ -245,7 +245,7 @@ struct ipn3ke_rpst { struct rte_eth_link ori_linfo; struct ipn3ke_tm_internals tm; /**< Private data store of assocaiated physical function */ - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; }; /* UUID IDs */ @@ -545,7 +545,7 @@ void ipn3ke_rpst_allmulticast_disable(struct rte_eth_dev *ethdev); int ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); int ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, uint16_t mtu); diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index cf3b214a27..aee2aac6c4 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -124,7 +124,7 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev) snprintf(attr_name, IPN3KE_RAWDEV_ATTR_LEN_MAX, "%s", "LineSideBaseMAC"); rawdev->dev_ops->attr_get(rawdev, attr_name, &base_mac); - ether_addr_copy((struct ether_addr *)&base_mac, &rpst->mac_addr); + ether_addr_copy((struct rte_ether_addr *)&base_mac, &rpst->mac_addr); ether_addr_copy(&rpst->mac_addr, &dev->data->mac_addrs[0]); dev->data->mac_addrs->addr_bytes[ETHER_ADDR_LEN - 1] = @@ -650,7 +650,7 @@ ipn3ke_rpst_allmulticast_disable(struct rte_eth_dev *ethdev) int ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(ethdev); struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 2470c89cf0..3ae521a422 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -223,11 +223,12 @@ static void ixgbe_dev_interrupt_handler(void *param); static void ixgbe_dev_interrupt_delayed_handler(void *param); static void ixgbe_dev_setup_link_alarm_handler(void *param); -static int ixgbe_add_rar(struct rte_eth_dev *dev, struct ether_addr *mac_addr, - uint32_t index, uint32_t pool); +static int ixgbe_add_rar(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr, + uint32_t index, uint32_t pool); static void ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index); static int ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static void ixgbe_dcb_init(struct ixgbe_hw *hw, struct ixgbe_dcb_config *dcb_config); static bool is_device_supported(struct rte_eth_dev *dev, struct rte_pci_driver *drv); @@ -268,7 +269,7 @@ static void ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev); /* For Eth VMDQ APIs support */ static int ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct - ether_addr * mac_addr, uint8_t on); + rte_ether_addr * mac_addr, uint8_t on); static int ixgbe_uc_all_hash_table_set(struct rte_eth_dev *dev, uint8_t on); static int ixgbe_mirror_rule_set(struct rte_eth_dev *dev, struct rte_eth_mirror_conf *mirror_conf, @@ -284,11 +285,11 @@ static void ixgbe_set_ivar_map(struct ixgbe_hw *hw, int8_t direction, static void ixgbe_configure_msix(struct rte_eth_dev *dev); static int ixgbevf_add_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool); static void ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index); static int ixgbevf_set_default_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int ixgbe_syn_filter_get(struct rte_eth_dev *dev, struct rte_eth_syn_filter *filter); static int ixgbe_syn_filter_handle(struct rte_eth_dev *dev, @@ -315,7 +316,7 @@ static int ixgbe_dev_filter_ctrl(struct rte_eth_dev *dev, static int ixgbevf_dev_set_mtu(struct rte_eth_dev *dev, uint16_t mtu); static int ixgbe_dev_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); static int ixgbe_dev_get_dcb_info(struct rte_eth_dev *dev, struct rte_eth_dcb_info *dcb_info); @@ -1222,7 +1223,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) return -ENOMEM; } /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *) hw->mac.perm_addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, ð_dev->data->mac_addrs[0]); /* Allocate memory for storing hash filter MAC addresses */ @@ -1533,7 +1534,7 @@ ixgbevf_negotiate_api(struct ixgbe_hw *hw) } static void -generate_random_mac_addr(struct ether_addr *mac_addr) +generate_random_mac_addr(struct rte_ether_addr *mac_addr) { uint64_t random; @@ -1564,7 +1565,8 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) IXGBE_DEV_PRIVATE_TO_VFTA(eth_dev->data->dev_private); struct ixgbe_hwstrip *hwstrip = IXGBE_DEV_PRIVATE_TO_HWSTRIP_BITMAP(eth_dev->data->dev_private); - struct ether_addr *perm_addr = (struct ether_addr *) hw->mac.perm_addr; + struct rte_ether_addr *perm_addr = + (struct rte_ether_addr *)hw->mac.perm_addr; PMD_INIT_FUNC_TRACE(); @@ -4901,7 +4903,7 @@ ixgbe_dev_rss_reta_query(struct rte_eth_dev *dev, } static int -ixgbe_add_rar(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +ixgbe_add_rar(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t pool) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -4920,7 +4922,7 @@ ixgbe_remove_rar(struct rte_eth_dev *dev, uint32_t index) } static int -ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) +ixgbe_set_default_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr) { struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); @@ -5370,7 +5372,7 @@ ixgbe_vt_check(struct ixgbe_hw *hw) } static uint32_t -ixgbe_uta_vector(struct ixgbe_hw *hw, struct ether_addr *uc_addr) +ixgbe_uta_vector(struct ixgbe_hw *hw, struct rte_ether_addr *uc_addr) { uint32_t vector = 0; @@ -5401,8 +5403,8 @@ ixgbe_uta_vector(struct ixgbe_hw *hw, struct ether_addr *uc_addr) } static int -ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr, - uint8_t on) +ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, + struct rte_ether_addr *mac_addr, uint8_t on) { uint32_t vector; uint32_t uta_idx; @@ -6033,7 +6035,7 @@ ixgbe_set_queue_rate_limit(struct rte_eth_dev *dev, } static int -ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, __attribute__((unused)) uint32_t index, __attribute__((unused)) uint32_t pool) { @@ -6045,7 +6047,8 @@ ixgbevf_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr, * operation. Trap this case to avoid exhausting the [very limited] * set of PF resources used to store VF MAC addresses. */ - if (memcmp(hw->mac.perm_addr, mac_addr, sizeof(struct ether_addr)) == 0) + if (memcmp(hw->mac.perm_addr, mac_addr, + sizeof(struct rte_ether_addr)) == 0) return -1; diag = ixgbevf_set_uc_addr_vf(hw, 2, mac_addr->addr_bytes); if (diag != 0) @@ -6065,8 +6068,9 @@ static void ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - struct ether_addr *perm_addr = (struct ether_addr *) hw->mac.perm_addr; - struct ether_addr *mac_addr; + struct rte_ether_addr *perm_addr = + (struct rte_ether_addr *)hw->mac.perm_addr; + struct rte_ether_addr *mac_addr; uint32_t i; int diag; @@ -6091,7 +6095,8 @@ ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index) if (is_zero_ether_addr(mac_addr)) continue; /* Skip the permanent MAC address */ - if (memcmp(perm_addr, mac_addr, sizeof(struct ether_addr)) == 0) + if (memcmp(perm_addr, mac_addr, + sizeof(struct rte_ether_addr)) == 0) continue; diag = ixgbevf_set_uc_addr_vf(hw, 2, mac_addr->addr_bytes); if (diag != 0) @@ -6110,7 +6115,8 @@ ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index) } static int -ixgbevf_set_default_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr) +ixgbevf_set_default_mac_addr(struct rte_eth_dev *dev, + struct rte_ether_addr *addr) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -6839,13 +6845,13 @@ ixgbe_dev_addr_list_itr(__attribute__((unused)) struct ixgbe_hw *hw, *vmdq = 0; mc_addr = *mc_addr_ptr; - *mc_addr_ptr = (mc_addr + sizeof(struct ether_addr)); + *mc_addr_ptr = (mc_addr + sizeof(struct rte_ether_addr)); return mc_addr; } static int ixgbe_dev_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct ixgbe_hw *hw; diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index fafff6b03e..6180c9473a 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -463,7 +463,7 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) int rar_entry = hw->mac.num_rar_entries - (vf + 1); uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); - if (is_valid_assigned_ether_addr((struct ether_addr *)new_mac)) { + if (is_valid_assigned_ether_addr((struct rte_ether_addr *)new_mac)) { rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6); return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV); } diff --git a/drivers/net/ixgbe/ixgbe_vf_representor.c b/drivers/net/ixgbe/ixgbe_vf_representor.c index 5d2e3e0238..2c01f6e33c 100644 --- a/drivers/net/ixgbe/ixgbe_vf_representor.c +++ b/drivers/net/ixgbe/ixgbe_vf_representor.c @@ -25,7 +25,7 @@ ixgbe_vf_representor_link_update(struct rte_eth_dev *ethdev, static int ixgbe_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct ixgbe_vf_representor *representor = ethdev->data->dev_private; @@ -211,7 +211,7 @@ ixgbe_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) vf_data = *IXGBE_DEV_PRIVATE_TO_P_VFDATA( representor->pf_ethdev->data->dev_private); - ethdev->data->mac_addrs = (struct ether_addr *) + ethdev->data->mac_addrs = (struct rte_ether_addr *) vf_data[representor->vf_id].vf_mac_addresses; /* Link state. Inherited from PF */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 3a874f9a99..3defba1753 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -11,7 +11,7 @@ int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { struct ixgbe_hw *hw; struct ixgbe_vf_info *vfinfo; @@ -35,7 +35,7 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); rar_entry = hw->mac.num_rar_entries - (vf + 1); - if (is_valid_assigned_ether_addr((struct ether_addr *)new_mac)) { + if (is_valid_assigned_ether_addr((struct rte_ether_addr *)new_mac)) { rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, ETHER_ADDR_LEN); return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index 72a941f9dc..84c6884729 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -42,7 +42,7 @@ int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf); * - (-EINVAL) if *vf* or *mac_addr* is invalid. */ int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /** * Enable/Disable VF VLAN anti spoofing. diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index 1f232e4da1..180cfd6c98 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -54,7 +54,7 @@ struct pmd_internals { int stop_thread; int no_request_thread; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; struct pmd_queue rx_queues[KNI_MAX_QUEUE_PER_PORT]; struct pmd_queue tx_queues[KNI_MAX_QUEUE_PER_PORT]; diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index c9cabd65a3..de234e903b 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -1835,7 +1835,8 @@ lio_dev_configure(struct rte_eth_dev *eth_dev) 2 + i)); /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *)mac, ð_dev->data->mac_addrs[0]); + ether_addr_copy((struct rte_ether_addr *)mac, + ð_dev->data->mac_addrs[0]); /* enable firmware checksum support for tunnel packets */ lio_enable_hw_tunnel_rx_checksum(eth_dev); diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index fe559c0407..460c10f890 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -841,7 +841,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) struct ibv_pd *pd = NULL; struct mlx4_priv *priv = NULL; struct rte_eth_dev *eth_dev = NULL; - struct ether_addr mac; + struct rte_ether_addr mac; char name[RTE_ETH_NAME_MAX_LEN]; /* If port is not enabled, skip. */ diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index e2d184f848..4e9bb9c1ad 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -186,7 +186,7 @@ struct mlx4_priv { } mr; LIST_HEAD(, mlx4_rss) rss; /**< Shared targets for Rx flow rules. */ LIST_HEAD(, rte_flow) flows; /**< Configured flow rule handles. */ - struct ether_addr mac[MLX4_MAX_MAC_ADDRESSES]; + struct rte_ether_addr mac[MLX4_MAX_MAC_ADDRESSES]; /**< Configured MAC addresses. Unused entries are zeroed. */ uint32_t mac_mc; /**< Number of trailing multicast entries in mac[]. */ struct mlx4_verbs_alloc_ctx verbs_alloc_ctx; @@ -209,10 +209,10 @@ void mlx4_promiscuous_disable(struct rte_eth_dev *dev); void mlx4_allmulticast_enable(struct rte_eth_dev *dev); void mlx4_allmulticast_disable(struct rte_eth_dev *dev); void mlx4_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index); -int mlx4_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +int mlx4_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq); -int mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr); -int mlx4_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *list, +int mlx4_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr); +int mlx4_set_mc_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr *list, uint32_t num); int mlx4_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on); int mlx4_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats); diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c index 765affc34c..6995c14a55 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -463,7 +463,7 @@ mlx4_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) * 0 on success, negative errno value otherwise and rte_errno is set. */ int -mlx4_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +mlx4_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq) { struct mlx4_priv *priv = dev->data->dev_private; @@ -501,7 +501,7 @@ mlx4_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, * 0 on success, negative errno value otherwise and rte_errno is set. */ int -mlx4_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *list, +mlx4_set_mc_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr *list, uint32_t num) { struct mlx4_priv *priv = dev->data->dev_private; @@ -598,7 +598,7 @@ mlx4_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) * 0 on success, negative errno value otherwise and rte_errno is set. */ int -mlx4_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +mlx4_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { return mlx4_mac_addr_add(dev, mac_addr, 0, 0); } diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 1dcdb31a02..78bd452bdd 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -1354,7 +1354,7 @@ mlx4_flow_internal(struct mlx4_priv *priv, struct rte_flow_error *error) .type = RTE_FLOW_ACTION_TYPE_END, }, }; - struct ether_addr *rule_mac = ð_spec.dst; + struct rte_ether_addr *rule_mac = ð_spec.dst; rte_be16_t *rule_vlan = (ETH_DEV(priv)->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_VLAN_FILTER) && @@ -1391,7 +1391,7 @@ next_vlan: } } for (i = 0; i != RTE_DIM(priv->mac) + 1; ++i) { - const struct ether_addr *mac; + const struct rte_ether_addr *mac; /* Broadcasts are handled by an extra iteration. */ if (i < RTE_DIM(priv->mac)) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 9f5ec97ec1..2798e0e954 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -1087,7 +1087,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev, unsigned int mprq_max_stride_size_n = 0; unsigned int mprq_min_stride_num_n = 0; unsigned int mprq_max_stride_num_n = 0; - struct ether_addr mac; + struct rte_ether_addr mac; char name[RTE_ETH_NAME_MAX_LEN]; int own_domain_id = 0; uint16_t port_id; diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 3eaaafd5ed..80df971e52 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -327,7 +327,7 @@ struct mlx5_priv { struct rte_eth_dev_data *dev_data; /* Pointer to device data. */ struct mlx5_ibv_shared *sh; /* Shared IB device context. */ uint32_t ibv_port; /* IB device port number. */ - struct ether_addr mac[MLX5_MAX_MAC_ADDRESSES]; /* MAC addresses. */ + struct rte_ether_addr mac[MLX5_MAX_MAC_ADDRESSES]; /* MAC addresses. */ BITFIELD_DECLARE(mac_own, uint64_t, MLX5_MAX_MAC_ADDRESSES); /* Bit-field of MAC addresses owned by the PMD. */ uint16_t vlan_filter[MLX5_MAX_VLAN_IDS]; /* VLAN filters table. */ @@ -442,11 +442,12 @@ void mlx5_translate_port_name(const char *port_name_in, int mlx5_get_mac(struct rte_eth_dev *dev, uint8_t (*mac)[ETHER_ADDR_LEN]); void mlx5_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index); -int mlx5_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, +int mlx5_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t index, uint32_t vmdq); -int mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr); +int mlx5_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr); int mlx5_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, uint32_t nb_mc_addr); + struct rte_ether_addr *mc_addr_set, + uint32_t nb_mc_addr); /* mlx5_rss.c */ @@ -549,9 +550,9 @@ void mlx5_mp_uninit_secondary(void); /* mlx5_nl.c */ int mlx5_nl_init(int protocol); -int mlx5_nl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, +int mlx5_nl_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t index); -int mlx5_nl_mac_addr_remove(struct rte_eth_dev *dev, struct ether_addr *mac, +int mlx5_nl_mac_addr_remove(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t index); void mlx5_nl_mac_addr_sync(struct rte_eth_dev *dev); void mlx5_nl_mac_addr_flush(struct rte_eth_dev *dev); diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index cf255ca95c..e8560fd42d 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -1211,13 +1211,13 @@ static int flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, size_t *size, struct rte_flow_error *error) { - struct ether_hdr *eth = NULL; - struct vlan_hdr *vlan = NULL; + struct rte_ether_hdr *eth = NULL; + struct rte_vlan_hdr *vlan = NULL; struct ipv4_hdr *ipv4 = NULL; struct ipv6_hdr *ipv6 = NULL; struct udp_hdr *udp = NULL; - struct vxlan_hdr *vxlan = NULL; - struct vxlan_gpe_hdr *vxlan_gpe = NULL; + struct rte_vxlan_hdr *vxlan = NULL; + struct rte_vxlan_gpe_hdr *vxlan_gpe = NULL; struct gre_hdr *gre = NULL; size_t len; size_t temp_size = 0; @@ -1237,10 +1237,10 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, rte_memcpy((void *)&buf[temp_size], items->spec, len); switch (items->type) { case RTE_FLOW_ITEM_TYPE_ETH: - eth = (struct ether_hdr *)&buf[temp_size]; + eth = (struct rte_ether_hdr *)&buf[temp_size]; break; case RTE_FLOW_ITEM_TYPE_VLAN: - vlan = (struct vlan_hdr *)&buf[temp_size]; + vlan = (struct rte_vlan_hdr *)&buf[temp_size]; if (!eth) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, @@ -1298,7 +1298,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, ipv6->proto = IPPROTO_UDP; break; case RTE_FLOW_ITEM_TYPE_VXLAN: - vxlan = (struct vxlan_hdr *)&buf[temp_size]; + vxlan = (struct rte_vxlan_hdr *)&buf[temp_size]; if (!udp) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, @@ -1311,7 +1311,7 @@ flow_dv_convert_encap_data(const struct rte_flow_item *items, uint8_t *buf, RTE_BE32(MLX5_ENCAP_VXLAN_FLAGS); break; case RTE_FLOW_ITEM_TYPE_VXLAN_GPE: - vxlan_gpe = (struct vxlan_gpe_hdr *)&buf[temp_size]; + vxlan_gpe = (struct rte_vxlan_gpe_hdr *)&buf[temp_size]; if (!udp) return rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ACTION, diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c index fc04c9d88e..789748d088 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -402,7 +402,7 @@ struct mlx5_flow_tcf_context { struct tcf_neigh_rule { LIST_ENTRY(tcf_neigh_rule) next; uint32_t refcnt; - struct ether_addr eth; + struct rte_ether_addr eth; uint16_t mask; union { struct { @@ -475,8 +475,8 @@ struct flow_tcf_vxlan_encap { uint8_t ip_tos; uint8_t ip_ttl_hop; struct { - struct ether_addr dst; - struct ether_addr src; + struct rte_ether_addr dst; + struct rte_ether_addr src; } eth; union { struct { @@ -689,8 +689,8 @@ flow_tcf_pedit_key_set_mac(const struct rte_flow_action *actions, { int idx = p_parser->sel.nkeys; uint32_t off = actions->type == RTE_FLOW_ACTION_TYPE_SET_MAC_SRC ? - offsetof(struct ether_hdr, s_addr) : - offsetof(struct ether_hdr, d_addr); + offsetof(struct rte_ether_hdr, s_addr) : + offsetof(struct rte_ether_hdr, d_addr); const struct rte_flow_action_set_mac *conf = (const struct rte_flow_action_set_mac *)actions->conf; diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c index bce026f982..9f6b89a82f 100644 --- a/drivers/net/mlx5/mlx5_mac.c +++ b/drivers/net/mlx5/mlx5_mac.c @@ -76,7 +76,7 @@ mlx5_internal_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) if (vf) mlx5_nl_mac_addr_remove(dev, &dev->data->mac_addrs[index], index); - memset(&dev->data->mac_addrs[index], 0, sizeof(struct ether_addr)); + memset(&dev->data->mac_addrs[index], 0, sizeof(struct rte_ether_addr)); } /** @@ -93,7 +93,7 @@ mlx5_internal_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) * 0 on success, a negative errno value otherwise and rte_errno is set. */ static int -mlx5_internal_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, +mlx5_internal_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t index) { struct mlx5_priv *priv = dev->data->dev_private; @@ -166,7 +166,7 @@ mlx5_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, +mlx5_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t index, uint32_t vmdq __rte_unused) { int ret; @@ -195,7 +195,7 @@ mlx5_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +mlx5_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { DRV_LOG(DEBUG, "port %u setting primary MAC address", dev->data->port_id); @@ -209,7 +209,7 @@ mlx5_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) */ int mlx5_set_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, uint32_t nb_mc_addr) + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { uint32_t i; int ret; diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c index 0ff96671f6..ce4c937488 100644 --- a/drivers/net/mlx5/mlx5_nl.c +++ b/drivers/net/mlx5/mlx5_nl.c @@ -80,7 +80,7 @@ /* Add/remove MAC address through Netlink */ struct mlx5_nl_mac_addr { - struct ether_addr (*mac)[]; + struct rte_ether_addr (*mac)[]; /**< MAC address handled by the device. */ int mac_n; /**< Number of addresses in the array. */ }; @@ -365,7 +365,7 @@ mlx5_nl_mac_addr_cb(struct nlmsghdr *nh, void *arg) * 0 on success, a negative errno value otherwise and rte_errno is set. */ static int -mlx5_nl_mac_addr_list(struct rte_eth_dev *dev, struct ether_addr (*mac)[], +mlx5_nl_mac_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr (*mac)[], int *mac_n) { struct mlx5_priv *priv = dev->data->dev_private; @@ -424,7 +424,7 @@ error: * 0 on success, a negative errno value otherwise and rte_errno is set. */ static int -mlx5_nl_mac_addr_modify(struct rte_eth_dev *dev, struct ether_addr *mac, +mlx5_nl_mac_addr_modify(struct rte_eth_dev *dev, struct rte_ether_addr *mac, int add) { struct mlx5_priv *priv = dev->data->dev_private; @@ -496,7 +496,7 @@ error: * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_nl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, +mlx5_nl_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t index) { struct mlx5_priv *priv = dev->data->dev_private; @@ -524,7 +524,7 @@ mlx5_nl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac, * 0 on success, a negative errno value otherwise and rte_errno is set. */ int -mlx5_nl_mac_addr_remove(struct rte_eth_dev *dev, struct ether_addr *mac, +mlx5_nl_mac_addr_remove(struct rte_eth_dev *dev, struct rte_ether_addr *mac, uint32_t index) { struct mlx5_priv *priv = dev->data->dev_private; @@ -542,7 +542,7 @@ mlx5_nl_mac_addr_remove(struct rte_eth_dev *dev, struct ether_addr *mac, void mlx5_nl_mac_addr_sync(struct rte_eth_dev *dev) { - struct ether_addr macs[MLX5_MAX_MAC_ADDRESSES]; + struct rte_ether_addr macs[MLX5_MAX_MAC_ADDRESSES]; int macs_n = 0; int i; int ret; @@ -583,7 +583,7 @@ mlx5_nl_mac_addr_flush(struct rte_eth_dev *dev) int i; for (i = MLX5_MAX_MAC_ADDRESSES - 1; i >= 0; --i) { - struct ether_addr *m = &dev->data->mac_addrs[i]; + struct rte_ether_addr *m = &dev->data->mac_addrs[i]; if (BITFIELD_ISSET(priv->mac_own, i)) mlx5_nl_mac_addr_remove(dev, m, i); diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h index 4339aaf338..2676634956 100644 --- a/drivers/net/mlx5/mlx5_rxtx.h +++ b/drivers/net/mlx5/mlx5_rxtx.h @@ -784,7 +784,7 @@ txq_mbuf_to_swp(struct mlx5_txq_data *txq, struct rte_mbuf *buf, * in if any of SWP offsets is set. Therefore, all of the L3 offsets * should be set regardless of HW offload. */ - off = buf->outer_l2_len + (vlan ? sizeof(struct vlan_hdr) : 0); + off = buf->outer_l2_len + (vlan ? sizeof(struct rte_vlan_hdr) : 0); offsets[1] = off >> 1; /* Outer L3 offset. */ off += buf->outer_l3_len; if (tunnel == PKT_TX_TUNNEL_UDP) diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c index b7fde35758..69681e296d 100644 --- a/drivers/net/mlx5/mlx5_trigger.c +++ b/drivers/net/mlx5/mlx5_trigger.c @@ -268,7 +268,7 @@ mlx5_traffic_enable(struct rte_eth_dev *dev) .dst.addr_bytes = "\xff\xff\xff\xff\xff\xff", }; const unsigned int vlan_filter_n = priv->vlan_filter_n; - const struct ether_addr cmp = { + const struct rte_ether_addr cmp = { .addr_bytes = "\x00\x00\x00\x00\x00\x00", }; unsigned int i; @@ -331,7 +331,7 @@ mlx5_traffic_enable(struct rte_eth_dev *dev) } /* Add MAC address flows. */ for (i = 0; i != MLX5_MAX_MAC_ADDRESSES; ++i) { - struct ether_addr *mac = &dev->data->mac_addrs[i]; + struct rte_ether_addr *mac = &dev->data->mac_addrs[i]; if (!memcmp(mac, &cmp, sizeof(*mac))) continue; diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index 8923a1634a..d539ba6a1b 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -617,7 +617,7 @@ mvneta_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) * 0 on success, negative error value otherwise. */ static int -mvneta_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +mvneta_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq __rte_unused) { struct mvneta_priv *priv = dev->data->dev_private; @@ -650,7 +650,7 @@ mvneta_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, * MAC address to register. */ static int -mvneta_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +mvneta_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct mvneta_priv *priv = dev->data->dev_private; int ret; diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index ce52f09014..8647c9b0de 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1102,7 +1102,7 @@ mrvl_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) * 0 on success, negative error value otherwise. */ static int -mrvl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +mrvl_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq __rte_unused) { struct mrvl_priv *priv = dev->data->dev_private; @@ -1154,7 +1154,7 @@ mrvl_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, * 0 on success, negative error value otherwise. */ static int -mrvl_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +mrvl_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct mrvl_priv *priv = dev->data->dev_private; int ret; diff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c index ffd1dab9b5..7389865753 100644 --- a/drivers/net/mvpp2/mrvl_flow.c +++ b/drivers/net/mvpp2/mrvl_flow.c @@ -989,7 +989,7 @@ mrvl_parse_eth(const struct rte_flow_item *item, struct rte_flow *flow, struct rte_flow_error *error) { const struct rte_flow_item_eth *spec = NULL, *mask = NULL; - struct ether_addr zero; + struct rte_ether_addr zero; int ret; ret = mrvl_parse_init(item, (const void **)&spec, (const void **)&mask, diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 553cb06f6e..35503df325 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -292,7 +292,7 @@ hn_dev_allmulticast_disable(struct rte_eth_dev *dev) static int hn_dev_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { /* No filtering on the synthetic path, but can do it on VF */ diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 7d7b557785..a5850c2492 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -108,7 +108,7 @@ static void hn_update_packet_stats(struct hn_stats *stats, const struct rte_mbuf *m) { uint32_t s = m->pkt_len; - const struct ether_addr *ea; + const struct rte_ether_addr *ea; if (s == 64) { stats->size_bins[1]++; @@ -127,7 +127,7 @@ hn_update_packet_stats(struct hn_stats *stats, const struct rte_mbuf *m) stats->size_bins[7]++; } - ea = rte_pktmbuf_mtod(m, const struct ether_addr *); + ea = rte_pktmbuf_mtod(m, const struct rte_ether_addr *); if (is_multicast_ether_addr(ea)) { if (is_broadcast_ether_addr(ea)) stats->broadcast++; diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h index de885d898e..bf94d90a76 100644 --- a/drivers/net/netvsc/hn_var.h +++ b/drivers/net/netvsc/hn_var.h @@ -131,7 +131,7 @@ struct hn_data { rte_atomic32_t rndis_req_id; uint8_t rndis_resp[256]; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; struct rte_eth_dev_owner owner; struct rte_intr_handle vf_intr; @@ -213,7 +213,7 @@ void hn_vf_allmulticast_disable(struct rte_eth_dev *dev); void hn_vf_promiscuous_enable(struct rte_eth_dev *dev); void hn_vf_promiscuous_disable(struct rte_eth_dev *dev); int hn_vf_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); int hn_vf_link_update(struct rte_eth_dev *dev, diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index b980bb8a4d..f1be7e22f0 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -32,12 +32,12 @@ /* Search for VF with matching MAC address, return port id */ static int hn_vf_match(const struct rte_eth_dev *dev) { - const struct ether_addr *mac = dev->data->mac_addrs; + const struct rte_ether_addr *mac = dev->data->mac_addrs; int i; RTE_ETH_FOREACH_DEV(i) { const struct rte_eth_dev *vf_dev = &rte_eth_devices[i]; - const struct ether_addr *vf_mac = vf_dev->data->mac_addrs; + const struct rte_ether_addr *vf_mac = vf_dev->data->mac_addrs; if (vf_dev == dev) continue; @@ -400,7 +400,7 @@ void hn_vf_promiscuous_disable(struct rte_eth_dev *dev) } int hn_vf_mc_addr_list(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct hn_data *hv = dev->data->dev_private; diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c index be7cced010..679af6eb2e 100644 --- a/drivers/net/nfb/nfb_ethdev.c +++ b/drivers/net/nfb/nfb_ethdev.c @@ -20,7 +20,7 @@ /** * Default MAC addr */ -static const struct ether_addr eth_addr = { +static const struct rte_ether_addr eth_addr = { .addr_bytes = { 0x00, 0x11, 0x17, 0x00, 0x00, 0x00 } }; @@ -352,7 +352,7 @@ nfb_eth_dev_set_link_down(struct rte_eth_dev *dev) */ static int nfb_eth_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *mac_addr) + struct rte_ether_addr *mac_addr) { unsigned int i; uint64_t mac = 0; @@ -418,7 +418,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) data->dev_private; struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); struct rte_pci_addr *pci_addr = &pci_dev->addr; - struct ether_addr eth_addr_init; + struct rte_ether_addr eth_addr_init; RTE_LOG(INFO, PMD, "Initializing NFB device (" PCI_PRI_FMT ")\n", pci_addr->domain, pci_addr->bus, pci_addr->devid, @@ -464,7 +464,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) nfb_eth_link_update(dev, 0); /* Allocate space for one mac address */ - data->mac_addrs = rte_zmalloc(data->name, sizeof(struct ether_addr), + data->mac_addrs = rte_zmalloc(data->name, sizeof(struct rte_ether_addr), RTE_CACHE_LINE_SIZE); if (data->mac_addrs == NULL) { RTE_LOG(ERR, PMD, "Could not alloc space for MAC address!\n"); diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 9394309ace..95c2be127c 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -119,7 +119,7 @@ static int nfp_net_rss_reta_write(struct rte_eth_dev *dev, static int nfp_net_rss_hash_write(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf); static int nfp_set_mac_addr(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /* The offset of the queue controller queues in the PCIe Target */ #define NFP_PCIE_QUEUE(_q) (0x80000 + (NFP_QCP_QUEUE_ADDR_SZ * ((_q) & 0xff))) @@ -553,7 +553,7 @@ nfp_net_write_mac(struct nfp_net_hw *hw, uint8_t *mac) } int -nfp_set_mac_addr(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +nfp_set_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct nfp_net_hw *hw; uint32_t update, ctrl; @@ -2962,7 +2962,8 @@ nfp_net_init(struct rte_eth_dev *eth_dev) nfp_net_vf_read_mac(hw); } - if (!is_valid_assigned_ether_addr((struct ether_addr *)&hw->mac_addr)) { + if (!is_valid_assigned_ether_addr( + (struct rte_ether_addr *)&hw->mac_addr)) { PMD_INIT_LOG(INFO, "Using random mac address for port %d", port); /* Using random mac addresses for VFs */ @@ -2971,7 +2972,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) } /* Copying mac address to DPDK eth_dev struct */ - ether_addr_copy((struct ether_addr *)hw->mac_addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac_addr, ð_dev->data->mac_addrs[0]); if (!(hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR)) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 159c1c1fdd..7683511cff 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -73,7 +73,7 @@ struct pmd_internals { struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT]; struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT]; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; /** Bit mask of RSS offloads, the bit offset also means flow type */ uint64_t flow_type_rss_offloads; @@ -467,7 +467,7 @@ eth_rss_hash_conf_get(struct rte_eth_dev *dev, static int eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, - __rte_unused struct ether_addr *addr) + __rte_unused struct rte_ether_addr *addr) { return 0; } diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 046e129865..643479254e 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -555,7 +555,7 @@ octeontx_dev_stats_reset(struct rte_eth_dev *dev) static int octeontx_dev_default_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *addr) + struct rte_ether_addr *addr) { struct octeontx_nic *nic = octeontx_pmd_priv(dev); int ret; diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 353538f16a..7655b3a7a5 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -78,7 +78,7 @@ struct pmd_internals { struct pcap_rx_queue rx_queue[RTE_PMD_PCAP_MAX_QUEUES]; struct pcap_tx_queue tx_queue[RTE_PMD_PCAP_MAX_QUEUES]; char devargs[ETH_PCAP_ARG_MAXLEN]; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; int if_index; int single_iface; int phy_mac; @@ -953,7 +953,7 @@ pmd_init_internals(struct rte_vdev_device *vdev, * derived from: 'locally administered':'p':'c':'a':'p':'iface_idx' * where the middle 4 characters are converted to hex. */ - (*internals)->eth_addr = (struct ether_addr) { + (*internals)->eth_addr = (struct rte_ether_addr) { .addr_bytes = { 0x02, 0x70, 0x63, 0x61, 0x70, iface_idx++ } }; (*internals)->phy_mac = 0; diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index b2fd2fd906..a72d466574 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -559,9 +559,9 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast, struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); struct qede_ucast_entry *tmp = NULL; struct qede_ucast_entry *u; - struct ether_addr *mac_addr; + struct rte_ether_addr *mac_addr; - mac_addr = (struct ether_addr *)ucast->mac; + mac_addr = (struct rte_ether_addr *)ucast->mac; if (add) { SLIST_FOREACH(tmp, &qdev->uc_list_head, list) { if ((memcmp(mac_addr, &tmp->mac, @@ -605,8 +605,9 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast, } static int -qede_add_mcast_filters(struct rte_eth_dev *eth_dev, struct ether_addr *mc_addrs, - uint32_t mc_addrs_num) +qede_add_mcast_filters(struct rte_eth_dev *eth_dev, + struct rte_ether_addr *mc_addrs, + uint32_t mc_addrs_num) { struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); @@ -629,7 +630,7 @@ qede_add_mcast_filters(struct rte_eth_dev *eth_dev, struct ether_addr *mc_addrs, mcast.num_mc_addrs = mc_addrs_num; mcast.opcode = ECORE_FILTER_ADD; for (i = 0; i < mc_addrs_num; i++) - ether_addr_copy(&mc_addrs[i], (struct ether_addr *) + ether_addr_copy(&mc_addrs[i], (struct rte_ether_addr *) &mcast.mac[i]); rc = ecore_filter_mcast_cmd(edev, &mcast, ECORE_SPQ_MODE_CB, NULL); if (rc != ECORE_SUCCESS) { @@ -654,7 +655,8 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev) mcast.opcode = ECORE_FILTER_REMOVE; j = 0; SLIST_FOREACH(tmp, &qdev->mc_list_head, list) { - ether_addr_copy(&tmp->mac, (struct ether_addr *)&mcast.mac[j]); + ether_addr_copy(&tmp->mac, + (struct rte_ether_addr *)&mcast.mac[j]); j++; } rc = ecore_filter_mcast_cmd(edev, &mcast, ECORE_SPQ_MODE_CB, NULL); @@ -701,7 +703,7 @@ qede_mac_int_ops(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast, } static int -qede_mac_addr_add(struct rte_eth_dev *eth_dev, struct ether_addr *mac_addr, +qede_mac_addr_add(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr, __rte_unused uint32_t index, __rte_unused uint32_t pool) { struct ecore_filter_ucast ucast; @@ -713,7 +715,7 @@ qede_mac_addr_add(struct rte_eth_dev *eth_dev, struct ether_addr *mac_addr, qede_set_ucast_cmn_params(&ucast); ucast.opcode = ECORE_FILTER_ADD; ucast.type = ECORE_FILTER_MAC; - ether_addr_copy(mac_addr, (struct ether_addr *)&ucast.mac); + ether_addr_copy(mac_addr, (struct rte_ether_addr *)&ucast.mac); re = (int)qede_mac_int_ops(eth_dev, &ucast, 1); return re; } @@ -742,13 +744,13 @@ qede_mac_addr_remove(struct rte_eth_dev *eth_dev, uint32_t index) /* Use the index maintained by rte */ ether_addr_copy(ð_dev->data->mac_addrs[index], - (struct ether_addr *)&ucast.mac); + (struct rte_ether_addr *)&ucast.mac); qede_mac_int_ops(eth_dev, &ucast, false); } static int -qede_mac_addr_set(struct rte_eth_dev *eth_dev, struct ether_addr *mac_addr) +qede_mac_addr_set(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr) { struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); @@ -1757,8 +1759,9 @@ static void qede_allmulticast_disable(struct rte_eth_dev *eth_dev) } static int -qede_set_mc_addr_list(struct rte_eth_dev *eth_dev, struct ether_addr *mc_addrs, - uint32_t mc_addrs_num) +qede_set_mc_addr_list(struct rte_eth_dev *eth_dev, + struct rte_ether_addr *mc_addrs, + uint32_t mc_addrs_num) { struct qede_dev *qdev = QEDE_INIT_QDEV(eth_dev); struct ecore_dev *edev = QEDE_INIT_EDEV(qdev); @@ -2549,7 +2552,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) } if (!is_vf) { - ether_addr_copy((struct ether_addr *)edev->hwfns[0]. + ether_addr_copy((struct rte_ether_addr *)edev->hwfns[0]. hw_info.hw_mac_addr, ð_dev->data->mac_addrs[0]); ether_addr_copy(ð_dev->data->mac_addrs[0], @@ -2565,8 +2568,9 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) &is_mac_forced); if (is_mac_exist) { DP_INFO(edev, "VF macaddr received from PF\n"); - ether_addr_copy((struct ether_addr *)&vf_mac, - ð_dev->data->mac_addrs[0]); + ether_addr_copy( + (struct rte_ether_addr *)&vf_mac, + ð_dev->data->mac_addrs[0]); ether_addr_copy(ð_dev->data->mac_addrs[0], &adapter->primary_mac); } else { diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index c06274d94c..d0e7c70be9 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -140,12 +140,12 @@ struct qede_vlan_entry { }; struct qede_mcast_entry { - struct ether_addr mac; + struct rte_ether_addr mac; SLIST_ENTRY(qede_mcast_entry) list; }; struct qede_ucast_entry { - struct ether_addr mac; + struct rte_ether_addr mac; uint16_t vlan; uint16_t vni; SLIST_ENTRY(qede_ucast_entry) list; @@ -228,7 +228,7 @@ struct qede_dev { SLIST_HEAD(vlan_list_head, qede_vlan_entry)vlan_list_head; uint16_t configured_vlans; bool accept_any_vlan; - struct ether_addr primary_mac; + struct rte_ether_addr primary_mac; SLIST_HEAD(mc_list_head, qede_mcast_entry) mc_list_head; uint16_t num_mc_addr; SLIST_HEAD(uc_list_head, qede_ucast_entry) uc_list_head; diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c index 7aeef700da..792b9efb4c 100644 --- a/drivers/net/qede/qede_filter.c +++ b/drivers/net/qede/qede_filter.c @@ -465,8 +465,8 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev, raw_pkt = (uint8_t *)buff; - len = 2 * sizeof(struct ether_addr); - raw_pkt += 2 * sizeof(struct ether_addr); + len = 2 * sizeof(struct rte_ether_addr); + raw_pkt += 2 * sizeof(struct rte_ether_addr); ether_type = (uint16_t *)raw_pkt; raw_pkt += sizeof(uint16_t); len += sizeof(uint16_t); diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h index ee5e54c19a..b840c743c9 100644 --- a/drivers/net/qede/qede_if.h +++ b/drivers/net/qede/qede_if.h @@ -59,7 +59,7 @@ struct qed_dev_eth_info { uint8_t num_queues; uint8_t num_tc; - struct ether_addr port_mac; + struct rte_ether_addr port_mac; uint16_t num_vlan_filters; uint32_t num_mac_filters; diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 27bac09954..0e8a3675b8 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -950,23 +950,23 @@ static inline uint8_t qede_check_notunn_csum_l4(uint16_t flag) static inline uint32_t qede_rx_cqe_to_pkt_type_outer(struct rte_mbuf *m) { uint32_t packet_type = RTE_PTYPE_UNKNOWN; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; - struct vlan_hdr *vlan_hdr; + struct rte_vlan_hdr *vlan_hdr; uint16_t ethertype; bool vlan_tagged = 0; uint16_t len; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); - len = sizeof(struct ether_hdr); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); + len = sizeof(struct rte_ether_hdr); ethertype = rte_cpu_to_be_16(eth_hdr->ether_type); /* Note: Valid only if VLAN stripping is disabled */ if (ethertype == ETHER_TYPE_VLAN) { vlan_tagged = 1; - vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); - len += sizeof(struct vlan_hdr); + vlan_hdr = (struct rte_vlan_hdr *)(eth_hdr + 1); + len += sizeof(struct rte_vlan_hdr); ethertype = rte_cpu_to_be_16(vlan_hdr->eth_proto); } @@ -1153,7 +1153,7 @@ qede_check_notunn_csum_l3(struct rte_mbuf *m, uint16_t flag) 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 *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); pkt_csum = ip->hdr_checksum; ip->hdr_checksum = 0; calc_csum = rte_ipv4_cksum(ip); diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index ab963a03c4..cae63a7f10 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -51,7 +51,7 @@ struct pmd_internals { struct ring_queue rx_ring_queues[RTE_PMD_RING_MAX_RX_RINGS]; struct ring_queue tx_ring_queues[RTE_PMD_RING_MAX_TX_RINGS]; - struct ether_addr address; + struct rte_ether_addr address; enum dev_action action; }; @@ -218,7 +218,7 @@ eth_mac_addr_remove(struct rte_eth_dev *dev __rte_unused, static int eth_mac_addr_add(struct rte_eth_dev *dev __rte_unused, - struct ether_addr *mac_addr __rte_unused, + struct rte_ether_addr *mac_addr __rte_unused, uint32_t index __rte_unused, uint32_t vmdq __rte_unused) { diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index ecd20e546e..dde25c5536 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -134,7 +134,7 @@ struct sfc_port { boolean_t promisc; boolean_t allmulti; - struct ether_addr default_mac_addr; + struct rte_ether_addr default_mac_addr; unsigned int max_mcast_addrs; unsigned int nb_mcast_addrs; diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index a007d4564c..fadcdb56a4 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -969,12 +969,12 @@ fail_inval: return -rc; } static int -sfc_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +sfc_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic); struct sfc_port *port = &sa->port; - struct ether_addr *old_addr = &dev->data->mac_addrs[0]; + struct rte_ether_addr *old_addr = &dev->data->mac_addrs[0]; int rc = 0; sfc_adapter_lock(sa); @@ -1053,8 +1053,8 @@ unlock: static int -sfc_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addr_set, - uint32_t nb_mc_addr) +sfc_set_mc_addr_list(struct rte_eth_dev *dev, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct sfc_adapter *sa = sfc_adapter_by_eth_dev(dev); struct sfc_port *port = &sa->port; @@ -2053,7 +2053,7 @@ sfc_eth_dev_init(struct rte_eth_dev *dev) struct sfc_adapter *sa; int rc; const efx_nic_cfg_t *encp; - const struct ether_addr *from; + const struct rte_ether_addr *from; sfc_register_dp(); @@ -2125,7 +2125,7 @@ sfc_eth_dev_init(struct rte_eth_dev *dev) * The arguments are really reverse order in comparison to * Linux kernel. Copy from NIC config to Ethernet device data. */ - from = (const struct ether_addr *)(encp->enc_mac_addr); + from = (const struct rte_ether_addr *)(encp->enc_mac_addr); ether_addr_copy(from, &dev->data->mac_addrs[0]); sfc_adapter_unlock(sa); diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c index 1709dba4e6..8de5f0c60c 100644 --- a/drivers/net/sfc/sfc_port.c +++ b/drivers/net/sfc/sfc_port.c @@ -227,7 +227,7 @@ sfc_port_start(struct sfc_adapter *sa) goto fail_mac_pdu_set; if (!sfc_sa2shared(sa)->isolated) { - struct ether_addr *addr = &port->default_mac_addr; + struct rte_ether_addr *addr = &port->default_mac_addr; sfc_log_init(sa, "set MAC address"); rc = efx_mac_addr_set(sa->nic, addr->addr_bytes); @@ -386,7 +386,7 @@ sfc_port_attach(struct sfc_adapter *sa) { struct sfc_port *port = &sa->port; const efx_nic_cfg_t *encp = efx_nic_cfg_get(sa->nic); - const struct ether_addr *from; + const struct rte_ether_addr *from; uint32_t mac_nstats; size_t mac_stats_size; long kvarg_stats_update_period_ms; @@ -401,7 +401,7 @@ sfc_port_attach(struct sfc_adapter *sa) port->flow_ctrl_autoneg = B_TRUE; RTE_BUILD_BUG_ON(sizeof(encp->enc_mac_addr) != sizeof(*from)); - from = (const struct ether_addr *)(encp->enc_mac_addr); + from = (const struct rte_ether_addr *)(encp->enc_mac_addr); ether_addr_copy(from, &port->default_mac_addr); port->max_mcast_addrs = EFX_MAC_MULTICAST_LIST_MAX; diff --git a/drivers/net/softnic/parser.c b/drivers/net/softnic/parser.c index a8688a21ea..7ea6eb4fa6 100644 --- a/drivers/net/softnic/parser.c +++ b/drivers/net/softnic/parser.c @@ -528,13 +528,13 @@ inet_pton6(const char *src, unsigned char *dst) return 1; } -static struct ether_addr * +static struct rte_ether_addr * my_ether_aton(const char *a) { int i; char *end; unsigned long o[ETHER_ADDR_LEN]; - static struct ether_addr ether_addr; + static struct rte_ether_addr ether_addr; i = 0; do { @@ -568,7 +568,7 @@ my_ether_aton(const char *a) } else return NULL; - return (struct ether_addr *)ðer_addr; + return (struct rte_ether_addr *)ðer_addr; } int @@ -596,15 +596,15 @@ softnic_parse_ipv6_addr(const char *token, struct in6_addr *ipv6) } int -softnic_parse_mac_addr(const char *token, struct ether_addr *addr) +softnic_parse_mac_addr(const char *token, struct rte_ether_addr *addr) { - struct ether_addr *tmp; + struct rte_ether_addr *tmp; tmp = my_ether_aton(token); if (tmp == NULL) return -1; - memcpy(addr, tmp, sizeof(struct ether_addr)); + memcpy(addr, tmp, sizeof(struct rte_ether_addr)); return 0; } diff --git a/drivers/net/softnic/parser.h b/drivers/net/softnic/parser.h index 1ee3f82a79..6f408b2485 100644 --- a/drivers/net/softnic/parser.h +++ b/drivers/net/softnic/parser.h @@ -49,7 +49,7 @@ int softnic_parse_hex_string(char *src, uint8_t *dst, uint32_t *size); int softnic_parse_ipv4_addr(const char *token, struct in_addr *ipv4); int softnic_parse_ipv6_addr(const char *token, struct in6_addr *ipv6); -int softnic_parse_mac_addr(const char *token, struct ether_addr *addr); +int softnic_parse_mac_addr(const char *token, struct rte_ether_addr *addr); int softnic_parse_mpls_labels(char *string, uint32_t *labels, uint32_t *n_labels); diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c index 32b001fd35..4bda2f2b02 100644 --- a/drivers/net/softnic/rte_eth_softnic.c +++ b/drivers/net/softnic/rte_eth_softnic.c @@ -339,7 +339,7 @@ pmd_free(struct pmd_internals *p) rte_free(p); } -static struct ether_addr eth_addr = { +static struct rte_ether_addr eth_addr = { .addr_bytes = {0}, }; diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 88448eff60..43a66432a0 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -105,7 +105,7 @@ struct szedata2_tx_queue { int szedata2_logtype_init; int szedata2_logtype_driver; -static struct ether_addr eth_addr = { +static struct rte_ether_addr eth_addr = { .addr_bytes = { 0x00, 0x11, 0x17, 0x00, 0x00, 0x00 } }; @@ -1332,7 +1332,7 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, static int eth_mac_addr_set(struct rte_eth_dev *dev __rte_unused, - struct ether_addr *mac_addr __rte_unused) + struct rte_ether_addr *mac_addr __rte_unused) { return 0; } @@ -1514,7 +1514,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi) eth_link_update(dev, 0); /* Allocate space for one mac address */ - data->mac_addrs = rte_zmalloc(data->name, sizeof(struct ether_addr), + data->mac_addrs = rte_zmalloc(data->name, sizeof(struct rte_ether_addr), RTE_CACHE_LINE_SIZE); if (data->mac_addrs == NULL) { PMD_INIT_LOG(ERR, "Could not alloc space for MAC address!"); diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 47a2b68f1d..71be763d66 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -261,7 +261,7 @@ tap_verify_csum(struct rte_mbuf *mbuf) uint32_t l2 = mbuf->packet_type & RTE_PTYPE_L2_MASK; uint32_t l3 = mbuf->packet_type & RTE_PTYPE_L3_MASK; uint32_t l4 = mbuf->packet_type & RTE_PTYPE_L4_MASK; - unsigned int l2_len = sizeof(struct ether_hdr); + unsigned int l2_len = sizeof(struct rte_ether_hdr); unsigned int l3_len; uint16_t cksum = 0; void *l3_hdr; @@ -1150,7 +1150,7 @@ tap_allmulti_disable(struct rte_eth_dev *dev) } static int -tap_mac_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct pmd_internals *pmd = dev->data->dev_private; enum ioctl_mode mode = LOCAL_ONLY; @@ -1172,15 +1172,16 @@ tap_mac_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) ret = tap_ioctl(pmd, SIOCGIFHWADDR, &ifr, 0, LOCAL_ONLY); if (ret < 0) return ret; - if (is_same_ether_addr((struct ether_addr *)&ifr.ifr_hwaddr.sa_data, + if (is_same_ether_addr((struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, mac_addr)) return 0; /* Check the current MAC address on the remote */ ret = tap_ioctl(pmd, SIOCGIFHWADDR, &ifr, 0, REMOTE_ONLY); if (ret < 0) return ret; - if (!is_same_ether_addr((struct ether_addr *)&ifr.ifr_hwaddr.sa_data, - mac_addr)) + if (!is_same_ether_addr( + (struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, + mac_addr)) mode = LOCAL_AND_REMOTE; ifr.ifr_hwaddr.sa_family = AF_LOCAL; rte_memcpy(ifr.ifr_hwaddr.sa_data, mac_addr, ETHER_ADDR_LEN); @@ -1458,7 +1459,7 @@ tap_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) static int tap_set_mc_addr_list(struct rte_eth_dev *dev __rte_unused, - struct ether_addr *mc_addr_set __rte_unused, + struct rte_ether_addr *mc_addr_set __rte_unused, uint32_t nb_mc_addr __rte_unused) { /* @@ -1682,7 +1683,7 @@ static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] = { static int eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name, - char *remote_iface, struct ether_addr *mac_addr, + char *remote_iface, struct rte_ether_addr *mac_addr, enum rte_tuntap_type type) { int numa_node = rte_socket_id(); @@ -1957,7 +1958,7 @@ set_remote_iface(const char *key __rte_unused, return 0; } -static int parse_user_mac(struct ether_addr *user_mac, +static int parse_user_mac(struct rte_ether_addr *user_mac, const char *value) { unsigned int index = 0; @@ -1985,7 +1986,7 @@ set_mac_type(const char *key __rte_unused, const char *value, void *extra_args) { - struct ether_addr *user_mac = extra_args; + struct rte_ether_addr *user_mac = extra_args; if (!value) return 0; @@ -2198,7 +2199,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev) int speed; char tap_name[RTE_ETH_NAME_MAX_LEN]; char remote_iface[RTE_ETH_NAME_MAX_LEN]; - struct ether_addr user_mac = { .addr_bytes = {0} }; + struct rte_ether_addr user_mac = { .addr_bytes = {0} }; struct rte_eth_dev *eth_dev; int tap_devices_count_increased = 0; diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h index dc3579ac0d..8d6d53dc0a 100644 --- a/drivers/net/tap/rte_eth_tap.h +++ b/drivers/net/tap/rte_eth_tap.h @@ -70,8 +70,8 @@ struct pmd_internals { char remote_iface[RTE_ETH_NAME_MAX_LEN]; /* Remote netdevice name */ char name[RTE_ETH_NAME_MAX_LEN]; /* Internal Tap device name */ int type; /* Type field - TUN|TAP */ - struct ether_addr eth_addr; /* Mac address of the device port */ - struct ifreq remote_initial_flags; /* Remote netdevice flags on init */ + struct rte_ether_addr eth_addr; /* Mac address of the device port */ + struct ifreq remote_initial_flags;/* Remote netdevice flags on init */ int remote_if_index; /* remote netdevice IF_INDEX */ int if_index; /* IF_INDEX for the port */ int ioctl_sock; /* socket for ioctl calls */ diff --git a/drivers/net/tap/tap_bpf_program.c b/drivers/net/tap/tap_bpf_program.c index 532e8838fe..2b1dba15b7 100644 --- a/drivers/net/tap/tap_bpf_program.c +++ b/drivers/net/tap/tap_bpf_program.c @@ -37,7 +37,7 @@ #define KEY_IDX 0 #define BPF_MAP_ID_KEY 1 -struct vlan_hdr { +struct rte_vlan_hdr { __be16 proto; __be16 tci; }; @@ -141,12 +141,12 @@ rss_l3_l4(struct __sk_buff *skb) /* Get correct proto for 802.1ad */ if (skb->vlan_present && skb->vlan_proto == htons(ETH_P_8021AD)) { - if (data + ETH_ALEN * 2 + sizeof(struct vlan_hdr) + + if (data + ETH_ALEN * 2 + sizeof(struct rte_vlan_hdr) + sizeof(proto) > data_end) return TC_ACT_OK; proto = *(__u16 *)(data + ETH_ALEN * 2 + - sizeof(struct vlan_hdr)); - off += sizeof(struct vlan_hdr); + sizeof(struct rte_vlan_hdr)); + off += sizeof(struct rte_vlan_hdr); } if (proto == htons(ETH_P_IP)) { diff --git a/drivers/net/thunderx/base/nicvf_plat.h b/drivers/net/thunderx/base/nicvf_plat.h index 6de07c7087..3f0519593f 100644 --- a/drivers/net/thunderx/base/nicvf_plat.h +++ b/drivers/net/thunderx/base/nicvf_plat.h @@ -46,6 +46,9 @@ #include #define NICVF_MAC_ADDR_SIZE ETHER_ADDR_LEN +/* Ethernet */ +#define ether_addr_copy(x, y) memcpy(y, x, ETHER_ADDR_LEN) + #include #define nicvf_addr_write(addr, val) rte_write64_relaxed((val), (void *)(addr)) #define nicvf_addr_read(addr) rte_read64_relaxed((void *)(addr)) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 879d889980..ec2087924a 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -2179,10 +2179,10 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) ret = -ENOMEM; goto alarm_fail; } - if (is_zero_ether_addr((struct ether_addr *)nic->mac_addr)) + if (is_zero_ether_addr((struct rte_ether_addr *)nic->mac_addr)) eth_random_addr(&nic->mac_addr[0]); - ether_addr_copy((struct ether_addr *)nic->mac_addr, + ether_addr_copy((struct rte_ether_addr *)nic->mac_addr, ð_dev->data->mac_addrs[0]); ret = nicvf_mbox_set_mac_addr(nic, nic->mac_addr); diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 801f54c96e..ef02fdcddc 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -68,7 +68,7 @@ struct vdev_netvsc_ctx { char devargs[256]; /**< Fail-safe device arguments. */ char if_name[IF_NAMESIZE]; /**< NetVSC netdevice name. */ unsigned int if_index; /**< NetVSC netdevice index. */ - struct ether_addr if_addr; /**< NetVSC MAC address. */ + struct rte_ether_addr if_addr; /**< NetVSC MAC address. */ int pipe[2]; /**< Fail-safe communication pipe. */ char yield[256]; /**< PCI sub-device arguments. */ }; @@ -157,7 +157,7 @@ vdev_netvsc_iface_is_netvsc(const struct if_nameindex *iface) */ static int vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface, - const struct ether_addr *eth_addr, + const struct rte_ether_addr *eth_addr, va_list ap), int is_netvsc, ...) { struct if_nameindex *iface = if_nameindex(); @@ -178,7 +178,7 @@ vdev_netvsc_foreach_iface(int (*func)(const struct if_nameindex *iface, for (i = 0; iface[i].if_name; ++i) { int is_netvsc_ret; struct ifreq req; - struct ether_addr eth_addr; + struct rte_ether_addr eth_addr; va_list ap; is_netvsc_ret = vdev_netvsc_iface_is_netvsc(&iface[i]) ? 1 : 0; @@ -368,7 +368,7 @@ vdev_netvsc_sysfs_readlink(char *buf, size_t size, const char *if_name, */ static int vdev_netvsc_device_probe(const struct if_nameindex *iface, - const struct ether_addr *eth_addr, + const struct rte_ether_addr *eth_addr, va_list ap) { struct vdev_netvsc_ctx *ctx = va_arg(ap, struct vdev_netvsc_ctx *); @@ -507,7 +507,7 @@ vdev_netvsc_alarm(__rte_unused void *arg) */ static int vdev_netvsc_netvsc_probe(const struct if_nameindex *iface, - const struct ether_addr *eth_addr, + const struct rte_ether_addr *eth_addr, va_list ap) { const char *name = va_arg(ap, const char *); @@ -527,7 +527,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface, if (!strcmp(pair->value, iface->if_name)) break; } else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) { - struct ether_addr tmp; + struct rte_ether_addr tmp; if (sscanf(pair->value, "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":" diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index b2cda04832..6705e90dba 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -43,7 +43,7 @@ static const char *valid_arguments[] = { NULL }; -static struct ether_addr base_eth_addr = { +static struct rte_ether_addr base_eth_addr = { .addr_bytes = { 0x56 /* V */, 0x48 /* H */, @@ -325,10 +325,10 @@ static inline void vhost_count_multicast_broadcast(struct vhost_queue *vq, struct rte_mbuf *mbuf) { - struct ether_addr *ea = NULL; + struct rte_ether_addr *ea = NULL; struct vhost_stats *pstats = &vq->stats; - ea = rte_pktmbuf_mtod(mbuf, struct ether_addr *); + ea = rte_pktmbuf_mtod(mbuf, struct rte_ether_addr *); if (is_multicast_ether_addr(ea)) { if (is_broadcast_ether_addr(ea)) pstats->xstats[VHOST_BROADCAST_PKT]++; @@ -1206,7 +1206,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name, struct rte_eth_dev_data *data; struct pmd_internal *internal = NULL; struct rte_eth_dev *eth_dev = NULL; - struct ether_addr *eth_addr = NULL; + struct rte_ether_addr *eth_addr = NULL; struct rte_vhost_vring_state *vring_state = NULL; struct internal_list *list = NULL; diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index d25c08f0a2..9b99bf3eb8 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -65,11 +65,11 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev); static int virtio_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on); static int virtio_mac_addr_add(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq); static void virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index); static int virtio_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static int virtio_intr_disable(struct rte_eth_dev *dev); @@ -1142,11 +1142,11 @@ virtio_mac_table_set(struct virtio_hw *hw, } static int -virtio_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, +virtio_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq __rte_unused) { struct virtio_hw *hw = dev->data->dev_private; - const struct ether_addr *addrs = dev->data->mac_addrs; + const struct rte_ether_addr *addrs = dev->data->mac_addrs; unsigned int i; struct virtio_net_ctrl_mac *uc, *mc; @@ -1161,7 +1161,7 @@ virtio_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr, mc->entries = 0; for (i = 0; i < VIRTIO_MAX_MAC_ADDRS; i++) { - const struct ether_addr *addr + const struct rte_ether_addr *addr = (i == index) ? mac_addr : addrs + i; struct virtio_net_ctrl_mac *tbl = is_multicast_ether_addr(addr) ? mc : uc; @@ -1176,7 +1176,7 @@ static void virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) { struct virtio_hw *hw = dev->data->dev_private; - struct ether_addr *addrs = dev->data->mac_addrs; + struct rte_ether_addr *addrs = dev->data->mac_addrs; struct virtio_net_ctrl_mac *uc, *mc; unsigned int i; @@ -1204,7 +1204,7 @@ virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) } static int -virtio_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +virtio_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct virtio_hw *hw = dev->data->dev_private; @@ -1395,7 +1395,7 @@ virtio_notify_peers(struct rte_eth_dev *dev) return; rarp_mbuf = rte_net_make_rarp_packet(rxvq->mpool, - (struct ether_addr *)hw->mac_addr); + (struct rte_ether_addr *)hw->mac_addr); if (rarp_mbuf == NULL) { PMD_DRV_LOG(ERR, "failed to make RARP packet."); return; @@ -1662,7 +1662,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) /* Copy the permanent MAC address to: virtio_hw */ virtio_get_hwaddr(hw); - ether_addr_copy((struct ether_addr *) hw->mac_addr, + ether_addr_copy((struct rte_ether_addr *)hw->mac_addr, ð_dev->data->mac_addrs[0]); PMD_INIT_LOG(DEBUG, "PORT MAC: %02X:%02X:%02X:%02X:%02X:%02X", diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index 8c56f238f9..fa9c855e86 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1092,7 +1092,7 @@ static inline void virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf) { uint32_t s = mbuf->pkt_len; - struct ether_addr *ea; + struct rte_ether_addr *ea; stats->bytes += s; @@ -1113,7 +1113,7 @@ virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf) stats->size_bins[7]++; } - ea = rte_pktmbuf_mtod(mbuf, struct ether_addr *); + ea = rte_pktmbuf_mtod(mbuf, struct rte_ether_addr *); if (is_multicast_ether_addr(ea)) { if (is_broadcast_ether_addr(ea)) stats->broadcast++; diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index f54536b499..3ad1e9e093 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -92,7 +92,7 @@ static int vmxnet3_dev_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vid, int on); static int vmxnet3_dev_vlan_offload_set(struct rte_eth_dev *dev, int mask); static int vmxnet3_mac_addr_set(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); static void vmxnet3_interrupt_handler(void *param); int vmxnet3_logtype_init; @@ -316,7 +316,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev) return -ENOMEM; } /* Copy the permanent MAC address */ - ether_addr_copy((struct ether_addr *) hw->perm_addr, + ether_addr_copy((struct rte_ether_addr *)hw->perm_addr, ð_dev->data->mac_addrs[0]); PMD_INIT_LOG(DEBUG, "MAC Address : %02x:%02x:%02x:%02x:%02x:%02x", @@ -1205,11 +1205,11 @@ vmxnet3_dev_supported_ptypes_get(struct rte_eth_dev *dev) } static int -vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr) +vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct vmxnet3_hw *hw = dev->data->dev_private; - ether_addr_copy(mac_addr, (struct ether_addr *)(hw->perm_addr)); + ether_addr_copy(mac_addr, (struct rte_ether_addr *)(hw->perm_addr)); vmxnet3_write_mac(hw, mac_addr->addr_bytes); return 0; } diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c index 4867a64f37..b691141b5f 100644 --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c @@ -676,7 +676,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, ptr = rte_pktmbuf_mtod(rxm, char *); slen = rte_pktmbuf_data_len(rxm); - hlen = sizeof(struct ether_hdr); + hlen = sizeof(struct rte_ether_hdr); if (rcd->v4) { if (unlikely(slen < hlen + sizeof(struct ipv4_hdr))) @@ -703,7 +703,7 @@ 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) + - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); tcp_hdr = (struct tcp_hdr *)(ptr + hlen); hlen += (tcp_hdr->data_off & 0xf0) >> 2; @@ -712,7 +712,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd, return (rte_pktmbuf_pkt_len(rxm) - hlen + rxm->udata64 - 1) / rxm->udata64; else - return hw->mtu - hlen + sizeof(struct ether_hdr); + return hw->mtu - hlen + sizeof(struct rte_ether_hdr); } /* Receive side checksum and other offloads */ diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c index d68c06aefb..2675a16f0e 100644 --- a/examples/bbdev_app/main.c +++ b/examples/bbdev_app/main.c @@ -273,7 +273,7 @@ signal_handler(int signum) } static void -print_mac(unsigned int portid, struct ether_addr *bbdev_ports_eth_address) +print_mac(unsigned int portid, struct rte_ether_addr *bbdev_ports_eth_address) { printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n", (unsigned int) portid, @@ -341,14 +341,14 @@ check_port_link_status(uint16_t port_id) static inline void add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst) { - struct ether_hdr *eth_from; - struct ether_hdr *eth_to; + struct rte_ether_hdr *eth_from; + struct rte_ether_hdr *eth_to; - eth_from = rte_pktmbuf_mtod(pkt_src, struct ether_hdr *); - eth_to = rte_pktmbuf_mtod(pkt_dst, struct ether_hdr *); + eth_from = rte_pktmbuf_mtod(pkt_src, struct rte_ether_hdr *); + eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *); /* copy header */ - rte_memcpy(eth_to, eth_from, sizeof(struct ether_hdr)); + rte_memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr)); } static inline void @@ -377,7 +377,7 @@ transform_enc_out_dec_in(struct rte_mbuf **mbufs, uint8_t *temp_buf, for (i = 0; i < num_pkts; ++i) { uint16_t pkt_data_len = rte_pktmbuf_data_len(mbufs[i]) - - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); /* Resize the packet if needed */ if (pkt_data_len < ncb) { @@ -395,7 +395,8 @@ transform_enc_out_dec_in(struct rte_mbuf **mbufs, uint8_t *temp_buf, for (l = start_bit_idx; l < start_bit_idx + d; ++l) { uint8_t *data = rte_pktmbuf_mtod_offset( mbufs[i], uint8_t *, - sizeof(struct ether_hdr) + (l >> 3)); + sizeof(struct rte_ether_hdr) + + (l >> 3)); if (*data & (0x80 >> (l & 7))) temp_buf[out_idx] = LLR_1_BIT; else @@ -410,7 +411,7 @@ transform_enc_out_dec_in(struct rte_mbuf **mbufs, uint8_t *temp_buf, } rte_memcpy(rte_pktmbuf_mtod_offset(mbufs[i], uint8_t *, - sizeof(struct ether_hdr)), temp_buf, ncb); + sizeof(struct rte_ether_hdr)), temp_buf, ncb); } } @@ -423,9 +424,9 @@ verify_data(struct rte_mbuf **mbufs, uint16_t num_pkts) struct rte_mbuf *in = out->userdata; if (memcmp(rte_pktmbuf_mtod_offset(in, uint8_t *, - sizeof(struct ether_hdr)), + sizeof(struct rte_ether_hdr)), rte_pktmbuf_mtod_offset(out, uint8_t *, - sizeof(struct ether_hdr)), + sizeof(struct rte_ether_hdr)), K / 8 - CRC_24B_LEN)) printf("Input and output buffers are not equal!\n"); } @@ -439,7 +440,7 @@ initialize_ports(struct app_config_params *app_params, uint16_t port_id = app_params->port_id; uint16_t q; /* ethernet addresses of ports */ - struct ether_addr bbdev_port_eth_addr; + struct rte_ether_addr bbdev_port_eth_addr; /* initialize ports */ printf("\nInitializing port %u...\n", app_params->port_id); @@ -707,14 +708,14 @@ run_encoding(struct lcore_conf *lcore_conf) char *data; const uint16_t pkt_data_len = rte_pktmbuf_data_len(rx_pkts_burst[i]) - - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); /* save input mbuf pointer for later comparison */ enc_out_pkts[i]->userdata = rx_pkts_burst[i]; /* copy ethernet header */ rte_pktmbuf_reset(enc_out_pkts[i]); data = rte_pktmbuf_append(enc_out_pkts[i], - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); if (data == NULL) { printf( "Not enough space for ethernet header in encoder output mbuf\n"); @@ -728,7 +729,7 @@ run_encoding(struct lcore_conf *lcore_conf) bbdev_ops_burst[i]->turbo_enc.input.data = rx_pkts_burst[i]; bbdev_ops_burst[i]->turbo_enc.input.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); /* Encoder will attach the CRC24B, adjust the length */ bbdev_ops_burst[i]->turbo_enc.input.length = in_data_len; @@ -746,7 +747,7 @@ run_encoding(struct lcore_conf *lcore_conf) bbdev_ops_burst[i]->turbo_enc.output.data = enc_out_pkts[i]; bbdev_ops_burst[i]->turbo_enc.output.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); } /* Enqueue packets on BBDevice */ @@ -834,15 +835,15 @@ run_decoding(struct lcore_conf *lcore_conf) bbdev_ops_burst[i]->turbo_dec.input.data = recv_pkts_burst[i]; bbdev_ops_burst[i]->turbo_dec.input.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); bbdev_ops_burst[i]->turbo_dec.input.length = rte_pktmbuf_data_len(recv_pkts_burst[i]) - - sizeof(struct ether_hdr); + - sizeof(struct rte_ether_hdr); bbdev_ops_burst[i]->turbo_dec.hard_output.data = recv_pkts_burst[i]; bbdev_ops_burst[i]->turbo_dec.hard_output.offset = - sizeof(struct ether_hdr); + sizeof(struct rte_ether_hdr); } /* Enqueue packets on BBDevice */ diff --git a/examples/bond/main.c b/examples/bond/main.c index 21a67e531a..38d1b40c25 100644 --- a/examples/bond/main.c +++ b/examples/bond/main.c @@ -201,7 +201,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool) "Start port %d failed (res=%d)", portid, retval); - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(portid, &addr); printf("Port %u MAC: ", portid); @@ -291,7 +291,7 @@ bond_port_init(struct rte_mempool *mbuf_pool) rte_eth_promiscuous_enable(BOND_PORT); - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(BOND_PORT, &addr); printf("Port %u MAC: ", (unsigned)BOND_PORT); @@ -300,21 +300,22 @@ bond_port_init(struct rte_mempool *mbuf_pool) } static inline size_t -get_vlan_offset(struct ether_hdr *eth_hdr, uint16_t *proto) +get_vlan_offset(struct rte_ether_hdr *eth_hdr, uint16_t *proto) { size_t vlan_offset = 0; if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) { - struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); + struct rte_vlan_hdr *vlan_hdr = + (struct rte_vlan_hdr *)(eth_hdr + 1); - vlan_offset = sizeof(struct vlan_hdr); + vlan_offset = sizeof(struct rte_vlan_hdr); *proto = vlan_hdr->eth_proto; if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) { vlan_hdr = vlan_hdr + 1; *proto = vlan_hdr->eth_proto; - vlan_offset += sizeof(struct vlan_hdr); + vlan_offset += sizeof(struct rte_vlan_hdr); } } return vlan_offset; @@ -336,9 +337,9 @@ struct global_flag_stru_t *global_flag_stru_p = &global_flag_stru; static int lcore_main(__attribute__((unused)) void *arg1) { struct rte_mbuf *pkts[MAX_PKT_BURST] __rte_cache_aligned; - struct ether_addr d_addr; + struct rte_ether_addr d_addr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct rte_arp_hdr *arp_hdr; struct ipv4_hdr *ipv4_hdr; uint16_t ether_type, offset; @@ -370,7 +371,8 @@ static int lcore_main(__attribute__((unused)) void *arg1) global_flag_stru_p->port_packets[0]++; rte_spinlock_unlock(&global_flag_stru_p->lock); } - eth_hdr = rte_pktmbuf_mtod(pkts[i], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkts[i], + struct rte_ether_hdr *); ether_type = eth_hdr->ether_type; if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_VLAN)) printf("VLAN taged frame, offset:"); @@ -450,7 +452,7 @@ static void cmd_obj_send_parsed(void *parsed_result, char ip_str[INET6_ADDRSTRLEN]; struct rte_mbuf *created_pkt; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct rte_arp_hdr *arp_hdr; uint32_t bond_ip; @@ -470,17 +472,17 @@ static void cmd_obj_send_parsed(void *parsed_result, return; } - pkt_size = sizeof(struct ether_hdr) + sizeof(struct rte_arp_hdr); + pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct rte_arp_hdr); created_pkt->data_len = pkt_size; created_pkt->pkt_len = pkt_size; - eth_hdr = rte_pktmbuf_mtod(created_pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *); rte_eth_macaddr_get(BOND_PORT, ð_hdr->s_addr); memset(ð_hdr->d_addr, 0xFF, ETHER_ADDR_LEN); eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_ARP); arp_hdr = (struct rte_arp_hdr *)( - (char *)eth_hdr + sizeof(struct ether_hdr)); + (char *)eth_hdr + sizeof(struct rte_ether_hdr)); 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; @@ -700,7 +702,7 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result, { uint16_t slaves[16] = {0}; uint8_t len = 16; - struct ether_addr addr; + struct rte_ether_addr addr; uint16_t i = 0; while (i < slaves_count) { diff --git a/examples/distributor/main.c b/examples/distributor/main.c index b5499bb129..e4c8c3c18d 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -179,7 +179,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return 0; } - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c index a4e64b354c..ce7f715f81 100644 --- a/examples/ethtool/ethtool-app/ethapp.c +++ b/examples/ethtool/ethtool-app/ethapp.c @@ -30,7 +30,7 @@ struct pcmd_intstr_params { struct pcmd_intmac_params { cmdline_fixed_string_t cmd; uint16_t port; - struct ether_addr mac; + struct rte_ether_addr mac; }; struct pcmd_str_params { cmdline_fixed_string_t cmd; @@ -475,7 +475,7 @@ pcmd_macaddr_callback(void *ptr_params, void *ptr_data) { struct pcmd_intmac_params *params = ptr_params; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; int stat; stat = 0; diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c index e23d3afd22..27c22cf90c 100644 --- a/examples/ethtool/ethtool-app/main.c +++ b/examples/ethtool/ethtool-app/main.c @@ -32,7 +32,7 @@ struct txq_port { }; struct app_port { - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; struct txq_port txq; rte_spinlock_t lock; int port_active; @@ -158,9 +158,9 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports) static void process_frame(struct app_port *ptr_port, struct rte_mbuf *ptr_frame) { - struct ether_hdr *ptr_mac_hdr; + struct rte_ether_hdr *ptr_mac_hdr; - ptr_mac_hdr = rte_pktmbuf_mtod(ptr_frame, struct ether_hdr *); + ptr_mac_hdr = rte_pktmbuf_mtod(ptr_frame, struct rte_ether_hdr *); ether_addr_copy(&ptr_mac_hdr->s_addr, &ptr_mac_hdr->d_addr); ether_addr_copy(&ptr_port->mac_addr, &ptr_mac_hdr->s_addr); } diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c index bf10139e77..299488c1cb 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c @@ -303,7 +303,7 @@ rte_ethtool_net_stop(uint16_t port_id) } int -rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr) +rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr) { RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); if (addr == NULL) @@ -314,7 +314,7 @@ rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr) } int -rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr) +rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr) { if (addr == NULL) return -EINVAL; @@ -323,7 +323,7 @@ rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr) int rte_ethtool_net_validate_addr(uint16_t port_id __rte_unused, - struct ether_addr *addr) + struct rte_ether_addr *addr) { if (addr == NULL) return -EINVAL; diff --git a/examples/ethtool/lib/rte_ethtool.h b/examples/ethtool/lib/rte_ethtool.h index 31cd5ae4ef..f177096636 100644 --- a/examples/ethtool/lib/rte_ethtool.h +++ b/examples/ethtool/lib/rte_ethtool.h @@ -260,7 +260,7 @@ int rte_ethtool_net_stop(uint16_t port_id); * - (0) if successful. * - (-ENODEV) if *port_id* invalid. */ -int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr); +int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr); /** * Setting the Ethernet device MAC address. @@ -276,7 +276,7 @@ int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr); * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr); +int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr); /** * Validate if the provided MAC address is valid unicast address @@ -292,7 +292,8 @@ int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr); * - (-EINVAL) if parameters invalid. * - others depends on the specific operations implementation. */ -int rte_ethtool_net_validate_addr(uint16_t port_id, struct ether_addr *addr); +int rte_ethtool_net_validate_addr(uint16_t port_id, + struct rte_ether_addr *addr); /** * Setting the Ethernet device maximum Tx unit. diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c index 58f8904e04..63227f0d57 100644 --- a/examples/eventdev_pipeline/main.c +++ b/examples/eventdev_pipeline/main.c @@ -317,7 +317,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) } /* Display the port MAC address. */ - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", diff --git a/examples/eventdev_pipeline/pipeline_common.h b/examples/eventdev_pipeline/pipeline_common.h index a6cc912fbb..ef23d963a3 100644 --- a/examples/eventdev_pipeline/pipeline_common.h +++ b/examples/eventdev_pipeline/pipeline_common.h @@ -99,11 +99,11 @@ struct config_data cdata; static __rte_always_inline void exchange_mac(struct rte_mbuf *m) { - struct ether_hdr *eth; - struct ether_addr addr; + struct rte_ether_hdr *eth; + struct rte_ether_addr addr; /* change mac addresses on packet (to use mbuf data) */ - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_addr_copy(ð->d_addr, &addr); ether_addr_copy(&addr, ð->d_addr); } diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c index 199612926b..5ae81fab1f 100644 --- a/examples/flow_classify/flow_classify.c +++ b/examples/flow_classify/flow_classify.c @@ -98,7 +98,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint8_t), .field_index = PROTO_FIELD_IPV4, .input_index = PROTO_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, next_proto_id), }, /* next input field (IPv4 source address) - 4 consecutive bytes. */ @@ -108,7 +108,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = SRC_FIELD_IPV4, .input_index = SRC_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, src_addr), }, /* next input field (IPv4 destination address) - 4 consecutive bytes. */ @@ -118,7 +118,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint32_t), .field_index = DST_FIELD_IPV4, .input_index = DST_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, dst_addr), }, /* @@ -131,7 +131,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = SRCP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, src_port), }, @@ -141,7 +141,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = { .size = sizeof(uint16_t), .field_index = DSTP_FIELD_IPV4, .input_index = SRCP_DESTP_INPUT_IPV4, - .offset = sizeof(struct ether_hdr) + + .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + offsetof(struct tcp_hdr, dst_port), }, @@ -192,7 +192,7 @@ static inline int port_init(uint8_t port, struct rte_mempool *mbuf_pool) { struct rte_eth_conf port_conf = port_conf_default; - struct ether_addr addr; + struct rte_ether_addr addr; const uint16_t rx_rings = 1, tx_rings = 1; int retval; uint16_t q; diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c index a582ac0752..7b8e7c4faf 100644 --- a/examples/flow_filtering/main.c +++ b/examples/flow_filtering/main.c @@ -45,7 +45,7 @@ struct rte_flow *flow; #include "flow_blocks.c" static inline void -print_ether_addr(const char *what, struct ether_addr *eth_addr) +print_ether_addr(const char *what, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); @@ -56,7 +56,7 @@ static void main_loop(void) { struct rte_mbuf *mbufs[32]; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct rte_flow_error error; uint16_t nb_rx; uint16_t i; @@ -71,7 +71,7 @@ main_loop(void) struct rte_mbuf *m = mbufs[j]; eth_hdr = rte_pktmbuf_mtod(m, - struct ether_hdr *); + struct rte_ether_hdr *); print_ether_addr("src=", ð_hdr->s_addr); print_ether_addr(" - dst=", diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index e90a61e35d..a9efb4baaa 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -60,7 +60,7 @@ * We have to consider the max possible overhead. */ #define MTU_OVERHEAD \ - (ETHER_HDR_LEN + ETHER_CRC_LEN + 2 * sizeof(struct vlan_hdr)) + (ETHER_HDR_LEN + ETHER_CRC_LEN + 2 * sizeof(struct rte_vlan_hdr)) /* * Default payload in bytes for the IPv6 packet. @@ -90,7 +90,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; #ifndef IPv4_BYTES #define IPv4_BYTES_FMT "%" PRIu8 ".%" PRIu8 ".%" PRIu8 ".%" PRIu8 @@ -252,7 +252,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, port_out = port_in; /* Remove the Ethernet header and trailer from the input packet */ - rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr)); + rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr)); /* Build transmission burst */ len = qconf->tx_mbufs[port_out].len; @@ -340,13 +340,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf, void *d_addr_bytes; m = qconf->tx_mbufs[port_out].m_table[i]; - struct ether_hdr *eth_hdr = (struct ether_hdr *) - rte_pktmbuf_prepend(m, (uint16_t)sizeof(struct ether_hdr)); + struct rte_ether_hdr *eth_hdr = (struct rte_ether_hdr *) + rte_pktmbuf_prepend(m, + (uint16_t)sizeof(struct rte_ether_hdr)); if (eth_hdr == NULL) { rte_panic("No headroom in mbuf.\n"); } - m->l2_len = sizeof(struct ether_hdr); + m->l2_len = sizeof(struct rte_ether_hdr); /* 02:00:00:00:00:xx */ d_addr_bytes = ð_hdr->d_addr.addr_bytes[0]; @@ -568,7 +569,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, struct ether_addr *eth_addr) +print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); @@ -669,11 +670,11 @@ check_ptype(int portid) static inline void parse_ptype(struct rte_mbuf *m) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t packet_type = RTE_PTYPE_UNKNOWN; uint16_t ether_type; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_type = eth_hdr->ether_type; if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c index bcf62fbf53..309b2936ea 100644 --- a/examples/ip_pipeline/cli.c +++ b/examples/ip_pipeline/cli.c @@ -245,7 +245,7 @@ static void print_link_info(struct link *link, char *out, size_t out_size) { struct rte_eth_stats stats; - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; struct rte_eth_link eth_link; uint16_t mtu; @@ -4777,7 +4777,7 @@ cmd_pipeline_table_rule_delete_default(char **tokens, } static void -ether_addr_show(FILE *f, struct ether_addr *addr) +ether_addr_show(FILE *f, struct rte_ether_addr *addr) { fprintf(f, "%02x:%02x:%02x:%02x:%02x:%02x", (uint32_t)addr->addr_bytes[0], (uint32_t)addr->addr_bytes[1], diff --git a/examples/ip_pipeline/parser.c b/examples/ip_pipeline/parser.c index ffcdeb3a64..4777f9ffd8 100644 --- a/examples/ip_pipeline/parser.c +++ b/examples/ip_pipeline/parser.c @@ -513,13 +513,13 @@ inet_pton6(const char *src, unsigned char *dst) return 1; } -static struct ether_addr * +static struct rte_ether_addr * my_ether_aton(const char *a) { int i; char *end; unsigned long o[ETHER_ADDR_LEN]; - static struct ether_addr ether_addr; + static struct rte_ether_addr ether_addr; i = 0; do { @@ -553,7 +553,7 @@ my_ether_aton(const char *a) } else return NULL; - return (struct ether_addr *)ðer_addr; + return (struct rte_ether_addr *)ðer_addr; } int @@ -581,15 +581,15 @@ parse_ipv6_addr(const char *token, struct in6_addr *ipv6) } int -parse_mac_addr(const char *token, struct ether_addr *addr) +parse_mac_addr(const char *token, struct rte_ether_addr *addr) { - struct ether_addr *tmp; + struct rte_ether_addr *tmp; tmp = my_ether_aton(token); if (tmp == NULL) return -1; - memcpy(addr, tmp, sizeof(struct ether_addr)); + memcpy(addr, tmp, sizeof(struct rte_ether_addr)); return 0; } diff --git a/examples/ip_pipeline/parser.h b/examples/ip_pipeline/parser.h index 261a8c8589..4538f675d4 100644 --- a/examples/ip_pipeline/parser.h +++ b/examples/ip_pipeline/parser.h @@ -47,7 +47,7 @@ int parse_hex_string(char *src, uint8_t *dst, uint32_t *size); int parse_ipv4_addr(const char *token, struct in_addr *ipv4); int parse_ipv6_addr(const char *token, struct in6_addr *ipv6); -int parse_mac_addr(const char *token, struct ether_addr *addr); +int parse_mac_addr(const char *token, struct rte_ether_addr *addr); int parse_mpls_labels(char *string, uint32_t *labels, uint32_t *n_labels); struct cpu_core_params { diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index 17b55d4c76..d9ecac0064 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -95,7 +95,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; #ifndef IPv4_BYTES #define IPv4_BYTES_FMT "%" PRIu8 ".%" PRIu8 ".%" PRIu8 ".%" PRIu8 @@ -308,7 +308,7 @@ static inline void reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, struct lcore_queue_conf *qconf, uint64_t tms) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct rte_ip_frag_tbl *tbl; struct rte_ip_frag_death_row *dr; struct rx_queue *rxq; @@ -318,7 +318,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, rxq = &qconf->rx_queue_list[queue]; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); dst_port = portid; @@ -350,7 +350,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, if (mo != m) { m = mo; eth_hdr = rte_pktmbuf_mtod(m, - struct ether_hdr *); + struct rte_ether_hdr *); ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1); } } @@ -388,7 +388,8 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, if (mo != m) { m = mo; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, + struct rte_ether_hdr *); ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1); } } @@ -691,7 +692,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index 478dd80c22..66e92165df 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -233,9 +233,9 @@ static inline void prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t) { uint8_t *nlp; - struct ether_hdr *eth; + struct rte_ether_hdr *eth; - eth = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); if (eth->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) { nlp = (uint8_t *)rte_pktmbuf_adj(pkt, ETHER_HDR_LEN); nlp = RTE_PTR_ADD(nlp, offsetof(struct ip, ip_p)); @@ -325,11 +325,12 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port, const struct lcore_conf *qconf) { struct ip *ip; - struct ether_hdr *ethhdr; + struct rte_ether_hdr *ethhdr; ip = rte_pktmbuf_mtod(pkt, struct ip *); - ethhdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, ETHER_HDR_LEN); + ethhdr = (struct rte_ether_hdr *) + rte_pktmbuf_prepend(pkt, ETHER_HDR_LEN); if (ip->ip_v == IPVERSION) { pkt->ol_flags |= qconf->outbound.ipv4_offloads; @@ -352,9 +353,9 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port, } memcpy(ðhdr->s_addr, ðaddr_tbl[port].src, - sizeof(struct ether_addr)); + sizeof(struct rte_ether_addr)); memcpy(ðhdr->d_addr, ðaddr_tbl[port].dst, - sizeof(struct ether_addr)); + sizeof(struct rte_ether_addr)); } static inline void @@ -1424,7 +1425,7 @@ parse_args(int32_t argc, char **argv) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); @@ -1435,7 +1436,7 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr) * Update destination ethaddr for the port. */ int -add_dst_ethaddr(uint16_t port, const struct ether_addr *addr) +add_dst_ethaddr(uint16_t port, const struct rte_ether_addr *addr) { if (port >= RTE_DIM(ethaddr_tbl)) return -EINVAL; @@ -1832,7 +1833,7 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads) uint16_t tx_queueid, rx_queueid, queue, lcore_id; int32_t ret, socket_id; struct lcore_conf *qconf; - struct ether_addr ethaddr; + struct rte_ether_addr ethaddr; struct rte_eth_conf local_port_conf = port_conf; rte_eth_dev_info_get(portid, &dev_info); diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h index 589398f6f0..e9272d74bc 100644 --- a/examples/ipsec-secgw/ipsec.h +++ b/examples/ipsec-secgw/ipsec.h @@ -306,7 +306,7 @@ sa_check_offloads(uint16_t port_id, uint64_t *rx_offloads, uint64_t *tx_offloads); int -add_dst_ethaddr(uint16_t port, const struct ether_addr *addr); +add_dst_ethaddr(uint16_t port, const struct rte_ether_addr *addr); void enqueue_cop_burst(struct cdev_qp *cqp); diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c index b0a8ee23b3..fc8c238fe5 100644 --- a/examples/ipsec-secgw/parser.c +++ b/examples/ipsec-secgw/parser.c @@ -324,7 +324,7 @@ parse_uint8x16(const char *s, uint8_t *v, uint8_t ls) } static int -parse_mac(const char *str, struct ether_addr *addr) +parse_mac(const char *str, struct rte_ether_addr *addr) { uint32_t i; @@ -499,7 +499,7 @@ cfg_parse_neigh(void *parsed_result, __rte_unused struct cmdline *cl, int32_t rc; struct cfg_neigh_add_item *res; struct parse_status *st; - struct ether_addr mac; + struct rte_ether_addr mac; st = data; res = parsed_result; diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 1eef291590..a047197c71 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -80,7 +80,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[MAX_PORTS]; +static struct rte_ether_addr ports_eth_addr[MAX_PORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; @@ -267,14 +267,15 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone) * and put it into the outgoing queue for the given port. */ static inline void -mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr, +mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr, struct lcore_queue_conf *qconf, uint16_t port) { - struct ether_hdr *ethdr; + struct rte_ether_hdr *ethdr; uint16_t len; /* Construct Ethernet header. */ - ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr)); + ethdr = (struct rte_ether_hdr *) + rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr)); RTE_ASSERT(ethdr != NULL); ether_addr_copy(dest_addr, ðdr->d_addr); @@ -302,11 +303,12 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf) uint16_t port; union { uint64_t as_int; - struct ether_addr as_addr; + struct rte_ether_addr as_addr; } dst_eth_addr; /* Remove the Ethernet header from the input packet */ - iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr)); + iphdr = (struct ipv4_hdr *) + rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr)); RTE_ASSERT(iphdr != NULL); dest_addr = rte_be_to_cpu_32(iphdr->dst_addr); @@ -535,7 +537,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, struct ether_addr *eth_addr) +print_ethaddr(const char *name, struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); diff --git a/examples/kni/main.c b/examples/kni/main.c index a58774a337..8bea07182f 100644 --- a/examples/kni/main.c +++ b/examples/kni/main.c @@ -832,7 +832,7 @@ kni_config_network_interface(uint16_t port_id, uint8_t if_up) } static void -print_ethaddr(const char *name, struct ether_addr *mac_addr) +print_ethaddr(const char *name, struct rte_ether_addr *mac_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, mac_addr); @@ -851,10 +851,10 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[]) } RTE_LOG(INFO, APP, "Configure mac address of %d\n", port_id); - print_ethaddr("Address:", (struct ether_addr *)mac_addr); + print_ethaddr("Address:", (struct rte_ether_addr *)mac_addr); ret = rte_eth_dev_default_mac_addr_set(port_id, - (struct ether_addr *)mac_addr); + (struct rte_ether_addr *)mac_addr); if (ret < 0) RTE_LOG(ERR, APP, "Failed to config mac_addr for port %d\n", port_id); @@ -912,7 +912,7 @@ kni_alloc(uint16_t port_id) } /* Get the interface default mac address */ rte_eth_macaddr_get(port_id, - (struct ether_addr *)&conf.mac_addr); + (struct rte_ether_addr *)&conf.mac_addr); rte_eth_dev_get_mtu(port_id, &conf.mtu); diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c index 0e6078aad8..1a8af28e2b 100644 --- a/examples/l2fwd-cat/l2fwd-cat.c +++ b/examples/l2fwd-cat/l2fwd-cat.c @@ -73,7 +73,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; /* Display the port MAC address. */ - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 06517b4718..dd09855e7a 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -79,7 +79,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint64_t l2fwd_enabled_port_mask; @@ -387,19 +387,19 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m, struct rte_crypto_op *op, struct l2fwd_crypto_params *cparams) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ip_hdr; uint32_t ipdata_offset, data_len; uint32_t pad_len = 0; char *padding; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); if (eth_hdr->ether_type != rte_cpu_to_be_16(ETHER_TYPE_IPv4)) return -1; - ipdata_offset = sizeof(struct ether_hdr); + ipdata_offset = sizeof(struct rte_ether_hdr); ip_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) + ipdata_offset); @@ -593,10 +593,10 @@ l2fwd_send_packet(struct rte_mbuf *m, uint16_t port) static void l2fwd_mac_updating(struct rte_mbuf *m, uint16_t dest_portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index a4d28e1782..033104d63d 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -52,7 +52,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint32_t l2fwd_enabled_port_mask; @@ -335,14 +335,14 @@ show_stats_cb(__rte_unused void *param) static void l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; int sent; unsigned dst_port; struct rte_eth_dev_tx_buffer *buffer; dst_port = l2fwd_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 0bf2b53364..21d19932d7 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -58,7 +58,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint32_t l2fwd_enabled_port_mask; @@ -165,14 +165,14 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer, static void l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; int sent; unsigned dst_port; struct rte_eth_dev_tx_buffer *buffer; dst_port = l2fwd_dst_ports[portid]; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index 6c23215a54..c1d6797b07 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -59,7 +59,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint32_t l2fwd_enabled_port_mask = 0; @@ -151,10 +151,10 @@ print_stats(void) static void l2fwd_mac_updating(struct rte_mbuf *m, unsigned dest_portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index a322ce4f2a..3a0f5820ef 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -82,7 +82,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask; @@ -173,7 +173,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port); *c = (unsigned char)(ip >> 8 & 0xff);\ *d = (unsigned char)(ip & 0xff);\ } while (0) -#define OFF_ETHHEAD (sizeof(struct ether_hdr)) +#define OFF_ETHHEAD (sizeof(struct rte_ether_hdr)) #define OFF_IPV42PROTO (offsetof(struct ipv4_hdr, next_proto_id)) #define OFF_IPV62PROTO (offsetof(struct ipv6_hdr, proto)) #define MBUF_IPV4_2PROTO(m) \ @@ -542,9 +542,9 @@ dump_acl4_rule(struct rte_mbuf *m, uint32_t sig) { uint32_t offset = sig & ~ACL_DENY_SIGNATURE; unsigned char a, b, c, d; - struct ipv4_hdr *ipv4_hdr = rte_pktmbuf_mtod_offset(m, - struct ipv4_hdr *, - sizeof(struct ether_hdr)); + struct ipv4_hdr *ipv4_hdr = + rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, + sizeof(struct rte_ether_hdr)); uint32_t_to_char(rte_bswap32(ipv4_hdr->src_addr), &a, &b, &c, &d); printf("Packet Src:%hhu.%hhu.%hhu.%hhu ", a, b, c, d); @@ -566,9 +566,9 @@ dump_acl6_rule(struct rte_mbuf *m, uint32_t sig) { unsigned i; uint32_t offset = sig & ~ACL_DENY_SIGNATURE; - struct ipv6_hdr *ipv6_hdr = rte_pktmbuf_mtod_offset(m, - struct ipv6_hdr *, - sizeof(struct ether_hdr)); + struct ipv6_hdr *ipv6_hdr = + rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, + sizeof(struct rte_ether_hdr)); printf("Packet Src"); for (i = 0; i < RTE_DIM(ipv6_hdr->src_addr); i += sizeof(uint16_t)) @@ -625,7 +625,7 @@ prepare_one_packet(struct rte_mbuf **pkts_in, struct acl_search_t *acl, if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) { ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); /* Check to make sure the packet is valid (RFC1812) */ if (is_valid_ipv4_pkt(ipv4_hdr, pkt->pkt_len) >= 0) { @@ -1754,7 +1754,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 3b448acc47..bcd584d3e5 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -135,7 +135,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; /* ethernet addresses of ports */ static rte_spinlock_t locks[RTE_MAX_ETHPORTS]; @@ -618,11 +618,11 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, static inline void parse_ptype_one(struct rte_mbuf *m) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t packet_type = RTE_PTYPE_UNKNOWN; uint16_t ether_type; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_type = eth_hdr->ether_type; if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; @@ -661,18 +661,18 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *d_addr_bytes; uint16_t dst_port; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + 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 *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); #ifdef DO_RFC_1812_CHECKS /* Check to make sure the packet is valid (RFC1812) */ @@ -710,7 +710,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); dst_port = get_ipv6_dst_port(ipv6_hdr, portid, qconf->ipv6_lookup_struct); @@ -1577,7 +1577,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c index 41137f978b..2c0c89e21e 100644 --- a/examples/l3fwd-vf/main.c +++ b/examples/l3fwd-vf/main.c @@ -112,7 +112,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint32_t enabled_port_mask = 0; @@ -417,15 +417,15 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid, lookup_struct_t *l3fwd_lookup_struct) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; void *tmp; uint16_t dst_port; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); #ifdef DO_RFC_1812_CHECKS /* Check to make sure the packet is valid (RFC1812) */ @@ -788,7 +788,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h index c962deac39..1893f8c3a1 100644 --- a/examples/l3fwd/l3fwd.h +++ b/examples/l3fwd/l3fwd.h @@ -73,7 +73,7 @@ extern volatile bool force_quit; /* ethernet addresses of ports */ extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS]; -extern struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ extern uint32_t enabled_port_mask; diff --git a/examples/l3fwd/l3fwd_altivec.h b/examples/l3fwd/l3fwd_altivec.h index 5ec99f9615..0c68aa01c1 100644 --- a/examples/l3fwd/l3fwd_altivec.h +++ b/examples/l3fwd/l3fwd_altivec.h @@ -68,13 +68,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP]) *p[2] = te[2]; *p[3] = te[3]; - rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1), + 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 ether_hdr *)p[1] + 1), + 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 ether_hdr *)p[2] + 1), + 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 ether_hdr *)p[3] + 1), + rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1), &dst_port[3], pkt[3]->packet_type); } @@ -121,10 +121,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, vector unsigned short dp1, static inline void process_packet(struct rte_mbuf *pkt, uint16_t *dst_port) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; vector unsigned int te, ve; - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); te = *(vector unsigned int *)eth_hdr; ve = (vector unsigned int)val_eth[dst_port[0]]; diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index fa8f82be61..64e79b9463 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -561,7 +561,7 @@ em_check_ptype(int portid) static inline void em_parse_ptype(struct rte_mbuf *m) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t packet_type = RTE_PTYPE_UNKNOWN; uint16_t ether_type; void *l3; @@ -569,9 +569,9 @@ em_parse_ptype(struct rte_mbuf *m) struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_type = eth_hdr->ether_type; - l3 = (uint8_t *)eth_hdr + sizeof(struct ether_hdr); + l3 = (uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr); if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) { ipv4_hdr = (struct ipv4_hdr *)l3; hdr_len = (ipv4_hdr->version_ihl & IPV4_HDR_IHL_MASK) * diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h index 228164e261..de1278b043 100644 --- a/examples/l3fwd/l3fwd_em.h +++ b/examples/l3fwd/l3fwd_em.h @@ -9,20 +9,20 @@ static __rte_always_inline void l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; uint16_t dst_port; uint32_t tcp_or_udp; uint32_t l3_ptypes; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); tcp_or_udp = m->packet_type & (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP); l3_ptypes = m->packet_type & RTE_PTYPE_L3_MASK; if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV4)) { /* Handle IPv4 headers.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); #ifdef DO_RFC_1812_CHECKS /* Check to make sure the packet is valid (RFC1812) */ @@ -55,7 +55,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid, struct ipv6_hdr *ipv6_hdr; ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); dst_port = em_get_ipv6_dst_port(ipv6_hdr, portid, qconf->ipv6_lookup_struct); diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h index 22c26dce33..ec52a011f6 100644 --- a/examples/l3fwd/l3fwd_em_hlm.h +++ b/examples/l3fwd/l3fwd_em_hlm.h @@ -92,7 +92,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, /* Handle IPv4 headers.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid, qconf->ipv4_lookup_struct); @@ -107,7 +107,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, /* Handle IPv6 headers.*/ ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid, qconf->ipv6_lookup_struct); @@ -142,7 +142,7 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, for (j = 0; j < EM_HASH_LOOKUP_COUNT && j < nb_rx; j++) { rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], - struct ether_hdr *) + 1); + struct rte_ether_hdr *) + 1); } for (j = 0; j < n; j += EM_HASH_LOOKUP_COUNT) { @@ -159,8 +159,9 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, for (i = 0, pos = j + EM_HASH_LOOKUP_COUNT; i < EM_HASH_LOOKUP_COUNT && pos < nb_rx; i++, pos++) { - rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[pos], - struct ether_hdr *) + 1); + rte_prefetch0(rte_pktmbuf_mtod( + pkts_burst[pos], + struct rte_ether_hdr *) + 1); } if (tcp_or_udp && (l3_type == RTE_PTYPE_L3_IPV4)) { diff --git a/examples/l3fwd/l3fwd_em_hlm_neon.h b/examples/l3fwd/l3fwd_em_hlm_neon.h index 16c8b04ac8..3ee2304b51 100644 --- a/examples/l3fwd/l3fwd_em_hlm_neon.h +++ b/examples/l3fwd/l3fwd_em_hlm_neon.h @@ -13,7 +13,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, int32x4_t mask0, union ipv4_5tuple_host *key) { int32x4_t tmpdata0 = vld1q_s32(rte_pktmbuf_mtod_offset(m0, int32_t *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); key->xmm = vandq_s32(tmpdata0, mask0); @@ -25,17 +25,17 @@ get_ipv6_5tuple(struct rte_mbuf *m0, int32x4_t mask0, { int32x4_t tmpdata0 = vld1q_s32( rte_pktmbuf_mtod_offset(m0, int *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len))); int32x4_t tmpdata1 = vld1q_s32( rte_pktmbuf_mtod_offset(m0, int *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len) + 8)); int32x4_t tmpdata2 = vld1q_s32( rte_pktmbuf_mtod_offset(m0, int *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len) + 16)); key->xmm[0] = vandq_s32(tmpdata0, mask0); diff --git a/examples/l3fwd/l3fwd_em_hlm_sse.h b/examples/l3fwd/l3fwd_em_hlm_sse.h index 41e2be958f..8156bbb903 100644 --- a/examples/l3fwd/l3fwd_em_hlm_sse.h +++ b/examples/l3fwd/l3fwd_em_hlm_sse.h @@ -13,7 +13,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, __m128i mask0, { __m128i tmpdata0 = _mm_loadu_si128( rte_pktmbuf_mtod_offset(m0, __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); key->xmm = _mm_and_si128(tmpdata0, mask0); @@ -25,18 +25,18 @@ get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0, { __m128i tmpdata0 = _mm_loadu_si128( rte_pktmbuf_mtod_offset(m0, __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len))); __m128i tmpdata1 = _mm_loadu_si128( rte_pktmbuf_mtod_offset(m0, __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len) + sizeof(__m128i))); __m128i tmpdata2 = _mm_loadu_si128( rte_pktmbuf_mtod_offset(m0, __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len) + sizeof(__m128i) + sizeof(__m128i))); diff --git a/examples/l3fwd/l3fwd_em_sequential.h b/examples/l3fwd/l3fwd_em_sequential.h index 35cf5eac09..770660e994 100644 --- a/examples/l3fwd/l3fwd_em_sequential.h +++ b/examples/l3fwd/l3fwd_em_sequential.h @@ -37,7 +37,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, /* Handle IPv4 headers.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid, qconf->ipv4_lookup_struct); @@ -52,7 +52,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, /* Handle IPv6 headers.*/ ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid, qconf->ipv6_lookup_struct); @@ -81,13 +81,14 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, if (nb_rx > 0) { rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[0], - struct ether_hdr *) + 1); + struct rte_ether_hdr *) + 1); } for (i = 1, j = 0; j < nb_rx; i++, j++) { if (i < nb_rx) { - rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i], - struct ether_hdr *) + 1); + rte_prefetch0(rte_pktmbuf_mtod( + pkts_burst[i], + struct rte_ether_hdr *) + 1); } dst_port[j] = em_get_dst_port(qconf, pkts_burst[j], portid); } diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index 60a00639e1..b373047f62 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -108,18 +108,18 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt, { struct ipv6_hdr *ipv6_hdr; struct ipv4_hdr *ipv4_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) { - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1); return lpm_get_ipv6_dst_port(ipv6_hdr, portid, @@ -140,7 +140,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt, { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) { return (uint16_t) ((rte_lpm_lookup(qconf->ipv4_lookup_struct, @@ -149,7 +149,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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1); return (uint16_t) ((rte_lpm6_lookup(qconf->ipv6_lookup_struct, @@ -380,11 +380,11 @@ lpm_check_ptype(int portid) static inline void lpm_parse_ptype(struct rte_mbuf *m) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t packet_type = RTE_PTYPE_UNKNOWN; uint16_t ether_type; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_type = eth_hdr->ether_type; if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h index b68868f443..0c98d3fc46 100644 --- a/examples/l3fwd/l3fwd_lpm.h +++ b/examples/l3fwd/l3fwd_lpm.h @@ -9,16 +9,16 @@ static __rte_always_inline void l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, struct lcore_conf *qconf) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; uint16_t dst_port; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + 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 *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); #ifdef DO_RFC_1812_CHECKS /* Check to make sure the packet is valid (RFC1812) */ @@ -51,7 +51,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid, struct ipv6_hdr *ipv6_hdr; ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); dst_port = lpm_get_ipv6_dst_port(ipv6_hdr, portid, qconf->ipv6_lookup_struct); diff --git a/examples/l3fwd/l3fwd_lpm_altivec.h b/examples/l3fwd/l3fwd_lpm_altivec.h index 4c9e2438b6..b36e991acc 100644 --- a/examples/l3fwd/l3fwd_lpm_altivec.h +++ b/examples/l3fwd/l3fwd_lpm_altivec.h @@ -18,28 +18,28 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], uint32_t *ipv4_flag) { struct ipv4_hdr *ipv4_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t x0, x1, x2, x3; - eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *); ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1); x3 = ipv4_hdr->dst_addr; ipv4_flag[0] &= pkt[3]->packet_type; diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h index 02ec0d8027..a3e42cfa72 100644 --- a/examples/l3fwd/l3fwd_lpm_neon.h +++ b/examples/l3fwd/l3fwd_lpm_neon.h @@ -19,25 +19,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], uint32_t *ipv4_flag) { struct ipv4_hdr *ipv4_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; int32_t dst[FWDSTEP]; - eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *); ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1); dst[3] = ipv4_hdr->dst_addr; ipv4_flag[0] &= pkt[3]->packet_type; @@ -98,14 +98,14 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, if (k) { for (i = 0; i < FWDSTEP; i++) { rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i], - struct ether_hdr *) + 1); + struct rte_ether_hdr *) + 1); } for (j = 0; j != k - FWDSTEP; j += FWDSTEP) { for (i = 0; i < FWDSTEP; i++) { rte_prefetch0(rte_pktmbuf_mtod( pkts_burst[j + i + FWDSTEP], - struct ether_hdr *) + 1); + struct rte_ether_hdr *) + 1); } processx4_step1(&pkts_burst[j], &dip, &ipv4_flag); @@ -125,17 +125,17 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst, switch (m) { case 3: rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], - struct ether_hdr *) + 1); + struct rte_ether_hdr *) + 1); j++; /* fallthrough */ case 2: rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], - struct ether_hdr *) + 1); + struct rte_ether_hdr *) + 1); j++; /* fallthrough */ case 1: rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j], - struct ether_hdr *) + 1); + struct rte_ether_hdr *) + 1); j++; } diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h index 1d16159069..4603e0749c 100644 --- a/examples/l3fwd/l3fwd_lpm_sse.h +++ b/examples/l3fwd/l3fwd_lpm_sse.h @@ -16,25 +16,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], uint32_t *ipv4_flag) { struct ipv4_hdr *ipv4_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t x0, x1, x2, x3; - eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *); ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1); x3 = ipv4_hdr->dst_addr; ipv4_flag[0] &= pkt[3]->packet_type; diff --git a/examples/l3fwd/l3fwd_neon.h b/examples/l3fwd/l3fwd_neon.h index 76ccdfa734..af2dc47ac2 100644 --- a/examples/l3fwd/l3fwd_neon.h +++ b/examples/l3fwd/l3fwd_neon.h @@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP]) vst1q_u32(p[2], ve[2]); vst1q_u32(p[3], ve[3]); - rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1), + 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 ether_hdr *)p[1] + 1), + 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 ether_hdr *)p[2] + 1), + 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 ether_hdr *)p[3] + 1), + rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1), &dst_port[3], pkt[3]->packet_type); } @@ -104,10 +104,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1, static inline void process_packet(struct rte_mbuf *pkt, uint16_t *dst_port) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32x4_t te, ve; - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); te = vld1q_u32((uint32_t *)eth_hdr); ve = vreinterpretq_u32_s32(val_eth[dst_port[0]]); diff --git a/examples/l3fwd/l3fwd_sse.h b/examples/l3fwd/l3fwd_sse.h index ed5267c112..3349f27478 100644 --- a/examples/l3fwd/l3fwd_sse.h +++ b/examples/l3fwd/l3fwd_sse.h @@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP]) _mm_storeu_si128(p[2], te[2]); _mm_storeu_si128(p[3], te[3]); - rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1), + 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 ether_hdr *)p[1] + 1), + 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 ether_hdr *)p[2] + 1), + 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 ether_hdr *)p[3] + 1), + rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1), &dst_port[3], pkt[3]->packet_type); } @@ -101,10 +101,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2) static inline void process_packet(struct rte_mbuf *pkt, uint16_t *dst_port) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; __m128i te, ve; - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); te = _mm_loadu_si128((__m128i *)eth_hdr); ve = val_eth[dst_port[0]]; diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 7b9683187b..b0a700ab15 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -81,7 +81,7 @@ volatile bool force_quit; /* ethernet addresses of ports */ uint64_t dest_eth_addr[RTE_MAX_ETHPORTS]; -struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; xmm_t val_eth[RTE_MAX_ETHPORTS]; @@ -647,7 +647,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr); @@ -908,14 +908,14 @@ main(int argc, char **argv) print_ethaddr(" Address:", &ports_eth_addr[portid]); printf(", "); print_ethaddr("Destination:", - (const struct ether_addr *)&dest_eth_addr[portid]); + (const struct rte_ether_addr *)&dest_eth_addr[portid]); printf(", "); /* * prepare src MACs for each port. */ ether_addr_copy(&ports_eth_addr[portid], - (struct ether_addr *)(val_eth + portid) + 1); + (struct rte_ether_addr *)(val_eth + portid) + 1); /* init memory */ if (!per_port_pool) { diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index f3346d23b4..9997c58f4a 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -53,7 +53,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr lsi_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr lsi_ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint32_t lsi_enabled_port_mask = 0; @@ -163,13 +163,13 @@ print_stats(void) static void lsi_simple_forward(struct rte_mbuf *m, unsigned portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; unsigned dst_port = lsi_dst_ports[portid]; int sent; struct rte_eth_dev_tx_buffer *buffer; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c index 39a846a563..f39681d72f 100644 --- a/examples/load_balancer/runtime.c +++ b/examples/load_balancer/runtime.c @@ -507,9 +507,9 @@ app_lcore_worker( } pkt = lp->mbuf_in.array[j]; - ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, - struct ipv4_hdr *, - sizeof(struct ether_hdr)); + ipv4_hdr = rte_pktmbuf_mtod_offset( + pkt, struct ipv4_hdr *, + sizeof(struct rte_ether_hdr)); ipv4_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr); if (unlikely(rte_lpm_lookup(lp->lpm_table, ipv4_dst, &port) != 0)) { diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index 0ddc63e925..9a8e422d41 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -66,7 +66,7 @@ get_printable_mac_addr(uint16_t port) if (unlikely(port >= RTE_MAX_ETHPORTS)) return err_address; if (unlikely(addresses[port][0]=='\0')){ - struct ether_addr mac; + struct rte_ether_addr mac; rte_eth_macaddr_get(port, &mac); snprintf(addresses[port], sizeof(addresses[port]), "%02x:%02x:%02x:%02x:%02x:%02x\n", diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c index 149bfdd02c..ca312029e2 100644 --- a/examples/packet_ordering/main.c +++ b/examples/packet_ordering/main.c @@ -255,7 +255,7 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[]) static inline int configure_eth_port(uint16_t port_id) { - struct ether_addr addr; + struct rte_ether_addr addr; const uint16_t rxRings = 1, txRings = 1; int ret; uint16_t q; diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 4f8747bc3e..b29ed9e978 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -92,11 +92,11 @@ check_ptype(int portid) static inline void parse_ptype(struct rte_mbuf *m) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t packet_type = RTE_PTYPE_UNKNOWN; uint16_t ether_type; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ether_type = eth_hdr->ether_type; if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN; @@ -186,7 +186,7 @@ static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ static uint64_t dest_eth_addr[RTE_MAX_ETHPORTS]; -static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; static xmm_t val_eth[RTE_MAX_ETHPORTS]; @@ -884,39 +884,39 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) static inline void simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { - struct ether_hdr *eth_hdr[8]; + struct rte_ether_hdr *eth_hdr[8]; struct ipv4_hdr *ipv4_hdr[8]; uint16_t dst_port[8]; int32_t ret[8]; union ipv4_5tuple_host key[8]; __m128i data[8]; - eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct ether_hdr *); - eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct ether_hdr *); - eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct ether_hdr *); - eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct ether_hdr *); - eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct ether_hdr *); - eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct ether_hdr *); - eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct ether_hdr *); - eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct rte_ether_hdr *); + eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct rte_ether_hdr *); + eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct rte_ether_hdr *); + eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct rte_ether_hdr *); + eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct rte_ether_hdr *); + eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct rte_ether_hdr *); + eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct rte_ether_hdr *); + eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct rte_ether_hdr *); /* Handle IPv4 headers.*/ ipv4_hdr[0] = rte_pktmbuf_mtod_offset(m[0], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_hdr[1] = rte_pktmbuf_mtod_offset(m[1], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_hdr[2] = rte_pktmbuf_mtod_offset(m[2], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_hdr[3] = rte_pktmbuf_mtod_offset(m[3], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_hdr[4] = rte_pktmbuf_mtod_offset(m[4], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_hdr[5] = rte_pktmbuf_mtod_offset(m[5], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_hdr[6] = rte_pktmbuf_mtod_offset(m[6], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_hdr[7] = rte_pktmbuf_mtod_offset(m[7], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); #ifdef DO_RFC_1812_CHECKS /* Check to make sure the packet is valid (RFC1812) */ @@ -967,28 +967,28 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) #endif /* End of #ifdef DO_RFC_1812_CHECKS */ data[0] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[0], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); data[1] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[1], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); data[2] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[2], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); data[3] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[3], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); data[4] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[4], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); data[5] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[5], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); data[6] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[6], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); data[7] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[7], __m128i *, - sizeof(struct ether_hdr) + + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live))); key[0].xmm = _mm_and_si128(data[0], mask0); @@ -1094,13 +1094,13 @@ static inline void get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0, __m128i mask1, union ipv6_5tuple_host *key) { __m128i tmpdata0 = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m0, - __m128i *, sizeof(struct ether_hdr) + + __m128i *, sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len))); __m128i tmpdata1 = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m0, - __m128i *, sizeof(struct ether_hdr) + + __m128i *, sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len) + sizeof(__m128i))); __m128i tmpdata2 = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m0, - __m128i *, sizeof(struct ether_hdr) + + __m128i *, sizeof(struct rte_ether_hdr) + offsetof(struct ipv6_hdr, payload_len) + sizeof(__m128i) + sizeof(__m128i))); key->xmm[0] = _mm_and_si128(tmpdata0, mask0); @@ -1113,37 +1113,37 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) { int32_t ret[8]; uint16_t dst_port[8]; - struct ether_hdr *eth_hdr[8]; + struct rte_ether_hdr *eth_hdr[8]; union ipv6_5tuple_host key[8]; __attribute__((unused)) struct ipv6_hdr *ipv6_hdr[8]; - eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct ether_hdr *); - eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct ether_hdr *); - eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct ether_hdr *); - eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct ether_hdr *); - eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct ether_hdr *); - eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct ether_hdr *); - eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct ether_hdr *); - eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct ether_hdr *); + eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct rte_ether_hdr *); + eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct rte_ether_hdr *); + eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct rte_ether_hdr *); + eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct rte_ether_hdr *); + eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct rte_ether_hdr *); + eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct rte_ether_hdr *); + eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct rte_ether_hdr *); + eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct rte_ether_hdr *); /* Handle IPv6 headers.*/ ipv6_hdr[0] = rte_pktmbuf_mtod_offset(m[0], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv6_hdr[1] = rte_pktmbuf_mtod_offset(m[1], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv6_hdr[2] = rte_pktmbuf_mtod_offset(m[2], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv6_hdr[3] = rte_pktmbuf_mtod_offset(m[3], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv6_hdr[4] = rte_pktmbuf_mtod_offset(m[4], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv6_hdr[5] = rte_pktmbuf_mtod_offset(m[5], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv6_hdr[6] = rte_pktmbuf_mtod_offset(m[6], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv6_hdr[7] = rte_pktmbuf_mtod_offset(m[7], struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); get_ipv6_5tuple(m[0], mask1, mask2, &key[0]); get_ipv6_5tuple(m[1], mask1, mask2, &key[1]); @@ -1228,16 +1228,16 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid) static __rte_always_inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; uint16_t dst_port; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + 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 *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); #ifdef DO_RFC_1812_CHECKS /* Check to make sure the packet is valid (RFC1812) */ @@ -1270,7 +1270,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid) struct ipv6_hdr *ipv6_hdr; ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); dst_port = get_ipv6_dst_port(ipv6_hdr, portid, RTE_PER_LCORE(lcore_conf)->ipv6_lookup_struct); @@ -1346,7 +1346,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) { uint32_t next_hop; struct ipv6_hdr *ipv6_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) { return (uint16_t) ((rte_lpm_lookup( @@ -1355,7 +1355,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) } else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) { - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1); return (uint16_t) ((rte_lpm6_lookup( @@ -1371,13 +1371,13 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid) static inline void process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint16_t portid) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; uint32_t dst_ipv4; uint16_t dp; __m128i te, ve; - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1); dst_ipv4 = ipv4_hdr->dst_addr; @@ -1403,25 +1403,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP], uint32_t *ipv4_flag) { struct ipv4_hdr *ipv4_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint32_t x0, x1, x2, x3; - eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *); ipv4_hdr = (struct 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 ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *); ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1); x3 = ipv4_hdr->dst_addr; ipv4_flag[0] &= pkt[3]->packet_type; @@ -1503,13 +1503,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP]) _mm_store_si128(p[2], te[2]); _mm_store_si128(p[3], te[3]); - rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1), + 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 ether_hdr *)p[1] + 1), + 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 ether_hdr *)p[2] + 1), + 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 ether_hdr *)p[3] + 1), + rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1), &dst_port[3], pkt[3]->packet_type); } @@ -3020,7 +3020,7 @@ parse_args(int argc, char **argv) } static void -print_ethaddr(const char *name, const struct ether_addr *eth_addr) +print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr) { char buf[ETHER_ADDR_FMT_SIZE]; @@ -3576,14 +3576,14 @@ main(int argc, char **argv) print_ethaddr(" Address:", &ports_eth_addr[portid]); printf(", "); print_ethaddr("Destination:", - (const struct ether_addr *)&dest_eth_addr[portid]); + (const struct rte_ether_addr *)&dest_eth_addr[portid]); printf(", "); /* * prepare src MACs for each port. */ ether_addr_copy(&ports_eth_addr[portid], - (struct ether_addr *)(val_eth + portid) + 1); + (struct rte_ether_addr *)(val_eth + portid) + 1); /* init memory */ ret = init_mem(NB_MBUF); diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index 82ae71c190..7d28f59ceb 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -53,7 +53,7 @@ static const struct rte_eth_conf port_conf_default = { }, }; -static const struct ether_addr ether_multicast = { +static const struct rte_ether_addr ether_multicast = { .addr_bytes = {0x01, 0x1b, 0x19, 0x0, 0x0, 0x0} }; @@ -334,7 +334,7 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx) struct ptp_header *ptp_hdr; ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(ptp_data->m, char *) - + sizeof(struct ether_hdr)); + + sizeof(struct rte_ether_hdr)); ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id); if (ptp_data->ptpset == 0) { @@ -361,20 +361,20 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx) static void parse_fup(struct ptpv2_data_slave_ordinary *ptp_data) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ptp_header *ptp_hdr; struct clock_id *client_clkid; struct ptp_message *ptp_msg; struct rte_mbuf *created_pkt; struct tstamp *origin_tstamp; - struct ether_addr eth_multicast = ether_multicast; + struct rte_ether_addr eth_multicast = ether_multicast; size_t pkt_size; int wait_us; struct rte_mbuf *m = ptp_data->m; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(m, char *) - + sizeof(struct ether_hdr)); + + sizeof(struct rte_ether_hdr)); if (memcmp(&ptp_data->master_clock_id, &ptp_hdr->source_port_id.clock_id, sizeof(struct clock_id)) != 0) @@ -382,7 +382,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data) ptp_data->seqID_FOLLOWUP = rte_be_to_cpu_16(ptp_hdr->seq_id); ptp_msg = (struct ptp_message *) (rte_pktmbuf_mtod(m, char *) + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); origin_tstamp = &ptp_msg->follow_up.precise_origin_tstamp; ptp_data->tstamp1.tv_nsec = ntohl(origin_tstamp->ns); @@ -393,11 +393,11 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data) if (ptp_data->seqID_FOLLOWUP == ptp_data->seqID_SYNC) { created_pkt = rte_pktmbuf_alloc(mbuf_pool); - pkt_size = sizeof(struct ether_hdr) + + pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct ptp_message); created_pkt->data_len = pkt_size; created_pkt->pkt_len = pkt_size; - eth_hdr = rte_pktmbuf_mtod(created_pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *); rte_eth_macaddr_get(ptp_data->portid, ð_hdr->s_addr); /* Set multicast address 01-1B-19-00-00-00. */ @@ -406,7 +406,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data) eth_hdr->ether_type = htons(PTP_PROTOCOL); ptp_msg = (struct ptp_message *) (rte_pktmbuf_mtod(created_pkt, char *) + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ptp_msg->delay_req.hdr.seq_id = htons(ptp_data->seqID_SYNC); ptp_msg->delay_req.hdr.msg_type = DELAY_REQ; @@ -499,7 +499,7 @@ parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data) uint16_t seq_id; ptp_msg = (struct ptp_message *) (rte_pktmbuf_mtod(m, char *) + - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); seq_id = rte_be_to_cpu_16(ptp_msg->delay_resp.hdr.seq_id); if (memcmp(&ptp_data->client_clock_id, &ptp_msg->delay_resp.req_port_id.clock_id, @@ -535,17 +535,17 @@ parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data) static void parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) { struct ptp_header *ptp_hdr; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t eth_type; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); eth_type = rte_be_to_cpu_16(eth_hdr->ether_type); if (eth_type == PTP_PROTOCOL) { ptp_data.m = m; ptp_data.portid = portid; ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(m, char *) - + sizeof(struct ether_hdr)); + + sizeof(struct rte_ether_hdr)); switch (ptp_hdr->msg_type) { case SYNC: diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index 9b0112449b..431e84f4e2 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -145,7 +145,8 @@ app_pkt_handle(struct rte_mbuf *pkt, uint64_t time) { uint8_t input_color, output_color; uint8_t *pkt_data = rte_pktmbuf_mtod(pkt, uint8_t *); - uint32_t pkt_len = rte_pktmbuf_pkt_len(pkt) - sizeof(struct ether_hdr); + uint32_t pkt_len = rte_pktmbuf_pkt_len(pkt) - + sizeof(struct rte_ether_hdr); uint8_t flow_id = (uint8_t)(pkt_data[APP_PKT_FLOW_POS] & (APP_FLOWS_MAX - 1)); input_color = pkt_data[APP_PKT_COLOR_POS]; enum policer_action action; diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c index c55d38744f..61e92a8208 100644 --- a/examples/quota_watermark/qw/main.c +++ b/examples/quota_watermark/qw/main.c @@ -50,8 +50,8 @@ static void send_pause_frame(uint16_t port_id, uint16_t duration) { struct rte_mbuf *mbuf; struct ether_fc_frame *pause_frame; - struct ether_hdr *hdr; - struct ether_addr mac_addr; + struct rte_ether_hdr *hdr; + struct rte_ether_addr mac_addr; RTE_LOG_DP(DEBUG, USER1, "Sending PAUSE frame (duration=%d) on port %d\n", @@ -63,7 +63,7 @@ static void send_pause_frame(uint16_t port_id, uint16_t duration) return; /* Prepare a PAUSE frame */ - hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr *); + hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *); pause_frame = (struct ether_fc_frame *) &hdr[1]; rte_eth_macaddr_get(port_id, &mac_addr); diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c index 2058be627e..a277519f55 100644 --- a/examples/rxtx_callbacks/main.c +++ b/examples/rxtx_callbacks/main.c @@ -115,7 +115,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) if (retval < 0) return retval; - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 diff --git a/examples/server_node_efd/node/node.c b/examples/server_node_efd/node/node.c index 3b97fbd45d..8bec351ec1 100644 --- a/examples/server_node_efd/node/node.c +++ b/examples/server_node_efd/node/node.c @@ -275,7 +275,7 @@ handle_packets(struct rte_hash *h, struct rte_mbuf **bufs, uint16_t num_packets) for (i = 0; i < num_packets; i++) { /* Handle IPv4 header.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = &ipv4_dst_ip[i]; } diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c index 404f1f165b..a086c5a779 100644 --- a/examples/server_node_efd/server/main.c +++ b/examples/server_node_efd/server/main.c @@ -68,7 +68,7 @@ get_printable_mac_addr(uint16_t port) { static const char err_address[] = "00:00:00:00:00:00"; static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)]; - struct ether_addr mac; + struct rte_ether_addr mac; if (unlikely(port >= RTE_MAX_ETHPORTS)) return err_address; @@ -253,7 +253,7 @@ process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[], for (i = 0; i < rx_count; i++) { /* Handle IPv4 header.*/ ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct ipv4_hdr *, - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); ipv4_dst_ip[i] = ipv4_hdr->dst_addr; key_ptrs[i] = (void *)&ipv4_dst_ip[i]; } diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c index 4aba1dc384..7e3cd87158 100644 --- a/examples/skeleton/basicfwd.c +++ b/examples/skeleton/basicfwd.c @@ -82,7 +82,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; /* Display the port MAC address. */ - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c index e0fe7bd2ff..9d8ab17ddc 100644 --- a/examples/tep_termination/main.c +++ b/examples/tep_termination/main.c @@ -157,7 +157,7 @@ uint16_t ports[RTE_MAX_ETHPORTS]; static unsigned nb_ports; /**< The number of ports specified in command line */ /* ethernet addresses of ports */ -struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; /* heads for the main used and free linked lists for the data path. */ static struct virtio_net_data_ll *ll_root_used; diff --git a/examples/tep_termination/main.h b/examples/tep_termination/main.h index 966c63a51d..7a70f7396f 100644 --- a/examples/tep_termination/main.h +++ b/examples/tep_termination/main.h @@ -50,7 +50,7 @@ struct vhost_dev { /**< Memory region information for gpa to hpa translation. */ struct virtio_memory_regions_hpa *regions_hpa; /**< Device MAC address (Obtained on first TX packet). */ - struct ether_addr mac_address; + struct rte_ether_addr mac_address; /**< RX queue number. */ uint16_t rx_q; /**< Data core that the device is added to. */ diff --git a/examples/tep_termination/vxlan.c b/examples/tep_termination/vxlan.c index 7732821d9c..6545b8ae4f 100644 --- a/examples/tep_termination/vxlan.c +++ b/examples/tep_termination/vxlan.c @@ -28,19 +28,20 @@ get_psd_sum(void *l3_hdr, uint16_t ethertype, uint64_t ol_flags) * header. */ static void -parse_ethernet(struct ether_hdr *eth_hdr, union tunnel_offload_info *info, +parse_ethernet(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *info, uint8_t *l4_proto) { struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; uint16_t ethertype; - info->outer_l2_len = sizeof(struct ether_hdr); + info->outer_l2_len = sizeof(struct rte_ether_hdr); ethertype = rte_be_to_cpu_16(eth_hdr->ether_type); if (ethertype == ETHER_TYPE_VLAN) { - struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); - info->outer_l2_len += sizeof(struct vlan_hdr); + struct rte_vlan_hdr *vlan_hdr = + (struct rte_vlan_hdr *)(eth_hdr + 1); + info->outer_l2_len += sizeof(struct rte_vlan_hdr); ethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto); } @@ -68,7 +69,8 @@ parse_ethernet(struct ether_hdr *eth_hdr, union tunnel_offload_info *info, * Calculate the checksum of a packet in hardware */ static uint64_t -process_inner_cksums(struct ether_hdr *eth_hdr, union tunnel_offload_info *info) +process_inner_cksums(struct rte_ether_hdr *eth_hdr, + union tunnel_offload_info *info) { void *l3_hdr = NULL; uint8_t l4_proto; @@ -80,12 +82,13 @@ process_inner_cksums(struct ether_hdr *eth_hdr, union tunnel_offload_info *info) struct sctp_hdr *sctp_hdr; uint64_t ol_flags = 0; - info->l2_len = sizeof(struct ether_hdr); + info->l2_len = sizeof(struct rte_ether_hdr); ethertype = rte_be_to_cpu_16(eth_hdr->ether_type); if (ethertype == ETHER_TYPE_VLAN) { - struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); - info->l2_len += sizeof(struct vlan_hdr); + struct rte_vlan_hdr *vlan_hdr = + (struct rte_vlan_hdr *)(eth_hdr + 1); + info->l2_len += sizeof(struct rte_vlan_hdr); ethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto); } @@ -141,7 +144,8 @@ decapsulation(struct rte_mbuf *pkt) uint16_t outer_header_len; struct udp_hdr *udp_hdr; union tunnel_offload_info info = { .data = 0 }; - struct ether_hdr *phdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + struct rte_ether_hdr *phdr = + rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); parse_ethernet(phdr, &info, &l4_proto); @@ -158,7 +162,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 vxlan_hdr); + + sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr); rte_pktmbuf_adj(pkt, outer_header_len); @@ -172,29 +176,31 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id) uint64_t ol_flags = 0; uint32_t old_len = m->pkt_len, hash; union tunnel_offload_info tx_offload = { .data = 0 }; - struct ether_hdr *phdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + struct rte_ether_hdr *phdr = + rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /*Allocate space for new ethernet, IPv4, UDP and VXLAN headers*/ - struct ether_hdr *pneth = (struct ether_hdr *) rte_pktmbuf_prepend(m, - sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) - + sizeof(struct udp_hdr) + sizeof(struct vxlan_hdr)); + struct rte_ether_hdr *pneth = + (struct rte_ether_hdr *) rte_pktmbuf_prepend(m, + sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) + + sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr)); struct ipv4_hdr *ip = (struct ipv4_hdr *) &pneth[1]; struct udp_hdr *udp = (struct udp_hdr *) &ip[1]; - struct vxlan_hdr *vxlan = (struct vxlan_hdr *) &udp[1]; + struct rte_vxlan_hdr *vxlan = (struct rte_vxlan_hdr *) &udp[1]; /* convert TX queue ID to vport ID */ vport_id = queue_id - 1; /* replace original Ethernet header with ours */ pneth = rte_memcpy(pneth, &app_l2_hdr[vport_id], - sizeof(struct ether_hdr)); + sizeof(struct rte_ether_hdr)); /* copy in IP header */ ip = rte_memcpy(ip, &app_ip_hdr[vport_id], sizeof(struct ipv4_hdr)); ip->total_length = rte_cpu_to_be_16(m->pkt_len - - sizeof(struct ether_hdr)); + - sizeof(struct rte_ether_hdr)); /* outer IP checksum */ ol_flags |= PKT_TX_OUTER_IP_CKSUM; @@ -209,7 +215,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id) m->l2_len += ETHER_VXLAN_HLEN; } - m->outer_l2_len = sizeof(struct ether_hdr); + m->outer_l2_len = sizeof(struct rte_ether_hdr); m->outer_l3_len = sizeof(struct ipv4_hdr); ol_flags |= PKT_TX_TUNNEL_VXLAN; @@ -225,7 +231,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id) udp->dgram_cksum = 0; udp->dgram_len = rte_cpu_to_be_16(old_len + sizeof(struct udp_hdr) - + sizeof(struct vxlan_hdr)); + + sizeof(struct rte_vxlan_hdr)); udp->dst_port = rte_cpu_to_be_16(vxdev.dst_port); hash = rte_hash_crc(phdr, 2 * ETHER_ADDR_LEN, phdr->ether_type); diff --git a/examples/tep_termination/vxlan.h b/examples/tep_termination/vxlan.h index bff786a2af..780ae73cc5 100644 --- a/examples/tep_termination/vxlan.h +++ b/examples/tep_termination/vxlan.h @@ -17,15 +17,15 @@ #define DEFAULT_VXLAN_PORT 4789 extern struct ipv4_hdr app_ip_hdr[VXLAN_N_PORTS]; -extern struct ether_hdr app_l2_hdr[VXLAN_N_PORTS]; +extern struct rte_ether_hdr app_l2_hdr[VXLAN_N_PORTS]; extern uint8_t tx_checksum; extern uint16_t tso_segsz; struct vxlan_port { uint32_t vport_id; /**< VirtIO port id */ uint32_t peer_ip; /**< remote VTEP IP address */ - struct ether_addr peer_mac; /**< remote VTEP MAC address */ - struct ether_addr vport_mac; /**< VirtIO port MAC address */ + struct rte_ether_addr peer_mac; /**< remote VTEP MAC address */ + struct rte_ether_addr vport_mac; /**< VirtIO port MAC address */ } __rte_cache_aligned; struct vxlan_conf { diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c index ad7fbe9c61..e4af7bc4d9 100644 --- a/examples/tep_termination/vxlan_setup.c +++ b/examples/tep_termination/vxlan_setup.c @@ -49,7 +49,7 @@ struct vxlan_conf vxdev; struct ipv4_hdr app_ip_hdr[VXLAN_N_PORTS]; -struct ether_hdr app_l2_hdr[VXLAN_N_PORTS]; +struct rte_ether_hdr app_l2_hdr[VXLAN_N_PORTS]; /* local VTEP IP address */ uint8_t vxlan_multicast_ips[2][4] = { {239, 1, 1, 1 }, {239, 1, 2, 1 } }; @@ -227,7 +227,7 @@ int vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m) { int i, ret; - struct ether_hdr *pkt_hdr; + struct rte_ether_hdr *pkt_hdr; uint64_t portid = vdev->vid; struct ipv4_hdr *ip; @@ -242,7 +242,7 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m) } /* Learn MAC address of guest device from packet */ - pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); if (is_same_ether_addr(&(pkt_hdr->s_addr), &vdev->mac_address)) { RTE_LOG(INFO, VHOST_DATA, "(%d) WARNING: This device is using an existing" diff --git a/examples/tep_termination/vxlan_setup.h b/examples/tep_termination/vxlan_setup.h index 2c20e2e399..4dc37d673d 100644 --- a/examples/tep_termination/vxlan_setup.h +++ b/examples/tep_termination/vxlan_setup.h @@ -9,7 +9,7 @@ extern uint16_t nb_devices; extern uint16_t udp_port; extern uint8_t filter_idx; extern uint16_t ports[RTE_MAX_ETHPORTS]; -extern struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; +extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS]; extern uint32_t enable_stats; extern struct device_statistics dev_statistics[MAX_DEVICES]; extern uint8_t rx_decap; diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 8f7b758c3d..cd1a51bfa5 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -161,7 +161,7 @@ const uint16_t vlan_tags[] = { }; /* ethernet addresses of ports */ -static struct ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS]; static struct vhost_dev_tailq_list vhost_dev_list = TAILQ_HEAD_INITIALIZER(vhost_dev_list); @@ -660,7 +660,7 @@ static unsigned check_ports_num(unsigned nb_ports) } static __rte_always_inline struct vhost_dev * -find_vhost_dev(struct ether_addr *mac) +find_vhost_dev(struct rte_ether_addr *mac) { struct vhost_dev *vdev; @@ -680,11 +680,11 @@ find_vhost_dev(struct ether_addr *mac) static int link_vmdq(struct vhost_dev *vdev, struct rte_mbuf *m) { - struct ether_hdr *pkt_hdr; + struct rte_ether_hdr *pkt_hdr; int i, ret; /* Learn MAC address of guest device from packet */ - pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); if (find_vhost_dev(&pkt_hdr->s_addr)) { RTE_LOG(ERR, VHOST_DATA, @@ -786,10 +786,10 @@ virtio_xmit(struct vhost_dev *dst_vdev, struct vhost_dev *src_vdev, static __rte_always_inline int virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m) { - struct ether_hdr *pkt_hdr; + struct rte_ether_hdr *pkt_hdr; struct vhost_dev *dst_vdev; - pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); dst_vdev = find_vhost_dev(&pkt_hdr->d_addr); if (!dst_vdev) @@ -824,7 +824,8 @@ find_local_dest(struct vhost_dev *vdev, struct rte_mbuf *m, uint32_t *offset, uint16_t *vlan_tag) { struct vhost_dev *dst_vdev; - struct ether_hdr *pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + struct rte_ether_hdr *pkt_hdr = + rte_pktmbuf_mtod(m, struct rte_ether_hdr *); dst_vdev = find_vhost_dev(&pkt_hdr->d_addr); if (!dst_vdev) @@ -866,7 +867,8 @@ static void virtio_tx_offload(struct rte_mbuf *m) void *l3_hdr; struct ipv4_hdr *ipv4_hdr = NULL; struct tcp_hdr *tcp_hdr = NULL; - struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + struct rte_ether_hdr *eth_hdr = + rte_pktmbuf_mtod(m, struct rte_ether_hdr *); l3_hdr = (char *)eth_hdr + m->l2_len; @@ -910,10 +912,10 @@ virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag) struct mbuf_table *tx_q; unsigned offset = 0; const uint16_t lcore_id = rte_lcore_id(); - struct ether_hdr *nh; + struct rte_ether_hdr *nh; - nh = rte_pktmbuf_mtod(m, struct ether_hdr *); + nh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); if (unlikely(is_broadcast_ether_addr(&nh->d_addr))) { struct vhost_dev *vdev2; @@ -946,10 +948,10 @@ queue2nic: /*Add packet to the port tx queue*/ tx_q = &lcore_tx_queue[lcore_id]; - nh = rte_pktmbuf_mtod(m, struct ether_hdr *); + nh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); if (unlikely(nh->ether_type == rte_cpu_to_be_16(ETHER_TYPE_VLAN))) { /* Guest has inserted the vlan tag. */ - struct vlan_hdr *vh = (struct vlan_hdr *) (nh + 1); + struct rte_vlan_hdr *vh = (struct rte_vlan_hdr *) (nh + 1); uint16_t vlan_tag_be = rte_cpu_to_be_16(vlan_tag); if ((vm2vm_mode == VM2VM_HARDWARE) && (vh->vlan_tci != vlan_tag_be)) diff --git a/examples/vhost/main.h b/examples/vhost/main.h index 764c33afed..7cba0edbff 100644 --- a/examples/vhost/main.h +++ b/examples/vhost/main.h @@ -35,7 +35,7 @@ struct vhost_dev { /**< Number of memory regions for gpa to hpa translation. */ uint32_t nregions_hpa; /**< Device MAC address (Obtained on first TX packet). */ - struct ether_addr mac_address; + struct rte_ether_addr mac_address; /**< RX VMDQ queue number. */ uint16_t vmdq_rx_q; /**< Vlan tag assigned to the pool */ diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c index 4a287109b1..1194f62f8e 100644 --- a/examples/vm_power_manager/channel_monitor.c +++ b/examples/vm_power_manager/channel_monitor.c @@ -56,12 +56,12 @@ static struct policy policies[MAX_CLIENTS]; #ifdef USE_JANSSON union PFID { - struct ether_addr addr; + struct rte_ether_addr addr; uint64_t pfid; }; static int -str_to_ether_addr(const char *a, struct ether_addr *ether_addr) +str_to_ether_addr(const char *a, struct rte_ether_addr *ether_addr) { int i; char *end; @@ -404,7 +404,7 @@ get_pfid(struct policy *pol) RTE_ETH_FOREACH_DEV(x) { ret = rte_pmd_i40e_query_vfid_by_mac(x, - (struct ether_addr *)&(pol->pkt.vfid[i])); + (struct rte_ether_addr *)&(pol->pkt.vfid[i])); if (ret != -EINVAL) { pol->port[i] = x; break; diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c index 2d9e7689a7..78c3aa0a1e 100644 --- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c +++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c @@ -34,7 +34,7 @@ struct cmd_quit_result { }; union PFID { - struct ether_addr addr; + struct rte_ether_addr addr; uint64_t pfid; }; diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c index 5fa13fe621..f8cab1162b 100644 --- a/examples/vm_power_manager/main.c +++ b/examples/vm_power_manager/main.c @@ -105,7 +105,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; /* Display the port MAC address. */ - struct ether_addr addr; + struct rte_ether_addr addr; rte_eth_macaddr_get(port, &addr); printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n", @@ -355,7 +355,7 @@ main(int argc, char **argv) /* Initialize ports. */ RTE_ETH_FOREACH_DEV(portid) { - struct ether_addr eth; + struct rte_ether_addr eth; int w, j; int ret; diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c index 627a5da485..5195a515a3 100644 --- a/examples/vmdq/main.c +++ b/examples/vmdq/main.c @@ -106,12 +106,12 @@ const uint16_t num_vlans = RTE_DIM(vlan_tags); static uint16_t num_pf_queues, num_vmdq_queues; static uint16_t vmdq_pool_base, vmdq_queue_base; /* pool mac addr template, pool mac addr is like: 52 54 00 12 port# pool# */ -static struct ether_addr pool_addr_template = { +static struct rte_ether_addr pool_addr_template = { .addr_bytes = {0x52, 0x54, 0x00, 0x12, 0x00, 0x00} }; /* ethernet addresses of ports */ -static struct ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS]; #define MAX_QUEUE_NUM_10G 128 #define MAX_QUEUE_NUM_1G 8 @@ -281,7 +281,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) * Removes this after i40e fixes this issue. */ for (q = 0; q < num_pools; q++) { - struct ether_addr mac; + struct rte_ether_addr mac; mac = pool_addr_template; mac.addr_bytes[4] = port; mac.addr_bytes[5] = q; @@ -407,10 +407,10 @@ vmdq_parse_args(int argc, char **argv) static void update_mac_address(struct rte_mbuf *m, unsigned dst_port) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c index 646368395e..75cf31a106 100644 --- a/examples/vmdq_dcb/main.c +++ b/examples/vmdq_dcb/main.c @@ -121,12 +121,12 @@ const uint16_t vlan_tags[] = { const uint16_t num_vlans = RTE_DIM(vlan_tags); /* pool mac addr template, pool mac addr is like: 52 54 00 12 port# pool# */ -static struct ether_addr pool_addr_template = { +static struct rte_ether_addr pool_addr_template = { .addr_bytes = {0x52, 0x54, 0x00, 0x12, 0x00, 0x00} }; /* ethernet addresses of ports */ -static struct ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS]; /* Builds up the correct configuration for vmdq+dcb based on the vlan tags array * given above, and the number of traffic classes available for use. */ @@ -332,7 +332,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) /* Set mac for each pool.*/ for (q = 0; q < num_pools; q++) { - struct ether_addr mac; + struct rte_ether_addr mac; mac = pool_addr_template; mac.addr_bytes[4] = port; @@ -494,10 +494,10 @@ vmdq_parse_args(int argc, char **argv) static void update_mac_address(struct rte_mbuf *m, unsigned dst_port) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; diff --git a/lib/librte_ethdev/rte_class_eth.c b/lib/librte_ethdev/rte_class_eth.c index cb99c92ece..e554668dac 100644 --- a/lib/librte_ethdev/rte_class_eth.c +++ b/lib/librte_ethdev/rte_class_eth.c @@ -44,7 +44,7 @@ eth_mac_cmp(const char *key __rte_unused, const char *value, void *opaque) { int ret; - struct ether_addr mac; + struct rte_ether_addr mac; const struct rte_eth_dev_data *data = opaque; struct rte_eth_dev_info dev_info; uint32_t index; diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h index 1ef4ed92b9..85c1e372ae 100644 --- a/lib/librte_ethdev/rte_eth_ctrl.h +++ b/lib/librte_ethdev/rte_eth_ctrl.h @@ -75,7 +75,7 @@ struct rte_eth_mac_filter { uint8_t is_vf; /**< 1 for VF, 0 for port dev */ uint16_t dst_id; /**< VF ID, available when is_vf is 1*/ enum rte_mac_filter_type filter_type; /**< MAC filter type */ - struct ether_addr mac_addr; + struct rte_ether_addr mac_addr; }; /** @@ -91,7 +91,7 @@ struct rte_eth_mac_filter { * RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. */ struct rte_eth_ethertype_filter { - struct ether_addr mac_addr; /**< Mac address to match. */ + struct rte_ether_addr mac_addr; /**< Mac address to match. */ uint16_t ether_type; /**< Ether type to match */ uint16_t flags; /**< Flags from RTE_ETHTYPE_FLAGS_* */ uint16_t queue; /**< Queue assigned to when match*/ @@ -216,8 +216,8 @@ enum rte_tunnel_iptype { * Tunneling Packet filter configuration. */ struct rte_eth_tunnel_filter_conf { - struct ether_addr outer_mac; /**< Outer MAC address to match. */ - struct ether_addr inner_mac; /**< Inner MAC address to match. */ + struct rte_ether_addr outer_mac; /**< Outer MAC address to match. */ + struct rte_ether_addr inner_mac; /**< Inner MAC address to match. */ uint16_t inner_vlan; /**< Inner VLAN to match. */ enum rte_tunnel_iptype ip_type; /**< IP address type. */ /** Outer destination IP address to match if ETH_TUNNEL_FILTER_OIP @@ -424,7 +424,7 @@ struct rte_eth_sctpv6_flow { * A structure used to define the input for MAC VLAN flow */ struct rte_eth_mac_vlan_flow { - struct ether_addr mac_addr; /**< Mac address to match. */ + struct rte_ether_addr mac_addr; /**< Mac address to match. */ }; /** @@ -444,7 +444,7 @@ struct rte_eth_tunnel_flow { enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to match. */ /** Tunnel ID to match. TNI, VNI... in big endian. */ uint32_t tunnel_id; - struct ether_addr mac_addr; /**< Mac address to match. */ + struct rte_ether_addr mac_addr; /**< Mac address to match. */ }; /** diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index d7cfa3d536..b868535c2e 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -1346,7 +1346,7 @@ static void rte_eth_dev_mac_restore(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) { - struct ether_addr *addr; + struct rte_ether_addr *addr; uint16_t i; uint32_t pool = 0; uint64_t pool_mask; @@ -2591,7 +2591,7 @@ rte_eth_dev_get_supported_ptypes(uint16_t port_id, uint32_t ptype_mask, } void -rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr) +rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr) { struct rte_eth_dev *dev; @@ -3078,7 +3078,7 @@ rte_eth_led_off(uint16_t port_id) * an empty spot. */ static int -get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) +get_mac_addr_index(uint16_t port_id, const struct rte_ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3094,10 +3094,10 @@ get_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) return -1; } -static const struct ether_addr null_mac_addr; +static const struct rte_ether_addr null_mac_addr; int -rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, +rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *addr, uint32_t pool) { struct rte_eth_dev *dev; @@ -3150,7 +3150,7 @@ rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *addr, } int -rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) +rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *addr) { struct rte_eth_dev *dev; int index; @@ -3181,7 +3181,7 @@ rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *addr) } int -rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) +rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct rte_ether_addr *addr) { struct rte_eth_dev *dev; int ret; @@ -3210,7 +3210,7 @@ rte_eth_dev_default_mac_addr_set(uint16_t port_id, struct ether_addr *addr) * an empty spot. */ static int -get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) +get_hash_mac_addr_index(uint16_t port_id, const struct rte_ether_addr *addr) { struct rte_eth_dev_info dev_info; struct rte_eth_dev *dev = &rte_eth_devices[port_id]; @@ -3229,7 +3229,7 @@ get_hash_mac_addr_index(uint16_t port_id, const struct ether_addr *addr) } int -rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, +rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, uint8_t on) { int index; @@ -4066,7 +4066,7 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id, int rte_eth_dev_set_mc_addr_list(uint16_t port_id, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { struct rte_eth_dev *dev; diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 1f35e1ddaf..bcc1bb71d9 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -2316,7 +2316,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id, * A pointer to a structure of type *ether_addr* to be filled with * the Ethernet address of the Ethernet device. */ -void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr); /** * Retrieve the contextual information of an Ethernet device. @@ -3029,7 +3029,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, * - (-ENOSPC) if no more MAC addresses can be added. * - (-EINVAL) if MAC address is invalid. */ -int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *mac_addr, uint32_t pool); /** @@ -3045,7 +3045,8 @@ int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr, * - (-ENODEV) if *port* invalid. * - (-EADDRINUSE) if attempting to remove the default MAC address */ -int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port_id, + struct rte_ether_addr *mac_addr); /** * Set the default MAC address. @@ -3061,7 +3062,7 @@ int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr); * - (-EINVAL) if MAC address is invalid. */ int rte_eth_dev_default_mac_addr_set(uint16_t port_id, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /** * Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device. @@ -3123,7 +3124,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port_id, * - (-EIO) if device is removed. * - (-EINVAL) if bad parameter. */ -int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, +int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr, uint8_t on); /** @@ -3668,7 +3669,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id, * - (-ENOSPC) if *port_id* has not enough multicast filtering resources. */ int rte_eth_dev_set_mc_addr_list(uint16_t port_id, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); /** diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 16300b1474..b406e297e8 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -250,17 +250,17 @@ typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index); /**< @internal Remove MAC address from receive address register */ typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint32_t index, uint32_t vmdq); /**< @internal Set a MAC address into Receive Address Address Register */ typedef int (*eth_mac_addr_set_t)(struct rte_eth_dev *dev, - struct ether_addr *mac_addr); + struct rte_ether_addr *mac_addr); /**< @internal Set a MAC address into Receive Address Address Register */ typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev, - struct ether_addr *mac_addr, + struct rte_ether_addr *mac_addr, uint8_t on); /**< @internal Set a Unicast Hash bitmap */ @@ -292,7 +292,7 @@ typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev, /**< @internal Delete tunneling UDP port */ typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev, - struct ether_addr *mc_addr_set, + struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr); /**< @internal set the list of multicast addresses on an Ethernet device */ @@ -597,13 +597,13 @@ struct rte_eth_dev_data { /**< Common RX buffer size handled by all queues. */ uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */ - struct ether_addr *mac_addrs; + struct rte_ether_addr *mac_addrs; /**< Device Ethernet link address. * @see rte_eth_dev_release_port() */ uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR]; /**< Bitmap associating MAC addresses to pools. */ - struct ether_addr *hash_mac_addrs; + struct rte_ether_addr *hash_mac_addrs; /**< Device Ethernet MAC addresses of hash filtering. * @see rte_eth_dev_release_port() */ diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index 63f84fca65..050af52f8d 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -584,8 +584,8 @@ static const struct rte_flow_item_raw rte_flow_item_raw_mask = { * same order as on the wire. */ struct rte_flow_item_eth { - struct ether_addr dst; /**< Destination MAC. */ - struct ether_addr src; /**< Source MAC. */ + struct rte_ether_addr dst; /**< Destination MAC. */ + struct rte_ether_addr src; /**< Source MAC. */ rte_be16_t type; /**< EtherType or TPID. */ }; @@ -981,9 +981,9 @@ struct rte_flow_item_arp_eth_ipv4 { uint8_t hln; /**< Hardware address length, normally 6. */ uint8_t pln; /**< Protocol address length, normally 4. */ rte_be16_t op; /**< Opcode (1 for request, 2 for reply). */ - struct ether_addr sha; /**< Sender hardware address. */ + struct rte_ether_addr sha; /**< Sender hardware address. */ rte_be32_t spa; /**< Sender IPv4 address. */ - struct ether_addr tha; /**< Target hardware address. */ + struct rte_ether_addr tha; /**< Target hardware address. */ rte_be32_t tpa; /**< Target IPv4 address. */ }; @@ -1127,7 +1127,7 @@ rte_flow_item_icmp6_nd_opt_mask = { struct rte_flow_item_icmp6_nd_opt_sla_eth { uint8_t type; /**< ND option type, normally 1. */ uint8_t length; /**< ND option length, normally 1. */ - struct ether_addr sla; /**< Source Ethernet LLA. */ + struct rte_ether_addr sla; /**< Source Ethernet LLA. */ }; /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH. */ @@ -1152,7 +1152,7 @@ rte_flow_item_icmp6_nd_opt_sla_eth_mask = { struct rte_flow_item_icmp6_nd_opt_tla_eth { uint8_t type; /**< ND option type, normally 2. */ uint8_t length; /**< ND option length, normally 1. */ - struct ether_addr tla; /**< Target Ethernet LLA. */ + struct rte_ether_addr tla; /**< Target Ethernet LLA. */ }; /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH. */ diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c index b60674b610..b6ff57b429 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c @@ -614,8 +614,9 @@ static inline void rxa_mtoip(struct rte_mbuf *m, struct ipv4_hdr **ipv4_hdr, struct ipv6_hdr **ipv6_hdr) { - struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); - struct vlan_hdr *vlan_hdr; + struct rte_ether_hdr *eth_hdr = + rte_pktmbuf_mtod(m, struct rte_ether_hdr *); + struct rte_vlan_hdr *vlan_hdr; *ipv4_hdr = NULL; *ipv6_hdr = NULL; @@ -630,7 +631,7 @@ rxa_mtoip(struct rte_mbuf *m, struct ipv4_hdr **ipv4_hdr, break; case RTE_BE16(ETHER_TYPE_VLAN): - vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); + vlan_hdr = (struct rte_vlan_hdr *)(eth_hdr + 1); switch (vlan_hdr->eth_proto) { case RTE_BE16(ETHER_TYPE_IPv4): *ipv4_hdr = (struct ipv4_hdr *)(vlan_hdr + 1); diff --git a/lib/librte_gro/gro_tcp4.c b/lib/librte_gro/gro_tcp4.c index 7d128a431c..2842195178 100644 --- a/lib/librte_gro/gro_tcp4.c +++ b/lib/librte_gro/gro_tcp4.c @@ -194,7 +194,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_tcp4_tbl *tbl, uint64_t start_time) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct ipv4_hdr *ipv4_hdr; struct tcp_hdr *tcp_hdr; uint32_t sent_seq; @@ -215,7 +215,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, if (unlikely(INVALID_TCP_HDRLEN(pkt->l4_len))) return -1; - eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); ipv4_hdr = (struct ipv4_hdr *)((char *)eth_hdr + pkt->l2_len); tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); hdr_len = pkt->l2_len + pkt->l3_len + pkt->l4_len; diff --git a/lib/librte_gro/gro_tcp4.h b/lib/librte_gro/gro_tcp4.h index d979248834..988cca8c6b 100644 --- a/lib/librte_gro/gro_tcp4.h +++ b/lib/librte_gro/gro_tcp4.h @@ -24,8 +24,8 @@ /* Header fields representing a TCP/IPv4 flow */ struct tcp4_flow_key { - struct ether_addr eth_saddr; - struct ether_addr eth_daddr; + struct rte_ether_addr eth_saddr; + struct rte_ether_addr eth_daddr; uint32_t ip_src_addr; uint32_t ip_dst_addr; diff --git a/lib/librte_gro/gro_vxlan_tcp4.c b/lib/librte_gro/gro_vxlan_tcp4.c index acb9bc9198..d713e3dd6c 100644 --- a/lib/librte_gro/gro_vxlan_tcp4.c +++ b/lib/librte_gro/gro_vxlan_tcp4.c @@ -289,11 +289,11 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_vxlan_tcp4_tbl *tbl, uint64_t start_time) { - struct ether_hdr *outer_eth_hdr, *eth_hdr; + struct rte_ether_hdr *outer_eth_hdr, *eth_hdr; struct ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr; struct tcp_hdr *tcp_hdr; struct udp_hdr *udp_hdr; - struct vxlan_hdr *vxlan_hdr; + struct rte_vxlan_hdr *vxlan_hdr; uint32_t sent_seq; int32_t tcp_dl; uint16_t frag_off, outer_ip_id, ip_id; @@ -313,15 +313,15 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, if (unlikely(INVALID_TCP_HDRLEN(pkt->l4_len))) return -1; - outer_eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *); + outer_eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); outer_ipv4_hdr = (struct ipv4_hdr *)((char *)outer_eth_hdr + pkt->outer_l2_len); udp_hdr = (struct udp_hdr *)((char *)outer_ipv4_hdr + pkt->outer_l3_len); - vxlan_hdr = (struct vxlan_hdr *)((char *)udp_hdr + + vxlan_hdr = (struct rte_vxlan_hdr *)((char *)udp_hdr + sizeof(struct udp_hdr)); - eth_hdr = (struct ether_hdr *)((char *)vxlan_hdr + - sizeof(struct vxlan_hdr)); + eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_hdr + + sizeof(struct rte_vxlan_hdr)); ipv4_hdr = (struct ipv4_hdr *)((char *)udp_hdr + pkt->l2_len); tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); diff --git a/lib/librte_gro/gro_vxlan_tcp4.h b/lib/librte_gro/gro_vxlan_tcp4.h index 0cafb9211c..7832942a68 100644 --- a/lib/librte_gro/gro_vxlan_tcp4.h +++ b/lib/librte_gro/gro_vxlan_tcp4.h @@ -12,10 +12,10 @@ /* Header fields representing a VxLAN flow */ struct vxlan_tcp4_flow_key { struct tcp4_flow_key inner_key; - struct vxlan_hdr vxlan_hdr; + struct rte_vxlan_hdr vxlan_hdr; - struct ether_addr outer_eth_saddr; - struct ether_addr outer_eth_daddr; + struct rte_ether_addr outer_eth_saddr; + struct rte_ether_addr outer_eth_daddr; uint32_t outer_ip_src_addr; uint32_t outer_ip_dst_addr; diff --git a/lib/librte_gso/rte_gso.h b/lib/librte_gso/rte_gso.h index a626a11e31..433f2c8bb3 100644 --- a/lib/librte_gso/rte_gso.h +++ b/lib/librte_gso/rte_gso.h @@ -18,11 +18,11 @@ extern "C" { #include /* Minimum GSO segment size for TCP based packets. */ -#define RTE_GSO_SEG_SIZE_MIN (sizeof(struct ether_hdr) + \ +#define RTE_GSO_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \ sizeof(struct ipv4_hdr) + sizeof(struct tcp_hdr) + 1) /* Minimum GSO segment size for UDP based packets. */ -#define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct ether_hdr) + \ +#define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \ sizeof(struct ipv4_hdr) + sizeof(struct udp_hdr) + 1) /* GSO flags for rte_gso_ctx. */ diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 946459c79c..7a41788e28 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -451,7 +451,7 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[]) RTE_LOG(INFO, KNI, "Configure mac address of %d", port_id); ret = rte_eth_dev_default_mac_addr_set(port_id, - (struct ether_addr *)mac_addr); + (struct rte_ether_addr *)mac_addr); if (ret < 0) RTE_LOG(ERR, KNI, "Failed to config mac_addr for port %d\n", port_id); diff --git a/lib/librte_net/rte_arp.c b/lib/librte_net/rte_arp.c index 877874a5e2..adda9f700f 100644 --- a/lib/librte_net/rte_arp.c +++ b/lib/librte_net/rte_arp.c @@ -9,9 +9,9 @@ #define RARP_PKT_SIZE 64 struct rte_mbuf * __rte_experimental rte_net_make_rarp_packet(struct rte_mempool *mpool, - const struct ether_addr *mac) + const struct rte_ether_addr *mac) { - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; struct rte_arp_hdr *rarp; struct rte_mbuf *mbuf; @@ -22,7 +22,8 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool, if (mbuf == NULL) return NULL; - eth_hdr = (struct ether_hdr *)rte_pktmbuf_append(mbuf, RARP_PKT_SIZE); + eth_hdr = (struct rte_ether_hdr *) + rte_pktmbuf_append(mbuf, RARP_PKT_SIZE); if (eth_hdr == NULL) { rte_pktmbuf_free(mbuf); return NULL; diff --git a/lib/librte_net/rte_arp.h b/lib/librte_net/rte_arp.h index a94fa6a005..f17c529722 100644 --- a/lib/librte_net/rte_arp.h +++ b/lib/librte_net/rte_arp.h @@ -22,9 +22,9 @@ extern "C" { * ARP header IPv4 payload. */ struct rte_arp_ipv4 { - struct ether_addr arp_sha; /**< sender hardware address */ + struct rte_ether_addr arp_sha; /**< sender hardware address */ uint32_t arp_sip; /**< sender IP address */ - struct ether_addr arp_tha; /**< target hardware address */ + struct rte_ether_addr arp_tha; /**< target hardware address */ uint32_t arp_tip; /**< target IP address */ } __attribute__((__packed__)); @@ -65,7 +65,7 @@ struct rte_arp_hdr { */ struct rte_mbuf * __rte_experimental rte_net_make_rarp_packet(struct rte_mempool *mpool, - const struct ether_addr *mac); + const struct rte_ether_addr *mac); #ifdef __cplusplus } diff --git a/lib/librte_net/rte_ether.h b/lib/librte_net/rte_ether.h index 3a87ff1849..afdbaa1a7c 100644 --- a/lib/librte_net/rte_ether.h +++ b/lib/librte_net/rte_ether.h @@ -54,7 +54,7 @@ extern "C" { * administrator and does not contain OUIs. * See http://standards.ieee.org/regauth/groupmac/tutorial.html */ -struct ether_addr { +struct rte_ether_addr { uint8_t addr_bytes[ETHER_ADDR_LEN]; /**< Addr bytes in tx order */ } __attribute__((__packed__)); @@ -75,8 +75,8 @@ struct ether_addr { * True (1) if the given two ethernet address are the same; * False (0) otherwise. */ -static inline int is_same_ether_addr(const struct ether_addr *ea1, - const struct ether_addr *ea2) +static inline int is_same_ether_addr(const struct rte_ether_addr *ea1, + const struct rte_ether_addr *ea2) { int i; for (i = 0; i < ETHER_ADDR_LEN; i++) @@ -95,7 +95,7 @@ static inline int is_same_ether_addr(const struct ether_addr *ea1, * True (1) if the given ethernet address is filled with zeros; * false (0) otherwise. */ -static inline int is_zero_ether_addr(const struct ether_addr *ea) +static inline int is_zero_ether_addr(const struct rte_ether_addr *ea) { int i; for (i = 0; i < ETHER_ADDR_LEN; i++) @@ -114,7 +114,7 @@ static inline int is_zero_ether_addr(const struct ether_addr *ea) * True (1) if the given ethernet address is a unicast address; * false (0) otherwise. */ -static inline int is_unicast_ether_addr(const struct ether_addr *ea) +static inline int is_unicast_ether_addr(const struct rte_ether_addr *ea) { return (ea->addr_bytes[0] & ETHER_GROUP_ADDR) == 0; } @@ -129,7 +129,7 @@ static inline int is_unicast_ether_addr(const struct ether_addr *ea) * True (1) if the given ethernet address is a multicast address; * false (0) otherwise. */ -static inline int is_multicast_ether_addr(const struct ether_addr *ea) +static inline int is_multicast_ether_addr(const struct rte_ether_addr *ea) { return ea->addr_bytes[0] & ETHER_GROUP_ADDR; } @@ -144,7 +144,7 @@ static inline int is_multicast_ether_addr(const struct ether_addr *ea) * True (1) if the given ethernet address is a broadcast address; * false (0) otherwise. */ -static inline int is_broadcast_ether_addr(const struct ether_addr *ea) +static inline int is_broadcast_ether_addr(const struct rte_ether_addr *ea) { const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea; @@ -162,7 +162,7 @@ static inline int is_broadcast_ether_addr(const struct ether_addr *ea) * True (1) if the given ethernet address is a universally assigned address; * false (0) otherwise. */ -static inline int is_universal_ether_addr(const struct ether_addr *ea) +static inline int is_universal_ether_addr(const struct rte_ether_addr *ea) { return (ea->addr_bytes[0] & ETHER_LOCAL_ADMIN_ADDR) == 0; } @@ -177,7 +177,7 @@ static inline int is_universal_ether_addr(const struct ether_addr *ea) * True (1) if the given ethernet address is a locally assigned address; * false (0) otherwise. */ -static inline int is_local_admin_ether_addr(const struct ether_addr *ea) +static inline int is_local_admin_ether_addr(const struct rte_ether_addr *ea) { return (ea->addr_bytes[0] & ETHER_LOCAL_ADMIN_ADDR) != 0; } @@ -193,7 +193,7 @@ static inline int is_local_admin_ether_addr(const struct ether_addr *ea) * True (1) if the given ethernet address is valid; * false (0) otherwise. */ -static inline int is_valid_assigned_ether_addr(const struct ether_addr *ea) +static inline int is_valid_assigned_ether_addr(const struct rte_ether_addr *ea) { return is_unicast_ether_addr(ea) && (!is_zero_ether_addr(ea)); } @@ -222,8 +222,8 @@ static inline void eth_random_addr(uint8_t *addr) * @param ea_to * A pointer to a ether_addr structure where to copy the Ethernet address. */ -static inline void ether_addr_copy(const struct ether_addr *ea_from, - struct ether_addr *ea_to) +static inline void ether_addr_copy(const struct rte_ether_addr *ea_from, + struct rte_ether_addr *ea_to) { #ifdef __INTEL_COMPILER uint16_t *from_words = (uint16_t *)(ea_from->addr_bytes); @@ -253,7 +253,7 @@ static inline void ether_addr_copy(const struct ether_addr *ea_from, */ static inline void ether_format_addr(char *buf, uint16_t size, - const struct ether_addr *eth_addr) + const struct rte_ether_addr *eth_addr) { snprintf(buf, size, "%02X:%02X:%02X:%02X:%02X:%02X", eth_addr->addr_bytes[0], @@ -268,9 +268,9 @@ ether_format_addr(char *buf, uint16_t size, * Ethernet header: Contains the destination address, source address * and frame type. */ -struct ether_hdr { - struct ether_addr d_addr; /**< Destination address. */ - struct ether_addr s_addr; /**< Source address. */ +struct rte_ether_hdr { + struct rte_ether_addr d_addr; /**< Destination address. */ + struct rte_ether_addr s_addr; /**< Source address. */ uint16_t ether_type; /**< Frame type. */ } __attribute__((__packed__)); @@ -279,7 +279,7 @@ struct ether_hdr { * Contains the 16-bit VLAN Tag Control Identifier and the Ethernet type * of the encapsulated frame. */ -struct vlan_hdr { +struct rte_vlan_hdr { uint16_t vlan_tci; /**< Priority (3) + CFI (1) + Identifier Code (12) */ uint16_t eth_proto;/**< Ethernet type of encapsulated frame. */ } __attribute__((__packed__)); @@ -289,7 +289,7 @@ struct vlan_hdr { * Contains the 8-bit flag, 24-bit VXLAN Network Identifier and * Reserved fields (24 bits and 8 bits) */ -struct vxlan_hdr { +struct rte_vxlan_hdr { uint32_t vx_flags; /**< flag (8) + Reserved (24). */ uint32_t vx_vni; /**< VNI (24) + Reserved (8). */ } __attribute__((__packed__)); @@ -311,7 +311,7 @@ struct vxlan_hdr { #define ETHER_TYPE_MPLS 0x8847 /**< MPLS ethertype. */ #define ETHER_TYPE_MPLSM 0x8848 /**< MPLS multicast ethertype. */ -#define ETHER_VXLAN_HLEN (sizeof(struct udp_hdr) + sizeof(struct vxlan_hdr)) +#define ETHER_VXLAN_HLEN (sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr)) /**< VXLAN tunnel header length. */ /** @@ -319,7 +319,7 @@ struct vxlan_hdr { * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network * Identifier and Reserved fields (16 bits and 8 bits). */ -struct vxlan_gpe_hdr { +struct rte_vxlan_gpe_hdr { uint8_t vx_flags; /**< flag (8). */ uint8_t reserved[2]; /**< Reserved (16). */ uint8_t proto; /**< next-protocol (8). */ @@ -336,7 +336,7 @@ struct vxlan_gpe_hdr { #define VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */ #define ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \ - sizeof(struct vxlan_gpe_hdr)) + sizeof(struct rte_vxlan_gpe_hdr)) /**< VXLAN-GPE tunnel header length. */ /** @@ -352,19 +352,19 @@ struct vxlan_gpe_hdr { */ static inline int rte_vlan_strip(struct rte_mbuf *m) { - struct ether_hdr *eh - = rte_pktmbuf_mtod(m, struct ether_hdr *); - struct vlan_hdr *vh; + struct rte_ether_hdr *eh + = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); + struct rte_vlan_hdr *vh; if (eh->ether_type != rte_cpu_to_be_16(ETHER_TYPE_VLAN)) return -1; - vh = (struct vlan_hdr *)(eh + 1); + vh = (struct rte_vlan_hdr *)(eh + 1); m->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED; m->vlan_tci = rte_be_to_cpu_16(vh->vlan_tci); /* Copy ether header over rather than moving whole packet */ - memmove(rte_pktmbuf_adj(m, sizeof(struct vlan_hdr)), + memmove(rte_pktmbuf_adj(m, sizeof(struct rte_vlan_hdr)), eh, 2 * ETHER_ADDR_LEN); return 0; @@ -384,8 +384,8 @@ static inline int rte_vlan_strip(struct rte_mbuf *m) */ static inline int rte_vlan_insert(struct rte_mbuf **m) { - struct ether_hdr *oh, *nh; - struct vlan_hdr *vh; + struct rte_ether_hdr *oh, *nh; + struct rte_vlan_hdr *vh; /* Can't insert header if mbuf is shared */ if (rte_mbuf_refcnt_read(*m) > 1) { @@ -398,16 +398,16 @@ static inline int rte_vlan_insert(struct rte_mbuf **m) *m = copy; } - oh = rte_pktmbuf_mtod(*m, struct ether_hdr *); - nh = (struct ether_hdr *) - rte_pktmbuf_prepend(*m, sizeof(struct vlan_hdr)); + oh = rte_pktmbuf_mtod(*m, struct rte_ether_hdr *); + nh = (struct rte_ether_hdr *) + rte_pktmbuf_prepend(*m, sizeof(struct rte_vlan_hdr)); if (nh == NULL) return -ENOSPC; memmove(nh, oh, 2 * ETHER_ADDR_LEN); nh->ether_type = rte_cpu_to_be_16(ETHER_TYPE_VLAN); - vh = (struct vlan_hdr *) (nh + 1); + vh = (struct rte_vlan_hdr *) (nh + 1); vh->vlan_tci = rte_cpu_to_be_16((*m)->vlan_tci); (*m)->ol_flags &= ~(PKT_RX_VLAN_STRIPPED | PKT_TX_VLAN); diff --git a/lib/librte_net/rte_net.c b/lib/librte_net/rte_net.c index 378a4126c6..315c37c551 100644 --- a/lib/librte_net/rte_net.c +++ b/lib/librte_net/rte_net.c @@ -229,8 +229,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, struct rte_net_hdr_lens *hdr_lens, uint32_t layers) { struct rte_net_hdr_lens local_hdr_lens; - const struct ether_hdr *eh; - struct ether_hdr eh_copy; + const struct rte_ether_hdr *eh; + struct rte_ether_hdr eh_copy; uint32_t pkt_type = RTE_PTYPE_L2_ETHER; uint32_t off = 0; uint16_t proto; @@ -253,8 +253,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, goto l3; /* fast path if packet is IPv4 */ if (proto == rte_cpu_to_be_16(ETHER_TYPE_VLAN)) { - const struct vlan_hdr *vh; - struct vlan_hdr vh_copy; + const struct rte_vlan_hdr *vh; + struct rte_vlan_hdr vh_copy; pkt_type = RTE_PTYPE_L2_ETHER_VLAN; vh = rte_pktmbuf_read(m, off, sizeof(*vh), &vh_copy); @@ -264,8 +264,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m, hdr_lens->l2_len += sizeof(*vh); proto = vh->eth_proto; } else if (proto == rte_cpu_to_be_16(ETHER_TYPE_QINQ)) { - const struct vlan_hdr *vh; - struct vlan_hdr vh_copy; + const struct rte_vlan_hdr *vh; + struct rte_vlan_hdr vh_copy; pkt_type = RTE_PTYPE_L2_ETHER_QINQ; vh = rte_pktmbuf_read(m, off + sizeof(*vh), sizeof(*vh), @@ -402,8 +402,8 @@ l3: } if (proto == rte_cpu_to_be_16(ETHER_TYPE_VLAN)) { - const struct vlan_hdr *vh; - struct vlan_hdr vh_copy; + const struct rte_vlan_hdr *vh; + struct rte_vlan_hdr vh_copy; pkt_type &= ~RTE_PTYPE_INNER_L2_MASK; pkt_type |= RTE_PTYPE_INNER_L2_ETHER_VLAN; @@ -414,8 +414,8 @@ l3: hdr_lens->inner_l2_len += sizeof(*vh); proto = vh->eth_proto; } else if (proto == rte_cpu_to_be_16(ETHER_TYPE_QINQ)) { - const struct vlan_hdr *vh; - struct vlan_hdr vh_copy; + const struct rte_vlan_hdr *vh; + struct rte_vlan_hdr vh_copy; pkt_type &= ~RTE_PTYPE_INNER_L2_MASK; pkt_type |= RTE_PTYPE_INNER_L2_ETHER_QINQ; diff --git a/lib/librte_pipeline/rte_table_action.c b/lib/librte_pipeline/rte_table_action.c index 9a65f3dedf..1e85cc9cfb 100644 --- a/lib/librte_pipeline/rte_table_action.c +++ b/lib/librte_pipeline/rte_table_action.c @@ -438,7 +438,7 @@ encap_cfg_check(struct rte_table_action_encap_config *encap) } struct encap_ether_data { - struct ether_hdr ether; + struct rte_ether_hdr ether; } __attribute__((__packed__)); #define VLAN(pcp, dei, vid) \ @@ -447,14 +447,14 @@ struct encap_ether_data { (((uint64_t)(vid)) & 0xFFFLLU)) \ struct encap_vlan_data { - struct ether_hdr ether; - struct vlan_hdr vlan; + struct rte_ether_hdr ether; + struct rte_vlan_hdr vlan; } __attribute__((__packed__)); struct encap_qinq_data { - struct ether_hdr ether; - struct vlan_hdr svlan; - struct vlan_hdr cvlan; + struct rte_ether_hdr ether; + struct rte_vlan_hdr svlan; + struct rte_vlan_hdr cvlan; } __attribute__((__packed__)); #define ETHER_TYPE_MPLS_UNICAST 0x8847 @@ -468,7 +468,7 @@ struct encap_qinq_data { (((uint64_t)(ttl)) & 0xFFLLU))) struct encap_mpls_data { - struct ether_hdr ether; + struct rte_ether_hdr ether; uint32_t mpls[RTE_TABLE_ACTION_MPLS_LABELS_MAX]; uint32_t mpls_count; } __attribute__((__packed__)); @@ -483,46 +483,46 @@ struct pppoe_ppp_hdr { } __attribute__((__packed__)); struct encap_pppoe_data { - struct ether_hdr ether; + struct rte_ether_hdr ether; struct pppoe_ppp_hdr pppoe_ppp; } __attribute__((__packed__)); #define IP_PROTO_UDP 17 struct encap_vxlan_ipv4_data { - struct ether_hdr ether; + struct rte_ether_hdr ether; struct ipv4_hdr ipv4; struct udp_hdr udp; - struct vxlan_hdr vxlan; + struct rte_vxlan_hdr vxlan; } __attribute__((__packed__)); struct encap_vxlan_ipv4_vlan_data { - struct ether_hdr ether; - struct vlan_hdr vlan; + struct rte_ether_hdr ether; + struct rte_vlan_hdr vlan; struct ipv4_hdr ipv4; struct udp_hdr udp; - struct vxlan_hdr vxlan; + struct rte_vxlan_hdr vxlan; } __attribute__((__packed__)); struct encap_vxlan_ipv6_data { - struct ether_hdr ether; + struct rte_ether_hdr ether; struct ipv6_hdr ipv6; struct udp_hdr udp; - struct vxlan_hdr vxlan; + struct rte_vxlan_hdr vxlan; } __attribute__((__packed__)); struct encap_vxlan_ipv6_vlan_data { - struct ether_hdr ether; - struct vlan_hdr vlan; + struct rte_ether_hdr ether; + struct rte_vlan_hdr vlan; struct ipv6_hdr ipv6; struct udp_hdr udp; - struct vxlan_hdr vxlan; + struct rte_vxlan_hdr vxlan; } __attribute__((__packed__)); struct encap_qinq_pppoe_data { - struct ether_hdr ether; - struct vlan_hdr svlan; - struct vlan_hdr cvlan; + struct rte_ether_hdr ether; + struct rte_vlan_hdr svlan; + struct rte_vlan_hdr cvlan; struct pppoe_ppp_hdr pppoe_ppp; } __attribute__((__packed__)); @@ -997,13 +997,13 @@ pkt_work_encap_vxlan_ipv4(struct rte_mbuf *mbuf, ether_length = (uint16_t)mbuf->pkt_len; ipv4_total_length = ether_length + - (sizeof(struct vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr) + sizeof(struct 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 vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr)); vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl)); @@ -1027,13 +1027,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 vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr) + sizeof(struct 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 vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr)); vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl)); @@ -1057,10 +1057,10 @@ pkt_work_encap_vxlan_ipv6(struct rte_mbuf *mbuf, ether_length = (uint16_t)mbuf->pkt_len; ipv6_payload_length = ether_length + - (sizeof(struct vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr)); udp_length = ether_length + - (sizeof(struct vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr)); vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl)); @@ -1083,10 +1083,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 vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr)); udp_length = ether_length + - (sizeof(struct vxlan_hdr) + + (sizeof(struct rte_vxlan_hdr) + sizeof(struct udp_hdr)); vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl)); @@ -1133,7 +1133,7 @@ pkt_work_encap(struct rte_mbuf *mbuf, case 1LLU << RTE_TABLE_ACTION_ENCAP_MPLS: { struct encap_mpls_data *mpls = data; - size_t size = sizeof(struct ether_hdr) + + size_t size = sizeof(struct rte_ether_hdr) + mpls->mpls_count * 4; encap(ip, data, size); diff --git a/lib/librte_pipeline/rte_table_action.h b/lib/librte_pipeline/rte_table_action.h index cf6eeaa303..ef45a30233 100644 --- a/lib/librte_pipeline/rte_table_action.h +++ b/lib/librte_pipeline/rte_table_action.h @@ -387,8 +387,8 @@ enum rte_table_action_encap_type { /** Pre-computed Ethernet header fields for encapsulation action. */ struct rte_table_action_ether_hdr { - struct ether_addr da; /**< Destination address. */ - struct ether_addr sa; /**< Source address. */ + struct rte_ether_addr da; /**< Destination address. */ + struct rte_ether_addr sa; /**< Source address. */ }; /** Pre-computed VLAN header fields for encapsulation action. */ diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index e9138dfab4..d49c3b8a98 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -308,7 +308,7 @@ struct virtio_net { uint64_t log_size; uint64_t log_base; uint64_t log_addr; - struct ether_addr mac; + struct rte_ether_addr mac; uint16_t mtu; struct vhost_device_ops const *notify_ops; diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index a6a33a1013..f97ec76f9b 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -969,18 +969,19 @@ parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr) struct ipv4_hdr *ipv4_hdr; struct ipv6_hdr *ipv6_hdr; void *l3_hdr = NULL; - struct ether_hdr *eth_hdr; + struct rte_ether_hdr *eth_hdr; uint16_t ethertype; - eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); - m->l2_len = sizeof(struct ether_hdr); + m->l2_len = sizeof(struct rte_ether_hdr); ethertype = rte_be_to_cpu_16(eth_hdr->ether_type); if (ethertype == ETHER_TYPE_VLAN) { - struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1); + struct rte_vlan_hdr *vlan_hdr = + (struct rte_vlan_hdr *)(eth_hdr + 1); - m->l2_len += sizeof(struct vlan_hdr); + m->l2_len += sizeof(struct rte_vlan_hdr); ethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto); }