|
78 | 78 | #include <rte_spinlock.h> |
79 | 79 |
|
80 | 80 | #include "ans_init.h" |
81 | | -#include "ans_enet_intf.h" |
82 | 81 | #include "ans_ip_intf.h" |
83 | 82 |
|
84 | 83 | /* add by ans_team -- end */ |
@@ -464,7 +463,7 @@ static int ans_init_ports(unsigned short nb_ports, struct ans_user_config *user |
464 | 463 | /* user default tx conf */ |
465 | 464 |
|
466 | 465 | /* txconf = &ans_tx_conf; */ |
467 | | - txconf->txq_flags = 0; |
| 466 | + txconf->txq_flags = 0; /* enable NIC all TX offload */ |
468 | 467 |
|
469 | 468 | printf("\t lcore id:%u, tx queue id:%d, socket id:%d \n", lcore_id, queueid, socketid); |
470 | 469 | printf("\t Conf-- tx pthresh:%d, tx hthresh:%d, tx wthresh:%d, txq_flags:0x%x \n", txconf->tx_thresh.pthresh, |
@@ -746,7 +745,7 @@ static int ans_main_loop(__attribute__((unused)) void *dummy) |
746 | 745 | cur_tsc = rte_rdtsc(); |
747 | 746 |
|
748 | 747 | /* add by ans_team ---start */ |
749 | | - ans_message_handle(lcore_id, cur_tsc); |
| 748 | + ans_message_handle(lcore_id); |
750 | 749 | /* add by ans_team ---end */ |
751 | 750 |
|
752 | 751 |
|
@@ -970,28 +969,31 @@ int main(int argc, char **argv) |
970 | 969 | printf("add %s device\r\n", ifname); |
971 | 970 | rte_eth_macaddr_get(portid, ð_addr); |
972 | 971 |
|
973 | | - ans_intf_add(portid, ifname, ð_addr); |
| 972 | + ans_iface_add(portid, ifname, ð_addr); |
974 | 973 |
|
975 | | - int ip_addr = 0x0200000a; |
| 974 | + /* host byte order */ |
| 975 | + int ip_addr = 0x0a000002; |
976 | 976 | ip_addr += portid << 16; |
977 | 977 |
|
978 | 978 | printf("add IP %x on device %s \n", ip_addr, ifname); |
979 | | - ans_intf_add_ipaddr((caddr_t)ifname, ip_addr, 0x00ffffff); |
| 979 | + ans_add_ipaddr((char *)ifname, ip_addr, 24); |
980 | 980 | } |
| 981 | + |
| 982 | + printf("show all IPs: \n"); |
| 983 | + ans_show_ipaddr(); |
| 984 | + printf("\n"); |
| 985 | + |
981 | 986 | /* add by ans_team ---end */ |
982 | 987 |
|
983 | 988 | /* add by ans_team for testing ---start */ |
984 | | - |
985 | | - printf("Show interface \n"); |
986 | | - ans_intf_show(); |
987 | | - |
| 989 | + |
988 | 990 | int route_ret = 0; |
989 | 991 | printf("add static route \r\n"); |
990 | 992 |
|
991 | | - route_ret = ans_add_route(0x00000a0a, 1, 0x0500000a, 0x00ffffff, ANS_IP_RTF_GATEWAY); |
992 | | - |
993 | | - ans_route_show_all(); |
| 993 | + /* host byte order */ |
| 994 | + route_ret = ans_add_route(0x0a0a0000, 24, 0x0a000005); |
994 | 995 |
|
| 996 | + ans_show_route(); |
995 | 997 | printf("\n"); |
996 | 998 | /* add by ans_team ---end */ |
997 | 999 |
|
|
0 commit comments