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 36CB943859; Sun, 7 Jan 2024 18:20:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2D86402E0; Sun, 7 Jan 2024 18:20:24 +0100 (CET) Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by mails.dpdk.org (Postfix) with ESMTP id DF11D402B1 for ; Sun, 7 Jan 2024 18:20:23 +0100 (CET) Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-5cdfa676fa3so1295080a12.1 for ; Sun, 07 Jan 2024 09:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1704648023; x=1705252823; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=GzRA65+ErqDjPLsb0iloDiZe255qHpNA9M1ksLDLzYw=; b=rPsiA4JVaAkD+VRaoG4fIFopo5sJT9ychurvgHPBIqLEdhmtQoYFSqHP+qQL+BWmJf jvdTBzKBj7We8gvfxamtwuIF9s9rovvmCZUiz+zdBsIVZLXNpez2de1B7XDOHkhYIcdr f9HLEMmDwPcDykcXCh2Uc8UTSCTdNzNyB4WK9UNlFar8XntV05V42hyfmtos2OnHn/Zc AYgaxCkUyGMOa26u+BGn83tPLstvGVQUlDyGq1zVpJLThVcmktsnwYLKp9mvcGIrYmEN C8DiCOJ5IVzaTQ5HBU4GmPC3dpPW5ZUcjWAoYHQjRsZ4tkrUObfQ3KZxDzNwKxxTxUjI D2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704648023; x=1705252823; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GzRA65+ErqDjPLsb0iloDiZe255qHpNA9M1ksLDLzYw=; b=rklb+NLvD2/acr0tXv08L5yx+q8Jj4stHEenQOJQu6p2iA+g9qZva9kjNQYXsBVc9K ZpFz49CKB5fk2lsPoV8ZyujgXENP5PNrfwtkg+/Zz/BD0FPzX+y/yrGllAh7QyLdmcj6 U5lREgWbnxNtIqi9ziXRpeWZ8Um9brcDMMnwFph8e734OxfPlQAedImR1mxv4x0pTrrp N6pim1B200ElFkXR/0L8o9KEp3Oug3DZ6xLDl0VdO7I15OfMefDYhjBhLrk27Ilt9442 VavylV4gQ8Qh3cyuyz9Z8i/mox4Q+e69Bgrlto3hBTDELUXfKSZDrpqXk7px92rehJyv Gjow== X-Gm-Message-State: AOJu0YyHtFxIdn/iOM59AuKg5mPSbPo+0paoRsXrX90aTQeERJcRHuWL +Wwk7xgZMz1TgH+kL41K3SWAkQpvS9q2wrKtcnwlHR0EST0= X-Google-Smtp-Source: AGHT+IFVV2nvNp2SzS2Zbej20iSHOyjNZ0J+Ax84ljd88VjIqutskq7Tg0mqQq+uVA8f1yR9L3JPpA== X-Received: by 2002:a17:90a:5786:b0:28c:4527:ef9a with SMTP id g6-20020a17090a578600b0028c4527ef9amr2862142pji.40.1704648022875; Sun, 07 Jan 2024 09:20:22 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id a15-20020a17090abe0f00b0028c8a4fb12fsm4591917pjs.49.2024.01.07.09.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 09:20:22 -0800 (PST) Date: Sun, 7 Jan 2024 09:20:20 -0800 From: Stephen Hemminger To: Kumara Parameshwaran Cc: hujiayu.hu@foxmail.com, dev@dpdk.org Subject: Re: [PATCH v11] gro: fix reordering of packets in GRO layer Message-ID: <20240107092020.371d466d@hermes.local> In-Reply-To: <20240107112920.521184-1-kumaraparamesh92@gmail.com> References: <20231208181738.23931-1-kumaraparamesh92@gmail.com> <20240107112920.521184-1-kumaraparamesh92@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Sun, 7 Jan 2024 16:59:20 +0530 Kumara Parameshwaran wrote: > + /* Return early if the TCP flags are not handled in GRO layer */ > + if (tcp_hdr->tcp_flags & (~(VALID_GRO_TCP_FLAGS))) Nit, lots of extra paren here. Could be: if (tcp_hdr->tcp_flags & ~VALID_GRO_TCP_FLAGS) > + if (find == 1) { > + /* > + * Any packet with additional flags like PSH,FIN should be processed > + * and flushed immediately. > + * Hence marking the start time to 0, so that the packets will be flushed > + * immediately in timer mode. > + */ > + if (tcp_hdr->tcp_flags & (RTE_TCP_ACK_FLAG | RTE_TCP_PSH_FLAG | RTE_TCP_FIN_FLAG)) { > + if (tcp_hdr->tcp_flags != RTE_TCP_ACK_FLAG) > + tbl->items[item_start_idx].start_time = 0; > + return process_tcp_item(pkt, tcp_hdr, tcp_dl, tbl->items, > + tbl->flows[i].start_index, > + &tbl->item_num, tbl->max_item_num, > + ip_id, is_atomic, start_time); > + } else { > + return -1; > + } > + } Reordering this conditional would keep code from being so indented. > - delete_tcp_item(tbl->items, item_idx, &tbl->item_num, INVALID_ARRAY_INDEX); > + delete_tcp_item(tbl->items, item_idx, &tbl->item_num, > + INVALID_ARRAY_INDEX); > return -1; This change is unnecessary, max line length in DPDK is 100 characters for readability. > return 0; > + } else { > + return -1; > } > > - return process_tcp_item(pkt, tcp_hdr, tcp_dl, tbl->items, tbl->flows[i].start_index, > - &tbl->item_num, tbl->max_item_num, > - ip_id, is_atomic, start_time); > + return -1; > } Since end of else and end of function both return -1, the else clause is unnecessary.