Oh I'm sorry for dropping the mailing list.

I think I do put the printk in the packet processing path. I am going to 
describe what I did below:

I put printk in the function ovs_vport_recieve() in vport.c, in 
ovs_dp_process_recieved_packet() in datapath.c, in ovs_flow_key_extract() and 
key_extract() in flow.c
Here is what I put in the vport.c file, the italic and bold code is what I 
added, just a test code.
         void ovs_vport_receive(struct vport *vport, struct sk_buff *skb, 
struct ovs_key_ipv4_tunnel *tun_key)
        {
    struct pcpu_sw_netstats *stats;

    stats = this_cpu_ptr(vport->percpu_stats);

    u64_stats_update_begin(&stats->syncp);
    stats->rx_packets++;
    stats->rx_bytes += skb->len;
    u64_stats_update_end(&stats->syncp);
    pr_info("*****This is in ovs_vport_recieve() function*****\n");
    pr_info("Packet recieved.\n");
    pr_info("*****End of this test place*****\n");
    OVS_CB(skb)->tun_key = tun_key;
    ovs_dp_process_received_packet  (vport, skb); 
        }
There is function pr_info in the posted code, but I do tried printk first and 
it did not work so I try this. I also define the macro #define pr_fmt(fmt) 
KBUILD_MODNAME ": " fmt at the first of these files.
BTW, the ovs version I use is ovs-2.3.1, my OS is Ubuntu 12.04. 

I am really appreciate for your reply and I am looking forward to your opinion.
Thanks a lot!
Chang


祝好,
刘畅
 
From: Jesse Gross
Date: 2015-09-18 00:34
To: liu_ch...@buaa.edu.cn
CC: dev@openvswitch.org
Subject: Re: [ovs-dev] How to debug openvswitch
On Thursday, September 17, 2015, liu_ch...@buaa.edu.cn <liu_ch...@buaa.edu.cn> 
wrote:
Thanks a lot for your reply!
But I have tried this command many times, what I saw was something like "br0 is 
left/enter promiscuous mode" which occures when I use ovs-vsctl add-br or 
ovs-vsctl add-port commands.
If there any tips of the methods or functions I can use to see the kernel 
output information? I've tried printk() and pr_info() in datapath.c, flow.c and 
vport.c, but they didn't work.
What I want is let ovs output some information to the console (or log file is 
OK) when the datapath recieves and processes packets.

Please don't drop the mailing list.

printk should output to dmesg. Without seeing the code, it's impossible to know 
why it is not showing up. Are you sure that you put the printk in a location on 
the packet processing path?
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to