<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:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Segoe UI";
panose-1:2 11 5 2 4 2 4 2 2 3;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:SimSun;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
p.alt, li.alt, div.alt
{mso-style-name:alt;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:SimSun;}
span.comment
{mso-style-name:comment;}
span.keyword
{mso-style-name:keyword;}
span.EmailStyle23
{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.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:311565918;
mso-list-template-ids:-1945742332;}
@list l0:level1
{mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level4
{mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level7
{mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;}
@list l1
{mso-list-id:1774206062;
mso-list-template-ids:467181076;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></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"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Hi Kumara,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Agree. We need to trim padding bytes first, then do the length check.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Jiayu<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><o:p> </o:p></span></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><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Jun Qiu <jun.qiu@jaguarmicro.com>
<br>
<b>Sent:</b> Wednesday, October 12, 2022 9:35 AM<br>
<b>To:</b> kumaraparameshwaran rathinavel <kumaraparamesh92@gmail.com>; dev@dpdk.org; David Marchand <david.marchand@redhat.com>; Hu, Jiayu <jiayu.hu@intel.com><br>
<b>Subject:</b> RE: [PATCH] gro : fix pkt length when extra bytes are padded to ethernet frame<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#101214;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:#101214;background:white"> tcp_dl chec</span>k.<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:DengXian"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid #6CE26C 2.25pt;padding:0in 0in 0in 0in">
<ol start="1" type="1">
<li class="alt" style="color:#5C5C5C;line-height:10.5pt;mso-list:l0 level1 lfo3;background:white">
<span class="comment"><span style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0in">/* trim the tail padding bytes */</span></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="MsoNormal" style="color:#5C5C5C;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:10.5pt;mso-list:l0 level1 lfo3;background:#F8F8F8;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in">ip_tlen = rte_be_to_cpu_16(ipv4_hdr->total_length); </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;line-height:10.5pt;mso-list:l0 level1 lfo3;background:white;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="keyword"><b><span style="font-size:9.0pt;font-family:Consolas;color:#006699;border:none windowtext 1.0pt;padding:0in">if</span></b></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> (pkt->pkt_len > (uint32_t)(ip_tlen + pkt->l2_len)) </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="MsoNormal" style="color:#5C5C5C;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:10.5pt;mso-list:l0 level1 lfo3;background:#F8F8F8;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> rte_pktmbuf_trim(pkt, pkt->pkt_len - ip_tlen - pkt->l2_len); </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;line-height:10.5pt;mso-list:l0 level1 lfo3;background:white;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="MsoNormal" style="color:#5C5C5C;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:10.5pt;mso-list:l0 level1 lfo3;background:#F8F8F8;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span class="comment"><span style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0in">/*</span></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;line-height:10.5pt;mso-list:l0 level1 lfo3;background:white;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="comment"><span style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0in"> * Don't process the packet whose payload length is less than or</span></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="MsoNormal" style="color:#5C5C5C;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:10.5pt;mso-list:l0 level1 lfo3;background:#F8F8F8;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span class="comment"><span style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0in"> * equal to 0.</span></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;line-height:10.5pt;mso-list:l0 level1 lfo3;background:white;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="comment"><span style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0in"> */</span></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="MsoNormal" style="color:#5C5C5C;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:10.5pt;mso-list:l0 level1 lfo3;background:#F8F8F8;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in">tcp_dl = pkt->pkt_len - hdr_len; </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;line-height:10.5pt;mso-list:l0 level1 lfo3;background:white;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span class="keyword"><b><span style="font-size:9.0pt;font-family:Consolas;color:#006699;border:none windowtext 1.0pt;padding:0in">if</span></b></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> (tcp_dl <= 0) </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="MsoNormal" style="color:#5C5C5C;mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:10.5pt;mso-list:l0 level1 lfo3;background:#F8F8F8;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> </span><span class="keyword"><b><span style="font-size:9.0pt;font-family:Consolas;color:#006699;border:none windowtext 1.0pt;padding:0in">return</span></b></span><span style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0in"> -1; </span><span style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li></ol>
</div>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> kumaraparameshwaran rathinavel <<a href="mailto:kumaraparamesh92@gmail.com">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">dev@dpdk.org</a>; David Marchand <<a href="mailto:david.marchand@redhat.com">david.marchand@redhat.com</a>>; Hu, Jiayu <<a href="mailto:jiayu.hu@intel.com">jiayu.hu@intel.com</a>>; Jun Qiu <<a href="mailto:jun.qiu@jaguarmicro.com">jun.qiu@jaguarmicro.com</a>><br>
<b>Subject:</b> Fwd: [PATCH] gro : fix pkt length when extra bytes are padded to ethernet frame<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="text-align:justify"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="text-align:justify"><o:p> </o:p></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:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt;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><o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<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.
<o:p></o:p></p>
</blockquote>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<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; <o:p></o:p></p>
</blockquote>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt;text-align:justify">-- <br>
David Marchand<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>