[ovs-discuss] Help in understanding the code

Justin Pettit jpettit at nicira.com
Thu Jul 11 08:15:24 UTC 2013


Are you sure modprobe picked up your new kernel module?  You may want to try running insmod with the path to your new ".ko". 

--Justin


On Jul 11, 2013, at 12:56 AM, sujith p s <sujithpandels at gmail.com> wrote:

> Need a hand here..Please..
> 
> Installed OpenvSwitch at first.Worked as expected.
> Later made a few, small changes (basically, inserting printk statements) in the ovs_dp_process_received_packet() of datapath.c in datapath directory.
> 
> I compile using following commands:
> sudo kill `cd /usr/local/var/run/openvswitch && cat ovsdb-server.pid ovs-vswitchd.pid`
> ./boot.sh
> ./configure
> ./configure --with-linux=/lib/modules/3.5.0-17-generic/build
> make
> sudo make install
> sudo make modules_install
> sudo /sbin/modprobe openvswitch
> lsmod --> shows openvswitch
> 
> 
> Then start daemons using commands:
> sudo ovsdb-tool convert /usr/local/etc/openvswitch/conf.db vswitchd/vswitch.ovsschema
> sudo ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock < etc > < etc > --pidfile --detach
> sudo ovs-vsctl --no-wait init
> sudo ovs-vswitchd --pidfile --detach
> 
> Everything goes fine.
> 
> But I am unable to see my changes after running the "$sudo mn --switch=ovsk" and tried ping command in mininet.
> mininet> h1 ping -c5 h2
> Checked dmesg and syslog.
> Am I going wrong somewhere in dealing with ovs kernel modules? 
> ( printk statements are having KERN_INFO severity. Ex: printk(KERN_INFO "Received packet..Trying to match the flow.."); )
> 
> Thanks in advance,
> Sujith
> 
> 
> On Wed, Jul 10, 2013 at 10:12 PM, sujith p s <sujithpandels at gmail.com> wrote:
>> Thanks for the quick reply!
>> 
>> Regarding the reason for not getting error for VLOG_INFO in my datapath module:
>> Backtracing my steps, I found out that i missed configuring/make-ing the kernel modules after the code changes. 
>> Thanks for suggesting printk option.
>> 
>> 
>> Regards,
>> Sujith
>> 
>> 
>> On Wed, Jul 10, 2013 at 8:08 PM, Andy Zhou <azhou at nicira.com> wrote:
>>> The remaining icmp packets are indeed processed in the kernel (via ovs_dp_process_received_packet()). ovs-vswitchd will install a flow entry in the kernel to handle those packets. 
>>> You can inspect kernel flows with "ovs-dpctl dump-flows". 
>>> 
>>> VLOG_INFO is only for user space programs. I am surprised it compiled with kernel module. printk may work better. 
>>> 
>>> --andy
>>> 
>>> 
>>> On Wed, Jul 10, 2013 at 4:20 AM, sujith p s <sujithpandels at gmail.com> wrote:
>>>> Hi everyone!
>>>> I'm a newcomer to OpenvSwitch. I installed it in mininet-VM using the INSTALL guide provided.
>>>> I am curious to understand the flow of the code in case of ping.
>>>> 
>>>> Example topology: 
>>>> $ sudo mn --switch=ovsk --topo linear
>>>> 
>>>>  h1 -- s1 -- s2 -- h2
>>>> 
>>>> command:
>>>> mininet> h1 ping -c5 h2
>>>> 
>>>> ofproto_run recognises a new flow ( 1st ping packet - icmp echo from h1 to h2 ) and send it as PACKET_IN to the controller.
>>>> Controller sends back the respective FLOW_MOD back to switch s1. handle_openflow() function takes care of these things.
>>>> Similarly above 2 steps happens for icmp echo reply from h2 to h1.
>>>> 
>>>> Now, I understand that since flow_mods are already installed in the flow table, there's no need to contact the controller once again for the 2nd icmp-echo packet from h1 to h2. 
>>>> 
>>>> What I wanted to know is which module(s) manages the remaining icmp packets, i.e. checking for a match and do the forwarding of these packets through mentioned port of the switch. 
>>>> 
>>>> It looks like ovs_dp_process_received_packet() in datapath.c So I tried checking by inserting VLOG_INFO statements in the module and installed it again. Looks like I was wrong about that.
>>>> 
>>>> I wanted to make sure that I am in the correct path.
>>>> 
>>>> Can anyone help me please!
>>>> 
>>>> Thanks in advance
>>>> Sujith
>>>> 
>>>> _______________________________________________
>>>> 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/20130711/c323f8e6/attachment.html>


More information about the discuss mailing list