Skip to content

Commit

Permalink
net: add rte prefix to ether structures
Browse files Browse the repository at this point in the history
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 <olivier.matz@6wind.com>
Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
  • Loading branch information
olivier-matz-6wind authored and Ferruh Yigit committed May 24, 2019
1 parent e482e0f commit 6d13ea8
Show file tree
Hide file tree
Showing 261 changed files with 1,480 additions and 1,372 deletions.
2 changes: 1 addition & 1 deletion app/pdump/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 7 additions & 6 deletions app/test-pipeline/pipeline_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,39 +39,40 @@ 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),
},
{
.type = RTE_ACL_FIELD_TYPE_MASK,
.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),
},
{
.type = RTE_ACL_FIELD_TYPE_MASK,
.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),
},
{
.type = RTE_ACL_FIELD_TYPE_RANGE,
.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),
},
};

Expand Down
4 changes: 2 additions & 2 deletions app/test-pipeline/pipeline_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
50 changes: 25 additions & 25 deletions app/test-pmd/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;
};
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;

};

Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion app/test-pmd/cmdline_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
25 changes: 13 additions & 12 deletions app/test-pmd/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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++) {
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;

/*
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6d13ea8

Please sign in to comment.