[ovs-discuss] Using popen() or system() calls from inside openvswitch source code

david jhon djhon9813 at gmail.com
Wed Apr 22 06:30:55 UTC 2015


Thanks a lot Ben,

Right now I am stuck in another issue, I am marking certain flows with tos
bits in sw_flow_key struct while sending upcall to userspace. I can see
modified value of tos bits when dpif_recv() is called from recv_upcalls()
(basically when dpif_print_packet() method is called) method in
ofproto-dpif-upcall.c but as soon as the upcall structure is passed to
process_upcall() and upcall_xlate(), modified value of tos field is
replaced by 0. I just want to process whole upcall with the modified value
of tos.
I'll be really grateful to you if you could please let me know how is it
possible to achieve this with openvswitch userspace code.


On Wed, Apr 15, 2015 at 11:23 PM, Ben Pfaff <blp at nicira.com> wrote:

> It's probably best to just use the existing code in ovs-vswitchd to
> access the database.
>
> On Wed, Apr 15, 2015 at 10:11:39AM +0500, david jhon wrote:
> > Thanks a lot for your reply.
> >
> > I am trying to add some records in ovsdb table based on upcall handling
> in
> > userspace. After digging little more, I came to know that it uses POSIX
> > message queues for Inter Process Communication and I should better go
> this
> > way. Thank you!
> >
> > On Wed, Apr 15, 2015 at 2:51 AM, Ben Pfaff <blp at nicira.com> wrote:
> >
> > > On Mon, Apr 13, 2015 at 12:01:25PM +0500, david jhon wrote:
> > > > I want to run a command from inside openvswitch code from
> > > > ofproto/ofproto-dpif-xlate.c. with popen(), openvswitch compiles and
> runs
> > > > successfully but it does not run command.
> > > >
> > > > With system(), openvswitch fails to compile with following error:
> > > >
> > > > blacklisted due to thread safety issues. I tried running system
> command
> > > > with ovs_mutex lock and unlock routines, but it makes no difference.
> > > >
> > > > Please let me know what am I doing wrong here. How could a linux
> command
> > > be
> > > > run from openvswitch. Your help/guidance in this regard will be
> highly
> > > > valuable and appreciated.
> > >
> > > It's probably a bad idea to do this.  The error is because POSIX says
> > > that system() need not be thread safe.
> > >
> > > There may be a better way to accomplish what you're trying to do.
> > > What are you trying to do?
> > >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20150422/9156181b/attachment-0002.html>


More information about the discuss mailing list