From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 81523A0471 for ; Tue, 16 Jul 2019 20:42:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6E9BC2BF5; Tue, 16 Jul 2019 20:42:44 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 59CE12BF5 for ; Tue, 16 Jul 2019 20:42:43 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id t16so9516445pfe.11 for ; Tue, 16 Jul 2019 11:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=acEjw/u3Nygxf1FsmqRsxhGVHObSYy8SI4xgsuBmqWw=; b=vWOvKpdbgP9qRWi+d1/o8yoh0w6YcV4ML0FwmDJkbuWf7F1Xo6wl+waIFmSYBkUbvH 1HlX/obPaJXsUCqU1YC1Y9QiVnP7kvOxTzNKnMhARETJirI/siD1I3uNHqXBohZrQj7C gZxdL8jvHzpRaSLUx9sj/Gc6Fr4Y4pscm7UEUuj3cEufOyeRmR88w3I+FvFS2avg3R08 wG4MMB87KIPF03Iuz56IFbVfJ64b5W9xAZjjO6MXr6NvpvOOsdOi9UYPPoW0VUsx0yBn cr8zlfiHqWqrYf3KdJTPq4bTt/rl9f5UNYuRevr/deBOZ0DCSPoWM22TOCd9OFSbzc4+ r8zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=acEjw/u3Nygxf1FsmqRsxhGVHObSYy8SI4xgsuBmqWw=; b=VjoGysQEk2P/pHzdGxFCrmsNYKSSDPnwpmGaiI6oGPo4cvzyHst09i6lXXQ7BWR6Fh LlDravWY24b8WYTtGzKN6aQqBzmfn9ESKDyUgp8FiQY8n/ZnhRNR69neEyRj7RDXMfbZ x54wONQkmbsG4RnV2kg0Kn2LIraig+0lVdMTc1lZ8KRZ6jBWnT+Iv41z20mPm0sCBtXj us00wXIJu5GR2EDP9w+hsOkXqm/4F2sxKFoQ7SXGpE6RwfKQs6pbRFliHLkCT8Xh3ki+ HDBMiDNkGSUGP0wLtHbGRLzvoA4ikcTgFU3UxbtbFe4+yorNp34hL88IXdwF+w6TGnYO tuYQ== X-Gm-Message-State: APjAAAVBnEz69PEBRWLwWlPORGtelv8wegqfTCSDwSib5hLdyeb7lf6U o7nHnTYqrYTLx4uK7p2UWl/wp8aO X-Google-Smtp-Source: APXvYqwf0njl3R40PvxgE6RCdMGP7+ov1TYHL5LxckviLFViyrrsv3EyW/+eGrjnGeD7o6iHg2qGyg== X-Received: by 2002:a63:3fc9:: with SMTP id m192mr36577501pga.429.1563302562209; Tue, 16 Jul 2019 11:42:42 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b26sm26242717pfo.129.2019.07.16.11.42.41 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 11:42:41 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 16 Jul 2019 11:42:34 -0700 Message-Id: <20190716184234.29999-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] testpmd: add option to not start device 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" Some configuration options can not be tested properly with testpmd because it automatically starts all ports. This makes it harder to test driver handling of configuration options: (for example rx_deferred_start). Add new command line flag --disable-device-start which skips the device start. The port can then be started manually later. Signed-off-by: Stephen Hemminger --- v2 -- add new option to guide in doc app/test-pmd/parameters.c | 4 ++++ app/test-pmd/testpmd.c | 7 ++++++- app/test-pmd/testpmd.h | 1 + doc/guides/testpmd_app_ug/run_app.rst | 6 ++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 16358ea00c9f..5244872c4aa8 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -174,6 +174,7 @@ usage(char* progname) printf(" --txonly-multi-flow: generate multiple flows in txonly mode\n"); printf(" --disable-link-check: disable check on link status when " "starting/stopping ports.\n"); + printf(" --disable-device-start: do not automatically start port\n"); printf(" --no-lsc-interrupt: disable link status change interrupt.\n"); printf(" --no-rmv-interrupt: disable device removal interrupt.\n"); printf(" --bitrate-stats=N: set the logical core N to perform " @@ -634,6 +635,7 @@ launch_args_parse(int argc, char** argv) { "txpkts", 1, 0, 0 }, { "txonly-multi-flow", 0, 0, 0 }, { "disable-link-check", 0, 0, 0 }, + { "disable-device-start", 0, 0, 0 }, { "no-lsc-interrupt", 0, 0, 0 }, { "no-rmv-interrupt", 0, 0, 0 }, { "print-event", 1, 0, 0 }, @@ -1196,6 +1198,8 @@ launch_args_parse(int argc, char** argv) no_flush_rx = 1; if (!strcmp(lgopts[opt_idx].name, "disable-link-check")) no_link_check = 1; + if (!strcmp(lgopts[opt_idx].name, "disable-device-start")) + no_device_start = 1; if (!strcmp(lgopts[opt_idx].name, "no-lsc-interrupt")) lsc_interrupt = 0; if (!strcmp(lgopts[opt_idx].name, "no-rmv-interrupt")) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 3ed3523b791e..807ee0c823b8 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -339,6 +339,11 @@ uint8_t flow_isolate_all; */ uint8_t no_link_check = 0; /* check by default */ +/* + * Don't automatically start all ports in interactive mode. + */ +uint8_t no_device_start = 0; + /* * Enable link status change notification */ @@ -3288,7 +3293,7 @@ main(int argc, char** argv) } } - if (start_port(RTE_PORT_ALL) != 0) + if (!no_device_start && start_port(RTE_PORT_ALL) != 0) rte_exit(EXIT_FAILURE, "Start ports failed\n"); /* set all ports to promiscuous mode by default */ diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index e3a6f7c7178c..fd8dccdf08f1 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -321,6 +321,7 @@ extern uint8_t flow_isolate_all; /**< set by "--flow-isolate-all */ extern uint8_t mp_alloc_type; /**< set by "--mp-anon" or "--mp-alloc" parameter */ extern uint8_t no_link_check; /**