X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl2fwd%2Fmain.c;h=1e2b142976a23ee17e25f22ce37239c01062ae23;hb=5908e7e837a62fe62c48094d8c2e947242f8fac3;hp=f8ca29cf679118374941ae9dbe0fc509cfeab45a;hpb=8728ccf37615904cf23fb8763895b05c9a3c6b0c;p=dpdk.git diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index f8ca29cf67..1e2b142976 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -59,7 +59,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT; static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT; /* ethernet addresses of ports */ -static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; +static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS]; /* mask of enabled ports */ static uint32_t l2fwd_enabled_port_mask = 0; @@ -82,8 +82,6 @@ static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, - .ignore_offload_bitfield = 1, - .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -153,17 +151,17 @@ print_stats(void) static void l2fwd_mac_updating(struct rte_mbuf *m, unsigned dest_portid) { - struct ether_hdr *eth; + struct rte_ether_hdr *eth; void *tmp; - eth = rte_pktmbuf_mtod(m, struct ether_hdr *); + eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *); /* 02:00:00:00:00:xx */ tmp = ð->d_addr.addr_bytes[0]; *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40); /* src addr */ - ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], ð->s_addr); + rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], ð->s_addr); } static void @@ -545,7 +543,7 @@ main(int argc, char **argv) /* convert to number of cycles */ timer_period *= rte_get_timer_hz(); - nb_ports = rte_eth_dev_count(); + nb_ports = rte_eth_dev_count_avail(); if (nb_ports == 0) rte_exit(EXIT_FAILURE, "No Ethernet ports - bye\n"); @@ -670,7 +668,6 @@ main(int argc, char **argv) /* init one TX queue on each port */ fflush(stdout); txq_conf = dev_info.default_txconf; - txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; txq_conf.offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid),