DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org
Cc: pablo.de.lara.guarch@intel.com,
	Bernard Iremonger <bernard.iremonger@intel.com>
Subject: [dpdk-dev] [PATCH v3 5/9] app/testpmd: add function port_is_bonding_slave
Date: Sun, 12 Jun 2016 16:23:13 +0100	[thread overview]
Message-ID: <1465744997-15487-6-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1465744997-15487-1-git-send-email-bernard.iremonger@intel.com>

Use this function in stop_port and close_port functions.

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/testpmd.c | 18 ++++++++++++++++++
 app/test-pmd/testpmd.h |  2 ++
 2 files changed, 20 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index f22d1b6..6f68a18 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1449,6 +1449,11 @@ stop_port(portid_t pid)
 			continue;
 		}
 
+		if (port_is_bonding_slave(pi)) {
+			printf("Please remove port %d from bonded device.\n", pi);
+			continue;
+		}
+
 		port = &ports[pi];
 		if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STARTED,
 						RTE_PORT_HANDLING) == 0)
@@ -1487,6 +1492,11 @@ close_port(portid_t pid)
 			continue;
 		}
 
+		if (port_is_bonding_slave(pi)) {
+			printf("Please remove port %d from bonded device.\n", pi);
+			continue;
+		}
+
 		port = &ports[pi];
 		if (rte_atomic16_cmpset(&(port->port_status),
 			RTE_PORT_CLOSED, RTE_PORT_CLOSED) == 1) {
@@ -1824,6 +1834,14 @@ void clear_port_slave_flag(portid_t slave_pid)
 	port->slave_flag = 0;
 }
 
+uint8_t port_is_bonding_slave(portid_t slave_pid)
+{
+	struct rte_port *port;
+
+	port = &ports[slave_pid];
+	return port->slave_flag;
+}
+
 const uint16_t vlan_tags[] = {
 		0,  1,  2,  3,  4,  5,  6,  7,
 		8,  9, 10, 11,  12, 13, 14, 15,
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index aa4bdac..50f81d7 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -532,6 +532,8 @@ void dev_set_link_down(portid_t pid);
 void init_port_config(void);
 void set_port_slave_flag(portid_t slave_pid);
 void clear_port_slave_flag(portid_t slave_pid);
+uint8_t port_is_bonding_slave(portid_t slave_pid);
+
 int init_port_dcb_config(portid_t pid, enum dcb_mode_enable dcb_mode,
 		     enum rte_eth_nb_tcs num_tcs,
 		     uint8_t pfc_en);
-- 
2.6.3

  parent reply	other threads:[~2016-06-12 15:23 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 12:52 [dpdk-dev] [PATCH 0/4] testpmd forwarding Bernard Iremonger
2016-04-20 12:52 ` [dpdk-dev] [PATCH 1/4] testpmd: add function port_is_forwarding Bernard Iremonger
2016-04-20 12:52 ` [dpdk-dev] [PATCH 2/4] testpmd: don't update fwding config when attaching/detaching a port Bernard Iremonger
2016-04-20 12:52 ` [dpdk-dev] [PATCH 3/4] testpmd: check port is not forwarding in stop_port and close_port Bernard Iremonger
2016-04-20 12:52 ` [dpdk-dev] [PATCH 4/4] testpmd: reconfigure forwarding after changing portlist Bernard Iremonger
2016-05-05 15:39 ` [dpdk-dev] [PATCH v2 0/8] app/testpmd: forwarding Bernard Iremonger
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 1/8] app/testpmd: add function port_is_forwarding Bernard Iremonger
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 2/8] app/testpmd: don't update fwding config when attaching/detaching a port Bernard Iremonger
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 3/8] app/testpmd: check port is not forwarding in stop_port and close_port Bernard Iremonger
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 4/8] app/testpmd: reconfigure forwarding after changing portlist Bernard Iremonger
2016-06-08 14:17     ` De Lara Guarch, Pablo
2016-06-10  9:22       ` Iremonger, Bernard
2016-06-10 15:58         ` Iremonger, Bernard
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 5/8] app/testpmd: add function port_is_bonding_slave Bernard Iremonger
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 6/8] app/testpmd: move call to init_fwd_streams Bernard Iremonger
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 7/8] app/testpmd: check for valid socket id when attaching port Bernard Iremonger
2016-05-05 15:39   ` [dpdk-dev] [PATCH v2 8/8] app/testpmd: check for valid mbuf pool Bernard Iremonger
2016-06-12 15:23   ` [dpdk-dev] [PATCH v3 0/9] app/testpmd: forwarding Bernard Iremonger
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 1/9] app/testpmd: add function port_is_forwarding Bernard Iremonger
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 2/9] app/testpmd: don't update fwding config when attaching/detaching a port Bernard Iremonger
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 3/9] app/testpmd: check port is not forwarding in stop_port and close_port Bernard Iremonger
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 4/9] app/testpmd: remove fwd_config_setup from fwd_config_display Bernard Iremonger
2016-06-13 15:57       ` De Lara Guarch, Pablo
2016-06-13 16:07         ` Iremonger, Bernard
2016-06-14  9:18           ` Iremonger, Bernard
2016-06-12 15:23     ` Bernard Iremonger [this message]
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 6/9] app/testpmd: move call to init_fwd_streams Bernard Iremonger
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 7/9] app/testpmd: check for valid socket id when attaching port Bernard Iremonger
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 8/9] app/testpmd: check for valid mbuf pool Bernard Iremonger
2016-06-12 15:23     ` [dpdk-dev] [PATCH v3 9/9] app/testpmd: stop forwarding on exit Bernard Iremonger
2016-06-14 12:28     ` [dpdk-dev] [PATCH v4 0/9] app/testpmd: forwarding Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 1/9] app/testpmd: add function port_is_forwarding Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 2/9] app/testpmd: don't update fwding config when attaching/detaching a port Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 3/9] app/testpmd: check port is not forwarding in stop_port and close_port Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 4/9] app/testpmd: remove fwd_config_setup from fwd_config_display Bernard Iremonger
2016-06-14 13:00         ` De Lara Guarch, Pablo
2016-06-14 14:14           ` Iremonger, Bernard
2016-06-14 14:30             ` De Lara Guarch, Pablo
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 5/9] app/testpmd: add function port_is_bonding_slave Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 6/9] app/testpmd: move call to init_fwd_streams Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 7/9] app/testpmd: check for valid socket id when attaching port Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 8/9] app/testpmd: check for valid mbuf pool Bernard Iremonger
2016-06-14 12:28       ` [dpdk-dev] [PATCH v4 9/9] app/testpmd: stop forwarding on exit Bernard Iremonger
2016-06-14 15:35       ` [dpdk-dev] [PATCH v5 0/9] app/testpmd: forwarding Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 1/9] app/testpmd: add new function Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 2/9] app/testpmd: do not update forwarding config Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 3/9] app/testpmd: check port is not forwarding Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 4/9] app/testpmd: separate fwd config setup from display Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 5/9] app/testpmd: add another new function Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 6/9] app/testpmd: move fwd streams initialisation Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 7/9] app/testpmd: check for valid socket id when attaching port Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 8/9] app/testpmd: check for valid mbuf pool Bernard Iremonger
2016-06-14 15:35         ` [dpdk-dev] [PATCH v5 9/9] app/testpmd: stop forwarding on exit Bernard Iremonger
2016-06-14 15:39         ` [dpdk-dev] [PATCH v5 0/9] app/testpmd: forwarding De Lara Guarch, Pablo
2016-06-16  8:15           ` 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=1465744997-15487-6-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=pablo.de.lara.guarch@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).