<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 21, 2024 at 11:32 PM Ferruh Yigit <<a href="mailto:ferruh.yigit@amd.com">ferruh.yigit@amd.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><div>On 2/16/2024 1:56 PM, Ferruh Yigit wrote:<br>
> On 2/16/2024 3:47 AM, Kumara Parameshwaran wrote:<br>
>> In heavy-weight mode GRO which is based on timer, the GRO packets<br>
>> will not be flushed in spite of timer expiry if there is no packet<br>
>> in the current poll. If timer mode GRO is enabled the<br>
>> rte_gro_timeout_flush API should be invoked.<br>
>><br>
>> Fixes: b7091f1dcfbc ("app/testpmd: enable the heavyweight mode TCP/IPv4 GRO")<br>
>> Cc: <a href="mailto:hujiayu.hu@foxmail.com" target="_blank">hujiayu.hu@foxmail.com</a><br>
>><br>
>> Signed-off-by: Kumara Parameshwaran <<a href="mailto:kumaraparamesh92@gmail.com" target="_blank">kumaraparamesh92@gmail.com</a>><br>
>> ---<br>
>> v1:<br>
>>     Changes to make sure that the GRO flush API is invoked if there are no packets in <br>
>>     current poll and timer expiry.<br>
>><br>
>> v2:<br>
>>     Fix code organisation issue<br>
>><br>
>> v3:<br>
>>     Fix warnings<br>
>><br>
>> v4:<br>
>>     Fix error and warnings<br>
>><br>
>> v5:<br>
>>     Fix compilation issue when GRO is not defined<br>
>><br>
>> v6:<br>
>>     Address review comments<br>
>><br>
>> v7:<br>
>>     Address review comments<br>
>><br>
>> v8:<br>
>>     Fix spell check warnings<br>
>><br>
>>  app/test-pmd/csumonly.c | 22 ++++++++++++++++++----<br>
>>  1 file changed, 18 insertions(+), 4 deletions(-)<br>
>><br>
>> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c<br>
>> index c103e54111..a922160f6d 100644<br>
>> --- a/app/test-pmd/csumonly.c<br>
>> +++ b/app/test-pmd/csumonly.c<br>
>> @@ -863,16 +863,29 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)<br>
>>  <br>
>>      /* receive a burst of packet */<br>
>>      nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);<br>
>> -    if (unlikely(nb_rx == 0))<br>
>> +    if (unlikely(nb_rx == 0)) {<br>
>> +#ifndef RTE_LIB_GRO<br>
>>              return false;<br>
>> +#else<br>
>> +            gro_enable = gro_ports[fs->rx_port].enable;<br>
>> +            /*<br>
>> +             * Make sure that in case of Heavyweight mode GRO the packets in<br>
>> +             * GRO cache should be flushed as the timer could have expired.<br>
>> +             *<br>
>> +             * The order of conditions should be the same as gro_ctx is valid<br>
>> +             * only when gro_flush_cycles is not the GRO_DEFAULT_FLUSH_CYCLES which<br>
>> +             * indicates light weight mode GRO<br>
>> +             */<br>
>><br>
> <br>
> Updated comment as below to make it terse, what do you think:<br>
>  /*<br>
>  * Check if packets need to be flushed in the GRO context<br>
>  * due to a timeout.<br>
>  *<br>
>  * Continue only in GRO heavyweight mode and if there are<br>
>  * packets in the GRO context.<br>
>  */<br>
> <br>
> <br>
>> +            if (!gro_enable || (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) ||<br>
>> +                    (rte_gro_get_pkt_count(current_fwd_lcore()->gro_ctx) == 0))<br>
>> +                    return false;<br>
>> +#endif<br>
>> +    }<br>
>><br>
> <br>
> Another issue but also related to your patch, if there is no packet to<br>
> Tx after GRO block, should we add another zero packet check:<br>
> if (unlikely(nb_rx == 0))<br>
>       return false;<br>
> <br>
> To prevent executing GSO and Tx path code with zero packet, do you think<br>
> does this make sense?<br>
> <br>
> <br>
<br>
Patch looks good to me, with above comment update, but I am worried<br>
about side impacts of this patch that we might be missing, that is why I<br>
would like it to be in -rc1, so that it can be tested better. Hence,<br>
<br>
<br>
Reviewed-by: Ferruh Yigit <<a href="mailto:ferruh.yigit@amd.com" target="_blank">ferruh.yigit@amd.com</a>><br>
<br>
Applied to dpdk-next-net/main, thanks.<br>
(Updated comment as suggested above while merging.)<br>
<br>
<br>
Lets continue to discuss return on "nb_rx == 0" case after GRO block,<br>
incremental to this patch.<br><br></div>I was not able to get to this. I will also take a look at the code to see if this can cause any issues. <br></div>Thanks. <br><div><div><div>
<br>
</div></div></div></blockquote></div></div>