Announce: Open Route Cache and ONL Platform code committed to ONL

1,707 views
Skip to first unread message

Rob Sherwood

unread,
Nov 20, 2014, 12:21:16 PM11/20/14
to opennetw...@googlegroups.com

We're happy to announce two significant pieces of code have landed in ONL today: ORC and ONLP.

Most of these pieces had partially landed earlier and I've been talking about them for a while, but only as of this weekend two major parts of Open Network Linux have finally come together in a more useful state.  For folks who are interested, please take a look and send feedback to the list (or even patches!).

Both of these changes are available as of the 207fb9e0f8936dc73bb996ed6a532d5eebcf1d8c commits, so the website has been updated and the http://opennetlinux.org/binaries/latest.installer link has been updated.  Now that these have landed, I'm considering doing the first ONL release -- feedback welcome!

So, getting into the details:

First, Open Route Cache (or ORC) is a small prototype tool for syncing routing state from the Linux software kernel tables (via RTNETLINK) into the physical hardware tables in the ASIC.  The code is divided into a top-half/bottom-half model where the top-half is device independent open source (https://github.com/floodlight/bigcode/blob/master/modules/orc/module/src) and the bottom-half is ASIC-dependent, closed-source (due to silicon manufacturers NDA, but available via the ONL apt repository).  For those who are curious, the top-half/bottom-half API is trivial (https://github.com/floodlight/bigcode/blob/master/modules/orc/module/inc/orc/orc_driver.h) and could probably be replaced by the SAI once/if it lands.  Later in the week I'll post a "Getting Started Guide" for ORC, but the basic idea is:

1) run orc, e.g. as root, run `orc --daemon`
    a) I've created an upstart script for this, but it has some problem -- appreciate the help if anyone gets a chance to fix it for me (https://github.com/floodlight/bigcode/blob/master/modules/orc/orc.upstart)
2) ORC creates virtual linux interfaces (orcXX) for each physical port on the switch
3) you add IP addresses and routes to those interfaces
     `ifconfig orc03 192.168.0.1 netmask 255.255.255.0`
     `route add -net 10.0.0.0 netmask 255.0.0.0 gw 192.168.0.2`
4) ORC then copies the relevant state into the hardware ASIC tables which enables hardware routing (exact number of routes and bandwidth vary by switch)
5) In theory, instead of manually adding routes, you could run one of many open source routing stacks (e.g., Quagga, Xorp, Bird, etc.), turning ONL into a modestly functional router.

As a caveat, the code quality is highly suspect (consider this a prototype not to be deployed in production) and is missing many useful features (no IPv6, no multicast, no ECMP).

Second, I've committed the code, packing, and tools to better leverage the ONL Platform (ONLP) libraries.  This is the platform-independent API to query the fans, SFPs, temperature sensors, power supplies, etc. etc. on the box (see API calls at https://github.com/opennetworklinux/ONLP/tree/master/modules/onlp/module/inc/onlp).  Probably the easiest way to understand what this is is via new onlpdump command (output at end of mail).

Probably this email is totally insufficient to cover ORC and ONLP, but better documentation, functionality, and usability are on their way.

- Rob
.

root@onl-powerpc:~# onlpdump -r
 Fan 1
   Description: Right
   State: Present
   Status: Running.
   RPM: 13881.
   Speed: 95%.
   Airflow: Front-to-Back.
 Fan 2
   Description: Center Right
   State: Present
   Status: Running.
   RPM: 13533.
   Speed: 93%.
   Airflow: Front-to-Back.
 Fan 3
   Description: Center Left
   State: Present
   Status: Running.
   RPM: 13636.
   Speed: 94%.
   Airflow: Front-to-Back.
 Fan 4
   Description: Left
   State: Present
   Status: Running.
   RPM: 13775.
   Speed: 95%.
   Airflow: Front-to-Back.
 Thermal 1
   Description: Chassis Thermal 1
   Status: Sensor Functional
   Temperature: 31.0 C.
 Thermal 2
   Description: Chassis Thermal 2
   Status: Sensor Functional
   Temperature: 31.0 C.
 Thermal 3
   Description: Chassis Thermal 3
   Status: Sensor Functional
   Temperature: 29.0 C.
 Thermal 4
   Description: Chassis Thermal 4
   Status: Sensor Functional
   Temperature: 29.0 C.
 Thermal 5
   Description: Chassis Thermal 5
   Status: Sensor Functional
   Temperature: 31.0 C.
 PSU 1
   Description: PSU-1
   State: Missing
 PSU 2
   Description: PSU-2
   State: Present
   Status: Running.
   Model: PSU-LB9
   Type: AC
   Vin: 217.5
   Vout: 12.5
   Iin: 0.4
   Iout: 4.7
   Pin: 75.0
   Pout: 58.0
   Fan 6
     Description: PSU-2 Fan
     State: Present
     Status: Running.
     RPM: 1792.
     Airflow: Front-to-Back.
   Thermal 9
     Description: PSU-2 Thermal 1
     Status: Sensor Functional
     Temperature: 29.0 C.
   Thermal 10
     Description: PSU-2 Thermal 2
     Status: Sensor Functional
     Temperature: 29.0 C.
   Thermal 11
     Description: PSU-2 Thermal 3
     Status: Sensor Functional
     Temperature: 30.0 C.

Nikolay Shopik

unread,
Nov 21, 2014, 9:00:20 AM11/21/14
to Rob Sherwood, opennetw...@googlegroups.com
Rob,

Am I suppose to compile onlpdump by myself? I've tried latest ONL, but
there is no onlpdump binary anywhere to be found.

And orc doesn't recognize --daemon option, if I try start it w/o
arguments it will complain about drivers.

DBG: options.c:99 :: Setting default driver to "orc_brcm.so"
DBG: options.c:104 :: Adding to default driver search path:
"/usr/share/orc/drivers"
DBG: load_driver.c:76 :: Looking for driver at:
/usr/share/orc/drivers/orc_brcm.so
ERR: load_driver.c:83 :: Failed to find driver 'orc_brcm.so' in
search path
FATAL_ERR:
/home/robs/work.onl/ONL-clean/submodules/bigcode/modules/orc//module/src//main.c:175
::Err: Failed to initialize driver at orc_brcm.so
exiting...

Rob Sherwood

unread,
Nov 21, 2014, 2:17:26 PM11/21/14
to Nikolay Shopik, opennetw...@googlegroups.com
Hmm... did you build from source or did you pull the pre-compiled binary?  The source code looks right, but you're experiencing the code as it was a week ago. 

Fwiw, the onlpdump code lives in /lib/platform-config/$platform/bin/onlpdump where $platform is populated from /etc/onl_platform.  That directory should be added to your PATH via /etc/profile.d/onl.sh (https://github.com/opennetworklinux/ONL/blob/45387680690ed2a23add41f4513a4f21971ad1de/builds/swi/all/shared/etc/profile.d/onl.sh): 

Is this what you're seeing?  I'm trying to understand if you've run into a problem with the build system or did I fat finger something building the latest.install image.

- Rob
.

Nikolay Shopik

unread,
Nov 21, 2014, 2:33:00 PM11/21/14
to Rob Sherwood, opennetw...@googlegroups.com
This is pre-compiled binary.

I've tried search onlpdump binary on filesystem didn't find it anywhere

Rob Sherwood

unread,
Nov 22, 2014, 12:56:00 PM11/22/14
to Nikolay Shopik, opennetw...@googlegroups.com
So, I'm not sure how I installed the wrong binary image into the latest.installer, but it was clearly an older one from a week ago and had barely any the changes I was talking about.

I've updated the link to the correct installer (with the right git hash, that matches HEAD) and verified that it installs everything correctly (see below).

Thanks for the help working out the bumps,

- Rob
.

root@onl-powerpc:~# which onlpdump
/lib/platform-config/powerpc-quanta-lb9-r0/bin/onlpdump
root@onl-powerpc:~# orc --help
Help requested 
Usage: orc [options] 
-d, --driver=DRIVER_NAME  -- ASIC driver to load ("orc_brcm.so") 
-D, --debug[=val]         -- Enable debugging (INFO)
--daemon                  -- Fork and run in background
-h, --help                -- Print this message
-i, --interface-prefix    -- Virtual interface prefix ("orc") 
-p, --dpath=path          -- Add a path to the driver search path
-P, --ports-only          -- Only create virtual ports and do TX/RX - no L3
-V, --verbose             -- Enable verbose opertations


   Default driver search path:
          Path: /usr/share/orc/drivers


   Valid Logging Levels:
          Log Level: TRACE == 0
          Log Level: DEBUG == 1
          Log Level: INFO == 2
          Log Level: WARN == 3
          Log Level: ERR == 4
          Log Level: FATAL == 5


Nikolay Shopik

unread,
Nov 25, 2014, 5:56:06 AM11/25/14
to Rob Sherwood, opennetw...@googlegroups.com
Thanks,

I've got installed latest.installer, now onlpdump there. But orc still
failing to start, here is debug output.

LOG: options.c:142 :: Setting Debug level to DEBUG
DBG: load_driver.c:76 :: Looking for driver at:
/usr/share/orc/drivers/orc_brcm.so
LOG: load_driver.c:79 :: Found driver at:
/usr/share/orc/drivers/orc_brcm.so
ERR: load_driver.c:51 :: Could not open Module
/usr/share/orc/drivers/orc_brcm.so --
/lib/powerpc-linux-gnu/libonlp.so.1: undefined symbol:
__onlp_platform_version_default__
FATAL_ERR:
/home/robs/work.onl/ONL/submodules/bigcode/modules/orc//module/src//main.c:194
::Err: Failed to initialize driver at orc_brcm.so


On 22/11/14 20:56, Rob Sherwood wrote:
> So, I'm not sure how I installed the wrong binary image into the
> latest.installer, but it was clearly an older one from a week ago and had
> barely any the changes I was talking about.
>
> I've updated the link to the correct installer (with the right git hash,
> that matches HEAD) and verified that it installs everything correctly (see
> below).
>
> Thanks for the help working out the bumps,
>
> - Rob
> .
>
> root@onl-powerpc:~# which onlpdump
> /lib/platform-config/powerpc-quanta-lb9-r0/bin/onlpdump
> root@onl-powerpc:~# orc --help
> Help requested
> Usage: orc [options]
> -d, --driver=DRIVER_NAME -- ASIC driver to load ("orc_brcm.so")
> -D, --debug[=val] -- Enable debugging (INFO)
> *--daemon -- Fork and run in background*

Rob Sherwood

unread,
Nov 25, 2014, 2:44:59 PM11/25/14
to Nikolay Shopik, opennetw...@googlegroups.com
Sigh.  Looks like I had a stale version of some of the .deb files in my local repo.  What this mean was that if you built it yourself it would have worked correctly, but the latest.installer was bad.

I've updated it now .. and downloaded and tried it myself (for real this time, sigh) and it works.

Please give it another spin and I'll look into your installer patch.

Thanks for the help,

- Rob
.

Yuliang Li

unread,
Jan 16, 2015, 4:06:16 PM1/16/15
to opennetw...@googlegroups.com
Rob,

I tried orc, but I got this:

root@onl-powerpc:~# orc
LOG:        load_driver.c:79  :: Found driver at: /usr/share/orc/drivers/orc_brcm.so
01-03 19:04:42.794895 Platform 'powerpc-as5710-54x-r0b' is not supported in the current build.
Platform 'powerpc-as5710-54x-r0b' is not supported in the current build.
Aborted

Do you know what is wrong?

Thanks,
Yuliang

Rob Sherwood

unread,
Jan 16, 2015, 6:20:39 PM1/16/15
to Yuliang Li, opennetw...@googlegroups.com
Hi Yuilang,

This is a known problem with the ORC build on AS5710 -- https://github.com/opennetworklinux/ONL/issues/62.

I'm going to try to take a swing at fixing it right now.

- Rob
.

--
You received this message because you are subscribed to the Google Groups "opennetworklinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opennetworklin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yuliang Li

unread,
Jan 21, 2015, 7:24:22 PM1/21/15
to opennetw...@googlegroups.com, liyuli...@gmail.com, Minlan Yu
Hi Rob,

I see. 

Is there any other way to do it? I just want to forward packet from switch port 1 to port 2, 3 to 4, 5 to 6, etc. How can I config the hardware table with ONL?

Thanks,
Yuliang
Reply all
Reply to author
Forward
0 new messages