examples: fix port id type
[dpdk.git] / examples / link_status_interrupt / main.c
index c83a62f..9d562f8 100644 (file)
@@ -494,7 +494,7 @@ lsi_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param,
 
 /* Check the link status of all ports in up to 9s, and print them finally */
 static void
-check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
 {
 #define CHECK_INTERVAL 100 /* 100ms */
 #define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
@@ -514,14 +514,13 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
                        /* 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,
+                                       printf(
+                                       "Port%d Link Up. Speed %u Mbps - %s\n",
+                                               portid, 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);
+                                       printf("Port %d Link Down\n", portid);
                                continue;
                        }
                        /* clear all_ports_up flag if any link down */
@@ -554,8 +553,8 @@ main(int argc, char **argv)
        struct lcore_queue_conf *qconf;
        struct rte_eth_dev_info dev_info;
        int ret;
-       uint8_t nb_ports;
-       uint8_t portid, portid_last = 0;
+       uint16_t nb_ports;
+       uint16_t portid, portid_last = 0;
        unsigned lcore_id, rx_lcore_id;
        unsigned nb_ports_in_mask = 0;