[ovs-discuss] Time a packet spends in the switch

satish kondapalli nitw.satish at gmail.com
Thu Oct 20 22:10:03 UTC 2016


Hi Danish,

Instead of "make module_install",  try to load with insmod command. One
more thing,  i think by default kernel comes with openvswith.ko in
/lib/moduels/.  Check where your module is copied  when  you did  make
modules_install.


Sateesh

On Thu, Oct 20, 2016 at 9:55 AM, Danish Sattar <danishsattar at gmail.com>
wrote:

> I'm just trying to print the following statement to the kernel log.
>
> File: openvswitch\datapath\datapath.c
>
> void ovs_dp_process_packet()
> *    pr_debug("pr_info inside ovs_dp_process_packet");*
> *    printk(KERN_DEBUG "printk inside ovs_dp_process_packet");*
>
> *My install script*
> * ./boot.sh*
> * ./configure --with-linux=/lib/modules/4.2.0-27-generic/build*
> * make*
> * make install*
> * make modules_install*
> * /sbin/modprobe openvswitch*
> * mkdir -p /usr/local/etc/openvswitch*
> * ovsdb-tool create /usr/local/etc/openvswitch/conf.db
> vswitchd/vswitch.ovsschema*
> * ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \*
> *
> --remote=db:Open_vSwitch,Open_vSwitch,manager_options \*
> *                     --private-key=db:Open_vSwitch,SSL,private_key \*
> *                     --certificate=db:Open_vSwitch,SSL,certificate \*
> *                     --bootstrap-ca-cert=db:Open_vSwitch,SSL,ca_cert \*
> *                     --pidfile --detach*
> * ovs-vsctl --no-wait init*
> * ovs-vswitchd --pidfile --detach*
> *       echo 8 > /proc/sys/kernel/printk*
> *       ovs-appctl vlog/set ANY:ANY:dbg*
>
> But there is no log in kernel.log, syslog, dmesg and no file name message.
> Is there something wrong the way i'm installing the switch or with the
> print statement?
>
> *Best Regards*
> *Danish Sattar*
>
> On Wed, Oct 19, 2016 at 2:35 PM, Danish Sattar <danishsattar at gmail.com>
> wrote:
>
>> i'm using vmware for the testing. So i have a state saved before
>> compiling the source code for virtual machine. Each after doing all the
>> modification, i compile, install and load the module. send some traffic
>> between couple of hosts then see all the log like kernel, dmesg, syslog
>> etc, if nothing works i restore to previous state and restart the process
>> (I'm trying to make sure nothing gets mixed up and each time right module
>> loads).
>>
>> *Best Regards*
>> *Danish Sattar*
>>
>> On Wed, Oct 19, 2016 at 1:43 PM, satish kondapalli <nitw.satish at gmail.com
>> > wrote:
>>
>>> Hi Danish,
>>>
>>>
>>> Please post four changes.  I guess all packets receives via
>>> netdev_frame_hook() function in openvswith.ko module.
>>>
>>> Sateesh
>>>
>>> On Wed, Oct 19, 2016 at 10:17 AM, Joe Stringer <joe at ovn.org> wrote:
>>>
>>>> Are you sure that you loaded your newly compiled kernel module?
>>>> (insmod build_dir/datapath/linux/openvswitch.ko)
>>>>
>>>> On 19 October 2016 at 09:40, Danish Sattar <danishsattar at gmail.com>
>>>> wrote:
>>>> > I've tried in datapath.c, bridge.c, learning-switch.c and
>>>> flow-table.c but
>>>> > nothing works.
>>>> > For kernel module i'm using printk() to print the messages and for
>>>> userspace
>>>> > simply writing to a file but for some reason nothing happens in either
>>>> > modules.
>>>> >
>>>> > Any other ideas that i can try to get the openvswitch per packet
>>>> processing
>>>> > time.
>>>> >
>>>> > Thanks
>>>> >
>>>> > Best Regards
>>>> > Danish Sattar
>>>> >
>>>> > On Thu, Oct 13, 2016 at 2:24 PM, Danish Sattar <
>>>> danishsattar at gmail.com>
>>>> > wrote:
>>>> >>
>>>> >> Thanks. I will give it a shot.
>>>> >>
>>>> >> Best Regards
>>>> >> Danish Sattar
>>>> >>
>>>> >> On Thu, Oct 13, 2016 at 2:15 PM, Ben Pfaff <blp at ovn.org> wrote:
>>>> >>>
>>>> >>> On Thu, Oct 13, 2016 at 12:27:38PM -0400, Danish Sattar wrote:
>>>> >>> > I'm trying to find out the time a packet spends in the switch
>>>> only.
>>>> >>> > Time
>>>> >>> > difference between packet in and out.
>>>> >>> >
>>>> >>> > I thought analyzing the time in learning-switch.c would be give
>>>> me some
>>>> >>> > info but that didn't work.
>>>> >>>
>>>> >>> Most packets don't ever go to userspace so you'll have to
>>>> instrument the
>>>> >>> kernel module, probably the ovs_dp_process_packet() function in
>>>> >>> datapath/datapath.h.  I don't know the best way to do this.
>>>> >>>
>>>> >>> You might be able to approximate this with the Linux "perf" tool.
>>>> >>
>>>> >>
>>>> >
>>>> >
>>>> > _______________________________________________
>>>> > discuss mailing list
>>>> > discuss at openvswitch.org
>>>> > http://openvswitch.org/mailman/listinfo/discuss
>>>> >
>>>> _______________________________________________
>>>> discuss mailing list
>>>> discuss at openvswitch.org
>>>> http://openvswitch.org/mailman/listinfo/discuss
>>>>
>>>
>>>
>>
>
> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> http://openvswitch.org/mailman/listinfo/discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20161020/712c9271/attachment-0002.html>


More information about the discuss mailing list