From patchwork Wed Sep 7 09:32:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumara Parameshwaran X-Patchwork-Id: 116035 X-Patchwork-Delegate: thomas@monjalon.net 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 5261AA054F; Wed, 7 Sep 2022 11:32:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EF168400D6; Wed, 7 Sep 2022 11:32:15 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 9BBCA40042 for ; Wed, 7 Sep 2022 11:32:14 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id a5-20020a17090aa50500b002008eeb040eso710555pjq.1 for ; Wed, 07 Sep 2022 02:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=CDEhk3xJIf9uv9oOQwNjX/sTUdYe/th6sP/9pWtAbjo=; b=Z6pLQhlul9yfrUMQYUDeTt1ScFhGKzwcO55+QidsWUZD4NmyrwVQzsLM40cGTiZgOD jL1fVW2zBEa4eDvOS+Yjuk3S8AQBE/DGAncK71AUOVjWvW6H6uf1D4jDkkeJKNdfsyDz TV9j6MIGTuz58fQBpzT1EzVPp2gxnBuwV5A/he7tWcNjiMFS/vgb25y0tZl4h0bepctr tbNcNqv3ZsJZ+fiBMtCAnH6QEFGeNmre/tCv+QYFmdVDVsbXfv9kvHlsbcBBkseAv0Ob HVP/nVRCJGCQg9kf8P9AUCV9Y5ChJyOiqE9HV5hSUt/kotidhBQSWBkDMMOUgBy0IlPp B/2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=CDEhk3xJIf9uv9oOQwNjX/sTUdYe/th6sP/9pWtAbjo=; b=zPJHeIXkIuNnRW5crCLBFTpDPB3UxrrTAyHszJ1Ztuw8p+EG+B8e4o7Phybu49RviI sIdeHX91mUiUcvBgKw74KuEyTEvI+rsx/bEksGEcDbxiIHkidHeuAfjtk8M9rroiRNYr HhtQfplkz64danPxtKNia0GyQD462yGt1YcEzebibgJrvSfv8ZHqAxpzbfDM+zznfuAU qwsZvywBB3ZzobGAP+S9JOelV/0xm09EQSZgwitnDK+dAmqwkOydlKvTGBYtOKWYHG2f YUrzms0F4+To5g1Pn1qOzq8umopZx7KVhGqvMKqzQuiCe/KC8T49DTytSjBCqDDRWKdj qCZg== X-Gm-Message-State: ACgBeo3FvRJgf+zhXPPmkiVxTTpwDfQkXFJpMaur0hPd1exIEgpZ9dRf uL0xA/7bwk6kje4E6gaFF9k= X-Google-Smtp-Source: AA6agR669+lDxsKgbK2hpL8y/wTR2p80Hjbc/ikhp95AxVAxRn9HBOpKy/ogYaLEPol3bf3LGlMVng== X-Received: by 2002:a17:902:c949:b0:172:d2cd:a9b2 with SMTP id i9-20020a170902c94900b00172d2cda9b2mr3142349pla.38.1662543133794; Wed, 07 Sep 2022 02:32:13 -0700 (PDT) Received: from kparameshwa-a02.vmware.com.com ([223.187.118.10]) by smtp.gmail.com with ESMTPSA id f21-20020aa79695000000b00538405dfe4asm11929491pfk.111.2022.09.07.02.32.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 07 Sep 2022 02:32:13 -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 15:02:05 +0530 Message-Id: <20220907093205.58735-1-kumaraparmesh92@gmail.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220907085937.53694-1-kumaraparmesh92@gmail.com> References: <20220907085937.53694-1-kumaraparmesh92@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 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 Acked-by: Jiayu Hu --- 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_2 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;