From patchwork Fri Feb 16 03:40:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumara Parameshwaran X-Patchwork-Id: 136841 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 A099A43B24; Fri, 16 Feb 2024 04:41:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6FF5140284; Fri, 16 Feb 2024 04:41:07 +0100 (CET) Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by mails.dpdk.org (Postfix) with ESMTP id 285124027C for ; Fri, 16 Feb 2024 04:41:05 +0100 (CET) Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-297108e7001so1300512a91.1 for ; Thu, 15 Feb 2024 19:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708054864; x=1708659664; 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=1XJe2qPYqgArwfX1IWFoby2TaS6dpU8KiCeKSwSiE64=; b=dH2IuTnflMK6hVtc+LFQcNAyYRMIYDInSLecYhc+m03oBbGkNW/b+GfR4Xe4Milrqh PNBTVKTJDk/iWKE7zsJinvyudvL4LtX9qZBViHYjPOp/BZ2c0Q2kZ0dJ7HvA6BVq226C omF1AnRU6TZKXTCj8aQC1qnoeGVxDRCv/7uvBQ8OIi613fhqFE8TXPSc5bDGoVCEqWti NwaOO0JNc5ck5PQbG8D53AbNlu8XAyfZXsc0evTeRlFytkaVQL9L0leJl0fHQ+SZ/d70 hnW44/shy2Pi2FvSNjwtcD7Wqd45fWKAfnhXt2fLD+Xgfut9gbQAIpXM1Z/hPBdhYUSW gCdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708054864; x=1708659664; 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=1XJe2qPYqgArwfX1IWFoby2TaS6dpU8KiCeKSwSiE64=; b=FACzzOt/NIYqL6EYv2o/13yH1B2sgHZ80+74c+AscLmnC0Zl2wE0h1WkmAhj/gUnL2 aB7pgE4wI2q1UoOluji2cG7M2xPAnTwN+6WKzWR7C4qv+Dg+FplhnWf+Saqw8cidzg39 hmk5q9ZVmC7KXUlDktlyV3XqkSO0vIWcYdwgAEUIGlunfHCnrFLxC0x+JyS1ESIMNRFP Ar/q3kd24sWYnfHOQPz2VeL89krlRjOuyoYKLdXH1sTI/1BsXm/S8dua7fwwduhTVJkk wTM43ha9fmKPos/lfd0czxamAYHIltbFZtR7UxU5rli1m5GL05HGUKCpkw+zGo3/YFmz dWuQ== X-Gm-Message-State: AOJu0YywMCbbyi37rnfvePTkGwCMOZypAfOzSC5dTWfWKHM9ck2I4Icn 6kL15dTgx0lm9+4+JXpr3+CIZEL96Yeeq/WAfnhJZpC58GuKuVRI X-Google-Smtp-Source: AGHT+IEoHQ6K6b2uK/YSRBoIeZVRAoX1Pr73uWahak4474ufhwf9lTtkBLrLGSwJ42FJcxSXfjAhIQ== X-Received: by 2002:a17:90b:234b:b0:299:30eb:f687 with SMTP id ms11-20020a17090b234b00b0029930ebf687mr1183105pjb.16.1708054864106; Thu, 15 Feb 2024 19:41:04 -0800 (PST) Received: from IDCREDBOX918.fareast.corp.microsoft.com ([167.220.238.89]) by smtp.gmail.com with ESMTPSA id sx6-20020a17090b2cc600b00296a686dd17sm4205916pjb.56.2024.02.15.19.41.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 19:41:03 -0800 (PST) From: Kumara Parameshwaran To: hujiayu.hu@foxmail.com Cc: dev@dpdk.org, Kumara Parameshwaran , jiayu.hu@intel.com Subject: [PATCH v7] app/testpmd : fix packets not getting flushed in heavy-weight mode API Date: Fri, 16 Feb 2024 09:10:25 +0530 Message-Id: <20240216034025.47371-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. Fixes: b7091f1dcfbc ("app/testpmd: enable the heavyweight mode TCP/IPv4 GRO") Cc: jiayu.hu@intel.com 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 v7: Address review comments app/test-pmd/csumonly.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index c103e54111..637a46d92a 100644 --- a/app/test-pmd/csumonly.c +++ b/app/test-pmd/csumonly.c @@ -863,16 +863,29 @@ 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); - if (unlikely(nb_rx == 0)) + if (unlikely(nb_rx == 0)) { +#ifndef RTE_LIB_GRO return false; +#else + gro_enable = gro_ports[fs->rx_port].enable; + /* + * Make sure that in case of Heavyweight mode GRO the packets in + * GRO cache should be flushed as the timer could have expired. + * + * The order of condidtions should be the same as gro_ctx is valid + * only when gro_flush_cycles is not the GRO_DEFAULT_FLUSH_CYCLES which + * indicates ligth weight mode GRO + */ + if (!gro_enable || (gro_flush_cycles == GRO_DEFAULT_FLUSH_CYCLES) || + (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; @@ -1103,6 +1116,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,