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 380E4A00C3 for ; Fri, 14 Oct 2022 04:37:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 298B342B91; Fri, 14 Oct 2022 04:37:46 +0200 (CEST) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2054.outbound.protection.outlook.com [40.107.215.54]) by mails.dpdk.org (Postfix) with ESMTP id 39C19400D4; Fri, 14 Oct 2022 04:37:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c62K7oAVmrCH5/h1SyWNzXfXN7IzWWLxMPvjxSnbPSi5QEXrLDBMGqnG5TI2+TOrMs3O8zODgk5J6zjyFec3wVwWFI7KpdrQ/BXZNcQ8+buht0A9BU3L8ROcOUBE6LEOkGnWMC0TQjgf78joAxyZWEJRXZ9wbS61RnnUFv5449V5xfg2qcM4B42x4AYAxtitUurw9jKiSOj6wOu1wplW4DThoee/qTj3POi83Z57eFyg5bqphwWDvr1cKnpixiiydCkBGlyX3yVvg3QXtDD7JAnps524cP7z1/QY/POiiG4s96UvI3yXwq+8LKu3vOw4cI6yDyYvgreGDJ5rGr0Ohg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pJ8TlZ4lojLGdGZtEAMTixwUefN3UPI+xe+XssT6Glo=; b=Qw4GIPes+FyWRtOfpjUdSWchP0h8oxjqTVR8oWj8l1HXfek3oETx13+Ec2nYqtfgL6nbTE/NXw40AqgZSuEkaMIAhVVO28vIEU+Q3HQEZtFppWgtnI4jRu9sjIhd7BGIye4B/R9Llxy+jqUGl/nlwTKxW1vNZ35akhj7L1s/n9/6zZ1/UiZk8KAfjSUuN5f6lJl31RJQZ8NZoR81kjdm7tUls7XKNFbiuUYKjwu8osj7E4eQJKHH7l2TYJpeZhy6WL2S96CTE1rVbmpCUBBM9BQ59sJdgvLrWG1sAqJjUdrPrjE2j8WGwKV/8CMmTdhZrpudiHvmgrY/XK2SQiHacg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pJ8TlZ4lojLGdGZtEAMTixwUefN3UPI+xe+XssT6Glo=; b=OMIl8og1U+9+0onu2+D5hGNMgz7di5ymtvQEx8GzDtsbbNSVSSYjN1tQY343/NfcYpINRN7I3vSiLBwKaxVhiV/Ak3iQ61I72NqVvN3SpffWcx1OtNPbKRv726TJpEBINJ9jrRNJtZVxoHGTbu7x9YQNRYBrkpU4mjzVG0c6HFD2KS9z1GOqnGWtG396areo84dy2coVHDWnQKpjXa1+2UaO/p4uuOKuH9mOETwPXFSabBQhY17Pz0Bb9zZ8GSY7o/u4/7hz2booc14pUuPMOC27aV48veuDX74Yi+cvuKS0Pp41WEhQut5+Lb6uoKS2RJOb198SPR90O6HVSZ+OjA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from TY0PR06MB5683.apcprd06.prod.outlook.com (2603:1096:400:273::6) by TYZPR06MB3999.apcprd06.prod.outlook.com (2603:1096:400:2d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Fri, 14 Oct 2022 02:37:34 +0000 Received: from TY0PR06MB5683.apcprd06.prod.outlook.com ([fe80::ffe:bed9:6923:1925]) by TY0PR06MB5683.apcprd06.prod.outlook.com ([fe80::ffe:bed9:6923:1925%8]) with mapi id 15.20.5709.021; Fri, 14 Oct 2022 02:37:34 +0000 From: Jun Qiu To: dev@dpdk.org Cc: jiayu.hu@intel.com, stable@dpdk.org Subject: [PATCH] gro: fix gro with tcp push flag Date: Fri, 14 Oct 2022 02:37:18 +0000 Message-Id: <20221014023718.65766-1-jun.qiu@jaguarmicro.com> X-Mailer: git-send-email 2.25.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI1PR02CA0038.apcprd02.prod.outlook.com (2603:1096:4:1f6::15) To TY0PR06MB5683.apcprd06.prod.outlook.com (2603:1096:400:273::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY0PR06MB5683:EE_|TYZPR06MB3999:EE_ X-MS-Office365-Filtering-Correlation-Id: e6cd67b2-f5ef-47ff-79b8-08daad8d0c9f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 84z/9M/aL9Fxbu9wRB0jHICgT2IfepBdHdkz64lvSXvCmVyRLmGLw3L1DvqNyoiCBiV81KJRaEIZDKV0RKIyraJ161XaYVdZe3taRv9HW6XQkMa+FfSIAhB4RxgkGImYZeE703Z8dGrc7NnJ6eMRMj+3SWxgD7OcrcrP2ZEOOUXXdTHNLfG2a4c83A3ci52Zuhm/ViO/y184jNvGeAJJo8lFxoQfu8CR0K/vwxkHdR2hNZ8AA2xPLLGy60g0mjRaGp7GeGGfAYr66OcN224xUfisaKaNx2GlSJnWCtqSoXHiPZqXE0eYrYzMt7wpc2UQRuOsG4PLVGvN4DXVI2rjELWQE5PrCorfRVPGv1NKGi2uyYHvicHh+9SCoxjRqs4mKw4U0t6fA0Qp1tigGxmoqVkll27+9yt0aRp89jGcI0hH4PX9g4XzfiDEcZJlnlRyqAVfHa4BRmbuekM34GZDdCm0PLVzaz3105ycIw/YCtPZAUd6KP8tdsVSzqsg2lfgwXcW4frt0bZkuY7XX1222JXwHdWtfUJMl8g5Oo+6/eLHtWjgj8hn2+qMtAptLXQdPlk7WZseYqw1XQAyxnAygxd98v1j1dclkjqcmHNDQOHUwX4B9ItujuCMnxzgnMhO7EpihEDKV/dSFpeUHcuZI6yH0UkWrHFkThaI/bX9+L0fcrVqMRyHZkfu5KKj1Ov/Jib2B4ZjxZLZvsCLUe+iaW5ZDQpFSfkS5vpVByLd15dEKSpTwpnoQy1UezZH4YzU9MVxObBzTeg3LjxTL+NE4g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TY0PR06MB5683.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(376002)(346002)(396003)(136003)(366004)(39830400003)(451199015)(6666004)(2906002)(2616005)(6506007)(83380400001)(86362001)(186003)(1076003)(26005)(6512007)(6916009)(66476007)(478600001)(316002)(38350700002)(6486002)(38100700002)(44832011)(5660300002)(8936002)(41300700001)(8676002)(66946007)(66556008)(52116002)(4326008)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+KlsPT6ti+35kWyXZxWtAsw+BDsQJ1fBs/TWyxoai+mW6Txb42awqLx/55F6?= =?us-ascii?Q?g3N2+ox+cov1E59slVesaiIoQkQK382c8RLWuCqJEX1agR2R//AQ5Py5PGiH?= =?us-ascii?Q?foq0RZcZ2UxPA0jMtzi2qFCDT6yaI3wxBztxCoN8rS3KQigIkPIQZVyQxt9c?= =?us-ascii?Q?ma49AeDvaruP5KZpxdFcNIg02L1oSU9qmET/F8UEcpkEq69d+ryjRLSooHFj?= =?us-ascii?Q?++/vDJwScZNassHZ4T/9GTyIWOXg6oVgKibHKnuDc+tHW+fT4mszrD4P3kv0?= =?us-ascii?Q?GjwLPQEb54ByecHdmbojG0TV+fnMd6mdxPtpXDYvi+zPP5ViWlijfqYPv1Y/?= =?us-ascii?Q?e2bNJo4gVRTwrR73W1aKoBak6WpQ2Jg3V+UvIkCErOH4EqvVaoQUEbstN+UV?= =?us-ascii?Q?pGuaV0RfiIgF0/gAqu18BV54f/fYZOywNlozON8W1SjRK9GsBckh0Ft+/K6d?= =?us-ascii?Q?ZabBII1HlLejyERP9wvTFHGMttllQH9VkptKXK5rn9KC+8sDqVtRcBQNA+pm?= =?us-ascii?Q?Gfv8mPPHYHJshTSoseK65UgzuBnhEvcaUGpnw4VQAbbo5Q5GKzTlQLQMl03E?= =?us-ascii?Q?KYs3y/8iz0A1amUrAvSnkd/w/Mj4f9TIVZ0V9boHnXujN2JHmcgA56k0BHKm?= =?us-ascii?Q?TwpZFhQWTT6iS9pUkEv8s/dNmjQUxbVOoatODYlFD8Nxtp1iew42oeBdn8f5?= =?us-ascii?Q?O19CnkSYqtKnCxqOwfU7fZY218vIgyvnNGMcztmJTXdoXGDN085Y60rWvF/u?= =?us-ascii?Q?A/50GofFVxrXLtrzaADSRvWklgKBKKzFV4i/OP2vfHmNVYw+gv31YIe47REE?= =?us-ascii?Q?7s47eCE09ZEBoHGNBeHGRwX2Z+w8zAWN40ii2rICoXqKdGx5d2vA42JZB+j/?= =?us-ascii?Q?OQ1H160gUVnRuGXQecf7+MXWUPmBXU+EP9WGQ4hK+l7zBn9ZJlfVe4N1iEiB?= =?us-ascii?Q?5fPVhigZRGtp1wmDPAuXHcpPZ8DfoiQff3tNy63EEWVTIh0SJqwTModDBaFf?= =?us-ascii?Q?fILIUrd7rLFI6F33iy8vUwG8/cLP7kaxo+D+GRanBE+QowA/+SoJ8cyAwwc2?= =?us-ascii?Q?QPpcVJNsnBgSk/QKQ7ktWeGddRzrtmQSJN0nq5QQdqkt1y6q/TFCGwfkPPt8?= =?us-ascii?Q?YapGxjI9XJAS7dnOcytdP2BbZQ/anarmhqhhqkGJtzNN2LC1QIsJKgqQQRpd?= =?us-ascii?Q?gmlM3lFeOYAzU73kzzRz7j+uA0E1uG6vhXflM1uB/23j/JkYxK8eb7N3D5HU?= =?us-ascii?Q?7MkKfNmcwyZ+CAfWX5UjvS07Ze+HR/jyqZzEtcgR3fa2q9R7qBHrhBpBToB+?= =?us-ascii?Q?f1O7kNsO72uUSTu/5Y2KVfn8BwLsh2F3F+SaG3t1/zaTGL9puxs6119IMeQI?= =?us-ascii?Q?QJOjyf7iSVFQi3KLJ9P4Mrbq3e+xK4iPZ6J28Mv6sL8CdohvJziN5oQgZeKD?= =?us-ascii?Q?mWYENGQO2mEy5aRJFuYLxcaEJPZiYh0hyn5dmYQEoDBJ4BaHJqskaIy+Diow?= =?us-ascii?Q?1S8t6HSgJDTLEbxYiu3YzSmw+vReOVorrnT4DGDa7eGEoYpnX36A7hHQx7TL?= =?us-ascii?Q?Y45xv10K5rLSHsfpBwQzQS8Wn8pEgnQoy7PzRggu8opz/MPSMmBgd7qlh61w?= =?us-ascii?Q?Xg=3D=3D?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: e6cd67b2-f5ef-47ff-79b8-08daad8d0c9f X-MS-Exchange-CrossTenant-AuthSource: TY0PR06MB5683.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2022 02:37:34.1680 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B03oqckz9vmNG3KMzmMAd+RbBKe1k1CR+WExOiIfmLEsOBv36NdAinFH6mGNKWgEMXWQEqPypFjv0/jNNybZQQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYZPR06MB3999 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org TCP data packets sometimes carry a PUSH flag. Currently, only the packets that do not have PUSH flag can be GROed. The packets that have a PUSH flag cannot be GROed, the packets that cannot be processed by GRO are placed last. In this case, the received packets may be out of order. For example, there are two packets mbuf1 and mbuf2. mbuf1 contains PUSH flag, mbuf2 does not contain PUSH flag. After GRO processing, mbuf2 is sent for processing before mbuf1. This out-of-order will affect TCP processing performance and lead to unnecessary dup-ACK. Like some hardware LRO implementations, a control flag is provided for marking that TCP packets carrying PSH flags can be merged. Fixes: 0d2cbe59b719 ("lib/gro: support TCP/IPv4") Cc: stable@dpdk.org Signed-off-by: Jun Qiu --- lib/gro/gro_tcp4.c | 15 ++++++++++----- lib/gro/gro_tcp4.h | 21 +++++++++++++++++---- lib/gro/gro_vxlan_tcp4.c | 15 ++++++++++----- lib/gro/gro_vxlan_tcp4.h | 5 ++++- lib/gro/rte_gro.c | 12 ++++++++---- lib/gro/rte_gro.h | 5 +++++ 6 files changed, 54 insertions(+), 19 deletions(-) diff --git a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c index 8f5e800250..0b8f86857e 100644 --- a/lib/gro/gro_tcp4.c +++ b/lib/gro/gro_tcp4.c @@ -6,6 +6,7 @@ #include #include +#include "rte_gro.h" #include "gro_tcp4.h" void * @@ -191,7 +192,8 @@ update_header(struct gro_tcp4_item *item) int32_t gro_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_tcp4_tbl *tbl, - uint64_t start_time) + uint64_t start_time, + uint16_t flags) { struct rte_ether_hdr *eth_hdr; struct rte_ipv4_hdr *ipv4_hdr; @@ -205,7 +207,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, uint32_t cur_idx, prev_idx, item_idx; uint32_t i, max_flow_num, remaining_flow_num; int cmp; - uint8_t find; + uint8_t find, tcp_flags; /* * Don't process the packet whose TCP header length is greater @@ -220,10 +222,13 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, hdr_len = pkt->l2_len + pkt->l3_len + pkt->l4_len; /* - * Don't process the packet which has FIN, SYN, RST, PSH, URG, ECE - * or CWR set. + * Don't process the packet which has FIN, SYN, RST, URG, ECE + * or CWR set, the PSH flag is ignored at the user's discretion. */ - if (tcp_hdr->tcp_flags != RTE_TCP_ACK_FLAG) + tcp_flags = tcp_hdr->tcp_flags & (~(RTE_TCP_ACK_FLAG)); + if (flags & RTE_GRO_TCP_PUSH_IGNORE) + tcp_flags = tcp_flags & (~(RTE_TCP_PSH_FLAG)); + if (tcp_flags) return -1; /* * Don't process the packet whose payload length is less than or diff --git a/lib/gro/gro_tcp4.h b/lib/gro/gro_tcp4.h index 212f97a042..b005bfe7a0 100644 --- a/lib/gro/gro_tcp4.h +++ b/lib/gro/gro_tcp4.h @@ -134,6 +134,8 @@ void gro_tcp4_tbl_destroy(void *tbl); * Pointer pointing to the TCP/IPv4 reassembly table * @start_time * The time when the packet is inserted into the table + * @flags + * Functional flags for GRO * * @return * - Return a positive value if the packet is merged. @@ -143,7 +145,8 @@ void gro_tcp4_tbl_destroy(void *tbl); */ int32_t gro_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_tcp4_tbl *tbl, - uint64_t start_time); + uint64_t start_time, + uint16_t flags); /** * This function flushes timeout packets in a TCP/IPv4 reassembly table, @@ -210,7 +213,8 @@ merge_two_tcp4_packets(struct gro_tcp4_item *item, uint16_t l2_offset) { struct rte_mbuf *pkt_head, *pkt_tail, *lastseg; - uint16_t hdr_len, l2_len; + struct rte_tcp_hdr *head_tcp_hdr, *tail_tcp_hdr; + uint16_t hdr_len, l2_len, l3_offset; if (cmp > 0) { pkt_head = item->firstseg; @@ -221,13 +225,22 @@ merge_two_tcp4_packets(struct gro_tcp4_item *item, } /* check if the IPv4 packet length is greater than the max value */ - hdr_len = l2_offset + pkt_head->l2_len + pkt_head->l3_len + - pkt_head->l4_len; + l3_offset = l2_offset + pkt_head->l2_len + pkt_head->l3_len; + hdr_len = l3_offset + pkt_head->l4_len; l2_len = l2_offset > 0 ? pkt_head->outer_l2_len : pkt_head->l2_len; if (unlikely(pkt_head->pkt_len - l2_len + pkt_tail->pkt_len - hdr_len > MAX_IPV4_PKT_LENGTH)) return 0; + /* merge push flag to pkt_head */ + tail_tcp_hdr = rte_pktmbuf_mtod_offset(pkt_tail, + struct rte_tcp_hdr *, l3_offset); + if (tail_tcp_hdr->tcp_flags & RTE_TCP_PSH_FLAG) { + head_tcp_hdr = rte_pktmbuf_mtod_offset(pkt_head, + struct rte_tcp_hdr *, l3_offset); + head_tcp_hdr->tcp_flags |= RTE_TCP_PSH_FLAG; + } + /* remove the packet header for the tail packet */ rte_pktmbuf_adj(pkt_tail, hdr_len); diff --git a/lib/gro/gro_vxlan_tcp4.c b/lib/gro/gro_vxlan_tcp4.c index 3be4deb7c7..c7282139ee 100644 --- a/lib/gro/gro_vxlan_tcp4.c +++ b/lib/gro/gro_vxlan_tcp4.c @@ -7,6 +7,7 @@ #include #include +#include "rte_gro.h" #include "gro_vxlan_tcp4.h" void * @@ -287,7 +288,8 @@ update_vxlan_header(struct gro_vxlan_tcp4_item *item) int32_t gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_vxlan_tcp4_tbl *tbl, - uint64_t start_time) + uint64_t start_time, + uint16_t flags) { struct rte_ether_hdr *outer_eth_hdr, *eth_hdr; struct rte_ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr; @@ -304,7 +306,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, uint32_t i, max_flow_num, remaining_flow_num; int cmp; uint16_t hdr_len; - uint8_t find; + uint8_t find, tcp_flags; /* * Don't process the packet whose TCP header length is greater @@ -326,10 +328,13 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len); /* - * Don't process the packet which has FIN, SYN, RST, PSH, URG, - * ECE or CWR set. + * Don't process the packet which has FIN, SYN, RST, URG, ECE + * or CWR set, the PSH flag is ignored at the user's discretion. */ - if (tcp_hdr->tcp_flags != RTE_TCP_ACK_FLAG) + tcp_flags = tcp_hdr->tcp_flags & (~(RTE_TCP_ACK_FLAG)); + if (flags & RTE_GRO_TCP_PUSH_IGNORE) + tcp_flags = tcp_flags & (~(RTE_TCP_PSH_FLAG)); + if (tcp_flags) return -1; hdr_len = pkt->outer_l2_len + pkt->outer_l3_len + pkt->l2_len + diff --git a/lib/gro/gro_vxlan_tcp4.h b/lib/gro/gro_vxlan_tcp4.h index 7832942a68..b6d8b92599 100644 --- a/lib/gro/gro_vxlan_tcp4.h +++ b/lib/gro/gro_vxlan_tcp4.h @@ -108,6 +108,8 @@ void gro_vxlan_tcp4_tbl_destroy(void *tbl); * Pointer pointing to the VxLAN reassembly table * @start_time * The time when the packet is inserted into the table + * @flags + * Functional flags for GRO * * @return * - Return a positive value if the packet is merged. @@ -117,7 +119,8 @@ void gro_vxlan_tcp4_tbl_destroy(void *tbl); */ int32_t gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_vxlan_tcp4_tbl *tbl, - uint64_t start_time); + uint64_t start_time, + uint16_t flags); /** * This function flushes timeout packets in the VxLAN reassembly table, diff --git a/lib/gro/rte_gro.c b/lib/gro/rte_gro.c index e35399fd42..ce9ac81142 100644 --- a/lib/gro/rte_gro.c +++ b/lib/gro/rte_gro.c @@ -77,6 +77,8 @@ struct gro_ctx { uint64_t gro_types; /* reassembly tables */ void *tbls[RTE_GRO_TYPE_MAX_NUM]; + /**< Functional flags for GRO */ + uint16_t flags; }; void * @@ -116,6 +118,7 @@ rte_gro_ctx_create(const struct rte_gro_param *param) gro_types |= gro_type_flag; } gro_ctx->gro_types = param->gro_types; + gro_ctx->flags = param->flags; return gro_ctx; } @@ -245,7 +248,8 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts, if (IS_IPV4_VXLAN_TCP4_PKT(pkts[i]->packet_type) && do_vxlan_tcp_gro) { ret = gro_vxlan_tcp4_reassemble(pkts[i], - &vxlan_tcp_tbl, 0); + &vxlan_tcp_tbl, 0, + param->flags); if (ret > 0) /* Merge successfully */ nb_after_gro--; @@ -262,7 +266,7 @@ rte_gro_reassemble_burst(struct rte_mbuf **pkts, unprocess_pkts[unprocess_num++] = pkts[i]; } else if (IS_IPV4_TCP_PKT(pkts[i]->packet_type) && do_tcp4_gro) { - ret = gro_tcp4_reassemble(pkts[i], &tcp_tbl, 0); + ret = gro_tcp4_reassemble(pkts[i], &tcp_tbl, 0, param->flags); if (ret > 0) /* merge successfully */ nb_after_gro--; @@ -354,7 +358,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts, if (IS_IPV4_VXLAN_TCP4_PKT(pkts[i]->packet_type) && do_vxlan_tcp_gro) { if (gro_vxlan_tcp4_reassemble(pkts[i], vxlan_tcp_tbl, - current_time) < 0) + current_time, gro_ctx->flags) < 0) unprocess_pkts[unprocess_num++] = pkts[i]; } else if (IS_IPV4_VXLAN_UDP4_PKT(pkts[i]->packet_type) && do_vxlan_udp_gro) { @@ -364,7 +368,7 @@ rte_gro_reassemble(struct rte_mbuf **pkts, } else if (IS_IPV4_TCP_PKT(pkts[i]->packet_type) && do_tcp4_gro) { if (gro_tcp4_reassemble(pkts[i], tcp_tbl, - current_time) < 0) + current_time, gro_ctx->flags) < 0) unprocess_pkts[unprocess_num++] = pkts[i]; } else if (IS_IPV4_UDP_PKT(pkts[i]->packet_type) && do_udp4_gro) { diff --git a/lib/gro/rte_gro.h b/lib/gro/rte_gro.h index 9f9ed4935a..691b8a26cf 100644 --- a/lib/gro/rte_gro.h +++ b/lib/gro/rte_gro.h @@ -39,6 +39,7 @@ extern "C" { #define RTE_GRO_IPV4_VXLAN_UDP_IPV4 (1ULL << RTE_GRO_IPV4_VXLAN_UDP_IPV4_INDEX) /**< VxLAN UDP/IPv4 GRO flag. */ +#define RTE_GRO_TCP_PUSH_IGNORE 0x01 /** * Structure used to create GRO context objects or used to pass * application-determined parameters to rte_gro_reassemble_burst(). @@ -55,6 +56,10 @@ struct rte_gro_param { * like reassembly tables. When use rte_gro_reassemble_burst(), * applications don't need to set this value. */ + uint16_t flags; + /**< Functional flags for GRO, For example, + * merge TCP packets with push flag. + */ }; /** -- 2.25.1