<div dir="ltr"><div>Hi Jiayu,</div><div><br></div><div>Please find the patch <a href="http://patches.dpdk.org/project/dpdk/patch/20221016144305.19249-1-kumaraparmesh92@gmail.com/">http://patches.dpdk.org/project/dpdk/patch/20221016144305.19249-1-kumaraparmesh92@gmail.com/</a> <br></div><div><br></div><div>I did reply with the above message ID but for some reason a new patch series was created. Not sure what was the mistake that I made. Should the commit message be the same for the series ? <br></div><div><br></div><div>Thanks,</div><div>Kumara.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 16, 2022 at 12:31 PM Hu, Jiayu <<a href="mailto:jiayu.hu@intel.com">jiayu.hu@intel.com</a>> 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"><div class="msg-5317273817241004428">
<div style="overflow-wrap: break-word;" lang="EN-US">
<div class="m_-5317273817241004428WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif">Hi Kumara,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif">Agree. We need to trim padding bytes first, then do the length check.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif">Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif">Jiayu<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<div style="border-color:currentcolor currentcolor currentcolor blue;border-style:none none none solid;border-width:medium medium medium 1.5pt;padding:0in 0in 0in 4pt">
<div>
<div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11pt;font-family:"Calibri",sans-serif"> Jun Qiu <<a href="mailto:jun.qiu@jaguarmicro.com" target="_blank">jun.qiu@jaguarmicro.com</a>>
<br>
<b>Sent:</b> Wednesday, October 12, 2022 9:35 AM<br>
<b>To:</b> kumaraparameshwaran rathinavel <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>>; <a href="mailto:dev@dpdk.org" target="_blank">dev@dpdk.org</a>; David Marchand <<a href="mailto:david.marchand@redhat.com" target="_blank">david.marchand@redhat.com</a>>; Hu, Jiayu <<a href="mailto:jiayu.hu@intel.com" target="_blank">jiayu.hu@intel.com</a>><br>
<b>Subject:</b> RE: [PATCH] gro : fix pkt length when extra bytes are padded to ethernet frame<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:rgb(16,18,20);background:white">Yes, It's better to do it before
</span>the<span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:rgb(16,18,20);background:white"> tcp_dl chec</span>k.<u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian"><u></u> <u></u></span></p>
<div style="border-color:currentcolor currentcolor currentcolor rgb(108,226,108);border-style:none none none solid;border-width:medium medium medium 2.25pt;padding:0in">
<ol type="1" start="1">
<li class="m_-5317273817241004428alt" style="color:rgb(92,92,92);line-height:10.5pt;background:white">
<span class="m_-5317273817241004428comment"><span style="font-size:9pt;font-family:Consolas;color:rgb(0,130,0);border:1pt none windowtext;padding:0in">/* trim the tail padding bytes */</span></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="MsoNormal" style="color:rgb(92,92,92);line-height:10.5pt;background:rgb(248,248,248);box-sizing:border-box;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in">ip_tlen = rte_be_to_cpu_16(ipv4_hdr->total_length); </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="m_-5317273817241004428alt" style="line-height:10.5pt;background:white;box-sizing:border-box;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="m_-5317273817241004428keyword"><b><span style="font-size:9pt;font-family:Consolas;color:rgb(0,102,153);border:1pt none windowtext;padding:0in">if</span></b></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> (pkt->pkt_len > (uint32_t)(ip_tlen + pkt->l2_len)) </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="MsoNormal" style="color:rgb(92,92,92);line-height:10.5pt;background:rgb(248,248,248);box-sizing:border-box;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> rte_pktmbuf_trim(pkt, pkt->pkt_len - ip_tlen - pkt->l2_len); </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="m_-5317273817241004428alt" style="line-height:10.5pt;background:white;box-sizing:border-box;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="MsoNormal" style="color:rgb(92,92,92);line-height:10.5pt;background:rgb(248,248,248);box-sizing:border-box;list-style-type:decimal-leading-zero;list-style-position:outside">
<span class="m_-5317273817241004428comment"><span style="font-size:9pt;font-family:Consolas;color:rgb(0,130,0);border:1pt none windowtext;padding:0in">/*</span></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="m_-5317273817241004428alt" style="line-height:10.5pt;background:white;box-sizing:border-box;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="m_-5317273817241004428comment"><span style="font-size:9pt;font-family:Consolas;color:rgb(0,130,0);border:1pt none windowtext;padding:0in"> * Don't process the packet whose payload length is less than or</span></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="MsoNormal" style="color:rgb(92,92,92);line-height:10.5pt;background:rgb(248,248,248);box-sizing:border-box;list-style-type:decimal-leading-zero;list-style-position:outside">
<span class="m_-5317273817241004428comment"><span style="font-size:9pt;font-family:Consolas;color:rgb(0,130,0);border:1pt none windowtext;padding:0in"> * equal to 0.</span></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="m_-5317273817241004428alt" style="line-height:10.5pt;background:white;box-sizing:border-box;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="m_-5317273817241004428comment"><span style="font-size:9pt;font-family:Consolas;color:rgb(0,130,0);border:1pt none windowtext;padding:0in"> */</span></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="MsoNormal" style="color:rgb(92,92,92);line-height:10.5pt;background:rgb(248,248,248);box-sizing:border-box;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in">tcp_dl = pkt->pkt_len - hdr_len; </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="m_-5317273817241004428alt" style="line-height:10.5pt;background:white;box-sizing:border-box;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="m_-5317273817241004428keyword"><b><span style="font-size:9pt;font-family:Consolas;color:rgb(0,102,153);border:1pt none windowtext;padding:0in">if</span></b></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> (tcp_dl <= 0) </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li><li class="MsoNormal" style="color:rgb(92,92,92);line-height:10.5pt;background:rgb(248,248,248);box-sizing:border-box;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> </span><span class="m_-5317273817241004428keyword"><b><span style="font-size:9pt;font-family:Consolas;color:rgb(0,102,153);border:1pt none windowtext;padding:0in">return</span></b></span><span style="font-size:9pt;font-family:Consolas;color:black;border:1pt none windowtext;padding:0in"> -1; </span><span style="font-size:9pt;font-family:Consolas"><u></u><u></u></span></li></ol>
</div>
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11pt;font-family:"Calibri",sans-serif"> kumaraparameshwaran rathinavel <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>>
<br>
<b>Sent:</b> Tuesday, October 11, 2022 1:48 PM<br>
<b>To:</b> <a href="mailto:dev@dpdk.org" target="_blank">dev@dpdk.org</a>; David Marchand <<a href="mailto:david.marchand@redhat.com" target="_blank">david.marchand@redhat.com</a>>; Hu, Jiayu <<a href="mailto:jiayu.hu@intel.com" target="_blank">jiayu.hu@intel.com</a>>; Jun Qiu <<a href="mailto:jun.qiu@jaguarmicro.com" target="_blank">jun.qiu@jaguarmicro.com</a>><br>
<b>Subject:</b> Fwd: [PATCH] gro : fix pkt length when extra bytes are padded to ethernet frame<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="text-align:justify"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="text-align:justify"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="text-align:justify">On Tue, Oct 11, 2022 at 1:03 AM David Marchand <<a href="mailto:david.marchand@redhat.com" target="_blank">david.marchand@redhat.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-bottom:12pt;text-align:justify">On Mon, Oct 10, 2022 at 7:51 PM Kumara Parameshwaran<br>
<<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>> wrote:<br>
><br>
> From: Kumara Parameshwaran <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>><br>
><br>
> When GRO packets are merged the packet length is used while<br>
> merging the adjacent packets. If the padded bytes are accounted<br>
> we would end up acking unsent TCP segments.<br>
><br>
> Signed-off-by: Kumara Parameshwaran <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>><br>
> v1:<br>
> If there is padding to the ethernet frame cases where timestamp is disabled<br>
> the packet length should be validated with the total ip length as packet length<br>
> is used in the GRO merging logic<br>
<br>
Please, can you test with current main branch?<br>
We recently merged a fix:<br>
<a href="https://git.dpdk.org/dpdk/commit/?id=b8a55871d5af6f5b8694b1cb5eacbc629734e403" target="_blank">https://git.dpdk.org/dpdk/commit/?id=b8a55871d5af6f5b8694b1cb5eacbc629734e403</a><u></u><u></u></p>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="text-align:justify">Thanks, David. I did look at the patch. This would fix the problem, but lets say for a case of an ACK packet where TCP data length would be zero and if the packet contains the padded bytes, this check should be
done before the follwing check and not after this. <a href="mailto:jiayu.hu@intel.com" target="_blank">
@Hu, Jiayu</a> <a href="mailto:jun.qiu@jaguarmicro.com" target="_blank">@Jun Qiu</a> please let me know your thoughts.
<u></u><u></u></p>
</blockquote>
</blockquote>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="text-align:justify">/*<br>
* Don't process the packet whose payload length is less than or<br>
* equal to 0.<br>
*/<br>
tcp_dl = pkt->pkt_len - hdr_len;<br>
if (tcp_dl <= 0)<br>
return -1; <u></u><u></u></p>
</blockquote>
</blockquote>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt">
<p class="MsoNormal" style="margin-bottom:12pt;text-align:justify">-- <br>
David Marchand<u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div></blockquote></div>