+#if 0
+//-------------------------------------------------------------------------------------------
+/** @ingroup xran
+ *
+ * @param[in] port - DPDK ETH port id
+ *
+ * @return void
+ *
+ * @description
+ * Prints statistics of usage of DPDK port
+ *
+**/
+//-------------------------------------------------------------------------------------------
+void xran_ethdi_ports_stats(void)
+{
+ struct rte_eth_stats stats;
+ struct xran_ethdi_ctx *ctx = xran_ethdi_get_ctx();
+ int32_t i = 0;
+
+ for(i = 0; i < ETHDI_VF_MAX; i++){
+ /* Get stats (extended stats includes common stats) */
+ rte_eth_stats_get(ctx->io_cfg.port[i], &stats);
+ printf("DPDK stats:\n");
+ printf("** Port %hhu **\n", ctx->io_cfg.port[i]);
+ printf("ierrors:\t%lu\n", stats.ierrors);
+ printf("oerrors:\t%lu\n", stats.oerrors);
+ printf("ipackets:\t%lu\n", stats.ipackets);
+ printf("opackets:\t%lu\n", stats.opackets);
+ printf("imissed:\t%lu\n", stats.imissed);
+ printf("rx_nombuf:\t%lu\n", stats.rx_nombuf);
+ }
+ return ;
+}
+#endif
+/* Check the link status of all ports in up to 9s, and print them finally */
+static void check_port_link_status(uint8_t portid)
+{
+#define CHECK_INTERVAL 100 /* 100ms */
+#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
+ uint8_t count, all_ports_up, print_flag = 0;
+ struct rte_eth_link link;
+
+ printf("\nChecking link status");
+ fflush(stdout);
+ for (count = 0; count <= MAX_CHECK_TIME; count++) {
+ all_ports_up = 1;
+ memset(&link, 0, sizeof(link));
+ rte_eth_link_get_nowait(portid, &link);
+
+ /* print link status if flag set */
+ if (print_flag == 1) {
+ if (link.link_status)
+ printf("Port %d Link Up - speed %u "
+ "Mbps - %s\n", (uint8_t)portid,
+ (unsigned)link.link_speed,
+ (link.link_duplex == ETH_LINK_FULL_DUPLEX) ?
+ ("full-duplex") : ("half-duplex\n"));
+ else
+ printf("Port %d Link Down\n",
+ (uint8_t)portid);
+ }
+ /* clear all_ports_up flag if any link down */
+ if (link.link_status == ETH_LINK_DOWN) {
+ all_ports_up = 0;
+ break;
+ }
+ /* after finally printing all link status, get out */
+ if (print_flag == 1)
+ break;
+
+ if (all_ports_up == 0) {
+ printf(".");
+ fflush(stdout);
+ rte_delay_ms(CHECK_INTERVAL);
+ }