summaryrefslogtreecommitdiff
path: root/examples/l3fwd-acl
diff options
context:
space:
mode:
authorZhiyong Yang <zhiyong.yang@intel.com>2017-10-13 21:17:00 +0800
committerThomas Monjalon <thomas@monjalon.net>2017-10-13 21:57:49 +0200
commit47523597ff6c6ecf5e26e9bd149ab74cca5ec598 (patch)
treed1654b9f107740099486fcf92bf0f2d949be1aa7 /examples/l3fwd-acl
parentb526f0552432ec7c8ef5bd5914f90a03473e9149 (diff)
downloaddpdk-47523597ff6c6ecf5e26e9bd149ab74cca5ec598.zip
dpdk-47523597ff6c6ecf5e26e9bd149ab74cca5ec598.tar.gz
dpdk-47523597ff6c6ecf5e26e9bd149ab74cca5ec598.tar.xz
examples: fix port id type
Fixes: f8244c6399d9 ("ethdev: increase port id range") Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
Diffstat (limited to 'examples/l3fwd-acl')
-rw-r--r--examples/l3fwd-acl/main.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index 77f83cd..a7f9fff 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -184,7 +184,7 @@ static inline int
is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len);
#endif
static inline void
-send_single_packet(struct rte_mbuf *m, uint8_t port);
+send_single_packet(struct rte_mbuf *m, uint16_t port);
#define MAX_ACL_RULE_NUM 100000
#define DEFAULT_MAX_CATEGORIES 1
@@ -1297,7 +1297,7 @@ static struct lcore_conf lcore_conf[RTE_MAX_LCORE];
/* Enqueue a single packet, and send burst if queue is filled */
static inline void
-send_single_packet(struct rte_mbuf *m, uint8_t port)
+send_single_packet(struct rte_mbuf *m, uint16_t port)
{
uint32_t lcore_id;
struct lcore_conf *qconf;
@@ -1501,7 +1501,7 @@ check_port_config(const unsigned nb_ports)
}
static uint8_t
-get_port_n_rx_queues(const uint8_t port)
+get_port_n_rx_queues(const uint16_t port)
{
int queue = -1;
uint16_t i;
@@ -1830,11 +1830,12 @@ init_mem(unsigned nb_mbuf)
/* 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 */
- uint8_t portid, count, all_ports_up, print_flag = 0;
+ uint16_t portid;
+ uint8_t count, all_ports_up, print_flag = 0;
struct rte_eth_link link;
printf("\nChecking link status");
@@ -1849,14 +1850,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 */
@@ -1894,7 +1894,8 @@ main(int argc, char **argv)
uint16_t queueid;
unsigned lcore_id;
uint32_t n_tx_queue, nb_lcores;
- uint8_t portid, nb_rx_queue, queue, socketid;
+ uint16_t portid;
+ uint8_t nb_rx_queue, queue, socketid;
/* init EAL */
ret = rte_eal_init(argc, argv);