DPDK patches and discussions
 help / color / mirror / Atom feed
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: fix invalid port detach
Date: Tue, 30 Jan 2018 14:13:40 +0000	[thread overview]
Message-ID: <1517321620-14198-2-git-send-email-matan@mellanox.com> (raw)
In-Reply-To: <1517321620-14198-1-git-send-email-matan@mellanox.com>

Using registration to all ports includes also the ports which should not
be used by the application.

It is nice to print each port event by testpmd but in case of RMV
event, testpmd tries to detach the port and this case is problematic
when the port should not be used by the application.

Check the port validation before detach API calling.

Fixes: 4fb82244b394 ("app/testpmd: extend event printing")

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..71b03d5 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -2026,6 +2026,9 @@ struct pmd_test_command {
 		fflush(stdout);
 	}
 
+	if (port_id_is_invalid(port_id, DISABLED_WARN))
+		return 0;
+
 	switch (type) {
 	case RTE_ETH_EVENT_INTR_RMV:
 		if (rte_eal_alarm_set(100000,
-- 
1.8.3.1

  reply	other threads:[~2018-01-30 14:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 14:13 [dpdk-dev] [PATCH 1/2] app/testpmd: fix port validation Matan Azrad
2018-01-30 14:13 ` Matan Azrad [this message]
2018-01-31 20:36   ` [dpdk-dev] [PATCH 2/2] app/testpmd: fix invalid port detach 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=1517321620-14198-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).