DPDK patches and discussions
 help / color / mirror / Atom feed
From: Zhiyong Yang <zhiyong.yang@intel.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, Zhiyong Yang <zhiyong.yang@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] examples: increase port_id range
Date: Wed,  9 Aug 2017 16:42:03 +0800	[thread overview]
Message-ID: <20170809084203.17562-3-zhiyong.yang@intel.com> (raw)
In-Reply-To: <20170809084203.17562-1-zhiyong.yang@intel.com>

Modify port_id related code in examples accordingly since port_id
definition in lib changes.

Signed-off-by: Zhiyong Yang <zhiyong.yang@intel.com>
---
 examples/bond/main.c                            |  6 +++---
 examples/ip_fragmentation/main.c                |  4 ++--
 examples/l3fwd-power/main.c                     |  7 ++++---
 examples/l3fwd/l3fwd.h                          | 10 +++++-----
 examples/l3fwd/l3fwd_em.c                       |  2 +-
 examples/l3fwd/l3fwd_lpm.c                      |  2 +-
 examples/link_status_interrupt/main.c           |  5 +++--
 examples/performance-thread/l3fwd-thread/main.c |  7 ++++---
 examples/rxtx_callbacks/main.c                  |  8 ++++----
 9 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 2d019d433..231906072 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -144,7 +144,7 @@
 uint8_t slaves[RTE_MAX_ETHPORTS];
 uint8_t slaves_count;
 
-static uint8_t BOND_PORT = 0xff;
+static uint16_t BOND_PORT = 0xff;
 
 static struct rte_mempool *mbuf_pool;
 
@@ -234,7 +234,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
 		rte_exit(EXIT_FAILURE,
 				"Faled to create bond port\n");
 
-	BOND_PORT = (uint8_t)retval;
+	BOND_PORT = (uint16_t)retval;
 
 	retval = rte_eth_dev_configure(BOND_PORT, 1, 1, &port_conf);
 	if (retval != 0)
@@ -675,7 +675,7 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result,
 			    struct cmdline *cl,
 			    __attribute__((unused)) void *data)
 {
-	uint8_t slaves[16] = {0};
+	uint16_t slaves[16] = {0};
 	uint8_t len = 16;
 	struct ether_addr addr;
 	uint8_t i = 0;
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 8c0e17911..a8e2a8657 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -708,7 +708,7 @@ parse_ptype(struct rte_mbuf *m)
 
 /* callback function to detect packet type for a queue of a port */
 static uint16_t
-cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused,
+cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused,
 		   struct rte_mbuf *pkts[], uint16_t nb_pkts,
 		   uint16_t max_pkts __rte_unused,
 		   void *user_param __rte_unused)
@@ -876,7 +876,7 @@ main(int argc, char **argv)
 	uint16_t queueid = 0;
 	unsigned lcore_id = 0, rx_lcore_id = 0;
 	uint32_t n_tx_queue, nb_lcores;
-	uint8_t portid;
+	uint16_t portid;
 
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index fd442f5ef..a64188a5b 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -634,7 +634,7 @@ parse_ptype_one(struct rte_mbuf *m)
 }
 
 static uint16_t
-cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused,
+cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused,
 	       struct rte_mbuf *pkts[], uint16_t nb_pkts,
 	       uint16_t max_pkts __rte_unused,
 	       void *user_param __rte_unused)
@@ -648,7 +648,7 @@ cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused,
 }
 
 static int
-add_cb_parse_ptype(uint8_t portid, uint16_t queueid)
+add_cb_parse_ptype(uint16_t portid, uint16_t queueid)
 {
 	printf("Port %d: softly parse packet type info\n", portid);
 	if (rte_eth_add_rx_callback(portid, queueid, cb_parse_ptype, NULL))
@@ -1651,7 +1651,8 @@ main(int argc, char **argv)
 	uint64_t hz;
 	uint32_t n_tx_queue, nb_lcores;
 	uint32_t dev_rxq_num, dev_txq_num;
-	uint8_t portid, nb_rx_queue, queue, socketid;
+	uint8_t nb_rx_queue, queue, socketid;
+	uint16_t portid;
 	uint16_t org_rxq_intr = port_conf.intr_conf.rxq;
 
 	/* catch SIGINT and restore cpufreq governor to ondemand */
diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index 011ba148b..d1d14f957 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -83,7 +83,7 @@ struct mbuf_table {
 };
 
 struct lcore_rx_queue {
-	uint8_t port_id;
+	uint16_t port_id;
 	uint8_t queue_id;
 } __rte_cache_aligned;
 
@@ -117,7 +117,7 @@ extern struct lcore_conf lcore_conf[RTE_MAX_LCORE];
 
 /* Send burst of packets on an output interface */
 static inline int
-send_burst(struct lcore_conf *qconf, uint16_t n, uint8_t port)
+send_burst(struct lcore_conf *qconf, uint16_t n, uint16_t port)
 {
 	struct rte_mbuf **m_table;
 	int ret;
@@ -139,7 +139,7 @@ send_burst(struct lcore_conf *qconf, uint16_t n, uint8_t port)
 /* Enqueue a single packet, and send burst if queue is filled */
 static inline int
 send_single_packet(struct lcore_conf *qconf,
-		struct rte_mbuf *m, uint8_t port)
+		struct rte_mbuf *m, uint16_t port)
 {
 	uint16_t len;
 
@@ -212,11 +212,11 @@ int
 lpm_check_ptype(int portid);
 
 uint16_t
-em_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[],
+em_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[],
 		  uint16_t nb_pkts, uint16_t max_pkts, void *user_param);
 
 uint16_t
-lpm_cb_parse_ptype(uint8_t port, uint16_t queue, struct rte_mbuf *pkts[],
+lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[],
 		   uint16_t nb_pkts, uint16_t max_pkts, void *user_param);
 
 int
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 53d081bd7..df38a1362 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -628,7 +628,7 @@ em_parse_ptype(struct rte_mbuf *m)
 }
 
 uint16_t
-em_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused,
+em_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused,
 		  struct rte_mbuf *pkts[], uint16_t nb_pkts,
 		  uint16_t max_pkts __rte_unused,
 		  void *user_param __rte_unused)
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index ff1e40355..1cb9dccf7 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -413,7 +413,7 @@ lpm_parse_ptype(struct rte_mbuf *m)
 }
 
 uint16_t
-lpm_cb_parse_ptype(uint8_t port __rte_unused, uint16_t queue __rte_unused,
+lpm_cb_parse_ptype(uint16_t port __rte_unused, uint16_t queue __rte_unused,
 		   struct rte_mbuf *pkts[], uint16_t nb_pkts,
 		   uint16_t max_pkts __rte_unused,
 		   void *user_param __rte_unused)
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index f4e3969a6..e923243a2 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -470,7 +470,7 @@ lsi_parse_args(int argc, char **argv)
  *  int.
  */
 static int
-lsi_event_callback(uint8_t port_id, enum rte_eth_event_type type, void *param,
+lsi_event_callback(uint16_t port_id, enum rte_eth_event_type type, void *param,
 		    void *ret_param)
 {
 	struct rte_eth_link link;
@@ -498,7 +498,8 @@ check_all_ports_link_status(uint8_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;
+	uint8_t count, all_ports_up, print_flag = 0;
+	uint16_t portid;
 	struct rte_eth_link link;
 
 	printf("\nChecking link status");
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 7954b9744..826e08dca 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -140,7 +140,7 @@ parse_ptype(struct rte_mbuf *m)
 }
 
 static uint16_t
-cb_parse_ptype(__rte_unused uint8_t port, __rte_unused uint16_t queue,
+cb_parse_ptype(__rte_unused uint16_t port, __rte_unused uint16_t queue,
 		struct rte_mbuf *pkts[], uint16_t nb_pkts,
 		__rte_unused uint16_t max_pkts, __rte_unused void *user_param)
 {
@@ -3497,10 +3497,11 @@ main(int argc, char **argv)
 	int ret;
 	int i;
 	unsigned nb_ports;
-	uint16_t queueid;
+	uint16_t queueid, portid;
 	unsigned lcore_id;
 	uint32_t n_tx_queue, nb_lcores;
-	uint8_t portid, nb_rx_queue, queue, socketid;
+	uint8_t nb_rx_queue, queue, socketid;
+
 
 	/* init EAL */
 	ret = rte_eal_init(argc, argv);
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 669924055..e66f16f25 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -59,7 +59,7 @@ static struct {
 
 
 static uint16_t
-add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
+add_timestamps(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
 		struct rte_mbuf **pkts, uint16_t nb_pkts,
 		uint16_t max_pkts __rte_unused, void *_ __rte_unused)
 {
@@ -72,7 +72,7 @@ add_timestamps(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
 }
 
 static uint16_t
-calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
+calc_latency(uint16_t port __rte_unused, uint16_t qidx __rte_unused,
 		struct rte_mbuf **pkts, uint16_t nb_pkts, void *_ __rte_unused)
 {
 	uint64_t cycles = 0;
@@ -97,7 +97,7 @@ calc_latency(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
  * coming from the mbuf_pool passed as 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;
@@ -195,7 +195,7 @@ int
 main(int argc, char *argv[])
 {
 	struct rte_mempool *mbuf_pool;
-	uint8_t portid;
+	uint16_t portid;
 
 	/* init EAL */
 	int ret = rte_eal_init(argc, argv);
-- 
2.13.3

  parent reply	other threads:[~2017-08-09  8:42 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-09  8:42 [dpdk-dev] [PATCH 0/2] " Zhiyong Yang
2017-08-09  8:42 ` [dpdk-dev] [PATCH 1/2] ethdev: " Zhiyong Yang
2017-08-09 12:52   ` Ferruh Yigit
2017-08-09 12:57     ` Wiles, Keith
2017-08-10  0:53       ` Yang, Zhiyong
2017-08-10  0:51     ` Yang, Zhiyong
2017-08-09  8:42 ` Zhiyong Yang [this message]
2017-08-09 14:48   ` [dpdk-dev] [PATCH 2/2] examples: " Stephen Hemminger
2017-08-10  1:03     ` Yang, Zhiyong
2017-08-09  9:00 ` [dpdk-dev] [PATCH 0/2] " De Lara Guarch, Pablo
2017-08-09  9:17   ` Yang, Zhiyong
2017-09-04  5:57 ` [dpdk-dev] [PATCH v2 0/4] " Zhiyong Yang
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 1/4] ethdev: " Zhiyong Yang
2017-09-04  9:06     ` Bruce Richardson
2017-09-04  9:29       ` Ferruh Yigit
2017-09-04  9:47         ` Yang, Zhiyong
2017-09-04 13:12           ` Adrien Mazarguil
2017-09-04 13:17             ` Richardson, Bruce
2017-09-04 13:36               ` Adrien Mazarguil
2017-09-04 13:59                 ` Yang, Zhiyong
2017-09-04 14:41                   ` Adrien Mazarguil
2017-09-05  6:51       ` Yang, Zhiyong
2017-09-06  8:32     ` Hemant Agrawal
2017-09-06  8:48       ` Yang, Zhiyong
     [not found]     ` <CALZ3Guikt9x8sz-oEKCuDCSp_wtKa64bSXTrMhqcWyg7f_dS7g@mail.gmail.com>
2017-09-07  0:45       ` Yang, Zhiyong
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 2/4] examples: " Zhiyong Yang
2017-09-04 14:15     ` Hunt, David
2017-09-04 15:01       ` Yang, Zhiyong
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 3/4] common_base: extend RTE_MAX_ETHPORTS from 32 to 1024 Zhiyong Yang
2017-09-04  7:46     ` Yao, Lei A
2017-09-04  7:59       ` Yang, Zhiyong
2017-09-04  9:09         ` Bruce Richardson
2017-09-04 10:05           ` Yang, Zhiyong
2017-09-04 10:27             ` Ananyev, Konstantin
2017-09-04 14:18               ` Yang, Zhiyong
2017-09-06  8:42               ` Hemant Agrawal
2017-09-06  8:52                 ` Yang, Zhiyong
2017-09-04 10:29             ` Bruce Richardson
2017-09-04  9:27       ` Ananyev, Konstantin
2017-09-04  5:57   ` [dpdk-dev] [PATCH v2 4/4] testpmd: add flexibility to mbuf allocation Zhiyong Yang
2017-09-09 14:47   ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Zhiyong Yang
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 1/4] ethdev: " Zhiyong Yang
2017-09-11  9:37       ` Adrien Mazarguil
2017-09-11 10:51         ` Yang, Zhiyong
2017-09-11 10:21       ` Ferruh Yigit
2017-09-13  2:26         ` Yang, Zhiyong
2017-09-13 11:56           ` Ferruh Yigit
2017-09-13 12:15             ` Yang, Zhiyong
2017-09-13 12:18             ` Thomas Monjalon
2017-09-13 13:33               ` Ferruh Yigit
2017-09-19  6:05                 ` Yang, Zhiyong
2017-09-19 12:30                   ` Wiles, Keith
2017-09-14 12:49           ` Ferruh Yigit
2017-09-15  5:11             ` Yang, Zhiyong
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 2/4] test: " Zhiyong Yang
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 3/4] examples: " Zhiyong Yang
2017-09-14 14:41       ` Ferruh Yigit
2017-09-09 14:47     ` [dpdk-dev] [PATCH v3 4/4] librte_mbuf: modify port initialization value Zhiyong Yang
2017-09-11 10:23     ` [dpdk-dev] [PATCH v3 0/4] increase port_id range Ferruh Yigit
2017-09-11 11:25       ` Yang, Zhiyong
2017-09-13  8:14       ` Matej Vido
2017-09-13  8:21         ` Yang, Zhiyong
2017-09-18 14:54           ` Laatz, Kevin
2017-09-19  1:39             ` Yang, Zhiyong
2017-09-11 10:26     ` Ferruh Yigit
2017-09-11 10:55       ` Yang, Zhiyong
2017-09-11 11:24         ` Ferruh Yigit
2017-09-21  8:32     ` [dpdk-dev] [PATCH v4 0/5] " Zhiyong Yang
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang
2017-09-21 10:36         ` Ferruh Yigit
2017-09-22  2:02           ` Yang, Zhiyong
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 2/5] ethdev: increase port_id range Zhiyong Yang
2017-09-21 11:49         ` Adrien Mazarguil
2017-10-06 14:34           ` Nélio Laranjeiro
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 3/5] examples: " Zhiyong Yang
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 4/5] test: " Zhiyong Yang
2017-09-21  8:32       ` [dpdk-dev] [PATCH v4 5/5] librte_mbuf: modify port initialization value Zhiyong Yang
2017-09-25  3:22       ` [dpdk-dev] [PATCH v5 0/5] increase port_id range Zhiyong Yang
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang
2017-09-25 11:34           ` Ferruh Yigit
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 2/5] ethdev: increase port_id range Zhiyong Yang
2017-09-25 11:37           ` Ferruh Yigit
2017-09-25 12:06           ` Ferruh Yigit
2017-09-26  7:01             ` Yang, Zhiyong
2017-09-27 18:44               ` Ferruh Yigit
2017-09-28  2:12                 ` Yang, Zhiyong
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 3/5] examples: " Zhiyong Yang
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 4/5] test: " Zhiyong Yang
2017-09-25  3:22         ` [dpdk-dev] [PATCH v5 5/5] librte_mbuf: modify port initialization value Zhiyong Yang
2017-09-29  7:17         ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 1/5] net/bonding: remove bonding APIs using ABI versioning Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 2/5] ethdev: increase port_id range Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 3/5] examples: " Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 4/5] test: " Zhiyong Yang
2017-09-29  7:17           ` [dpdk-dev] [PATCH v6 5/5] librte_mbuf: modify port initialization value Zhiyong Yang
2017-10-06  2:15           ` [dpdk-dev] [PATCH v6 0/5] increase port_id range Ferruh Yigit
2017-10-06 13:31             ` Gaëtan Rivet
2017-10-06 14:29             ` Thomas Monjalon
2017-10-06 16:02             ` Thomas Monjalon
2017-10-11 21:21             ` Ferruh Yigit
2017-10-12  1:33               ` Yang, Zhiyong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170809084203.17562-3-zhiyong.yang@intel.com \
    --to=zhiyong.yang@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).