<div dir="ltr"><div>Hi William,</div><div>Thanks for your reply. Please find the inline comments.</div><div><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 30, 2019 at 9:26 PM William Tu &lt;<a href="mailto:u9012063@gmail.com">u9012063@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ramana,<br>
<br>
I&#39;m trying to understand your setup.<br>
<br>
On Wed, Aug 28, 2019 at 4:11 AM Ramana Reddy &lt;<a href="mailto:gtvrreddy@gmail.com" target="_blank">gtvrreddy@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi Ben, Justin, Jesse and All,<br>
&gt;<br>
&gt; Hope everyone doing great.<br>
&gt;<br>
&gt; During my work, I create a socket using AF_PACKET with virtio_net_hdr and<br>
&gt; filled all the fields in the virtio_net_hdr<br>
&gt; and the flag to VIRTIO_NET_GSO_TCPV4 to enable TSO using af_packet.<br>
&gt;<br>
&gt; vnet-&gt;gso_type = VIRTIO_NET_HDR_GSO_TCPV4;<br>
&gt;<br>
&gt; The code is not working when I am trying to send large packets over OVS<br>
&gt; VXLAN tunnel. It&#39;s dropping the large packets and<br>
&gt; the application is resending the MTU sized packets. The code is working<br>
&gt; fine in non ovs case (directly sending without ovs).<br>
<br>
Do you create AF_PACKET and bind its socket to OVS&#39;s vxlan device,<br>
ex: vxlan_sys_4789?<br></blockquote><div>No. We created a AF_PACKET and binding it our own interface in the container. It takes the help of the routing table in the container</div><div>and routes the packets to the OVS veth interface, and from there, the OVS rule selects the respective out_port  based on the destination IP address. </div><div>We can&#39;t select  vxlan_sys_4789 interface as it is in the host namespace. It&#39;s up to the OVS  to select the respective interface (out_port).</div><div>And we are not aware and need not know about the underlying network (OVS bridge or linux or some docker bridge) in the host. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
In the non-ovs working case, do you bind AF_PACKET to the vxlan device created<br>
by using ip link command?<br>
<br>
&gt;<br>
&gt; I understood that UDP tunneling offloading (VXLAN) not happening because of<br>
&gt; nic may not support this offloading feature,<br>
&gt; but when I send iperf (AF_INET) traffic, though the offloading is not<br>
&gt; happening, but the large packets are fragmented and the<br>
&gt; VXLAN tunneling sending the fragmented packets.  Why are we seeing this<br>
&gt; different behavior?<br>
<br>
OVS&#39;s vxlan device is a light-weight tunnel device, so it might not<br>
have all the<br>
features.<br></blockquote><div>This is the same question in my mind. OVS may not be handling AF_PACKET with vnet_hdr. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt;<br>
&gt; What is the expected behavior in AF_PACKET in OVS? Does OVS support<br>
&gt; AF_PACKET offloading mechanism?<br>
<br>
AF_PACKET (see net/packet/af_packet.c) just from userspace send packet into<br>
kernel and to the device you bind to.  It creates skb and invokes the<br>
device&#39;s xmit<br>
function.<br></blockquote><div>This I understood. But OVS should understand this and offload the packet to the driver or to the nic</div><div>when virtio_net_hdr is set. If we send the packets to the normal interface (eth0) without ovs, the kernel</div><div>is able to understand the TSO packets with virtio_net_hdr and handover the offloading to the driver (GSO) or nic (TSO).    </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
William<br>
<br>
&gt; If not, how we can avoid the retransmission of the packets. What are things<br>
&gt; to be done so that the kernel fragments<br>
&gt; large packets and send them out without dropping ( in case if offloading<br>
&gt; feature not available)?<br>
&gt;<br>
&gt; Looking forward to your reply.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Ramana<br>
&gt; _______________________________________________<br>
&gt; dev mailing list<br>
&gt; <a href="mailto:dev@openvswitch.org" target="_blank">dev@openvswitch.org</a><br>
&gt; <a href="https://mail.openvswitch.org/mailman/listinfo/ovs-dev" rel="noreferrer" target="_blank">https://mail.openvswitch.org/mailman/listinfo/ovs-dev</a><br>
</blockquote></div></div>