[dpdk-dev] [PATCH V2 2/5] Add Intel FPGA BUS Probe Code
Gaëtan Rivet
gaetan.rivet at 6wind.com
Wed Mar 21 11:05:03 CET 2018
On Wed, Mar 21, 2018 at 03:51:31PM +0800, Rosen Xu wrote:
> Signed-off-by: Rosen Xu <rosen.xu at intel.com>
> ---
> lib/librte_eal/common/eal_common_bus.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_eal/common/eal_common_bus.c b/lib/librte_eal/common/eal_common_bus.c
> index 3e022d5..e3bcebe 100644
> --- a/lib/librte_eal/common/eal_common_bus.c
> +++ b/lib/librte_eal/common/eal_common_bus.c
> @@ -87,7 +87,7 @@ struct rte_bus_list rte_bus_list =
> rte_bus_probe(void)
> {
> int ret;
> - struct rte_bus *bus, *vbus = NULL;
> + struct rte_bus *bus, *vbus = NULL, *ifpga_bus = NULL;
>
> TAILQ_FOREACH(bus, &rte_bus_list, next) {
> if (!strcmp(bus->name, "vdev")) {
> @@ -95,6 +95,11 @@ struct rte_bus_list rte_bus_list =
> continue;
> }
>
> + if (!strcmp(bus->name, "ifpga")) {
> + ifpga_bus = bus;
> + continue;
> + }
> +
> ret = bus->probe();
> if (ret)
> RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n",
> @@ -108,6 +113,13 @@ struct rte_bus_list rte_bus_list =
> vbus->name);
> }
>
> + if (ifpga_bus) {
> + ret = ifpga_bus->probe();
> + if (ret)
> + RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n",
> + ifpga_bus->name);
> + }
> +
I do not think this solution is generic and scalable anough to get into
common EAL code.
However, I do not think we need to come up with a dependency scheme
(callback registration to check whether proper conditions are met to
proceed with probing).
I think you have a hard-dependency on the PCI bus because you are simply
probing a PCI device. You do not need an additional bus for this.
--
Gaëtan Rivet
6WIND
More information about the dev
mailing list