I am reading the gre tunnel related codes in ovs.
   The fuction "ovs_tnl_send" encapsulates packets coming from vports, then 
sends the packets out from a NIC based on a host route entry.
   I was puzzled on the paragraph:
********
   cache_vport = ovs_internal_dev_get_vport(rt_dst(rt).dev);
   skb->protocol = htons(ETH_P_IP);
   iph = ip_hdr(skb);
   iph->tot_len = htons(skb->len - skb_network_offset(skb));
   ip_send_check(iph);
   if (cache_vport) {
    if (unlikely(compute_ip_summed(skb, true))) {
     kfree_skb(skb);
     goto next;
    }
    OVS_CB(skb)->flow = cache->flow;
    ovs_vport_receive(cache_vport, skb);--->send to datapath again?
    sent_len += orig_len;
   } else {------>send to NIC
    int xmit_err;
    skb->dev = rt_dst(rt).dev;
    xmit_err = dev_queue_xmit(skb);
    if (likely(net_xmit_eval(xmit_err) == 0))
     sent_len += orig_len;
   }
**********
The question is when the rt_dst(rt).dev is a internal dev? Why sending the 
packet to the datapath again?
Thanks a lot.
---Xing'an
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to