From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0067.outbound.protection.outlook.com [104.47.42.67]) by dpdk.org (Postfix) with ESMTP id E54051B831 for ; Tue, 5 Jun 2018 13:31:51 +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=PDF9/IJ6Z5N5cZ5LOwvIz+LnBP/Z+byLEfwanJTXVFo=; b=FSUEA6jbcyvYRM/8gqd/3ykHH0zCutOLkAG6Mv4gF2TT3soHFDS1EBwwwP2p5iYnEqa7IhD3jBctyuoKotXxvWGr6qZgQV119Jb3V7qnT37g5f2j0UTMOroTIDOnJytbC5HdI33MWAATKyUX+l5D1aJSBvRAvyaYWR4kjNu3gZs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Pavan.Bhagavatula@cavium.com; Received: from ltp-pvn.caveonetworks.com (111.93.218.67) by CY4PR07MB3462.namprd07.prod.outlook.com (2603:10b6:910:75::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.14; Tue, 5 Jun 2018 11:31:48 +0000 From: Pavan Nikhilesh To: jerin.jacob@caviumnetworks.com, gaetan.rivet@6wind.com, thomas@monjalon.net Cc: dev@dpdk.org, Pavan Nikhilesh Date: Tue, 5 Jun 2018 17:01:28 +0530 Message-Id: <20180605113128.15365-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: CO2PR07CA0074.namprd07.prod.outlook.com (2603:10b6:100::42) To CY4PR07MB3462.namprd07.prod.outlook.com (2603:10b6:910:75::15) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(2017052603328)(7153060)(7193020); SRVR:CY4PR07MB3462; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 3:Q5zm1sVxLIRYB6rBTkUE1NxgR61xnN81R++9vl5giLmGtCOkJ/Wo8/AgHw6MMEaycR4jTcVimWA+gFsOULWD7dJlbzwT8mYv27Rj9H2R+jdyODe3aeH4ixWwHwdsT/yRntuuzFzMTxXrQumISgpD2tlgJS05yHUelTy4qeXN3GMs8Ek4HeWlUNkPj6QHI43AxX/VKvvg/cSDdhU6Wr6kK9MJv1Hw85f1RjOBw570mFCCOOiSEkzCVkEQWQI5OT9S; 25:A/fvwh9xfp2JGwxP8eqMwn+UFH+Fe29JBBU+cAp7rQxHpl9lUsR/WoqNFJ0DQo3YYeLCMYE9tokROP6GZYEqXtAPuJLyTJGfJBXzWIcUfIga3vTw1VCZIjQSDS0GVpj74R+cw1oLAqGellPvYKtxW2b3skao6w6ewcoQwsezx4kV+C04SwhskSPZiGiqimARfRa1vIV5DWapMEp2hx5mhWoXl674KcSwjsEQfMpFnAQT0c7l8JGWb5WV69+scsKygwZkNdywRLFHfK8X3Jniru1WUlQ2BtETNEBHKOKe73T8dmR7ZUwx2thZfqksmqIlFonryz2MLg/lhotYKGQvmQ==; 31:mJsEF2Fen005x9HdGe6ELBHuMLDKueVLTSbr47vrdZFj9p0+i3rocYneSiyQA4FvmcwyP1iKVQ7aYWhQm3dxApCLQje+GUWV1wcRLAFIj3AhpcsOxaU7DJ7XUo7ld3kLmk+3LVm1pge1mkoehX+q+sfNfHyY5GIE1/eN0uMMBqBTeiO68AWuwRUSg3U/tt/y7XaYkkSersAryrFyMFi9kqW2aH88Wg48YwyhAcF3euQ= X-MS-TrafficTypeDiagnostic: CY4PR07MB3462: X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 20:Mkhm+rozDDXdFVI2vXBgFFRNg18dHnvsFkmHOa3dxlpXeg2Gl4L6ZI6fuQl7/CtQmm+DnlX87I7iJDHQkMJ+NK9geQGNGQaN8wLmg3u8YBSBxkb7YMwkLJ7lHsMUg7im9Cp9o/2jYwAotyqA1jR69nYAzpP10HBpESY/1XVD260owGb8rlxCVfq75zaL7Gb3Yfi7jMo1tYcK+MbegZirnHkqEf67bmhj5fuzzIzSbWs60drFwQ9zAOhtqSvaeVYurIw6XNguPHhvdF4Mz85zWf6KEAsKpzQ3Tp4mdIoZqomXfkqermK5gSyusMJtPf5Y1h4c6S0XbkqjiLibNKaXRxm2jCCbGRcV/UpaE2WTDhKfrX5ydoFsWvcDgEZiP1lwYu458Oiwtyl78jze0xWmz/vXo/ni0k7IknSSDDEEvANM0LP8xfPcihVVQj3gMzXmeVRILNIasl06m+Ex5SkWgxBNQjvF5Jv9gp9H84UM6FMrtjhYd3sVlz9fEZyHfYtahvoA948mW69MhcqKLtcmKs4yekAtdIHamtafIaRiRR2fyT65F3UdJg8qPvfiyIzG7PU1WdDV1UkWZCJM/3ctrgTJYd0nDOqGg4kgc17FDuc=; 4:H2+2g6ceDxRBF/ROFix7roG9QyLcCbui3wPr+rhOkHCuKmloV6NF1zuJplN5RcNkQEgQkG0sTXe3dymWYlMzxlKghaz9XYeefktd2NFy74BrlspZ+BwQ/FJXrKz80TAEtjqxemtr8a9QMygF7G59Lg76AhJFlygFoVzTrzx0dB25CUT890f+Xm5YeBPoantH3JoPudUQNX87kbaFKFTF4uTG0YBhANpFIyfjkB5s/PrH7yjH3sEuLEd5siZ4K/ul6BWH2wgqL0i9vaRJPe577Q== 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)(5005006)(8121501046)(93006095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR07MB3462; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3462; X-Forefront-PRVS: 0694C54398 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(39380400002)(396003)(376002)(346002)(366004)(189003)(199004)(81156014)(2906002)(8676002)(51416003)(52116002)(956004)(6486002)(53416004)(105586002)(106356001)(2616005)(1857600001)(476003)(36756003)(6506007)(386003)(7736002)(68736007)(26005)(42882007)(305945005)(486006)(16526019)(5009440100003)(316002)(1076002)(25786009)(97736004)(48376002)(50466002)(478600001)(53936002)(69596002)(6116002)(3846002)(72206003)(16586007)(107886003)(6512007)(6666003)(5660300001)(50226002)(81166006)(8936002)(66066001)(4326008)(47776003)(42262002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3462; H:ltp-pvn.caveonetworks.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR07MB3462; 23:UaV7WlSDNr+9wU0M6AktthDtWURhXJ4ZCQW8gDM+6?= =?us-ascii?Q?rSgxWfYX5QKCaj/937YSmFHu1iAqft8L3D5+icU9GTswdWtUEGO5aFu9tIBT?= =?us-ascii?Q?TtS8wtGMwwGsQseovaIpiu7LEqp4MvRPlm98ukyv3EtyVDVAb/glft9B3kl9?= =?us-ascii?Q?Phx6N39E90m37nPuyNCMLzCSxESfXdD/IiTfwLYT5sLsrECpW5Blp4yD/jcQ?= =?us-ascii?Q?Vc9Qb9b31OUryD1qSep/axsxD7pDtlFNOXo9QhS6Cqbkkdx8By4dStgkLVTj?= =?us-ascii?Q?XsuSu/w3QN4T4ak8vNDCyOdLfLq9bUhB0lvHnBrxpIP99kiJEIOUcnEgGt84?= =?us-ascii?Q?3QxMkdjh2QuOzYGwDQeNG6velgIfybL/nJF3myDgeBhTrmU+jeSHKDe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I8CHI6fh3i/BdxpFkL?= X-Microsoft-Antispam-Message-Info: 5Ah3hnD/avhdy1lDnOv9I1aa4yxN9wdhliZqJUwV5Vb5iCRHpeqFn4BosVSUVQH0ntos5bAB6Pdyl24VviAFh0yLsdFqcd3yl4b/h0CmtWAg9kANETMqZkJ6KVXcfmRVutApYVD9LcY7KmaAY+nzB4WUwWFjX+9cwjkct9qB5Vd7FX7zu5X8tpnzBSjXtcRn X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 6:r9w1Spz3I/BKEaF+4Jj02Ige+n+cdtkE/tLPg67rZedVudJk+ZHcR/HOedIBf2nJqHYPbJXxyoG6RypAh+1z85BaVuuy72zhJ1xSLlCqxC5rIQ1YCYGM8jxADNWb8Vv4Wn6og1/IXkSyiEi0rE4oD9S5r5JKbx74GbJK8pKJNUJNhNHg17ckRuuRIzK31vsR7AOAGMIUHw2poQvUKXsgFoSbUOpHKw4F9FyT/+Am/vNcSjwtzhqfgk0m70rNxMABJYs0QBaPMhN2TQ1XKbJTLjf1QqXx7j169LBv+iz1+jAoUlBhrI715cFSfil33pVm4mkjRVf/gXCwRE6H2B+myu3JnKWiwpu6GslBZmf5lvFS2+GjcW2g5TvTjcjiXAmNGOfnrtZH1OlVfHdYug+AYNpqIIk4zxi5i89T1gqSzzGBLFMpfu25WiVA20gg+Lxp+6bYcH57On68ZXOrPeyyrQ==; 5:1fgzWHrpW0H6MvM7mlovv9iiulWxr5zviSm32PlZolf+tH+1sdlQzs6Mm+bYgWCrinTpTphBH2XO7qj9ug5avhEvfNtzz6SiLH1f+lIRWvbP00Y8eP8g67c7MnS/JdOcB+spAHRTX0eeWxj+QmLc6EZBsGDlOzrIuufE7WYxIc8=; 24:jvpkXEvq1wSy1bzty6RnK0fRovhl7GfssOvx1PTKWZ1QH7DUXDN1qarNNRpKSwhT/UqYiZcqSzyXmdgVe39JOL2xybc82bcXUGC5inoeC80= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3462; 7:ik2wXg2RDNdIANapRfjOMhkDWnDi/A8qjwDlhp4nVzB5JMMgsUHeGRWxIHsl55dJ9DlhZCQlttQP0LBwJlYVBSXWj5UguWNq16bjnIUvYTixaiwDK3eA1JT7ndC4tNt1onADthVPyHHr5hotNK8nBdAMDQwRP5qbwmxldVR+n7G1BdN3PlvIWH6B7R15HyqBCH0wp/MHmEbG47Y+EvSP7VSbOAsaaXF0IMXEsTikOI0RcvXRxD7mc7gW2gz7Azi8 X-MS-Office365-Filtering-Correlation-Id: cce49cae-2cc2-4407-bfc1-08d5cad7ee0c X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2018 11:31:48.6804 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cce49cae-2cc2-4407-bfc1-08d5cad7ee0c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3462 Subject: [dpdk-dev] [PATCH] 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: Tue, 05 Jun 2018 11:31:52 -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. Add a new eal command line option --pci-args to pass device args without the need to whitelist the devices. Signed-off-by: Pavan Nikhilesh --- lib/librte_eal/common/eal_common_devargs.c | 3 +++ lib/librte_eal/common/eal_common_options.c | 7 +++++++ 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, 14 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..31494ec9b 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: 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