From: Matan Azrad <matan@mellanox.com>
To: Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] app/testpmd: use dedicated function to get Tx port
Date: Sun, 4 Feb 2018 17:27:05 +0000 [thread overview]
Message-ID: <1517765225-11117-2-git-send-email-matan@mellanox.com> (raw)
In-Reply-To: <1517765225-11117-1-git-send-email-matan@mellanox.com>
A new function was added to get a Tx port as a function of the topology
mode and the Rx port.
Use this function to get the Tx port of simple stream.
Signed-off-by: Matan Azrad <matan@mellanox.com>
---
app/test-pmd/config.c | 31 +++----------------------------
1 file changed, 3 insertions(+), 28 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 02ab1e3..4bb255c 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1916,19 +1916,6 @@ struct igb_ring_desc_16_bytes {
simple_fwd_config_setup(void)
{
portid_t i;
- portid_t j;
- portid_t inc = 2;
-
- if (port_topology == PORT_TOPOLOGY_CHAINED ||
- port_topology == PORT_TOPOLOGY_LOOP) {
- inc = 1;
- } else if (nb_fwd_ports % 2) {
- printf("\nWarning! Cannot handle an odd number of ports "
- "with the current port topology. Configuration "
- "must be changed to have an even number of ports, "
- "or relaunch application with "
- "--port-topology=chained\n\n");
- }
cur_fwd_config.nb_fwd_ports = (portid_t) nb_fwd_ports;
cur_fwd_config.nb_fwd_streams =
@@ -1947,26 +1934,14 @@ struct igb_ring_desc_16_bytes {
(lcoreid_t) cur_fwd_config.nb_fwd_ports;
setup_fwd_config_of_each_lcore(&cur_fwd_config);
- for (i = 0; i < cur_fwd_config.nb_fwd_ports; i = (portid_t) (i + inc)) {
- if (port_topology != PORT_TOPOLOGY_LOOP)
- j = (portid_t) ((i + 1) % cur_fwd_config.nb_fwd_ports);
- else
- j = i;
+ for (i = 0; i < cur_fwd_config.nb_fwd_ports; i++) {
fwd_streams[i]->rx_port = fwd_ports_ids[i];
fwd_streams[i]->rx_queue = 0;
- fwd_streams[i]->tx_port = fwd_ports_ids[j];
+ fwd_streams[i]->tx_port =
+ fwd_ports_ids[fwd_topology_tx_port_get(i)];
fwd_streams[i]->tx_queue = 0;
fwd_streams[i]->peer_addr = fwd_streams[i]->tx_port;
fwd_streams[i]->retry_enabled = retry_enabled;
-
- if (port_topology == PORT_TOPOLOGY_PAIRED) {
- fwd_streams[j]->rx_port = fwd_ports_ids[j];
- fwd_streams[j]->rx_queue = 0;
- fwd_streams[j]->tx_port = fwd_ports_ids[i];
- fwd_streams[j]->tx_queue = 0;
- fwd_streams[j]->peer_addr = fwd_streams[j]->tx_port;
- fwd_streams[j]->retry_enabled = retry_enabled;
- }
}
}
--
1.8.3.1
next prev parent reply other threads:[~2018-02-04 17:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-04 17:27 [dpdk-dev] [PATCH 1/2] app/testpmd: fix RSS stream invalid Tx port set Matan Azrad
2018-02-04 17:27 ` Matan Azrad [this message]
2018-02-05 14:09 ` [dpdk-dev] [PATCH v2 0/3] testpmd: fix rss forward config Matan Azrad
2018-02-05 14:09 ` [dpdk-dev] [PATCH v2 1/3] app/testpmd: fix port index in RSS fwd config Matan Azrad
2018-02-05 14:09 ` [dpdk-dev] [PATCH v2 2/3] app/testpmd: fix port topology " Matan Azrad
2018-02-05 14:09 ` [dpdk-dev] [PATCH v2 3/3] app/testpmd: use dedicated function to get Tx port Matan Azrad
2018-02-06 17:20 ` [dpdk-dev] [PATCH v2 0/3] testpmd: fix rss forward config Thomas Monjalon
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=1517765225-11117-2-git-send-email-matan@mellanox.com \
--to=matan@mellanox.com \
--cc=dev@dpdk.org \
--cc=wenzhuo.lu@intel.com \
/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).