OpenFlow Data Plane Abstraction (OF-DPA) API Guide and Reference Manual
|
This section details the build procedure for the OF-DPA software using the following environment:
To successfully build OF-DPA software for a Linux environment, execute the following steps in the order specified.
This section provides information about how to install the Broadcom Linux toolchains for OF-DPA 2.0. The following table contains information about the toolchains provided for the supported architectures and CPUs:
Directory | Architecture | CPU | OS Version |
---|---|---|---|
e500v2 | PowerPC | E500v2 | BRL 3.8 |
iproc | ARM CPU | ARMv7 | BRL 3.6 |
x86_64 | Intel x86 | Intel Atom | Ubuntu 12.04 |
The toolchains are built to run under Red Hat Enterprise Linux 5 (RHEL5), RHEL6, CentOS 5, and CentOS 6, 64-bit. If there is a need for toolchains to run in a different environment, contact Broadcom for assistance.
To install the toolchains:
After building the toolchain, the operator must extract the open source code. A sample set of commands for extracting the open source code is as follows.
The various open source packages are unpacked into the OFDPA_R200_open_source_support_code directory.
Refer to the following command sequence as a guide for building mkimage:
When this process is complete, the mkimage and mkimage64 binaries are available in tools/mkimage and tools/mkimage64, respectively, and should be copied to a location that is accessible via the PATH variable, so that is visible to the OF-DPA build process. mkimage64 is identical to mkimage.
The operator should now be ready to install and build the Linux kernel. The kernel is automatically built as part of the OF-DPA image construction, so there is no need to do a separate build of the kernel.
The Linux kernel provided with the OF-DPA distribution compiles as simply as any other distribution of Linux. The exception is the image packaging. The OF-DPA code image needs to be packaged using the mkimage tool from the u‑boot distribution.
Refer to the following command sequence as a guide for installing and building the Linux kernel:
The iProc ARM kernel sources are bundled in the open source tarball and also within the OF-DPA source code directory structure. For iProc ARM, the kernel is automatically built as part of the OF-DPA image construction, so there is no need to do a separate build of the kernel. The following information documents the location of the iProc ARM sources within the tree.
The kernel that gets built for iProc ARM BSP can be found in the OF-DPA tree at this location:
For example, the iproc_hr2 kernel sources are found in this tree:
The 40-character string is the SHA ID that corresponds to the version of the kernel that we have provided for that BSP. A BSP that uses this kernel auto-build feature has two places where this SHA ID can be configured:
where:
Within that file, the BSP may optionally define the Makefile variable GIT_COMMIT_ID to exactly match the 40-character string. If GIT_COMMIT_ID is not found there, the Makefile system falls back to this file:
For OF-DPA 2.0, the BSPs use only the common version of the kernel.cfg file. In that file, there is this line:
The user of a BSP can find this commit ID, and use it to locate the proper version of the kernel sources within the build_kernels subdirectory.
If you forget to install this file and perform a make with OF-DPA, then you must do a make clean for OF-DPA after installing gen_init_cpio.
Users can build OF-DPA as an interprocess mode application or choose to generate the archives necessary to statically link with their code. The sections below provide the build instructions for these modes. In either mode, the SDK is also built as part of the OF-DPA make process. OF-DPA builds the SDK using the SDK Make system.
These make variables control building OF-DPA. They are typically set in the Makefile in the platform output directory. The common variables are:
The following make variables are only needed by the iProc systems to address some make issues in the SDK.
The following make variables are only needed by the Ubuntu switches:
Change to the platform subdirectory (e.g. bin/ly2-trident-fsl14 ) and type "make". This will generate the following binaries in the directory specified by DELIVERABLES_DIR. The default setting for DELIVERABLES_DIR is output/<platform>/build/ as defined in Make.common.
Users can choose to link OF-DPA statically with their application. The OF-DPA build target 'libraries' generates the archives for OF-DPA code. By default, the SDK code archives are also generated on invocation of 'libraries' target. The archives are generated in LIBRARIES_DIR directory. Statically link the OF-DPA archives with the user application code to generate the executable image.
The OF-Agent application is an example of a single process mode application. This application is built by the make target 'ofagentapp'. It statically links an example port of the Indigo agent with OF-DPA. The OF-DPA process is started using the command "./ofagentapp &" from the switch Linux prompt.
Applications accessing the OF-DPA APIs must invoke ofdpaClientInitialize() before invoking any other OF-DPA APIs.
Use the following commands to clean the builds
Use the following command to generate OF-DPA documentation
Some small example applications are provided along with OF-DPA that invoke OF-DPA APIs. These applications typically dump tables or perform trivial tasks. They can be examined as a model for writing code to access the OF-DPA API. These applications access OF-DPA via the RPC interface.
The example applications may be built using following command.
This command must be issued in the directory ofdpa/output/<platform>.
This command also creates the Python interface to the RPC shared library.
For Ubuntu-based switches, a .deb package will be built if the make target is package.
This package can be installed using the usual package managers. OF-DPA will be installed as upstart services. There are two services: ofdpa and ofagentapp. The ofdpa service starts ofdpa in Interprocess mode. The ofagentapp service starts OF-DPA in Single Process mode with the Indigo OpenFlow agent.
Example: To start the ofdpa service:
To stop the ofdpa service: