[dpdk-dev] [RFC 0/6] Flattened Device Tree access from DPDK

Jan Viktorin viktorin at rehivetech.com
Sat Mar 26 02:12:32 CET 2016


Hello,

while extending the DPDK by a kind of platform devices (for the 16.07), an
access to the FDT might be necessary (or at least very helpful). This patch
series for 16.07 introduces an approach to solve this topic.

The API is designed from scratch and there is only the Linux backend for it.
The Linux backend can read and traverse the /proc/device-tree structure. The
API, however, stays as independent as possible. It is possible to:

* open the FDT in a platform independent way (rte_fdt_open/close)
* define a path in the FDT in an abstract way (rte_fdt_path)
* read strings, 32 and 64 bit values, a binary content (rte_fdt_path_readX)
* walk the FDT structure from a selected point (rte_fdt_path_walk)

I've included unit tests of the API and of the Linux implemention. Some basic
API tests are introduced in the patch 3. Then a simplified device-tree file
structure is added together with more tests testing the Linux backend (4,5).
I've left those 3 patches separated for now but I think they can be aggregated
into a single patch later.

Here, I've encounter an issue. The testing FDT files (app/test/linux-fdt) need
to be copied (or linked) to the working directory of the _test_ executable. I
have no idea, how to integrate such logic into the build system.

The API provides a very limited set of access functions. I think, it's as
minimalistic as possible while enabling all necessary operations a PMD driver
would need. However, some higher level functions would be helpful, too.

The patch series is still missing some bits (eg. better error logging).

Any comments and suggestions are welcome...

Regards
Jan


Jan Viktorin (6):
  eal/fdt: introduce Flattened Device Tree API
  eal/fdt: implement FDT API for Linux
  eal/fdt: test FDT API
  eal/fdt: add testing FDT of xgene-1 got from Linux runtime
  eal/fdt: test Linux implementation on xgene-1 FDT
  eal/fdt: export for dpdk 16.07

 app/test/Makefile                                  |   1 +
 app/test/linux-fdt/xgene1/#address-cells           | Bin 0 -> 4 bytes
 app/test/linux-fdt/xgene1/#size-cells              | Bin 0 -> 4 bytes
 app/test/linux-fdt/xgene1/compatible               | Bin 0 -> 28 bytes
 app/test/linux-fdt/xgene1/model                    | Bin 0 -> 25 bytes
 .../xgene1/soc/ethernet at 17020000/local-mac-address | Bin 0 -> 6 bytes
 .../linux-fdt/xgene1/soc/ethernet at 17020000/reg     | Bin 0 -> 48 bytes
 app/test/test_fdt.c                                | 484 +++++++++++++++++++++
 lib/librte_eal/common/Makefile                     |   2 +-
 lib/librte_eal/common/eal_common_fdt.c             | 317 ++++++++++++++
 lib/librte_eal/common/include/rte_fdt.h            | 185 ++++++++
 lib/librte_eal/linuxapp/eal/Makefile               |   3 +
 lib/librte_eal/linuxapp/eal/eal_fdt.c              | 336 ++++++++++++++
 lib/librte_eal/linuxapp/eal/rte_eal_version.map    |  20 +
 14 files changed, 1347 insertions(+), 1 deletion(-)
 create mode 100644 app/test/linux-fdt/xgene1/#address-cells
 create mode 100644 app/test/linux-fdt/xgene1/#size-cells
 create mode 100644 app/test/linux-fdt/xgene1/compatible
 create mode 100644 app/test/linux-fdt/xgene1/model
 create mode 100644 app/test/linux-fdt/xgene1/soc/ethernet at 17020000/local-mac-address
 create mode 100644 app/test/linux-fdt/xgene1/soc/ethernet at 17020000/reg
 create mode 100644 app/test/test_fdt.c
 create mode 100644 lib/librte_eal/common/eal_common_fdt.c
 create mode 100644 lib/librte_eal/common/include/rte_fdt.h
 create mode 100644 lib/librte_eal/linuxapp/eal/eal_fdt.c

-- 
2.7.0



More information about the dev mailing list