All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gregory Etelson <getelson@nvidia.com>
To: <dev@dpdk.org>, <getelson@nvidia.com>
Cc: <matan@nvidia.com>, <rasland@nvidia.com>, <thomas@monjalon.net>,
	"David Hunt" <david.hunt@intel.com>,
	Jianfeng Tan <jianfeng.tan@intel.com>
Subject: [dpdk-dev] [PATCH v2 1/2] examples/l3fwd-power: fix check_ptype query
Date: Tue, 17 Nov 2020 20:49:39 +0200	[thread overview]
Message-ID: <20201117184940.19218-1-getelson@nvidia.com> (raw)
In-Reply-To: <20201028095935.27855-1-getelson@nvidia.com>

l3fwd-power uses `--parse-ptype' parameter to query egress packets
type.  Before that feature is eanbled l3fwd-power verifies PMD ability
to advertise supporrtred packet types with
rte_eth_dev_get_supported_ptypes().

The patch updates code for PMDs that register supported types after
dev_start.

Fixes: 82bea4661626 ("examples/l3fwd-power: add --parse-ptype option")

Signed-off-by: Gregory Etelson <getelson@nvidia.com>
---
 examples/l3fwd-power/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 2874285c4e..995a3b6ad7 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -2707,9 +2707,7 @@ main(int argc, char **argv)
 				if (add_cb_parse_ptype(portid, queueid) < 0)
 					rte_exit(EXIT_FAILURE,
 						 "Fail to add ptype cb\n");
-			} else if (!check_ptype(portid))
-				rte_exit(EXIT_FAILURE,
-					 "PMD can not provide needed ptypes\n");
+			}
 		}
 	}
 
@@ -2740,6 +2738,11 @@ main(int argc, char **argv)
 		}
 		/* initialize spinlock for each port */
 		rte_spinlock_init(&(locks[portid]));
+
+		if (!parse_ptype)
+			if (!check_ptype(portid))
+				rte_exit(EXIT_FAILURE,
+					"PMD can not provide needed ptypes\n");
 	}
 
 	check_all_ports_link_status(enabled_port_mask);
-- 
2.29.2


  parent reply	other threads:[~2020-11-17 18:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  9:59 [dpdk-dev] [PATCH 1/2] drivers/net/mlx5: fix representor interrupts handler Gregory Etelson
2020-10-28  9:59 ` [dpdk-dev] [PATCH 2/2] examples/l3fwd-power: fix check_ptype query Gregory Etelson
2020-11-04 18:25 ` [dpdk-dev] [PATCH 1/2] drivers/net/mlx5: fix representor interrupts handler Thomas Monjalon
2020-11-17 18:49 ` Gregory Etelson [this message]
2020-11-17 18:49   ` [dpdk-dev] [PATCH v2 2/2] " Gregory Etelson
2020-11-22 17:05     ` Thomas Monjalon
2020-11-22 17:03   ` [dpdk-dev] [PATCH v2 1/2] examples/l3fwd-power: fix check_ptype query 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=20201117184940.19218-1-getelson@nvidia.com \
    --to=getelson@nvidia.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.