git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
examples: fix port id type
[dpdk.git]
/
examples
/
link_status_interrupt
/
main.c
diff --git
a/examples/link_status_interrupt/main.c
b/examples/link_status_interrupt/main.c
index
c83a62f
..
9d562f8
100644
(file)
--- a/
examples/link_status_interrupt/main.c
+++ b/
examples/link_status_interrupt/main.c
@@
-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 the link status of all ports in up to 9s, and print them finally */
static void
-check_all_ports_link_status(uint
8
_t port_num, uint32_t port_mask)
+check_all_ports_link_status(uint
16
_t port_num, uint32_t port_mask)
{
#define CHECK_INTERVAL 100 /* 100ms */
#define MAX_CHECK_TIME 90 /* 9s (90 * 100ms) in total */
{
#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)
/* 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
(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 */
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;
struct lcore_queue_conf *qconf;
struct rte_eth_dev_info dev_info;
int ret;
- uint
8
_t nb_ports;
- uint
8
_t portid, portid_last = 0;
+ uint
16
_t nb_ports;
+ uint
16
_t portid, portid_last = 0;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;
unsigned lcore_id, rx_lcore_id;
unsigned nb_ports_in_mask = 0;