From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 954AB20BD for ; Wed, 9 Aug 2017 10:42:30 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Aug 2017 01:42:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,346,1498546800"; d="scan'208";a="138116331" Received: from unknown (HELO dpdk5.bj.intel.com) ([172.16.182.182]) by fmsmga006.fm.intel.com with ESMTP; 09 Aug 2017 01:42:13 -0700 From: Zhiyong Yang To: dev@dpdk.org Cc: thomas@monjalon.net, Zhiyong Yang Date: Wed, 9 Aug 2017 16:42:03 +0800 Message-Id: <20170809084203.17562-3-zhiyong.yang@intel.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170809084203.17562-1-zhiyong.yang@intel.com> References: <20170809084203.17562-1-zhiyong.yang@intel.com> Subject: [dpdk-dev] [PATCH 2/2] examples: increase port_id range X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Aug 2017 08:42:31 -0000 Modify port_id related code in examples accordingly since port_id definition in lib changes. Signed-off-by: Zhiyong Yang --- 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