summaryrefslogtreecommitdiff
path: root/examples/l2fwd-cat
diff options
context:
space:
mode:
authorZhiyong Yang <zhiyong.yang@intel.com>2017-09-29 15:17:24 +0800
committerThomas Monjalon <thomas@monjalon.net>2017-10-06 18:23:25 +0200
commitf8244c6399d9fae6afab6770ae367aef38742ea5 (patch)
tree9861217c70b10fd192462d338900428365aba00a /examples/l2fwd-cat
parent2db978d04ba91e18fc8647f125f4d7b15965c57c (diff)
downloaddpdk-f8244c6399d9fae6afab6770ae367aef38742ea5.zip
dpdk-f8244c6399d9fae6afab6770ae367aef38742ea5.tar.gz
dpdk-f8244c6399d9fae6afab6770ae367aef38742ea5.tar.xz
ethdev: increase port id range
Extend port_id definition from uint8_t to uint16_t in lib and drivers data structures, specifically rte_eth_dev_data. Modify the APIs, drivers and app using port_id at the same time. Fix some checkpatch issues from the original code and remove some unnecessary cast operations. release_17_11 and deprecation docs have been updated in this patch. Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'examples/l2fwd-cat')
-rw-r--r--examples/l2fwd-cat/l2fwd-cat.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index c293bd9..b10ac89 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -59,7 +59,7 @@ static const struct rte_eth_conf port_conf_default = {
* coming from the mbuf_pool passed as a parameter.
*/
static inline int
-port_init(uint8_t port, struct rte_mempool *mbuf_pool)
+port_init(uint16_t port, struct rte_mempool *mbuf_pool)
{
struct rte_eth_conf port_conf = port_conf_default;
const uint16_t rx_rings = 1, tx_rings = 1;
@@ -106,7 +106,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
- (unsigned)port,
+ port,
addr.addr_bytes[0], addr.addr_bytes[1],
addr.addr_bytes[2], addr.addr_bytes[3],
addr.addr_bytes[4], addr.addr_bytes[5]);
@@ -124,8 +124,8 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
static __attribute__((noreturn)) void
lcore_main(void)
{
- const uint8_t nb_ports = rte_eth_dev_count();
- uint8_t port;
+ const uint16_t nb_ports = rte_eth_dev_count();
+ uint16_t port;
/*
* Check that the port is on the same NUMA node as the polling thread
@@ -181,7 +181,7 @@ main(int argc, char *argv[])
{
struct rte_mempool *mbuf_pool;
unsigned nb_ports;
- uint8_t portid;
+ uint16_t portid;
/* Initialize the Environment Abstraction Layer (EAL). */
int ret = rte_eal_init(argc, argv);
@@ -217,7 +217,7 @@ main(int argc, char *argv[])
/* Initialize all ports. */
for (portid = 0; portid < nb_ports; portid++)
if (port_init(portid, mbuf_pool) != 0)
- rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu8 "\n",
+ rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu16 "\n",
portid);
if (rte_lcore_count() > 1)