From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gaetan Rivet Subject: [PATCH v9 25/27] bus/pci: process declarative PCI devargs Date: Wed, 4 Jul 2018 00:15:08 +0200 Message-ID: References: Cc: Gaetan Rivet To: dev@dpdk.org Return-path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 926D51BECE for ; Wed, 4 Jul 2018 00:16:09 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id s14-v6so3756664wmc.1 for ; Tue, 03 Jul 2018 15:16:09 -0700 (PDT) In-Reply-To: In-Reply-To: References: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Introduce the facility to process future PCI parameters. Once the matching between PCI devices and devargs has been done, it is possible to process each devargs. New parameters would have the PCI device handle to work with when parsing the device (bus specific) parameters. Signed-off-by: Gaetan Rivet --- drivers/bus/pci/pci_common.c | 3 +++ drivers/bus/pci/pci_params.c | 10 ++++++++++ drivers/bus/pci/private.h | 13 +++++++++++++ 3 files changed, 26 insertions(+) diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 749b6eee3..e2816eedb 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -251,6 +251,9 @@ pci_probe_all_drivers(struct rte_pci_device *dev) if (dev->driver != NULL) return 0; + if (rte_pci_devargs_process(dev) < 0) + return -1; + FOREACH_DRIVER_ON_PCIBUS(dr) { rc = rte_pci_probe_one_driver(dr, dev); if (rc < 0) diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c index bb62bcb80..7dceef89b 100644 --- a/drivers/bus/pci/pci_params.c +++ b/drivers/bus/pci/pci_params.c @@ -131,3 +131,13 @@ rte_pci_devargs_prepare(struct rte_devargs *da) rte_kvargs_free(kvargs); return ret; } + +int +rte_pci_devargs_process(struct rte_pci_device *pdev) +{ + /* For the moment, no PCI param + * needs to be processed. + */ + (void) pdev; + return 0; +} diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index 9beb24c6a..06dc85e85 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -207,4 +207,17 @@ rte_pci_dev_iterate(const void *start, int rte_pci_devargs_prepare(struct rte_devargs *da); +/* + * Process the device devargs, if any. + * + * @param pdev + * PCI device + * + * @return + * 0 on success. + * <0 on error. + */ +int +rte_pci_devargs_process(struct rte_pci_device *pdev); + #endif /* _PCI_PRIVATE_H_ */ -- 2.11.0