[ovs-dev] Running openvswitch in Android

Ben Pfaff blp at nicira.com
Mon Jul 8 18:02:43 UTC 2013


Do you have a patch to fix the problem? We like Open vSwitch to work in
many environments as possible.
On Jul 8, 2013 10:59 AM, "muddin" <muddin at cs.odu.edu> wrote:

>  Hello
>
>  Finally I was able to run the openvSwitch in Android with no crash. I
> found that android does not support any 128 bit value transfer between
> variables. Therefore the  ipv6 addr can not be copied directly in android.
> I saw that in android linux/ipv6.h and net/ipv6.h header file has some
> macro and inline function to deal with such 128 bit value. Which was not
> used by the openvswitch.
>
>  Thank you everyone. If any one interested in deploying openvSwitch in
> android I am more then happy to discuss about this in more details.
>
>  Regards
> Mostafa
> PhD Student
> www.cs.odu.edu/~muddin
>
>
>
> ------------------------------
> *From:* muddin
> *Sent:* Monday, July 01, 2013 2:04 AM
> *To:* jinga at google.com
> *Subject:* FW: [ovs-dev] Running openvswitch in Android
>
>     Hello Jing
>
>  I was wrong, problem is not in that function.  Also it was not generate
> any core dump file. Only logcat shows the following error
>
>  F/libc    ( 2735): Fatal signal 7 (SIGBUS) at 0xbe7e4c6a (code=1),
> thread 2735 (ovs-vswitchd)
> I/DEBUG   (  160): process stopped due to unexpected signal 14
>
>
>  The second line was generated from
> $ANDROID_SOURCE/system/core/debuggerd/debuggerd.c
>
>  This program "debuggerd" is responsible for generating the core dump
> file which is called Tombstone in Android.
>
>  The strange thing is that although ovs-vswitchd was crashing for
> SIGBUS(7) signal but that Debuggerd program is getting SIGALRM(14) signal.
> I don't know why. Any how, debuggerd program does not generate Tombstone
> for SIGALRM. But I enable it by changing the debuggerd.c file.
>
>  Now it generate the Tombstone file for the ovs-vswitchd
>
>  I have attached the file. Now what should i do?
>
>  Regards
> Mostafa
>
>
>
>
>
>
>  ------------------------------
> *From:* muddin
> *Sent:* Friday, June 28, 2013 4:23 PM
> *To:* Jing Ai
> *Subject:* RE: [ovs-dev] Running openvswitch in Android
>
>   Hello Jing,
>
>  Sorry I was busy with something else. I think I have some sort of idea
> why the vswitchd daemon is not stable.
>
>  The reason it crashes is for following reason
>  F/libc    ( 3539): Fatal signal 7 (SIGBUS) at 0xbee8dc6a (code=1),
> thread 3539 (ovs-vswitchd)
>
>  Basically its a data alignment issue.
>
>  The function I think is responsible for this is
>
>  'ftruncate()'
>
>  You can see the use of this function in  /lib/daemon.c
>
>  "if (ftruncate(fileno(file), 0) == -1) {
>
>         VLOG_FATAL("%s: truncate failed (%s)", tmpfile, strerror(errno));
>
>     }
>
> "
>
>  Do you have any idea how can I replace this function? However I got that
> error message from logcat. I enable the core dump in android. I don't know
> why it doesn't create the core dump file for vswitchd daemon. I haven't
> deal with core-dump before. Probably I am missing something.
>
>
>  It seems you work in google. I was wondering are you guys have used the
> ovs in android before. Since currently I am staying at Palo Alto I would
> really love to see you some time to discuss about this, if thats ok with
> you.
>
>  Regards
> Mostafa
>  ------------------------------
> *From:* Jing Ai [jinga at google.com]
> *Sent:* Sunday, June 23, 2013 10:32 PM
> *To:* muddin
> *Subject:* Re: [ovs-dev] Running openvswitch in Android
>
>   Mostafa,
>
>  I do not have the setup. You can find -name core.ovs-vswitchd.* to
> locate the core file.
>
>  Best,
> Jing
>
>
> On Fri, Jun 21, 2013 at 2:42 PM, muddin <muddin at cs.odu.edu> wrote:
>
>>  Hello Jing,
>>
>>  I have a silly question may be,
>>
>>  How to do core file in Android? Can you help me on this.
>>
>>  Regards
>> Mostafa
>>  ------------------------------
>> *From:* Jing Ai [jinga at google.com]
>> *Sent:* Tuesday, June 18, 2013 5:35 PM
>>
>> *To:* muddin
>> *Subject:* Re: [ovs-dev] Running openvswitch in Android
>>
>>    Mostafa,
>>
>>  I was busy recently. Forgot to ask you, do you have core file for
>> ovs-vswitchd? What does the backtrace look like?
>>
>>  Best,
>> Jing
>>
>>
>> On Thu, Jun 13, 2013 at 11:07 AM, muddin <muddin at cs.odu.edu> wrote:
>>
>>>  Hello Jing,
>>>
>>>  Another issue, is that after I start the ovs-vswitchd daemon then it
>>> automatically exits. Event though i didn't do any command. following is the
>>> log:
>>>
>>>  2013-06-13T17:26:37Z|00001|vlog|INFO|opened log file
>>> /data/local/tmp/log/openvswitch/ovs-vswitchd.log
>>> 2013-06-13T17:26:37Z|00002|worker(worker)|INFO|worker process started
>>> 2013-06-13T17:26:37Z|00002|reconnect|INFO|unix:/data/local/tmp/run/openvswitch/db.sock:
>>> connecting...
>>> 2013-06-13T17:26:37Z|00003|reconnect|INFO|unix:/data/local/tmp/run/openvswitch/db.sock:
>>> connected
>>> 2013-06-13T17:26:37Z|00004|netlink_socket|WARN|sysconf(_SC_UIO_MAXIOV):
>>> Function not implemented
>>> 2013-06-13T17:26:37Z|00005|bridge|INFO|bridge br0: using datapath ID
>>> 000010683f4a371d
>>> 2013-06-13T17:26:37Z|00006|connmgr|INFO|br0: added service controller
>>> "punix:/data/local/tmp/run/openvswitch/br0.mgmt"
>>> 2013-06-13T17:26:37Z|00007|bridge|INFO|ovs-vswitchd (Open vSwitch)
>>> 1.11.90
>>> 2013-06-13T17:26:47Z|00008|memory|INFO|1612 kB peak resident set size
>>> after 10.1 seconds
>>> 2013-06-13T17:26:47Z|00009|memory|INFO|ports:2 rules:4
>>> 2013-06-13T17:26:47Z|00003|worker(worker)|INFO|worker process exiting
>>> 2013-06-13T17:30:34Z|00001|vlog|INFO|opened log file
>>> /data/local/tmp/log/openvswitch/ovs-vswitchd.log
>>> 2013-06-13T17:30:34Z|00002|worker(worker)|INFO|worker process started
>>> 2013-06-13T17:30:34Z|00002|reconnect|INFO|unix:/data/local/tmp/run/openvswitch/db.sock:
>>> connecting...
>>> 2013-06-13T17:30:34Z|00003|reconnect|INFO|unix:/data/local/tmp/run/openvswitch/db.sock:
>>> connected
>>> 2013-06-13T17:30:34Z|00004|netlink_socket|WARN|sysconf(_SC_UIO_MAXIOV):
>>> Function not implemented
>>> 2013-06-13T17:30:34Z|00005|bridge|INFO|bridge br0: using datapath ID
>>> 000010683f4a371d
>>> 2013-06-13T17:30:34Z|00006|connmgr|INFO|br0: added service controller
>>> "punix:/data/local/tmp/run/openvswitch/br0.mgmt"
>>> 2013-06-13T17:30:34Z|00007|bridge|INFO|ovs-vswitchd (Open vSwitch)
>>> 1.11.90
>>> 2013-06-13T17:30:35Z|00003|worker(worker)|INFO|worker process exiting
>>>
>>>
>>>  It seems ovs-vswitchd daemon is not stable. It automatically stops.
>>>
>>>  Regards
>>> Mostafa
>>>
>>>
>>>  ------------------------------
>>> *From:* Jing Ai [jinga at google.com]
>>>
>>> *Sent:* Thursday, June 13, 2013 2:38 AM
>>>  *To:* muddin
>>> *Subject:* Re: [ovs-dev] Running openvswitch in Android
>>>
>>>    ovs-dpctl, ovs-ofctl, ovs-vsctl are utilities to dump information or
>>> push config; while ovs-vswitchd and ovsdb-server are two main daemons. You
>>> can refer the following link http://wangcong.org/blog/archives/2131 for
>>> better understanding on how those binaries interact with each other.
>>> Normally ovs-vswitchd runs on its own and only interact with openvswitch
>>> kernel module and ovsdb-server.
>>>
>>>  I will take a further look tomorrow.
>>>
>>>  Best,
>>> Jing
>>>
>>>
>>>
>>>
>>> On Wed, Jun 12, 2013 at 7:03 PM, muddin <muddin at cs.odu.edu> wrote:
>>>
>>>>  Actually that output was --verbose enable not -v.
>>>>
>>>>  Another thing is that I am only using the following program in
>>>> Android. Is there any chance ovs-vswitchd is looking for some other
>>>> userspace program or system program
>>>>
>>>>  ovs-dpctl
>>>> ovs-ofctl
>>>> ovs-vsctl
>>>> ovs-vswitchd
>>>> ovsdb-server
>>>> ovsdb-tool
>>>>
>>>>
>>>>  Regards
>>>> Mostafa
>>>>
>>>>  ------------------------------
>>>> *From:* Jing Ai [jinga at google.com]
>>>> *Sent:* Wednesday, June 12, 2013 9:58 PM
>>>>
>>>> *To:* muddin
>>>> *Subject:* Re: [ovs-dev] Running openvswitch in Android
>>>>
>>>>    Mostafa,
>>>>
>>>>  I did not see anything interesting from the log. Can you use  *
>>>> --verbose *to replace --v and run it again? Thanks!
>>>>
>>>>  Best,
>>>> Jing
>>>>
>>>>
>>>> On Wed, Jun 12, 2013 at 6:44 PM, muddin <muddin at cs.odu.edu> wrote:
>>>>
>>>>>  Hello Jing,
>>>>>
>>>>>  Attach is the generated log file.
>>>>>
>>>>>  It seems the last entry is the worker process exiting.
>>>>>
>>>>>  Any clue
>>>>>
>>>>>  Thank you
>>>>> Mostafa
>>>>>  ------------------------------
>>>>> *From:* Jing Ai [jinga at google.com]
>>>>> *Sent:* Wednesday, June 12, 2013 9:26 PM
>>>>> *To:* muddin
>>>>>
>>>>> *Subject:* Re: [ovs-dev] Running openvswitch in Android
>>>>>
>>>>>    Can you run ovs-vswitchd with log file, i.e., ./ovs-vswitchd --verbose --pidfile --detach *--log-file*? Also, you can add *-v* for more detailed information.
>>>>>
>>>>> Whenever ovs-vswitchd crashed, please check the log file located at <your path>/var/log/openvswitch/ovs-vswitchd.log to see what happens there.
>>>>>
>>>>>
>>>>> Best,
>>>>>
>>>>> Jing
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Jun 12, 2013 at 6:12 PM, muddin <muddin at cs.odu.edu> wrote:
>>>>>
>>>>>>  Hello Jing Ali,
>>>>>>
>>>>>>  Thank you for quick reply, This is interesting. It seems you are
>>>>>> right the ovs-vswitchd daemon is not running
>>>>>>
>>>>>>  Let me tell you when it stops. Following are the sequence of
>>>>>> commands
>>>>>>
>>>>>>  #./ovsdb-tool --verbose create
>>>>>> /data/local/tmp/etc/openvswitch/conf.db ../vswitch.ovsschema
>>>>>> # ./ovsdb-server
>>>>>> --remote=punix:/data/local/tmp/run/openvswitch/db.sock \
>>>>>>                      --remote=db:Open_vSwitch,manager_options \
>>>>>>                      --pidfile --detach
>>>>>>
>>>>>>   # ps
>>>>>> ....
>>>>>> root      1533  2     0      0     bf008518 00000000 S ovs_workq
>>>>>> root      1547  1     2612   1272  c0128b34 401bdf5c S ./ovsdb-server
>>>>>>
>>>>>>
>>>>>>  # ./ovs-vsctl --verbose --no-wait init
>>>>>> # ./ovs-vswitchd --verbose --pidfile --detach
>>>>>> # ps
>>>>>> ...
>>>>>>  root      1533  2     0      0     bf008518 00000000 S ovs_workq
>>>>>> root      1547  1     2612   1272  c0128b34 401bdf5c S ./ovsdb-server
>>>>>> root      1562  1     3368   1060  c0128b34 4012af5c S ./ovs-vswitchd
>>>>>> root      1563  1562  3340   640   c0128b34 4012af5c S ovs-vswitchd:
>>>>>> worker process for pid 1562
>>>>>> root      1565  2     0      0     c007fea4 00000000 S kworker/0:1
>>>>>>
>>>>>>
>>>>>>  # ./ovs-vsctl --verbose add-br br0
>>>>>> # ps
>>>>>>
>>>>>>  root      1533  2     0      0     bf008518 00000000 S ovs_workq
>>>>>> root      1547  1     2616   1272  c0128b34 401bdf5c S ./ovsdb-server
>>>>>> root      1565  2     0      0     c007fea4 00000000 S kworker/0:1
>>>>>> root      1576  2     0      0     c007fea4 00000000 S kworker/u:1
>>>>>>
>>>>>>  There is no ovs-vswitchd!!!
>>>>>>
>>>>>>   #./ovs-vsctl --verbose add-port br0 wlan0
>>>>>>
>>>>>>  Now Hang!!
>>>>>>
>>>>>>  Attchment is the output with verbose. Any idea why it stoped at
>>>>>> that command.
>>>>>>
>>>>>>
>>>>>>  Regards
>>>>>> Mostafa
>>>>>>
>>>>>>
>>>>>>
>>>>>>  ------------------------------
>>>>>> *From:* Jing Ai [jinga at google.com]
>>>>>> *Sent:* Wednesday, June 12, 2013 8:26 PM
>>>>>> *To:* muddin
>>>>>> *Cc:* dev at openvswitch.org
>>>>>> *Subject:* Re: [ovs-dev] Running openvswitch in Android
>>>>>>
>>>>>>    ovs-vsctl hang for bridge related operations usually indicates
>>>>>> that ovs-vswitchd daemon is not running. Can you check it?
>>>>>>
>>>>>>  Also, ovs-vsctl show cmd works since it only interacts with ovsdb &
>>>>>> ovsdb-server.
>>>>>>
>>>>>>  Best,
>>>>>> Jing
>>>>>>
>>>>>>
>>>>>> On Wed, Jun 12, 2013 at 4:26 PM, muddin <muddin at cs.odu.edu> wrote:
>>>>>>
>>>>>>>   Hello,
>>>>>>>
>>>>>>>
>>>>>>>  We have compiled and installed the openvswitch in the android
>>>>>>> platform. Following is the version details of the Android and the
>>>>>>> OpenvSwitch
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>            Android version:  4.2.2 (jelly bean)
>>>>>>>
>>>>>>>       Android source git:
>>>>>>> https://android.googlesource.com/device/lge/mako-kernel
>>>>>>>
>>>>>>>           Android Kernel source git:
>>>>>>> https://android.googlesource.com/kernel/msm.git
>>>>>>>
>>>>>>>           Kernel version:  3.4
>>>>>>>
>>>>>>>           Android Build: full_mako-usedebug 4.2.2 JDQ39
>>>>>>>
>>>>>>>           Openvswitch Kernel Module version: Open vSwitch switching
>>>>>>> datapath 1.11.90
>>>>>>>
>>>>>>>           Openvswitch version: (Open vSwitch) 1.11.90
>>>>>>>
>>>>>>>           OpenFlow versions 0x1:0x4 (from $ ./ovs-ofctl -V)
>>>>>>>
>>>>>>>           OpenvSwitch source git: git clone git://
>>>>>>> openvswitch.org/openvswitch
>>>>>>>
>>>>>>>           OpenvSwitch git commit:
>>>>>>> c985ec94a2fe051f083a55d67311e643a432a7ae
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  However we have been facing some problems to run some of the user
>>>>>>> commands in Android, for example,
>>>>>>>
>>>>>>>
>>>>>>>  #this command runs fine
>>>>>>>
>>>>>>> $ ./ovs-vsctl --verbose add-br br0
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  #this command actually hang. Then we apply  ctl+z to stop
>>>>>>>
>>>>>>> $ ./ovs-vsctl --verbose add-port br0 wlan0
>>>>>>>
>>>>>>>
>>>>>>>  #this command also hang.  Then we apply ctl+z to stop
>>>>>>>
>>>>>>> $ ovs-vsctl add-port br0 vif1.0
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> #this command runs fine
>>>>>>>
>>>>>>> $ ./ovs-vsctl show
>>>>>>>
>>>>>>>
>>>>>>>    aff90ca3-aabd-4bf9-84e5-a8b81e6e8a8e
>>>>>>>
>>>>>>>     Bridge "br0"
>>>>>>>
>>>>>>>         Port "vif1.0"
>>>>>>>
>>>>>>>             Interface "vif1.0"
>>>>>>>
>>>>>>>         Port "wlan0"
>>>>>>>
>>>>>>>             Interface "wlan0"
>>>>>>>
>>>>>>>         Port "br0"
>>>>>>>
>>>>>>>             Interface "br0"
>>>>>>>
>>>>>>>                 type: internal
>>>>>>>
>>>>>>>
>>>>>>>  #this command shows error
>>>>>>>
>>>>>>> $ ./ovs-ofctl --verbose dump-flows br0
>>>>>>>
>>>>>>> ovs-ofctl: /data/local/tmp/run/openvswitch/br0.mgmt: failed to open
>>>>>>> socket (Connection refused)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  Can you please help on explaining the possible reason of such
>>>>>>> error?
>>>>>>>
>>>>>>>
>>>>>>>  Here is more details about the files in
>>>>>>> "/data/local/tmp/run/openvswitch/"
>>>>>>>
>>>>>>>
>>>>>>>  shell at android:/data/local/tmp # ls -l
>>>>>>> /data/local/tmp/run/openvswitch/
>>>>>>>
>>>>>>> srwx------ root     root              2013-06-12 20:17 br0.mgmt
>>>>>>>
>>>>>>> srwx------ root     root              2013-06-12 20:17 br0.snoop
>>>>>>>
>>>>>>> srwx------ root     root              2013-06-12 20:16 db.sock
>>>>>>>
>>>>>>> srwx------ root     root              2013-06-12 20:17
>>>>>>> ovs-vswitchd.1703.ctl
>>>>>>>
>>>>>>> -rw-rw-rw- root     root            5 2013-06-12 20:17
>>>>>>> ovs-vswitchd.pid
>>>>>>>
>>>>>>> srwx------ root     root              2013-06-12 20:16
>>>>>>> ovsdb-server.1691.ctl
>>>>>>>
>>>>>>> -rw-rw-rw- root     root            5 2013-06-12 20:16
>>>>>>> ovsdb-server.pid
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  The attached file "verbosecmd.txt" shows the output of the above
>>>>>>> commands with verbose enable.
>>>>>>>
>>>>>>>
>>>>>>>  The details of building and installing openvswitch for android can
>>>>>>> be found in the file "Build-Openvswitch.txt".
>>>>>>>
>>>>>>> In order build the openvswitch a patch file "ovs_android.patch" and
>>>>>>> a script file "envsetup.sh" is required. More details about using these two
>>>>>>> files can be found in "Build-Openvswitch.txt".
>>>>>>>
>>>>>>>
>>>>>>>  Regards
>>>>>>>
>>>>>>> Mostafa Uddin
>>>>>>>
>>>>>>> http://cs.odu.edu/~muddin
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> dev mailing list
>>>>>>> dev at openvswitch.org
>>>>>>> http://openvswitch.org/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20130708/fb15bf8c/attachment-0003.html>


More information about the dev mailing list