From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by dpdk.org (Postfix) with ESMTP id 4E135B349 for ; Mon, 22 Sep 2014 10:32:08 +0200 (CEST) Received: by mail-wi0-f180.google.com with SMTP id q5so2473166wiv.7 for ; Mon, 22 Sep 2014 01:38:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+gZmdFQhVSAe+YV3zya6O8DcUHH1fsDMDtf6MAodi5U=; b=PLPA+YVOIEHuHEfwJpuZuXEsBNK1ltDqJtS4VwaxxWdJorvbtQMh1DUvjeMZfpw9mB HlSf7vfl51EndbdkPHwCuBP8OXc2kxWST+OkCRyrizm+sWyYxXM/e5UATwCU2LOeB9We Ym65UNRsdO3W/DtAc8Ji91CnXQ+I7DKa+8W7Mc6lDPt9u8LztBwQd2+ySa9ADbp+OCY7 bhjATlADJd2TZ+IKbWhM7SYSctmTw1ukPI4JfHTAabnGkWLVErcQ7EGUA/J0lllUVfVu tssD5r6ThYcIaxo9N+NnAJRP2jznKHAq1cAnI+/yOpRU5AT2zAxcSkfjOGfBHeahHx/+ dXVA== X-Gm-Message-State: ALoCoQkw+Vouwss9GafeR9mjKipXoeaZ+/Oy/bFFP73eo4lr+htM+hK9g0ceHcUUeKMm46+TIHIi X-Received: by 10.180.189.18 with SMTP id ge18mr13442021wic.37.1411375091372; Mon, 22 Sep 2014 01:38:11 -0700 (PDT) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id js2sm11522334wjc.9.2014.09.22.01.38.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Sep 2014 01:38:10 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Mon, 22 Sep 2014 10:37:57 +0200 Message-Id: <1411375081-27986-4-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1411375081-27986-1-git-send-email-david.marchand@6wind.com> References: <1411375081-27986-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 3/7] eal: remove duplicate handling of white/black list X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 08:32:10 -0000 We can handle both short and long options for those in the same case. Signed-off-by: David Marchand --- lib/librte_eal/bsdapp/eal/eal.c | 18 ++---------------- lib/librte_eal/linuxapp/eal/eal.c | 18 ++---------------- 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c index 7e9f3aa..8599a35 100644 --- a/lib/librte_eal/bsdapp/eal/eal.c +++ b/lib/librte_eal/bsdapp/eal/eal.c @@ -513,8 +513,8 @@ eal_parse_args(int argc, char **argv) {OPT_PROC_TYPE, 1, 0, 0}, {OPT_FILE_PREFIX, 1, 0, 0}, {OPT_SOCKET_MEM, 1, 0, 0}, - {OPT_PCI_WHITELIST, 1, 0, 0}, - {OPT_PCI_BLACKLIST, 1, 0, 0}, + {OPT_PCI_WHITELIST, 1, 0, 'w'}, + {OPT_PCI_BLACKLIST, 1, 0, 'b'}, {OPT_VDEV, 1, 0, 0}, {OPT_SYSLOG, 1, NULL, 0}, {OPT_LOG_LEVEL, 1, NULL, 0}, @@ -629,20 +629,6 @@ eal_parse_args(int argc, char **argv) else if (!strcmp(lgopts[option_index].name, OPT_PROC_TYPE)) { internal_config.process_type = eal_parse_proc_type(optarg); } - else if (!strcmp(lgopts[option_index].name, OPT_PCI_BLACKLIST)) { - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, - optarg) < 0) { - eal_usage(prgname); - return -1; - } - } - else if (!strcmp(lgopts[option_index].name, OPT_PCI_WHITELIST)) { - if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, - optarg) < 0) { - eal_usage(prgname); - return -1; - } - } else if (!strcmp(lgopts[option_index].name, OPT_VDEV)) { if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, optarg) < 0) { diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c index bf63744..655c454 100644 --- a/lib/librte_eal/linuxapp/eal/eal.c +++ b/lib/librte_eal/linuxapp/eal/eal.c @@ -718,8 +718,8 @@ eal_parse_args(int argc, char **argv) {OPT_PROC_TYPE, 1, 0, 0}, {OPT_FILE_PREFIX, 1, 0, 0}, {OPT_SOCKET_MEM, 1, 0, 0}, - {OPT_PCI_WHITELIST, 1, 0, 0}, - {OPT_PCI_BLACKLIST, 1, 0, 0}, + {OPT_PCI_WHITELIST, 1, 0, 'w'}, + {OPT_PCI_BLACKLIST, 1, 0, 'b'}, {OPT_VDEV, 1, 0, 0}, {OPT_SYSLOG, 1, NULL, 0}, {OPT_LOG_LEVEL, 1, NULL, 0}, @@ -879,20 +879,6 @@ eal_parse_args(int argc, char **argv) return -1; } } - else if (!strcmp(lgopts[option_index].name, OPT_PCI_BLACKLIST)) { - if (rte_eal_devargs_add(RTE_DEVTYPE_BLACKLISTED_PCI, - optarg) < 0) { - eal_usage(prgname); - return -1; - } - } - else if (!strcmp(lgopts[option_index].name, OPT_PCI_WHITELIST)) { - if (rte_eal_devargs_add(RTE_DEVTYPE_WHITELISTED_PCI, - optarg) < 0) { - eal_usage(prgname); - return -1; - } - } else if (!strcmp(lgopts[option_index].name, OPT_VDEV)) { if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, optarg) < 0) { -- 1.7.10.4