From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0088.outbound.protection.outlook.com [104.47.42.88]) by dpdk.org (Postfix) with ESMTP id 15D791D390 for ; Fri, 15 Jun 2018 06:44:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=U4fW5V6upsx8cccFPhsa6gCHO4kHqj4KdIHZ4eNl44k=; b=nAqF/1BahXqC5RbseyzJf1m/zbIqgceXt26l/sXNDhm1dZ3rSRdq+e/N+HYU6BDnXn+IHrpff0RiQA1Yn7e7bw9qrScN+QPJwsBsFuRx8qQBY6Pe/qllh5FVxZc4KBWSQx4ZwNRKP1QRUoEP4pWq+wM+xxAaO+URa6aDUzuRFYE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from localhost.localdomain (111.93.218.67) by CY4PR07MB3464.namprd07.prod.outlook.com (2603:10b6:910:75::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.17; Fri, 15 Jun 2018 04:44:32 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, gaetan.rivet@6wind.com, thomas@monjalon.net Cc: dev@dpdk.org, Pavan Nikhilesh Date: Fri, 15 Jun 2018 10:13:59 +0530 Message-Id: <20180615044359.20692-1-pbhagavatula@caviumnetworks.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MAXPR0101CA0015.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:c::25) To CY4PR07MB3464.namprd07.prod.outlook.com (2603:10b6:910:75::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 873f81a8-4bdd-409c-f5ea-08d5d27ab123 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB3464; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 3:APZJp8a9JKIY03xJfw79Rr8mHiMNv7kqFlllgRKAP/OvAMdfzZThjUJ9pMiMKTSr3V43kCUMBbsqf5swC0WSqFCjxLeqjPe9Ov5FNs1pdOddqGJQXdaNGYJFab/8F65we5CeRFarZEsVfRvP26t8kAJRbwlcsb/uHH3o7DYHPmTY9nervO/TIYdEIueddn5P2GYwAa1jbxRaYOus7cY+uORUQxqDUZYFmxE3IXuaUz0VskY8b92R7UQt3iC422O7; 25:NEDiSV6el2KSqy/v6B/3Y8g2T6TNSTEf+hjLWqqLHFwFQ2bLCsnIH9EF85M3cRYl64nPC/Gp4Pp9whsnJUdZOBmmvAAHBu/U20heHwFtbo6gJ8wYuLiY6Mdfn/6cmsja/sN3n/87sMPkpvCXswioPRi/bJm/QL+a4OeZItMf44EvxOuLEcaJ7ZKnzOxmC3aa/GDGHluV2RHHJDuu6AdvtUdiYUQeTES3iPIui9cq3eabdyIUf0KsTFQ+IY3YN5vF9hhIkm6n6grNNLY4N/zaf7scjs+EIMVV66EHVEbCzgTRv3Q3nPKiU+hrGie5Zg+2v61XaGMP17PYhQq+w2426w==; 31:gGA+nNpXEfrzNlBqE2525SmoEMXHuQbx8ts55nprdr3Fees7+cVf4fXB+zr2IolyCJlyDrEyg6KFJyrYCU/wZtRNSnIEZ7rQn/hXV2jOrBhPmbE+xcZFLl7LFW1TFnEojMz63RiXlQWNjVA7UDWMyLCe2spBWuBMjpbGE26YfaWwLp/4pxOuKncO3tRnqCEdW9t426HV7KT8oPMg/UvWXHr8b1GJziPj4eMEDshuppg= X-MS-TrafficTypeDiagnostic: CY4PR07MB3464: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 20:virg2XtNHURGiSq34C5O/k+KcyTEdatbez6sTPEtJrTL34PjTO2kX9gTJvM2U4mrZI7hjJ8jfOv2p3d4cNIT5ljH4ilbzXSuo3lDiIulA8T16JOMc1k2FdwlbhhtvbdfZAH65BQg24YY8fJgi8z9ghiH8/xJqkiLaCPIpyYAyES9S4HB3md5GhxnUk4byb36478Z6sDux8z/Q5r9LlBLHxZ/eAdMerD6TTX2wRiE9eWReshf5AT8OPYmcrd9tP/2RbmpqHKa+3v+BWNjpZXxtgjlCjdPbyKELXq6wIFBJrSSyPpWKLNub+n9fbDSakUV4Yc6i3iLHbOjN3avcP9eoT0u/3NLXz6k5/Qsp+u7bcDY5sciDKwVVDy0j1jeK5MH70bYCmvMH293PzjCs8AFLecHzNTBeljsd/cfG5Raxs3UrFB/AOUQfszmnpft1xGHgA25nswcfr8VTYgPC7EiGASNXRQbT9lon4TOCYDbXpWjOHZezz92SaqesCmiWupnqe9PgGZswMUCWOe68bP1ZXxt2FEm4REU07mhtRC4Js8P0hMc78XrtOyzqKpxUrnzuKVuRrVDPYvxPmdJ8vLIhxnB8MxPBkihvty0ogui5Eo=; 4:4cZx1zdtdvpVIJ+UamxYnEwNBDp3tQosrFcK6mUz3YBCgbL4a58e9jL7w45k/jHkqJOqPhCP6678HLkF0LrZitqu0SxKSDjJTqGh8KXXcIFsPC77C1utHZjx9Mw81ofjEv6Ykvkx5jHD6sOpYDA/0WLvQS8XHxdnNFabllKAyVFKu5P+e/09TfCDL6UXkeL5jnjjmOAWC7ds3LcUvPxcAFgtE1KBoiNZURe0ucN1yIF4CaIdF1eFbNpIg2J26V5lPlDO/C8B2b3cNdww3JpkSg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR07MB3464; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3464; X-Forefront-PRVS: 0704670F76 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(376002)(366004)(396003)(39850400004)(39380400002)(199004)(189003)(51416003)(97736004)(52116002)(42882007)(316002)(16586007)(476003)(7736002)(2616005)(5660300001)(305945005)(956004)(6506007)(386003)(6486002)(2906002)(1857600001)(26005)(16526019)(59450400001)(68736007)(478600001)(53936002)(6116002)(3846002)(106356001)(105586002)(25786009)(5009440100003)(8676002)(4326008)(81166006)(81156014)(48376002)(6666003)(6512007)(8936002)(50466002)(1076002)(72206003)(486006)(66066001)(36756003)(107886003)(47776003)(50226002)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3464; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3464; 23:oJJACB3AhXuzuLA+7UdE3g7tZfGkZ2zGVyfNvhElu?= =?us-ascii?Q?KmyLpWkpp42J8jceT2tNlRV+tXRX0MjbbtDPBnQQP90l6SdlhL8UDdwl63Pd?= =?us-ascii?Q?M/lgMmiBdhiyyE69qp6UjxZPrMHEaGG1pXQPyyyOzqjP16tlMqt19iob3gZl?= =?us-ascii?Q?1JsADrL4uyjlAh8mBcTZDUGwh+WYSJdcrc3IE5sT6+twYtopDqkW12oHotqX?= =?us-ascii?Q?/HOdqtuNhuFlPxaZxLbs/j5ezyLDLfi+/tfU/cA28W8nPynvB3pbutBLK/WH?= =?us-ascii?Q?T3lm/I4EufAxGdGPoNtCRoA1fnAeyC7WuyEbhBZ7CKYsuF/Xq5dUCVfa9iQn?= =?us-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l9s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3464; 7:HZHNbSZSEIVDlgL8//iMrSrjS0D1Jefhj/7RrNcDoR37HRIOrvE/k1nK6ahLyT0Sp4lmX237uj2Ud3EHslNQZmTOdsIDIdoIZ3guCg201bkCInfK6mprA2vtEQqW6lOtix9de2ZJf3a06hthIlmzeO5xJLbc1sjbzMQNBtSchd48K4cqI3gq5j+KNIb93MmJz9E2O7L7HMIh6qA1FKCMur54vPA/p1KPM1OxRz4FiAmzoejSPoWdysqDhtvDi/73 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2018 04:44:32.2295 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 873f81a8-4bdd-409c-f5ea-08d5d27ab123 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3464 Subject: [dpdk-dev] [PATCH v2] eal/devargs: add option to supply PCI dev args 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: , X-List-Received-Date: Fri, 15 Jun 2018 04:44:36 -0000 Currently, the only way of supplying device argument to a pci device is to whitelist it i.e. -w 000X:00:0X.0,self_test=1. This is not a very feasible method as whitelisting a device has its own side effects i.e only the whitelisted pci devices are probed. Add a new eal command line option --pci-args to pass device args without the need to whitelist the devices. --pci-args 000X:00:0X.0,self_test=1 Signed-off-by: Pavan Nikhilesh --- v2 Changes: - Document the option usage in eal_common_usage. - Update commit log to be more informative. lib/librte_eal/common/eal_common_devargs.c | 3 +++ lib/librte_eal/common/eal_common_options.c | 9 +++++++++ lib/librte_eal/common/eal_options.h | 2 ++ lib/librte_eal/common/include/rte_dev.h | 1 + lib/librte_eal/common/include/rte_devargs.h | 1 + 5 files changed, 16 insertions(+) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index b0434158b..a56bfeea0 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -156,6 +156,9 @@ rte_devargs_add(enum rte_devtype devtype, const char *devargs_str) bus = devargs->bus; if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) devargs->policy = RTE_DEV_BLACKLISTED; + else if (devargs->type == RTE_DEVTYPE_WHITELISTED_PCI) + devargs->policy = RTE_DEV_WHITELISTED; + if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { if (devargs->policy == RTE_DEV_WHITELISTED) bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST; diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index ecebb2923..31eebaa53 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -76,6 +76,7 @@ eal_long_options[] = { {OPT_VMWARE_TSC_MAP, 0, NULL, OPT_VMWARE_TSC_MAP_NUM }, {OPT_LEGACY_MEM, 0, NULL, OPT_LEGACY_MEM_NUM }, {OPT_SINGLE_FILE_SEGMENTS, 0, NULL, OPT_SINGLE_FILE_SEGMENTS_NUM}, + {OPT_PCI_DEVARGS, 1, NULL, OPT_PCI_DEVARGS_NUM}, {0, 0, NULL, 0 } }; @@ -1224,6 +1225,12 @@ eal_parse_common_option(int opt, const char *optarg, case OPT_SINGLE_FILE_SEGMENTS_NUM: conf->single_file_segments = 1; break; + case OPT_PCI_DEVARGS_NUM: + if (eal_option_device_add(RTE_DEVTYPE_NORMAL, + optarg) < 0) { + return -1; + } + break; /* don't know what to do, leave this to caller */ default: @@ -1360,6 +1367,8 @@ eal_common_usage(void) " --"OPT_VDEV" Add a virtual device.\n" " The argument format is [,key=val,...]\n" " (ex: --vdev=net_pcap0,iface=eth2).\n" + " --"OPT_PCI_DEVARGS" Pass key-value arguments to a pci device\n" + " The argument format is [,key=val,...]\n" " -d LIB.so|DIR Add a driver or driver directory\n" " (can be used multiple times)\n" " --"OPT_VMWARE_TSC_MAP" Use VMware TSC map instead of native RDTSC\n" diff --git a/lib/librte_eal/common/eal_options.h b/lib/librte_eal/common/eal_options.h index 211ae06ae..d52d38e32 100644 --- a/lib/librte_eal/common/eal_options.h +++ b/lib/librte_eal/common/eal_options.h @@ -59,6 +59,8 @@ enum { OPT_LEGACY_MEM_NUM, #define OPT_SINGLE_FILE_SEGMENTS "single-file-segments" OPT_SINGLE_FILE_SEGMENTS_NUM, +#define OPT_PCI_DEVARGS "pci-args" + OPT_PCI_DEVARGS_NUM, OPT_LONG_MAX_NUM }; diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 3879ff3ca..fb3e5033f 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -124,6 +124,7 @@ enum rte_kernel_driver { * Device policies. */ enum rte_dev_policy { + RTE_DEV_NORMAL, RTE_DEV_WHITELISTED, RTE_DEV_BLACKLISTED, }; diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 58fbd90a2..78c600bf2 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -29,6 +29,7 @@ extern "C" { * Type of generic device */ enum rte_devtype { + RTE_DEVTYPE_NORMAL, /* Normal dev with special pci args */ RTE_DEVTYPE_WHITELISTED_PCI, RTE_DEVTYPE_BLACKLISTED_PCI, RTE_DEVTYPE_VIRTUAL, -- 2.17.1