From patchwork Mon Jul 31 19:27:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenzhuo Lu X-Patchwork-Id: 27295 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 7B0179A0D; Mon, 31 Jul 2017 21:26:41 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 3A30899B8 for ; Mon, 31 Jul 2017 21:26:33 +0200 (CEST) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP; 31 Jul 2017 12:26:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,304,1498546800"; d="scan'208";a="131661982" Received: from dpdk26.sh.intel.com ([10.67.110.152]) by orsmga005.jf.intel.com with ESMTP; 31 Jul 2017 12:26:31 -0700 From: Wenzhuo Lu To: dev@dpdk.org Cc: Wenzhuo Lu Date: Tue, 1 Aug 2017 03:27:20 +0800 Message-Id: <1501529240-64181-4-git-send-email-wenzhuo.lu@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1501529240-64181-1-git-send-email-wenzhuo.lu@intel.com> References: <1501529240-64181-1-git-send-email-wenzhuo.lu@intel.com> Subject: [dpdk-dev] [RFC PATCH 3/3] app/testpmd: a parameter to set max queue per VF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add a parameter in testpmd CLI. This parameter is used to set the max queue number per VF. Signed-off-by: Wenzhuo Lu --- app/test-pmd/parameters.c | 33 ++++++++++++++++++++++++++++++++- app/test-pmd/testpmd.c | 2 ++ app/test-pmd/testpmd.h | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 2f7f70f..2dd806d 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -100,7 +100,7 @@ "--rss-ip | --rss-udp | " "--rxpt= | --rxht= | --rxwt= | --rxfreet= | " "--txpt= | --txht= | --txwt= | --txfreet= | " - "--txrst= | --txqflags= ]\n", + "--txrst= | --txqflags= | --vf-max-queue= ]\n", progname); #ifdef RTE_LIBRTE_CMDLINE printf(" --interactive: run in interactive mode.\n"); @@ -216,6 +216,8 @@ "disable print of designated event or all of them.\n"); printf(" --flow-isolate-all: " "requests flow API isolated mode on all ports at initialization time.\n"); + printf(" --vf-max-queue=N: set the maximum queue number per VF " + "(N: positive integer).\n"); } #ifdef RTE_LIBRTE_CMDLINE @@ -638,6 +640,7 @@ { "no-rmv-interrupt", 0, 0, 0 }, { "print-event", 1, 0, 0 }, { "mask-event", 1, 0, 0 }, + { "vf-max-queue", 1, 0, 0 }, { 0, 0, 0, 0 }, }; @@ -1133,3 +1136,31 @@ } } } + +void +pre_launch_args_parse(int argc, char **argv) +{ + int i; + char *tmp; + int nb_queue = 0; + + /** + * Don't want to check the first string. + * It should not be a parameter. + */ + for (i = 1; i < argc; i++) { + tmp = *(argv + i); + if (!strncmp(tmp, "--vf-max-queue=", 15)) { + tmp += 15; + nb_queue = atoi(tmp); + if (nb_queue > 0) + g_max_queue_number_per_vf = nb_queue; + else + rte_exit(EXIT_FAILURE, + "vf-max-queue must be > 0\n"); + + /* delete it if more than 1 patameters to check */ + break; + } + } +} diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index e754d12..b374f38 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2289,6 +2289,8 @@ uint8_t port_is_bonding_slave(portid_t slave_pid) signal(SIGINT, signal_handler); signal(SIGTERM, signal_handler); + pre_launch_args_parse(argc, argv); + diag = rte_eal_init(argc, argv); if (diag < 0) rte_panic("Cannot init EAL\n"); diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index c9d7739..8d0e72b 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -650,6 +650,7 @@ void port_rss_hash_key_update(portid_t port_id, char rss_type[], uint8_t *open_ddp_package_file(const char *file_path, uint32_t *size); int save_ddp_package_file(const char *file_path, uint8_t *buf, uint32_t size); int close_ddp_package_file(uint8_t *buf); +void pre_launch_args_parse(int argc, char **argv); enum print_warning { ENABLED_WARN = 0,