[v2] gro : packets not getting flushed in heavy-weight mode API

Message ID 20240117201408.426140-1-kumaraparamesh92@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] gro : packets not getting flushed in heavy-weight mode API |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build fail github build: failed

Commit Message

Kumara Parameshwaran Jan. 17, 2024, 8:14 p.m. UTC
  In heavy-weight mode GRO which is based on timer, the GRO packets will not be
flushed inspite of timer expiry if there is no packet in the current poll.
If timer mode GRO is enabled the rte_gro_timeout_flush API should be invoked.

Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
---
v1:
    Changes to make sure that the GRO flush API is invoked if there are no packets in 
    current poll and timer expiry.

v2:
    Fix code organisation issue

 app/test-pmd/csumonly.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
  

Patch

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index c103e54111..c1fde50126 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -863,16 +863,25 @@  pkt_burst_checksum_forward(struct fwd_stream *fs)
 
 	/* receive a burst of packet */
 	nb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);
+#ifdef RTE_LIB_GRO
+	gro_enable = gro_ports[fs->rx_port].enable;
+	if (unlikely(nb_rx == 0)) {
+		if (gro_enable && (gro_flush_cycles != GRO_DEFAULT_FLUSH_CYCLES)) {
+			goto init;
+		} else {
+			return false;
+		}
+	}
+#else
 	if (unlikely(nb_rx == 0))
 		return false;
+#endif
 
+init:
 	rx_bad_ip_csum = 0;
 	rx_bad_l4_csum = 0;
 	rx_bad_outer_l4_csum = 0;
 	rx_bad_outer_ip_csum = 0;
-#ifdef RTE_LIB_GRO
-	gro_enable = gro_ports[fs->rx_port].enable;
-#endif
 
 	txp = &ports[fs->tx_port];
 	tx_offloads = txp->dev_conf.txmode.offloads;