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;
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,
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,
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;
};
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;
};
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,
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;
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;
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;
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;
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 =
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,
cmdline_fixed_string_t addr;
portid_t port_id;
uint16_t vf_id;
- struct ether_addr mac_addr;
+ struct rte_ether_addr mac_addr;
};
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;
};
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_vxlan_set =
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 =
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;
};
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);
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;
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];
* 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++) {
}
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;
}
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;
/*
* 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",
}
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
}
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;
}
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;
* 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;
}
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
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 */
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 ==
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);
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;
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
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;
/* 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,
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. */
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;
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);
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;
}
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];
{
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;
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);
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)
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;
* 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)) {
* 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",
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;
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;
struct rte_mbuf *pkts_burst[MAX_PKT_BURST];
struct rte_port *txp;
struct rte_mbuf *mb;
- struct ether_hdr *eth_hdr;
- struct ether_addr addr;
+ struct rte_ether_hdr *eth_hdr;
+ struct rte_ether_addr addr;
uint16_t nb_rx;
uint16_t nb_tx;
uint16_t i;
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 *);
/* Swap dest and src mac addresses. */
ether_addr_copy(ð_hdr->d_addr, &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;
* 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;
/*
portid_t pi;
queueid_t qi;
struct rte_port *port;
- struct ether_addr mac_addr;
+ struct rte_ether_addr mac_addr;
enum rte_eth_event_type event_type;
if (port_id_is_invalid(pid, ENABLED_WARN))
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 */
uint64_t tx_dropped; /**< If no descriptor in TX ring */
struct fwd_stream *rx_stream; /**< Port RX stream, if unique */
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. */
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. */
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);
struct rte_mbuf *pkt;
struct rte_mbuf *pkt_seg;
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;
*/
copy_buf_to_pkt(ð_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));
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));
/*
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;
}
{
uint16_t pkt_data_len;
- pkt_data_len = (uint16_t) (tx_pkt_length - (sizeof(struct ether_hdr) +
+ pkt_data_len = (uint16_t) (tx_pkt_length - (sizeof(struct rte_ether_hdr) +
sizeof(struct ipv4_hdr) +
sizeof(struct udp_hdr)));
setup_pkt_udp_ip_headers(&pkt_ip_hdr, &pkt_udp_hdr, pkt_data_len);
#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);
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;
(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;
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)) {
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);
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]);
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];
.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. */
.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. */
.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),
},
/*
.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),
},
.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),
},
{
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;
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;
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=",
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);
/* 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);
.. 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);
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 */
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 */
{
// ...
- 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);
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 */
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:
{
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;
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];
}
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];
}
{
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;
};
/* 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}
};
/* 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;
/* 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
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;
};
int if_index;
char *if_name;
- struct ether_addr eth_addr;
+ struct rte_ether_addr eth_addr;
struct tpacket_req req;
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,
(void (*)(struct rte_eth_dev *, void *))
dlsym(ark->d_handle, "stats_reset");
ark->user_ext.mac_addr_add =
- (void (*)(struct rte_eth_dev *, struct ether_addr *, uint32_t,
+ (void (*)(struct rte_eth_dev *, struct rte_ether_addr *, uint32_t,
uint32_t, void *))
dlsym(ark->d_handle, "mac_addr_add");
ark->user_ext.mac_addr_remove =
(void (*)(struct rte_eth_dev *, uint32_t, void *))
dlsym(ark->d_handle, "mac_addr_remove");
ark->user_ext.mac_addr_set =
- (void (*)(struct rte_eth_dev *, struct ether_addr *,
+ (void (*)(struct rte_eth_dev *, struct rte_ether_addr *,
void *))
dlsym(ark->d_handle, "mac_addr_set");
ark->user_ext.set_mtu =
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 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;
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);
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,
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 *);
};
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 */
}
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)) {
}
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);
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);
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 */
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);
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();
int avf_config_promisc(struct avf_adapter *adapter, bool enable_unicast,
bool enable_multicast);
int avf_add_del_eth_addr(struct avf_adapter *adapter,
- struct ether_addr *addr, bool add);
+ struct rte_ether_addr *addr, bool add);
int avf_add_del_vlan(struct avf_adapter *adapter, uint16_t vlanid, bool add);
#endif /* _AVF_ETHDEV_H_ */
static void avf_dev_allmulticast_enable(struct rte_eth_dev *dev);
static void avf_dev_allmulticast_disable(struct rte_eth_dev *dev);
static int avf_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 avf_dev_del_mac_addr(struct rte_eth_dev *dev, uint32_t index);
struct rte_eth_rss_conf *rss_conf);
static int avf_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu);
static int avf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
+ struct rte_ether_addr *mac_addr);
static int avf_dev_rx_queue_intr_enable(struct rte_eth_dev *dev,
uint16_t queue_id);
static int avf_dev_rx_queue_intr_disable(struct rte_eth_dev *dev,
}
static int
-avf_dev_add_mac_addr(struct rte_eth_dev *dev, struct ether_addr *addr,
+avf_dev_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr,
__rte_unused uint32_t index,
__rte_unused uint32_t pool)
{
struct avf_adapter *adapter =
AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
struct avf_info *vf = AVF_DEV_PRIVATE_TO_VF(adapter);
- struct ether_addr *addr;
+ struct rte_ether_addr *addr;
int err;
addr = &dev->data->mac_addrs[index];
static int
avf_dev_set_default_mac_addr(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr)
+ struct rte_ether_addr *mac_addr)
{
struct avf_adapter *adapter =
AVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
struct avf_hw *hw = AVF_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;
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;
}
/* 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 */
{
struct virtchnl_ether_addr_list *list;
struct avf_info *vf = AVF_DEV_PRIVATE_TO_VF(adapter);
- struct ether_addr *addr;
+ struct rte_ether_addr *addr;
struct avf_cmd_info args;
int len, err, i, j;
int next_begin = 0;
}
int
-avf_add_del_eth_addr(struct avf_adapter *adapter, struct ether_addr *addr,
+avf_add_del_eth_addr(struct avf_adapter *adapter, struct rte_ether_addr *addr,
bool add)
{
struct virtchnl_ether_addr_list *list;
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 */
}
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];
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 */
/* 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;
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));
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 =
}
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;
}
}
- 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;
PMD_DRV_LOG(INFO, sc, "pcie_bus=%d, pcie_device=%d",
sc->pcie_bus, sc->pcie_device);
/* 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 */
};
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);
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;
};
}
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;
}
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 */
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;
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;
}
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;
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);
}
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;
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;
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];
* - (-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
* - (-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);
/**
*/
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
#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 }
};
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;
uint8_t i, slave_id;
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;
/** 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. */
/** 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__));
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];
} __attribute__((__packed__));
struct marker_header {
- struct ether_hdr eth_hdr;
+ struct rte_ether_hdr eth_hdr;
struct marker marker;
} __attribute__((__packed__));
return -ENOMEM;
}
-void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset,
+void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset,
struct bond_dev_private *internals) {
struct rte_arp_hdr *arp;
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;
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;
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);
&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;
}
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;
}
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);
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;
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 */
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 */
* @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);
/**
* 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);
/**
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;
/* Parse MAC */
return cmdline_parse_etheraddr(NULL, value, extra_args,
- sizeof(struct ether_addr));
+ sizeof(struct rte_ether_addr));
}
int
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;
/* Cast to structure, containing bonded device's port id and queue id */
struct bond_rx_queue *bd_rx_q = (struct bond_rx_queue *)queue;
struct bond_dev_private *internals = bd_rx_q->dev_private;
- struct ether_addr bond_mac;
+ struct rte_ether_addr bond_mac;
- struct ether_hdr *hdr;
+ 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 */
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
#endif
static void
-mode6_debug(const char __attribute__((unused)) *info, struct ether_hdr *eth_h,
+mode6_debug(const char __attribute__((unused)) *info, struct rte_ether_hdr *eth_h,
uint16_t port, uint32_t __attribute__((unused)) *burstnumber)
{
struct ipv4_hdr *ipv4_h;
{
struct 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;
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);
}
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;
burst_xmit_l2_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
uint8_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);
uint8_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;
burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
uint8_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;
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 *);
proto = eth_hdr->ether_type;
vlan_offset = get_vlan_offset(eth_hdr, &proto);
l3hash = 0;
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;
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)
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;
/* 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);
"Failed to allocate ARP packet from pool");
continue;
}
- pkt_size = sizeof(struct ether_hdr) + sizeof(struct rte_arp_hdr)
- + client_info->vlan_count * sizeof(struct vlan_hdr);
+ pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct rte_arp_hdr)
+ + client_info->vlan_count * sizeof(struct rte_vlan_hdr);
upd_pkt->data_len = pkt_size;
upd_pkt->pkt_len = pkt_size;
#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
}
#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
}
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");
}
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");
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
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];
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++) {
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
}
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)
}
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");
}
static int
-bond_ethdev_mac_addr_add(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
+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;
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,
/* 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) {
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;
};
struct rte_eth_link *slave_dev_link);
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);
{
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]);
}
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;
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,
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)
{
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;
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;
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)
{
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();
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;
*/
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,
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 */
}
/* 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:
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,
+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
}
/* 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 */
}
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);
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);
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;
static void igb_intr_disable(struct e1000_hw *hw);
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);
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);
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);
}
/* 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));
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();
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 "
#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);
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);
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();
}
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);
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;
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);
ENA_ADMIN_FEATURE_OFFLOAD_DESC_TSO_IPV4_MASK;
/* 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);
adapter->drv_stats = rte_zmalloc("adapter stats",
sizeof(*adapter->drv_stats),
* 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);
}
/* 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]);
ENETC_PMD_DEBUG("port_id %d vendorID=0x%x deviceID=0x%x",
}
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);
}
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;
enic_copy_item_eth_v2(const struct rte_flow_item *item,
struct filter_v2 *enic_filter, u8 *inner_ofst)
{
- 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;
if (*inner_ofst == 0) {
/* 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));
} else {
/* inner header */
- if ((*inner_ofst + sizeof(struct ether_hdr)) >
+ if ((*inner_ofst + sizeof(struct rte_ether_hdr)) >
FILTER_GENERIC_1_KEY_LEN)
return ENOTSUP;
/* Offset into L5 where inner Ethernet header goes */
memcpy(&gp->layer[FILTER_GENERIC_1_L5].mask[*inner_ofst],
- &enic_mask, sizeof(struct ether_hdr));
+ &enic_mask, sizeof(struct rte_ether_hdr));
memcpy(&gp->layer[FILTER_GENERIC_1_L5].val[*inner_ofst],
- &enic_spec, sizeof(struct ether_hdr));
- *inner_ofst += sizeof(struct ether_hdr);
+ &enic_spec, sizeof(struct rte_ether_hdr));
+ *inner_ofst += sizeof(struct rte_ether_hdr);
}
return 0;
}
mask = &rte_flow_item_vlan_mask;
if (*inner_ofst == 0) {
- struct ether_hdr *eth_mask =
+ struct rte_ether_hdr *eth_mask =
(void *)gp->layer[FILTER_GENERIC_1_L2].mask;
- struct ether_hdr *eth_val =
+ struct rte_ether_hdr *eth_val =
(void *)gp->layer[FILTER_GENERIC_1_L2].val;
/* Outer TPID cannot be matched */
gp->val_vlan = spec->tci;
} else {
/* Inner header. Mask/Val start at *inner_ofst into L5 */
- if ((*inner_ofst + sizeof(struct vlan_hdr)) >
+ if ((*inner_ofst + sizeof(struct rte_vlan_hdr)) >
FILTER_GENERIC_1_KEY_LEN)
return ENOTSUP;
memcpy(&gp->layer[FILTER_GENERIC_1_L5].mask[*inner_ofst],
- mask, sizeof(struct vlan_hdr));
+ mask, sizeof(struct rte_vlan_hdr));
memcpy(&gp->layer[FILTER_GENERIC_1_L5].val[*inner_ofst],
- spec, sizeof(struct vlan_hdr));
- *inner_ofst += sizeof(struct vlan_hdr);
+ spec, sizeof(struct rte_vlan_hdr));
+ *inner_ofst += sizeof(struct rte_vlan_hdr);
}
return 0;
}
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;
}
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);
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;
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))
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,
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)
{
}
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;
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;
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. */
/* 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;
/* 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)
{
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 ||
/* 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]);
}
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);
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);
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;
"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 */
/* 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)
{
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;
{
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;
/* 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;
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");
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);
}
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 &&
/* 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;
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;
}
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;
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) ==
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);
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);
}
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);
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;
*/
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);
/* 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;
};
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 */
/* 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 */
};
* 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. */
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;
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 */
+ struct rte_ether_addr mc_addrs[I40E_NUM_MACADDR_MAX]; /* Multicast addrs */
uint16_t mc_addrs_num; /* Multicast mac addresses number */
/* Event from pf */
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);
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);
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);
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
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 */
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)
{
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);
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];
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 */
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;
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 {
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);
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;
}
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);
{
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[] = {
[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),
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;
[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),
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;
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,
(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(
}
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) ||
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(
}
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;
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;
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;
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;
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;
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;
}
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;
* - (-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.
*/
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
* - (-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
* -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
static int ixgbe_dev_interrupt_action(struct rte_eth_dev *dev);
static void ixgbe_dev_interrupt_handler(void *param);
static void ixgbe_dev_interrupt_delayed_handler(void *param);
-static int ixgbe_add_rar(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
+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);
/* 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,
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,
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);
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 */
}
static void
-generate_random_mac_addr(struct ether_addr *mac_addr)
+generate_random_mac_addr(struct rte_ether_addr *mac_addr)
{
uint64_t random;
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();
}
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);
}
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);
}
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;
}
static int
-ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr,
+ixgbe_uc_hash_table_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
uint8_t on)
{
uint32_t vector;
}
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)
{
* 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)
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;
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)
}
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);
*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;
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);
}
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;
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 */
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;
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,
* - (-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.
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];
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);
struct ibv_pd *pd = NULL;
struct priv *priv = NULL;
struct rte_eth_dev *eth_dev = NULL;
- struct ether_addr mac;
+ struct rte_ether_addr mac;
/* If port is not enabled, skip. */
if (!(conf.ports.enabled & (1 << i)))
} 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. */
};
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_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr);
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);
void mlx4_stats_reset(struct rte_eth_dev *dev);
* 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 priv *priv = dev->data->dev_private;
* 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);
}
.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 =
(priv->dev->data->dev_conf.rxmode.offloads &
DEV_RX_OFFLOAD_VLAN_FILTER) &&
}
}
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))
#ifdef HAVE_IBV_DEVICE_COUNTERS_SET_SUPPORT
struct ibv_counter_set_description cs_desc = { .counter_type = 0 };
#endif
- struct ether_addr mac;
+ struct rte_ether_addr mac;
char name[RTE_ETH_NAME_MAX_LEN];
int own_domain_id = 0;
unsigned int i;
struct ibv_pd *pd; /* Protection Domain. */
char ibdev_name[IBV_SYSFS_NAME_MAX]; /* IB device name. */
char ibdev_path[IBV_SYSFS_PATH_MAX]; /* IB device path for secondary */
- 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. */
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 */
/* 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);
{
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;
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));
}
/**
* 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 priv *priv = dev->data->dev_private;
* 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;
* 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);
*/
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;
/* 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. */
};
* 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 priv *priv = dev->data->dev_private;
* 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 priv *priv = dev->data->dev_private;
* 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 priv *priv = dev->data->dev_private;
* 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 priv *priv = dev->data->dev_private;
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;
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);
* 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)
.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;
}
/* 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;
* 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;
* 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;
* 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;
* 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;
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,
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 */
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]++;
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++;
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;
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,
/* 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;
char buf[32];
int i;
ether_format_addr(buf, sizeof(buf), mac);
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;
}
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;
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)))
}
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;
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 */
}
/* 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))
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;
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;
}
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;
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];
- struct ether_addr eth_addr;
+ struct rte_ether_addr eth_addr;
int if_index;
int single_iface;
int phy_mac;
* 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;
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,
}
static int
-qede_add_mcast_filters(struct rte_eth_dev *eth_dev, struct ether_addr *mc_addrs,
+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);
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) {
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);
}
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;
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;
}
/* 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);
}
static int
-qede_set_mc_addr_list(struct rte_eth_dev *eth_dev, struct ether_addr *mc_addrs,
+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);
}
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],
&is_mac_forced);
if (is_mac_exist) {
DP_INFO(edev, "VF macaddr received from PF\n");
- ether_addr_copy((struct ether_addr *)&vf_mac,
+ 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);
};
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;
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;
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);
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;
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);
}
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);
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;
};
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)
{
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;
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 = dev->data->dev_private;
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);
static int
-sfc_set_mc_addr_list(struct rte_eth_dev *dev, struct ether_addr *mc_addr_set,
+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 = dev->data->dev_private;
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
int rc;
const efx_nic_cfg_t *encp;
- const struct ether_addr *from;
+ const struct rte_ether_addr *from;
sfc_register_dp();
* 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);
goto fail_mac_pdu_set;
if (!port->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);
{
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;
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;
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 {
} else
return NULL;
- return (struct ether_addr *)ðer_addr;
+ return (struct rte_ether_addr *)ðer_addr;
}
int
}
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;
}
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);
rte_free(p);
}
-static struct ether_addr eth_addr = {
+static struct rte_ether_addr eth_addr = {
.addr_bytes = {0},
};
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 }
};
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;
}
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!");
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;
}
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;
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,
+ 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;
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)
{
/*
static int
eth_dev_tap_create(struct rte_vdev_device *vdev, 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();
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;
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;
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;
strcpy(tuntap_name, "TAP");
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 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 */
#define KEY_IDX 0
#define BPF_MAP_ID_KEY 1
-struct vlan_hdr {
+struct rte_vlan_hdr {
__be16 proto;
__be16 tci;
};
/* 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)) {
nic->node = mbx.nic_cfg.node_id;
nic->sqs_mode = mbx.nic_cfg.sqs_mode;
nic->loopback_supported = mbx.nic_cfg.loopback_supported;
- ether_addr_copy((struct ether_addr *)mbx.nic_cfg.mac_addr,
- (struct ether_addr *)nic->mac_addr);
+ ether_addr_copy((struct rte_ether_addr *)mbx.nic_cfg.mac_addr,
+ (struct rte_ether_addr *)nic->mac_addr);
nic->pf_acked = true;
break;
case NIC_MBOX_MSG_ACK:
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);
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. */
};
*/
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();
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;
*/
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 *);
*/
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 *);
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 ":"
NULL
};
-static struct ether_addr base_eth_addr = {
+static struct rte_ether_addr base_eth_addr = {
.addr_bytes = {
0x56 /* V */,
0x48 /* H */,
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]++;
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;
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_enable(struct rte_eth_dev *dev);
static int virtio_intr_disable(struct rte_eth_dev *dev);
}
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;
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;
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;
}
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;
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;
/* 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",
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;
if (s == 64) {
stats->size_bins[1]++;
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++;
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;
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",
}
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;
}
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)))
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;
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 */
}
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,
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
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) {
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
}
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);
}
}
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");
}
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);
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");
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;
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 */
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 */
"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);
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);
}
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;
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;
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:");
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;
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));
+ arp_hdr = (struct rte_arp_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;
{
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) {
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",
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;
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;
};
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;
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);
}
}
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)
}
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;
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;
* - (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.
* - (-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
* - (-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.
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",
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);
}
.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. */
.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. */
.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),
},
/*
.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),
},
.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),
},
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;
#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);
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;
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=",
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
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;
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];
}
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);
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;
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;
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 {
} else
return NULL;
- return (struct ether_addr *)ðer_addr;
+ return (struct rte_ether_addr *)ðer_addr;
}
int
}
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;
}
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 {
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
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;
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;
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);
}
}
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);
}
}
}
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);
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));
prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port)
{
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 |= PKT_TX_IP_CKSUM | PKT_TX_IPV4;
}
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
}
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);
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);
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;
* 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);
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);
}
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);
}
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);
}
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);
}
/* 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);
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",
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;
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);
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];
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;
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];
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;
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];
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;
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];
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;
*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) \
unsigned char a, b, c, d;
struct ipv4_hdr *ipv4_hdr = rte_pktmbuf_mtod_offset(m,
struct ipv4_hdr *,
- sizeof(struct ether_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);
uint32_t offset = sig & ~ACL_DENY_SIGNATURE;
struct ipv6_hdr *ipv6_hdr = rte_pktmbuf_mtod_offset(m,
struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
printf("Packet Src");
for (i = 0; i < RTE_DIM(ipv6_hdr->src_addr); i += sizeof(uint16_t))
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) {
}
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);
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];
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;
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) */
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);
}
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);
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;
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) */
}
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);
/* 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;
*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);
}
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]];
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;
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) *
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) */
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);
/* 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);
/* 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);
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) {
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);
+ struct rte_ether_hdr *) + 1);
}
if (tcp_or_udp && (l3_type == RTE_PTYPE_L3_IPV4)) {
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);
{
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);
{
__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);
{
__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)));
/* 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);
/* 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);
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);
+ struct rte_ether_hdr *) + 1);
}
dst_port[j] = em_get_dst_port(qconf, pkts_burst[j], portid);
}
{
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,
{
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,
} 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,
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;
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) */
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);
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;
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;
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);
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++;
}
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;
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);
}
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]]);
_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);
}
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]];
/* 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];
}
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);
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);
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;
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];
pkt = lp->mbuf_in.array[j];
ipv4_hdr = rte_pktmbuf_mtod_offset(pkt,
struct ipv4_hdr *,
- sizeof(struct ether_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)) {
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",
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;
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;
/* 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];
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) */
#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);
__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);
{
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]);
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) */
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);
{
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(
} 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(
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;
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;
_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);
}
}
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];
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);
},
};
-static const struct ether_addr ether_multicast = {
+static const struct rte_ether_addr ether_multicast = {
.addr_bytes = {0x01, 0x1b, 0x19, 0x0, 0x0, 0x0}
};
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) {
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)
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);
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. */
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;
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,
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:
{
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;
{
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",
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);
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
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];
}
{
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;
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];
}
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",
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;
/**< 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. */
* 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);
}
* 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;
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);
}
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);
(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);
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;
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;
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);
#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 {
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 } };
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;
}
/* 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"
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;
};
/* 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);
}
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;
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,
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)
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)
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;
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;
/*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))
/**< 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 */
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;
};
union PFID {
- struct ether_addr addr;
+ struct rte_ether_addr addr;
uint64_t pfid;
};
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",
/* Initialize ports. */
RTE_ETH_FOREACH_DEV(portid) {
- struct ether_addr eth;
+ struct rte_ether_addr eth;
int w, j;
int ret;
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
* 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;
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];
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. */
/* 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;
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];
#include <ctype.h>
#include <string.h>
#include <sys/types.h>
-#include <net/ethernet.h>
#include <rte_string_fns.h>
+#include <rte_ether.h>
#include "cmdline_parse.h"
#include "cmdline_parse_etheraddr.h"
/* the format can be either XX:XX:XX:XX:XX:XX or XXXX:XXXX:XXXX */
#define ETHER_ADDRSTRLENLONG 18
#define ETHER_ADDRSTRLENSHORT 15
+#define ETHER_ADDR_LEN 6
-#ifdef __linux__
-#define ea_oct ether_addr_octet
-#else
-#define ea_oct octet
-#endif
-
-
-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 {
while (i-- != 0) {
if (o[i] > UINT8_MAX)
return NULL;
- ether_addr.ea_oct[i] = (uint8_t)o[i];
+ ether_addr.addr_bytes[i] = (uint8_t)o[i];
}
/* Support the format XXXX:XXXX:XXXX */
} else if (i == ETHER_ADDR_LEN / 2) {
while (i-- != 0) {
if (o[i] > UINT16_MAX)
return NULL;
- ether_addr.ea_oct[i * 2] = (uint8_t)(o[i] >> 8);
- ether_addr.ea_oct[i * 2 + 1] = (uint8_t)(o[i] & 0xff);
+ ether_addr.addr_bytes[i * 2] = (uint8_t)(o[i] >> 8);
+ ether_addr.addr_bytes[i * 2 + 1] = (uint8_t)(o[i] & 0xff);
}
/* unknown format */
} else
return NULL;
- return (struct ether_addr *)ðer_addr;
+ return (struct rte_ether_addr *)ðer_addr;
}
int
{
unsigned int token_len = 0;
char ether_str[ETHER_ADDRSTRLENLONG+1];
- struct ether_addr *tmp;
+ struct rte_ether_addr *tmp;
- if (res && ressize < sizeof(struct ether_addr))
+ if (res && ressize < sizeof(struct rte_ether_addr))
return -1;
if (!buf || ! *buf)
if (tmp == NULL)
return -1;
if (res)
- memcpy(res, tmp, sizeof(struct ether_addr));
+ memcpy(res, tmp, sizeof(struct rte_ether_addr));
return token_len;
}
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;
};
/**
* 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*/
* 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
* 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. */
};
/**
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. */
};
/**
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;
}
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;
* 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];
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;
}
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;
}
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;
* 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];
}
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;
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;
* 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.
* - (-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);
/**
* - (-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.
* - (-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.
* - (-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);
/**
* - (-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);
/**
/**< @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 */
/**< @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 */
/**< Common rx buffer size handled by all queues */
uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
- struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
+ struct rte_ether_addr* mac_addrs;/**< Device Ethernet Link address. */
uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
/** bitmap array of associating Ethernet MAC addresses to pools */
- struct ether_addr* hash_mac_addrs;
+ struct rte_ether_addr* hash_mac_addrs;
/** Device Ethernet MAC addresses of hash filtering. */
uint16_t port_id; /**< Device [external] port identifier. */
__extension__
* 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. */
};
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. */
};
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. */
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. */
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;
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);
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;
int cmp;
uint8_t find;
- 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;
/* 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;
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;
uint16_t tcp_dl, frag_off, outer_ip_id, ip_id;
uint8_t outer_is_atomic, is_atomic;
uint16_t hdr_len;
uint8_t find;
- 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);
/* 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;
#include <rte_mbuf.h>
/* 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. */
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);
#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;
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;
* 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__));
*/
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
}
* 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__));
* 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++)
* 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++)
* 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;
}
* 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;
}
* 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;
* 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;
}
* 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;
}
* 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));
}
* @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);
*/
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],
* 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__));
* 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__));
* 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__));
#define ETHER_TYPE_TEB 0x6558 /**< Transparent Ethernet Bridging. */
#define ETHER_TYPE_LLDP 0x88CC /**< LLDP Protocol. */
-#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. */
/**
* 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). */
#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. */
/**
*/
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;
*/
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) {
*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;
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;
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);
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),
}
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;
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;
}
struct encap_ether_data {
- struct ether_hdr ether;
+ struct rte_ether_hdr ether;
} __attribute__((__packed__));
#define VLAN(pcp, dei, vid) \
(((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
(((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__));
} __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__));
static size_t
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));
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));
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));
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));
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);
/** 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. */
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;
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);
}
.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),
},
{
.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),
},
{
.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),
},
{
.size = sizeof(uint16_t),
.field_index = SRCP_FIELD_IPV4,
.input_index = SRCP_FIELD_IPV4,
- .offset = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr),
+ .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr),
},
{
.type = RTE_ACL_FIELD_TYPE_RANGE,
.size = sizeof(uint16_t),
.field_index = DSTP_FIELD_IPV4,
.input_index = SRCP_FIELD_IPV4,
- .offset = sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr) +
+ .offset = sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr) +
sizeof(uint16_t),
},
};
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);
}
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);
}
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);
int
generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
- struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
+ struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst,
uint8_t pkt_len, uint8_t nb_pkt_segs)
{
* 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);
int
generate_packet_burst_proto(struct rte_mempool *mp,
struct rte_mbuf **pkts_burst,
- struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
+ struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
uint8_t ipv4, uint8_t proto, void *proto_hdr,
int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs)
{
* 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);
#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,
+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
int
generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
- struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
+ struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst,
uint8_t pkt_len, uint8_t nb_pkt_segs);
int
generate_packet_burst_proto(struct rte_mempool *mp,
struct rte_mbuf **pkts_burst,
- struct ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
+ struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
uint8_t ipv4, uint8_t proto, void *proto_hdr,
int nb_pkt_per_burst, uint8_t pkt_len, uint8_t nb_pkt_segs);
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)
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 */
{
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));
{
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));
/* 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));
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",
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",
.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. */
.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. */
.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),
},
/*
.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),
},
.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),
},
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);
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,
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);
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,
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);
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,
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;
.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,
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!");
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,
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;
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++)
"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 */
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),
uint16_t slaves[RTE_MAX_ETHPORTS];
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
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);
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, expected_mac_addr_0, expected_mac_addr_2;
int i;
/* 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);
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;
"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);
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, 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);
/* 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);
"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);
"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 */
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, 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);
/* 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);
"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,
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, expected_mac_addr_0, expected_mac_addr_1;
int i;
/* 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);
/*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);
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, 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);
/* 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);
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,
*/
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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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);
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 *);
- arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(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 rte_ether_hdr));
if (slave_idx%2 == 0) {
if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) {
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;
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,
*/
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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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,
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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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,
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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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,
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));
+ arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + 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,
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 *);
- arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(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 rte_ether_hdr));
if (slave_idx%2 == 0) {
if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) {
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;
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,
*/
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;
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;
#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 }
};
};
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 {
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 &&
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 *);
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;
}
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;
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;
}
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;
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);
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)]++;
}
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);
}
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");
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,
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,
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) {
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 = {
}
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);
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;
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),
static void
prepare_pkt(struct rte_mbuf *mbuf)
{
- struct ether_hdr *eth_hdr;
- struct vlan_hdr *vlan1, *vlan2;
+ struct rte_ether_hdr *eth_hdr;
+ struct rte_vlan_hdr *vlan1, *vlan2;
struct ipv4_hdr *ip_hdr;
/* Simulate a classifier */
- eth_hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr *);
- vlan1 = (struct vlan_hdr *)(ð_hdr->ether_type );
- vlan2 = (struct vlan_hdr *)((uintptr_t)ð_hdr->ether_type + sizeof(struct vlan_hdr));
- eth_hdr = (struct ether_hdr *)((uintptr_t)ð_hdr->ether_type + 2 *sizeof(struct vlan_hdr));
+ eth_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *);
+ vlan1 = (struct rte_vlan_hdr *)(ð_hdr->ether_type );
+ vlan2 = (struct rte_vlan_hdr *)((uintptr_t)ð_hdr->ether_type + sizeof(struct rte_vlan_hdr));
+ eth_hdr = (struct rte_ether_hdr *)((uintptr_t)ð_hdr->ether_type + 2 *sizeof(struct rte_vlan_hdr));
ip_hdr = (struct ipv4_hdr *)((uintptr_t)eth_hdr + sizeof(eth_hdr->ether_type));
vlan1->vlan_tci = rte_cpu_to_be_16(SUBPORT);
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;
}
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;
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