From patchwork Tue Jul 16 18:29:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 56532 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4CF7F2BF4; Tue, 16 Jul 2019 20:29:32 +0200 (CEST) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 5088914E8 for ; Tue, 16 Jul 2019 20:29:31 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id a93so10530484pla.7 for ; Tue, 16 Jul 2019 11:29:31 -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=2N9u8t+Z3GxyVebASgZoreHjL3sG7BSRyNsmEpjs9og=; b=q8UslZY+yrXtNuQexGhgmvCrzW0jWfr8x/KnIk5DhHs68YnH/xqfUmGo8QKF20tiBh ITt+XZ5rD0zFn0uUCMzILCnhTS4gGGe2dbSIijqeL5a3IHOM20FiqGarJH9cnQy+OMje DW+JyJCyx0Or9Wec8JdCKAavlak0gv/WN3TAbU2Wx9LdMmsZ8EvJhI+qB4DwwjD6D0pA P3AJj4mQEuClpmN3jQtodvn0g6ym3ZEk7cWU80wOWHdFPNU+j3uBZKksO+rQ32Z9MlDa ZOY1E+y9I9FE5d14yEIvh4+PkgnZVen2AQX4UFZ+BHrS15sFgQ0Br6oYGm4o9bgOeG1a T39g== 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=2N9u8t+Z3GxyVebASgZoreHjL3sG7BSRyNsmEpjs9og=; b=VxgL/3P9H+TEx4WjIRc6ACWkUIfYufvgznRg3DdT0Bl+S6/Zb1Vi6+OVUHjYIBNgwW juOcLLmUhgm67yCRAzeCNmAd1sG0Nxb3C6hBLNZmdFmh5fNK++QZhLUiRiQR3idfPNQH //c9+1mVYgChYwbaLhFU1xtEMls3hB+sKkrpgx96buN9u6EiHmzrzGwt7Ncmc5SEopGY K9Gn+9Un002dmJN0nR9Uyqy+SwC1w/UbLLmENlHpmpK6Cxq43nbB8zfVOp2cWLK2Nog3 Ssh8bub+zMgeEju9ip7OCi9JnxUpvKxBW3VlVQRqHR1ioeyxvDjUFmKIbJir8/DNON1V 264g== X-Gm-Message-State: APjAAAW4xxK8Nad0cHgwFS0o4RVIBpXcX/8uKV25mhVtat3ESsaFFhj4 9tcXzqHqkngDjW9Hnd/1EhwX802j X-Google-Smtp-Source: APXvYqxXta2+6o6nGMeXhW9vk8mzWV1e4NauqlVdmW/xRAD4b+xJ1bDZ3mxWJ3V2La7kU7jUdqg8zg== X-Received: by 2002:a17:902:9a42:: with SMTP id x2mr38044792plv.106.1563301770051; Tue, 16 Jul 2019 11:29:30 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id r15sm23038825pfh.121.2019.07.16.11.29.29 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 16 Jul 2019 11:29:29 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 16 Jul 2019 11:29:22 -0700 Message-Id: <20190716182922.24578-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH] 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 current testpmd because it automatically starts all ports. This makes it harder to test driver handling of configuration options: (for example rx_deferred_start) which maybe buggy in some drivers. 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 --- app/test-pmd/parameters.c | 4 ++++ app/test-pmd/testpmd.c | 7 ++++++- app/test-pmd/testpmd.h | 1 + 3 files changed, 11 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; /**