From patchwork Sun Feb 11 04:55:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumara Parameshwaran X-Patchwork-Id: 136585 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 481DB43AAB; Sun, 11 Feb 2024 05:55:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 03DBA40283; Sun, 11 Feb 2024 05:55:44 +0100 (CET) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by mails.dpdk.org (Postfix) with ESMTP id D9DCD4025D for ; Sun, 11 Feb 2024 05:55:41 +0100 (CET) Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-785388b3281so90918085a.2 for ; Sat, 10 Feb 2024 20:55:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707627341; x=1708232141; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dW6fYDSLf9X4TWVoNLPDZpMoZd0i1NVt44o7o24aq80=; b=Aoalhuz0fE1ShI8uNklzQK0WxqC6DutFNi4qY43aPPv7G2DYBd4MO8D28k5qqmieui INnh6exG6CryIR1TnLr4/6D9uPeNPjo5bmmqpKPuuFfoqv+6utK7X8bhUo0+lq5Jpgvc 4e1LzKyHEqKkSBV8JXuXlmBj7prY+dl0GT1MSsiaSikHZi12J803JexU6fU9dbl0n1mW abpS38pJoeVx47E4xIvH96PbpKdpBFe0645Xss3ppC14WxFWSSGaaQr45zq8K6bbQpzX era/tGoDlN3Bzks5BkwnfE0XCumlN3JC3kMVdszkaditbP7UEEufK8BpKrCOK/rhT/YR gJCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707627341; x=1708232141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dW6fYDSLf9X4TWVoNLPDZpMoZd0i1NVt44o7o24aq80=; b=Fg3KEBrhQbP4ur3xYsnHTTUV0BsINNWbFi7spVtiQnUW8bkJY5QZGMN77ThEVNLK1y 8L0VSpYkooco78eBm+F71hm93773GGobjyvCfP7Dveoz9YpWiNgWWmvih9Bxp7XvdP/V jS1vBq3VsMCfO21z6q53TAIipSfS7i/17uBAVxIyhknCZpbp1MR/4gQk3zrAQnT0mfDz AprAoG0bADpI+M3ErTyHB0xfVEL1OW1iIy2HqOu+ULgwc7qLMJJC66MhY5v1B/ZO6TWI jexfb1PdUny08lsVhJY8uKLlJ0oUe21SmsSCU/l/8qmepIJ2hrNKweEa/HFtXlRwpXiP PZDA== X-Gm-Message-State: AOJu0YyaAkup0uNTLIUj/hD0D9DOZL1SYobIpqbTOdAatD0cH8WXT4s2 rVSQdTyyC7fWtAaRkr0wSBplwBSyDgxda9bQA1jP78erUxizqJtSNqWZlsag X-Google-Smtp-Source: AGHT+IF1Gqv9aWHhk1xuovyuIvtopPiSzYd17NU4oTR7v+hYRUF3iEhYPQOn2FnWiIKixWH0R4Hmuw== X-Received: by 2002:a05:620a:144e:b0:783:82af:f516 with SMTP id i14-20020a05620a144e00b0078382aff516mr3357408qkl.62.1707627341048; Sat, 10 Feb 2024 20:55:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUQt9e+Uua+G7cOE28MpZgSVWjAKSYgCRz9hAYecxrYB3mrabMgSnLIdBp73/7Qe58+4Na1TNRopVkCHxY8o3OqrmMzi51SB0yCnQ== Received: from IDCREDBOX918.fareast.corp.microsoft.com ([167.220.238.89]) by smtp.gmail.com with ESMTPSA id h13-20020a170902eecd00b001d94ee4af40sm3764153plb.106.2024.02.10.20.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Feb 2024 20:55:40 -0800 (PST) From: Kumara Parameshwaran To: hujiayu.hu@foxmail.com Cc: dev@dpdk.org, Kumara Parameshwaran Subject: [PATCH v6] gro : packets not getting flushed in heavy-weight mode API Date: Sun, 11 Feb 2024 10:25:11 +0530 Message-Id: <20240211045511.1221879-1-kumaraparamesh92@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240117195228.423261-1-kumaraparamesh92@gmail.com> References: <20240117195228.423261-1-kumaraparamesh92@gmail.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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. Signed-off-by: Kumara Parameshwaran --- 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 v3: Fix warnings v4: Fix error and warnings v5: Fix compilation issue when GRO is not defined v6: Address review comments app/test-pmd/csumonly.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index c103e54111..21b45b4ba4 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -863,16 +863,22 @@ 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); +#ifndef RTE_LIB_GRO if (unlikely(nb_rx == 0)) return false; - +#else + gro_enable = gro_ports[fs->rx_port].enable; + if (unlikely(nb_rx == 0)) { + if (!gro_enable || (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES)) + return false; + if ((rte_gro_get_pkt_count(current_fwd_lcore()->gro_ctx) == 0)) + return false; + } +#endif 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;