summaryrefslogtreecommitdiff
path: root/examples/multi_process/client_server_mp
diff options
context:
space:
mode:
authorIntel <intel.com>2013-06-03 00:00:00 +0000
committerThomas Monjalon <thomas.monjalon@6wind.com>2013-09-17 14:16:09 +0200
commitcdfd5dbb90b05e198b436f97f0ba320d7cd7d8ad (patch)
treea9a26c2b7b4dc9f2f64acb2ee9c2efa268f10671 /examples/multi_process/client_server_mp
parent5c95261dbf79b5b03314b5477a3f3088a6934796 (diff)
downloaddpdk-cdfd5dbb90b05e198b436f97f0ba320d7cd7d8ad.zip
dpdk-cdfd5dbb90b05e198b436f97f0ba320d7cd7d8ad.tar.gz
dpdk-cdfd5dbb90b05e198b436f97f0ba320d7cd7d8ad.tar.xz
examples: work only on defined lcores
Signed-off-by: Intel
Diffstat (limited to 'examples/multi_process/client_server_mp')
-rw-r--r--examples/multi_process/client_server_mp/mp_server/init.c8
-rw-r--r--examples/multi_process/client_server_mp/mp_server/main.c10
2 files changed, 6 insertions, 12 deletions
diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
index 2abdfc0..b45e020 100644
--- a/examples/multi_process/client_server_mp/mp_server/init.c
+++ b/examples/multi_process/client_server_mp/mp_server/init.c
@@ -250,21 +250,21 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
for (count = 0; count <= MAX_CHECK_TIME; count++) {
all_ports_up = 1;
for (portid = 0; portid < port_num; portid++) {
- if ((port_mask & (1 << portid)) == 0)
+ if ((port_mask & (1 << ports->id[portid])) == 0)
continue;
memset(&link, 0, sizeof(link));
- rte_eth_link_get_nowait(portid, &link);
+ rte_eth_link_get_nowait(ports->id[portid], &link);
/* 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,
+ "Mbps - %s\n", ports->id[portid],
(unsigned)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);
+ (uint8_t)ports->id[portid]);
continue;
}
/* clear all_ports_up flag if any link down */
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index b796e76..43e0ab5 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -138,8 +138,8 @@ do_stats_display(void)
const volatile struct tx_stats *tx = &ports->tx_stats[i];
for (j = 0; j < ports->num_ports; j++){
/* assign to local variables here, save re-reading volatile vars */
- const uint64_t tx_val = tx->tx[j];
- const uint64_t drop_val = tx->tx_drop[j];
+ const uint64_t tx_val = tx->tx[ports->id[j]];
+ const uint64_t drop_val = tx->tx_drop[ports->id[j]];
port_tx[j] += tx_val;
port_tx_drop[j] += drop_val;
client_tx[i] += tx_val;
@@ -200,12 +200,6 @@ sleep_lcore(__attribute__((unused)) void *dummy)
while (sleep(sleeptime) <= sleeptime)
do_stats_display();
}
- else {
- const unsigned sleeptime = 100;
- printf("Putting core %u to sleep\n", rte_lcore_id());
- while (sleep(sleeptime) <= sleeptime)
- ; /* loop doing nothing */
- }
return 0;
}