Skip to content

Commit

Permalink
app/testpmd: fix GRO packets flush on timeout
Browse files Browse the repository at this point in the history
[ upstream commit 461c287ab55303bad1e68bd1dfac6e6ec27953c3 ]

In heavy-weight mode GRO which is based on timer, the GRO packets
will not be flushed in spite 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.

Fixes: b7091f1 ("app/testpmd: enable the heavyweight mode TCP/IPv4 GRO")

Signed-off-by: Kumara Parameshwaran <kumaraparamesh92@gmail.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
kparam1992 authored and bluca committed Mar 7, 2024
1 parent b14df7f commit aa166bc
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions app/test-pmd/csumonly.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,17 +867,29 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
nb_rx = rte_eth_rx_burst(fs->rx_port, fs->rx_queue, pkts_burst,
nb_pkt_per_burst);
inc_rx_burst_stats(fs, nb_rx);
if (unlikely(nb_rx == 0))
return;
if (unlikely(nb_rx == 0)) {
#ifndef RTE_LIB_GRO
return ;
#else
gro_enable = gro_ports[fs->rx_port].enable;
/*
* Check if packets need to be flushed in the GRO context
* due to a timeout.
*
* Continue only in GRO heavyweight mode and if there are
* packets in the GRO context.
*/
if (!gro_enable || (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) ||
(rte_gro_get_pkt_count(current_fwd_lcore()->gro_ctx) == 0))
return ;
#endif
}

fs->rx_packets += nb_rx;
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;
Expand Down Expand Up @@ -1105,6 +1117,7 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
}

#ifdef RTE_LIB_GRO
gro_enable = gro_ports[fs->rx_port].enable;
if (unlikely(gro_enable)) {
if (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) {
nb_rx = rte_gro_reassemble_burst(pkts_burst, nb_rx,
Expand Down

0 comments on commit aa166bc

Please sign in to comment.