<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Segoe UI Emoji";
panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.EmailStyle24
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi Zidane,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I40e used UDP dst port 4789 for Vxlan.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">BR,<o:p></o:p></p>
<p class="MsoNormal">Beilei<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Raja Zidane <rzidane@nvidia.com> <br>
<b>Sent:</b> Tuesday, February 15, 2022 10:31 PM<br>
<b>To:</b> Singh, Aman Deep <aman.deep.singh@intel.com>; Matan Azrad <matan@nvidia.com>; Yigit, Ferruh <ferruh.yigit@intel.com>; dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com><br>
<b>Cc:</b> stable@dpdk.org<br>
<b>Subject:</b> RE: [PATCH] app/testpmd: fix GENEVE parsing in csum forward mode<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi all,<br>
reviving the discussion.<o:p></o:p></p>
<pre><span style="font-family:"Calibri",sans-serif"><a id="OWAAM01E887F9971A4AF3A7EF6F4C29AA107E" href="mailto:beilei.xing@intel.com"><span style="font-family:"Calibri",sans-serif;text-decoration:none">@Beilei Xing</span></a> could you please provide info on what UDP destination ports are used for VxLan by i40 driver?<br>if its just the default then we can remove </span>"RTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0"<o:p></o:p></pre>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Singh, Aman Deep <<a href="mailto:aman.deep.singh@intel.com">aman.deep.singh@intel.com</a>>
<br>
<b>Sent:</b> Monday, January 31, 2022 6:48 PM<br>
<b>To:</b> Raja Zidane <<a href="mailto:rzidane@nvidia.com">rzidane@nvidia.com</a>>; Matan Azrad <<a href="mailto:matan@nvidia.com">matan@nvidia.com</a>>; Ferruh Yigit <<a href="mailto:ferruh.yigit@intel.com">ferruh.yigit@intel.com</a>>;
<a href="mailto:dev@dpdk.org">dev@dpdk.org</a>; Beilei Xing <<a href="mailto:beilei.xing@intel.com">beilei.xing@intel.com</a>>; Qi Zhang <<a href="mailto:qi.z.zhang@intel.com">qi.z.zhang@intel.com</a>><br>
<b>Cc:</b> <a href="mailto:stable@dpdk.org">stable@dpdk.org</a><br>
<b>Subject:</b> Re: [PATCH] app/testpmd: fix GENEVE parsing in csum forward mode<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="1" cellspacing="3" cellpadding="0" style="background:#FFEB9C">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">External email: Use caution opening links or attachments</span></b><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:black">
</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 1/30/2022 4:48 PM, Raja Zidane wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>I didn't want to remove the default parsing of tunnel as VxLan because I thought it might be used,<o:p></o:p></pre>
<pre>Instead I moved it to the end, which makes it detect all supported tunnel through udp_dst_port,<o:p></o:p></pre>
<pre>And only if no tunnel was matched it would default to VxLan.<o:p></o:p></pre>
<pre>That was the reason geneve weren't detected and parsed as vxlan instead, which is the bug I was trying to solve.<o:p></o:p></pre>
</blockquote>
<pre>We can take help/input from i40 maintainers for it.<o:p></o:p></pre>
<pre>Hi Beilei Xing,<o:p></o:p></pre>
<pre>For setting packet_type as Tunnel, what criteria is used by i40 driver. Is it only udp_dst port or any other parameters also.<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Singh, Aman Deep <a href="mailto:aman.deep.singh@intel.com"><aman.deep.singh@intel.com></a> <o:p></o:p></pre>
<pre>Sent: Thursday, January 20, 2022 12:47 PM<o:p></o:p></pre>
<pre>To: Matan Azrad <a href="mailto:matan@nvidia.com"><matan@nvidia.com></a>; Ferruh Yigit <a href="mailto:ferruh.yigit@intel.com"><ferruh.yigit@intel.com></a>; Raja Zidane <a href="mailto:rzidane@nvidia.com"><rzidane@nvidia.com></a>; <a href="mailto:dev@dpdk.org">dev@dpdk.org</a><o:p></o:p></pre>
<pre>Cc: <a href="mailto:stable@dpdk.org">stable@dpdk.org</a><o:p></o:p></pre>
<pre>Subject: Re: [PATCH] app/testpmd: fix GENEVE parsing in csum forward mode<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>External email: Use caution opening links or attachments<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>On 1/18/2022 6:49 PM, Matan Azrad wrote:<o:p></o:p></pre>
<pre> app/test-pmd/csumonly.c | 16 ++++++++++------<o:p></o:p></pre>
<pre> 1 file changed, 10 insertions(+), 6 deletions(-)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c <o:p></o:p></pre>
<pre>index 2aeea243b6..fe810fecdd 100644<o:p></o:p></pre>
<pre>--- a/app/test-pmd/csumonly.c<o:p></o:p></pre>
<pre>+++ b/app/test-pmd/csumonly.c<o:p></o:p></pre>
<pre>@@ -254,7 +254,10 @@ parse_gtp(struct rte_udp_hdr *udp_hdr,<o:p></o:p></pre>
<pre> info->l2_len += RTE_ETHER_GTP_HLEN;<o:p></o:p></pre>
<pre> }<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>-/* Parse a vxlan header */<o:p></o:p></pre>
<pre>+/*<o:p></o:p></pre>
<pre>+ * Parse a vxlan header.<o:p></o:p></pre>
<pre>+ * If a tunnel is detected in 'pkt_type' it will be parsed by default as vxlan.<o:p></o:p></pre>
<pre>+ */<o:p></o:p></pre>
<pre> static void<o:p></o:p></pre>
<pre> parse_vxlan(struct rte_udp_hdr *udp_hdr,<o:p></o:p></pre>
<pre> struct testpmd_offload_info *info, @@ -912,17 <o:p></o:p></pre>
<pre>+915,18 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)<o:p></o:p></pre>
<pre> RTE_MBUF_F_TX_TUNNEL_VXLAN_GPE;<o:p></o:p></pre>
<pre> goto tunnel_update;<o:p></o:p></pre>
<pre> }<o:p></o:p></pre>
<pre>- parse_vxlan(udp_hdr, &info,<o:p></o:p></pre>
<pre>- m->packet_type);<o:p></o:p></pre>
<pre>+ parse_geneve(udp_hdr, &info);<o:p></o:p></pre>
<pre> if (info.is_tunnel) {<o:p></o:p></pre>
<pre> tx_ol_flags |=<o:p></o:p></pre>
<pre>- RTE_MBUF_F_TX_TUNNEL_VXLAN;<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+ RTE_MBUF_F_TX_TUNNEL_GENEVE;<o:p></o:p></pre>
<pre> goto tunnel_update;<o:p></o:p></pre>
<pre> }<o:p></o:p></pre>
<pre>- parse_geneve(udp_hdr, &info);<o:p></o:p></pre>
<pre>+ /* Always keep last. */<o:p></o:p></pre>
<pre>+ parse_vxlan(udp_hdr, &info,<o:p></o:p></pre>
<pre>+ m->packet_type);<o:p></o:p></pre>
<pre> if (info.is_tunnel) {<o:p></o:p></pre>
<pre> tx_ol_flags |=<o:p></o:p></pre>
<pre>- RTE_MBUF_F_TX_TUNNEL_GENEVE;<o:p></o:p></pre>
<pre>+<o:p></o:p></pre>
<pre>+ RTE_MBUF_F_TX_TUNNEL_VXLAN;<o:p></o:p></pre>
<pre> goto tunnel_update;<o:p></o:p></pre>
<pre> }<o:p></o:p></pre>
<pre> } else if (info.l4_proto == <o:p></o:p></pre>
<pre>IPPROTO_GRE) {<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Ferruh Yigit <a href="mailto:ferruh.yigit@intel.com"><ferruh.yigit@intel.com></a><o:p></o:p></pre>
<pre>Sent: Tuesday, January 18, 2022 3:03 PM<o:p></o:p></pre>
<pre>To: Matan Azrad <a href="mailto:matan@nvidia.com"><matan@nvidia.com></a>; Raja Zidane <a href="mailto:rzidane@nvidia.com"><rzidane@nvidia.com></a>; <o:p></o:p></pre>
<pre><a href="mailto:dev@dpdk.org">dev@dpdk.org</a><o:p></o:p></pre>
<pre>Cc: <a href="mailto:stable@dpdk.org">stable@dpdk.org</a><o:p></o:p></pre>
<pre>Subject: Re: [PATCH] app/testpmd: fix GENEVE parsing in csum forward <o:p></o:p></pre>
<pre>mode<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>External email: Use caution opening links or attachments<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>On 1/18/2022 12:55 PM, Matan Azrad wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Ferruh Yigit <a href="mailto:ferruh.yigit@intel.com"><ferruh.yigit@intel.com></a><o:p></o:p></pre>
<pre>Sent: Tuesday, January 18, 2022 2:28 PM<o:p></o:p></pre>
<pre>To: Matan Azrad <a href="mailto:matan@nvidia.com"><matan@nvidia.com></a>; Raja Zidane <o:p></o:p></pre>
<pre><a href="mailto:rzidane@nvidia.com"><rzidane@nvidia.com></a>; <a href="mailto:dev@dpdk.org">dev@dpdk.org</a><o:p></o:p></pre>
<pre>Cc: <a href="mailto:stable@dpdk.org">stable@dpdk.org</a><o:p></o:p></pre>
<pre>Subject: Re: [PATCH] app/testpmd: fix GENEVE parsing in csum <o:p></o:p></pre>
<pre>forward mode<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>External email: Use caution opening links or attachments<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>On 1/18/2022 11:27 AM, Matan Azrad wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Ferruh Yigit <a href="mailto:ferruh.yigit@intel.com"><ferruh.yigit@intel.com></a><o:p></o:p></pre>
<pre>Sent: Tuesday, January 18, 2022 11:52 AM<o:p></o:p></pre>
<pre>To: Raja Zidane <a href="mailto:rzidane@nvidia.com"><rzidane@nvidia.com></a>; <a href="mailto:dev@dpdk.org">dev@dpdk.org</a><o:p></o:p></pre>
<pre>Cc: Matan Azrad <a href="mailto:matan@nvidia.com"><matan@nvidia.com></a>; <a href="mailto:stable@dpdk.org">stable@dpdk.org</a><o:p></o:p></pre>
<pre>Subject: Re: [PATCH] app/testpmd: fix GENEVE parsing in csum <o:p></o:p></pre>
<pre>forward mode<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>External email: Use caution opening links or attachments<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>On 12/5/2021 3:44 AM, Raja Zidane wrote:<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>The csum FWD mode parses any received packet to set mbuf <o:p></o:p></pre>
<pre>offloads for the transmitting burst, mainly in the checksum/TSO areas.<o:p></o:p></pre>
<pre>In the case of a tunnel header, the csum FWD tries to detect <o:p></o:p></pre>
<pre>known tunnels by the standard definition using the header'sdata <o:p></o:p></pre>
<pre>and fallback to check the packet type in the mbuf to see if the <o:p></o:p></pre>
<pre>Rx port driver already sign the packet as a tunnel.<o:p></o:p></pre>
<pre>In the fallback case, the csum assumes the tunnel is VXLAN and <o:p></o:p></pre>
<pre>parses the tunnel as VXLAN.<o:p></o:p></pre>
</blockquote>
<pre>As far as I can see there is a VXLAN port check in <o:p></o:p></pre>
<pre>'parse_vxlan()', why it is not helping?<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
</blockquote>
<pre>The problem is not the vxlan check but the tunnel type in mbuf <o:p></o:p></pre>
<pre>that caused the<o:p></o:p></pre>
</blockquote>
<pre>packet to be detected as vxlan(default) before checking GENEVE tunnel case.<o:p></o:p></pre>
<pre>Check is as following:<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> if (udp_hdr->dst_port != _htons(RTE_VXLAN_DEFAULT_PORT) &&<o:p></o:p></pre>
<pre> RTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0)<o:p></o:p></pre>
<pre> return;<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Do you what is the intention for the <o:p></o:p></pre>
<pre>"RTE_ETH_IS_TUNNEL_PKT(pkt_type) ==<o:p></o:p></pre>
</blockquote>
</blockquote>
<pre>0"<o:p></o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>check?<o:p></o:p></pre>
<pre>Why vxlan parsing doesn't stop when it is not default port?<o:p></o:p></pre>
</blockquote>
<pre>Maybe some drivers set the tunnel type for vxlan packets coming <o:p></o:p></pre>
<pre>after non-<o:p></o:p></pre>
</blockquote>
<pre>standard vxlan port.<o:p></o:p></pre>
<pre>But checking the tunnel flag to say that it is vxlan is too broad, isn't it?<o:p></o:p></pre>
<pre>And this is the problem you are having.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Can there be any way to detect and check non-standard vxlan port?<o:p></o:p></pre>
</blockquote>
<pre>Maybe yes, but it is probably more complex solusion.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>See this patch:<o:p></o:p></pre>
<pre><a href="https://patches.dpdk.org/project/dpdk/patch/1423819371-24222-13-git-se">https://patches.dpdk.org/project/dpdk/patch/1423819371-24222-13-git-se</a><o:p></o:p></pre>
<pre><a href="mailto:nd-email-olivier.matz@6wind.com/">nd-email-olivier.matz@6wind.com/</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>comments there:<o:p></o:p></pre>
<pre>1. check udp destination port, 4789 is the default vxlan port (rfc7348).<o:p></o:p></pre>
<pre>2. currently, this flag is set by i40e only if the packet is vxlan<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>And maybe another driver assumes more ports here.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Collecting all the non-standard ports can start from i40 maintainers<span style="font-family:"Segoe UI Emoji",sans-serif">😊</span><o:p></o:p></pre>
</blockquote>
<pre>I think, here we should check for supported tunnel types only. The i40 driver setting a Tunnel flag, does not means that it VxLan type only.<o:p></o:p></pre>
<pre>As in your case those were GENEVE packets getting treated as VxLan.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Making parse_vxlan() udp_dst_port specific can avoid this issue.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>When the GENEVE tunnel was added to the known tunnels in csum, <o:p></o:p></pre>
<pre>its parsing trial was wrongly located after the pkt type <o:p></o:p></pre>
<pre>detection, causing the csum to parse the GENEVE header as VXLAN <o:p></o:p></pre>
<pre>when the Rx port set the tunnel packet type.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Locate the GENEVE parsing trial before the packet type detection.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Fixes: ea0e711b8ae0 ("app/testpmd: add GENEVE parsing")<o:p></o:p></pre>
<pre>Cc: <a href="mailto:stable@dpdk.org">stable@dpdk.org</a><o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Signed-off-by: Raja Zidane <a href="mailto:rzidane@nvidia.com"><rzidane@nvidia.com></a><o:p></o:p></pre>
<pre>---<o:p></o:p></pre>
<pre>Acked-by: Matan Azrad <a href="mailto:matan@nvidia.com"><matan@nvidia.com></a><o:p></o:p></pre>
</blockquote>
<pre>Ack should be before '---' to be part of the commit log, <o:p></o:p></pre>
<pre>otherwise it is dropped when applied as comment.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</div>
</div>
</div>
</body>
</html>