<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:宋体;
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:等线;
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:"\@等线";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:宋体;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:等线;
color:windowtext;}
p.alt, li.alt, div.alt
{mso-style-name:alt;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:宋体;}
span.comment
{mso-style-name:comment;}
span.keyword
{mso-style-name:keyword;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:等线;}
.MsoPapDefault
{mso-style-type:export-only;
text-align:justify;
text-justify:inter-ideograph;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:311565918;
mso-list-template-ids:-1945742332;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></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="ZH-CN" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#101214;background:white">Yes, It's better to do it before
</span><span lang="EN-US">the</span><span lang="EN-US" style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#101214;background:white"> tcp_dl chec</span><span lang="EN-US">k.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.5pt;font-family:等线"><o:p> </o:p></span></p>
<div style="mso-element:para-border-div;border:none;border-left:solid #6CE26C 2.25pt;padding:0cm 0cm 0cm 0cm;background:white;margin-left:18.0pt;margin-right:0cm">
<ol start="1" type="1">
<li class="alt" style="color:#5C5C5C;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:white;border:none;padding:0cm">
<span class="comment"><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0cm">/* trim the tail padding bytes */</span></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> </span><span lang="EN-US" 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;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:#F8F8F8;border:none;padding:0cm;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm">ip_tlen = rte_be_to_cpu_16(ipv4_hdr->total_length); </span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:white;border:none;padding:0cm;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 lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#006699;border:none windowtext 1.0pt;padding:0cm">if</span></b></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> (pkt->pkt_len > (uint32_t)(ip_tlen + pkt->l2_len)) </span><span lang="EN-US" 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;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:#F8F8F8;border:none;padding:0cm;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> rte_pktmbuf_trim(pkt, pkt->pkt_len - ip_tlen - pkt->l2_len); </span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:white;border:none;padding:0cm;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;color:inherit;list-style-position:outside">
<span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> </span><span lang="EN-US" 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;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:#F8F8F8;border:none;padding:0cm;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 lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0cm">/*</span></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> </span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:white;border:none;padding:0cm;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 lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0cm"> * Don't process the packet whose payload length is less than or</span></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> </span><span lang="EN-US" 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;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:#F8F8F8;border:none;padding:0cm;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 lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0cm"> * equal to 0.</span></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> </span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:white;border:none;padding:0cm;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 lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#008200;border:none windowtext 1.0pt;padding:0cm"> */</span></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> </span><span lang="EN-US" 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;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:#F8F8F8;border:none;padding:0cm;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm">tcp_dl = pkt->pkt_len - hdr_len; </span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li><li class="alt" style="color:#5C5C5C;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:white;border:none;padding:0cm;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 lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#006699;border:none windowtext 1.0pt;padding:0cm">if</span></b></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> (tcp_dl <= 0) </span><span lang="EN-US" 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;margin-left:-18.0pt;line-height:10.5pt;mso-list:l0 level1 lfo1;background:#F8F8F8;border:none;padding:0cm;box-sizing: border-box;border-image: initial;list-style-image:initial;list-style-type:decimal-leading-zero;list-style-position:outside">
<span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> </span><span class="keyword"><b><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:#006699;border:none windowtext 1.0pt;padding:0cm">return</span></b></span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm"> -1; </span><span lang="EN-US" style="font-size:9.0pt;font-family:Consolas"><o:p></o:p></span></li></ol>
</div>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> kumaraparameshwaran rathinavel <kumaraparamesh92@gmail.com>
<br>
<b>Sent:</b> Tuesday, October 11, 2022 1:48 PM<br>
<b>To:</b> dev@dpdk.org; David Marchand <david.marchand@redhat.com>; Hu, Jiayu <jiayu.hu@intel.com>; Jun Qiu <jun.qiu@jaguarmicro.com><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"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span lang="EN-US">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></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt;text-align:justify;text-justify:inter-ideograph">
<span lang="EN-US">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></span></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span lang="EN-US">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></span></p>
</blockquote>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="text-align:justify;text-justify:inter-ideograph"><span lang="EN-US">/*<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></span></p>
</blockquote>
</blockquote>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt;text-align:justify;text-justify:inter-ideograph">
<span lang="EN-US">-- <br>
David Marchand<o:p></o:p></span></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</body>
</html>