From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E6E1A054A; Wed, 7 Sep 2022 10:59:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE304400D6; Wed, 7 Sep 2022 10:59:47 +0200 (CEST) Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id 00A9140042 for ; Wed, 7 Sep 2022 10:59:45 +0200 (CEST) Received: by mail-pj1-f44.google.com with SMTP id o4so13856515pjp.4 for ; Wed, 07 Sep 2022 01:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=1Y4TS4QBkLOZ0fsRRuOprVCvA3vYk8Gaew4MTj7hUV0=; b=cuEQjHcZ+ezSwyVDIsiXF2kJW629UHbweVGvf2dc/P2EI28P8vyG+eeZwyVzizh0fd RHBBtZA9vsCdcxDz4H7B/PV3ZM+YTTrysx8WPu5ZuguXZ5l/xZ03RPNdrHqPA163gOcx 9JcZk5+tPhfQIVGGdH0DoVAJRs0r7/hi2jchu8z4SJCcHEu0U+Wa9FBiK1U9RSRqZzUw tn3zxcbxYzPpDYY05zRPZj81W/cgJOLE96iR3pMMe1Ovdrfm0ogHKtQcqxCJjbgisAqn qZrTXX+VWeZXaG59fFVeFT87CFHDKlmlTK0O1n8QUfbvSmnTVDJg/EKbcguzRquUBjqC oQcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=1Y4TS4QBkLOZ0fsRRuOprVCvA3vYk8Gaew4MTj7hUV0=; b=CeHG1r55ii/qIF9gLdRI+zSh+7JVW0gwhkg+rmuT0nfXlrzzf/EZ2gW7Px9J8kOuOo oN29/9d81HtJeuOkNvAOW0hHg0Rl04cWNYHZlHh77zQBCSNlDt8gF3gf6SNUppMIPLGz C+xAu3EKNEs60naMuCRBo+/kvQWbd8luzeF/YgXcm7uWo4Uc7PTbGXB74TPuIudaYPlg 2FHco8Ffg4qTKx/lSZ0ASBp9mEDFQwDPFFAOlta1trrWIEFWNPtpm2UfhblSqthDVwQC 9eHeaCAylXOVkzgZyCoS/yc5b/E/6Zs1YN8OjdA2hOB7FpbuNnulmAHSVmu9jIHMhUkh H/lw== X-Gm-Message-State: ACgBeo3NA87IWPvjIf14ihUhAc7+fXd/Na73NaBL/j/ZUcJfWLbFxEik euM2xriB31GRZOdjiu9HzE4= X-Google-Smtp-Source: AA6agR5deIo2DJAh+y0/nugA4rbt50+Ea8x0rnxvAOh4l7+/RuFAoUNAn05Duh01UVu4ISfUy8KfaQ== X-Received: by 2002:a17:902:8505:b0:171:3df7:dea1 with SMTP id bj5-20020a170902850500b001713df7dea1mr2762752plb.110.1662541185010; Wed, 07 Sep 2022 01:59:45 -0700 (PDT) Received: from kparameshwa-a02.vmware.com.com ([223.187.118.10]) by smtp.gmail.com with ESMTPSA id ij28-20020a170902ab5c00b00176b66954a6sm5694839plb.121.2022.09.07.01.59.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Sep 2022 01:59:44 -0700 (PDT) From: Kumara Parameshwaran X-Google-Original-From: Kumara Parameshwaran To: jiayu.hu@intel.com Cc: dev@dpdk.org, Kumara Parameshwaran Subject: [PATCH] gro: fix the chain index in insert_new_item for more than 2 packets Date: Wed, 7 Sep 2022 14:29:37 +0530 Message-Id: <20220907085937.53694-1-kumaraparmesh92@gmail.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Kumara Parameshwaran When more than two packets are merged in a flow, and if we receive a 3rd packet which is matching the sequence of the 2nd packet the prev_idx will be 1 and not 2, hence resulting in packet re-ordering Signed-off-by: Kumara Parameshwaran --- V1: Initial changes to fix packet reordering issue when more than 2 items are chained in a flow. Ex: 3 mergeable TCP packets received in order. packet_0 - no flow found so insert the packet and new start index -> 0 packet_1-> flow found. prev_idx, curr_index = 0. So merge works find packet_0->packet_1 packet_3 flow found. prev_indx =0, curr_index = 1. Matching dequence numbers found but chained as packet_0->packet_2->packet_1 lib/gro/gro_tcp4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c index 7498c66141..9758e28fd5 100644 --- a/lib/gro/gro_tcp4.c +++ b/lib/gro/gro_tcp4.c @@ -305,7 +305,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, * length is greater than the max value. Store * the packet into the flow. */ - if (insert_new_item(tbl, pkt, start_time, prev_idx, + if (insert_new_item(tbl, pkt, start_time, cur_idx, sent_seq, ip_id, is_atomic) == INVALID_ARRAY_INDEX) return -1; -- 2.25.1