X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fl3fwd%2Fl3fwd_fib.c;h=7fd7c1dd645724287edd3a310242deea076d1fab;hb=c4045f34557a5ce3de2b14e997fe41b122595e29;hp=178722994284cf57884aca93c833cc15a0110c3c;hpb=91470c0ddfabc61655f6ed1516efd495d9271324;p=dpdk.git diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index 1787229942..7fd7c1dd64 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -92,9 +92,9 @@ fib_send_single(int nb_tx, struct lcore_conf *qconf, /* Set MAC addresses. */ eth_hdr = rte_pktmbuf_mtod(pkts_burst[j], struct rte_ether_hdr *); - *(uint64_t *)ð_hdr->d_addr = dest_eth_addr[hops[j]]; + *(uint64_t *)ð_hdr->dst_addr = dest_eth_addr[hops[j]]; rte_ether_addr_copy(&ports_eth_addr[hops[j]], - ð_hdr->s_addr); + ð_hdr->src_addr); /* Send single packet. */ send_single_packet(qconf, pkts_burst[j], hops[j]); @@ -182,14 +182,16 @@ fib_main_loop(__rte_unused void *dummy) lcore_id = rte_lcore_id(); qconf = &lcore_conf[lcore_id]; - if (qconf->n_rx_queue == 0) { + const uint16_t n_rx_q = qconf->n_rx_queue; + const uint16_t n_tx_p = qconf->n_tx_port; + if (n_rx_q == 0) { RTE_LOG(INFO, L3FWD, "lcore %u has nothing to do\n", lcore_id); return 0; } RTE_LOG(INFO, L3FWD, "entering main loop on lcore %u\n", lcore_id); - for (i = 0; i < qconf->n_rx_queue; i++) { + for (i = 0; i < n_rx_q; i++) { portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; @@ -207,7 +209,7 @@ fib_main_loop(__rte_unused void *dummy) diff_tsc = cur_tsc - prev_tsc; if (unlikely(diff_tsc > drain_tsc)) { - for (i = 0; i < qconf->n_tx_port; ++i) { + for (i = 0; i < n_tx_p; ++i) { portid = qconf->tx_port_id[i]; if (qconf->tx_mbufs[portid].len == 0) continue; @@ -221,7 +223,7 @@ fib_main_loop(__rte_unused void *dummy) } /* Read packet from RX queues. */ - for (i = 0; i < qconf->n_rx_queue; ++i) { + for (i = 0; i < n_rx_q; ++i) { portid = qconf->rx_queue_list[i].port_id; queueid = qconf->rx_queue_list[i].queue_id; nb_rx = rte_eth_rx_burst(portid, queueid, pkts_burst, @@ -410,7 +412,7 @@ fib_event_main_loop_tx_q_burst(__rte_unused void *dummy) return 0; } -/* Function to setup fib. */ +/* Function to setup fib. 8< */ void setup_fib(const int socketid) { @@ -466,6 +468,7 @@ setup_fib(const int socketid) ipv4_l3fwd_route_array[i].if_out); } } + /* >8 End of setup fib. */ /* Create the fib IPv6 table. */ snprintf(s, sizeof(s), "IPV6_L3FWD_FIB_%d", socketid);