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 8EB2442C0E for ; Fri, 2 Jun 2023 08:22:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A89F40695; Fri, 2 Jun 2023 08:22:16 +0200 (CEST) Received: from mail-yw1-f225.google.com (mail-yw1-f225.google.com [209.85.128.225]) by mails.dpdk.org (Postfix) with ESMTP id 7876340695 for ; Fri, 2 Jun 2023 08:22:15 +0200 (CEST) Received: by mail-yw1-f225.google.com with SMTP id 00721157ae682-5694f3a2b70so2947317b3.1 for ; Thu, 01 Jun 2023 23:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1685686935; x=1688278935; h=cc:to:from:subject:message-id:date:from:to:cc:subject:date :message-id:reply-to; bh=y8qy00ZMp5BfXeQyq9wa/uVkerXYkn2AJVeuw4eAC1U=; b=OsQwPf/XuN0PX4B23j9pKvVfim5XAKXi1UMXRohxFSIN7RqyJMMLeKwnC00lh65HRn ON2bF8KGG76lJMWZjGIY1/dSsjUDGco2/9NZKaaI5FhSUr9ZvaVbKQWlg1jpmoN204LL 855/lwOWSjh4Qt8NmHb418qTkj/CN8E2zEMfg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685686935; x=1688278935; h=cc:to:from:subject:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y8qy00ZMp5BfXeQyq9wa/uVkerXYkn2AJVeuw4eAC1U=; b=ZE34oqdbdqCHnzVxJbAKTpiwYs1yGes8yCZShQfGsdRMhCh4+z2/4JL3K0viwhc9bP rgx0uyJqjB2eBgJnfsEL1XAq044d2Wpk/FXhiINN0Jk/XE2v8DH7IDrBO47FfLsPR0BX EFvLvY4B4VQIGyin6Ia2q+BY3y2PIavLMqe4iqngrMo4YznWAge31VBahOzYp8suXZit iyCUyvh7MN4aVn/iNPmZ6LjODOfhN21C4EkYyJl21n3JOnpFVqjcpQKRSjX2BGFOVdFW MzFW1Cq6NwGowLleEBsBwmy5RjezNulRjnVNTO3uwYPYqUIBl7TzzrmZwN5QeuO2mW2z kMlQ== X-Gm-Message-State: AC+VfDzMqlmr5dt2BxVR2bnevA6wWfMbwAOVCHiRLf3lmyjtP//mJCkn is0sscm6MfNaTKOzTE3EE2Pkn+5B/S0PTYkDp/jZBzuAk//fGfBn5SVS80Mop2zF2m73BnhUgg= = X-Google-Smtp-Source: ACHHUZ6D+XLKU/JAmgfGSHxbfc8k8wrH01WWoZiCWfgzbLE0y0z2t6kw+9ckTbwG307vI4TjopzM4pDuOiVV X-Received: by 2002:a0d:e849:0:b0:565:b22c:4165 with SMTP id r70-20020a0de849000000b00565b22c4165mr11496217ywe.11.1685686934850; Thu, 01 Jun 2023 23:22:14 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id g10-20020a816b0a000000b00559f85e44f2sm86589ywc.27.2023.06.01.23.22.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2023 23:22:14 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Date: Thu, 01 Jun 2023 23:22:14 -0700 (PDT) Message-ID: <64798a96.810a0220.d7b8f.1a88SMTPIN_ADDED_MISSING@mx.google.com> Received: from [172.17.0.2] (unknown [172.18.0.34]) by postal.iol.unh.edu (Postfix) with ESMTP id 718EB605246B; Fri, 2 Jun 2023 02:22:14 -0400 (EDT) Subject: |WARNING| pw127946 [PATCH] [v3] gro : ipv6-gro review comments to reduce code duplication across v4 and v6 From: dpdklab@iol.unh.edu To: test-report@dpdk.org Cc: dpdk-test-reports@iol.unh.edu Content-Type: text/plain X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: test-report-bounces@dpdk.org Test-Label: iol-testing Test-Status: WARNING http://dpdk.org/patch/127946 _apply patch failure_ Submitter: Kumara Parameshwaran Date: Friday, June 02 2023 06:02:15 Applied on: CommitID:abaa473297cf21cb81e5348185a7694ae2f221e7 Apply patch set 127946 failed: .git/rebase-apply/patch:108: trailing whitespace. int32_t .git/rebase-apply/patch:109: trailing whitespace. gro_tcp_reassemble(struct rte_mbuf *pkt, .git/rebase-apply/patch:110: trailing whitespace. void *tbl, .git/rebase-apply/patch:111: trailing whitespace. void *key, .git/rebase-apply/patch:135: trailing whitespace. sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq); Checking patch lib/gro/gro_tcp.c... Checking patch lib/gro/gro_tcp.h... error: lib/gro/gro_tcp.h: does not exist in index Checking patch lib/gro/gro_tcp4.c... Hunk #1 succeeded at 71 (offset -1 lines). error: while searching for: } static inline uint32_t insert_new_item(struct gro_tcp4_tbl *tbl, struct rte_mbuf *pkt, uint64_t start_time, uint32_t prev_idx, uint32_t sent_seq, uint16_t ip_id, uint8_t is_atomic) { uint32_t item_idx; item_idx = find_an_empty_item(tbl); if (item_idx == INVALID_ARRAY_INDEX) return INVALID_ARRAY_INDEX; tbl->items[item_idx].firstseg = pkt; tbl->items[item_idx].lastseg = rte_pktmbuf_lastseg(pkt); tbl->items[item_idx].start_time = start_time; tbl->items[item_idx].next_pkt_idx = INVALID_ARRAY_INDEX; tbl->items[item_idx].sent_seq = sent_seq; tbl->items[item_idx].ip_id = ip_id; tbl->items[item_idx].nb_merged = 1; tbl->items[item_idx].is_atomic = is_atomic; tbl->item_num++; /* if the previous packet exists, chain them together. */ if (prev_idx != INVALID_ARRAY_INDEX) { tbl->items[item_idx].next_pkt_idx = tbl->items[prev_idx].next_pkt_idx; tbl->items[prev_idx].next_pkt_idx = item_idx; } return item_idx; } static inline uint32_t delete_item(struct gro_tcp4_tbl *tbl, uint32_t item_idx, uint32_t prev_item_idx) { uint32_t next_idx = tbl->items[item_idx].next_pkt_idx; /* NULL indicates an empty item */ tbl->items[item_idx].firstseg = NULL; tbl->item_num--; if (prev_item_idx != INVALID_ARRAY_INDEX) tbl->items[prev_item_idx].next_pkt_idx = next_idx; return next_idx; } static inline uint32_t insert_new_flow(struct gro_tcp4_tbl *tbl, struct tcp4_flow_key *src, uint32_t item_idx) { struct tcp4_flow_key *dst; uint32_t flow_idx; flow_idx = find_an_empty_flow(tbl); if (unlikely(flow_idx == INVALID_ARRAY_INDEX)) return INVALID_ARRAY_INDEX; dst = &(tbl->flows[flow_idx].key); rte_ether_addr_copy(&(src->eth_saddr), &(dst->eth_saddr)); rte_ether_addr_copy(&(src->eth_daddr), &(dst->eth_daddr)); dst->ip_src_addr = src->ip_src_addr; dst->ip_dst_addr = src->ip_dst_addr; dst->recv_ack = src->recv_ack; dst->src_port = src->src_port; dst->dst_port = src->dst_port; tbl->flows[flow_idx].start_index = item_idx; tbl->flow_num++; return flow_idx; } /* * update the packet length for the flushed packet. */ static inline void update_header(struct gro_tcp_item *item) { struct rte_ipv4_hdr *ipv4_hdr; struct rte_mbuf *pkt = item->firstseg; ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) + pkt->l2_len); ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len - pkt->l2_len); } int32_t gro_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_tcp4_tbl *tbl, error: patch failed: lib/gro/gro_tcp4.c:97 Hunk #3 succeeded at 183 (offset 21 lines). Hunk #4 succeeded at 197 (offset 21 lines). Hunk #5 succeeded at 212 (offset 21 lines). error: while searching for: frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset); is_atomic = (frag_off & RTE_IPV4_HDR_DF_FLAG) == RTE_IPV4_HDR_DF_FLAG; ip_id = is_atomic ? 0 : rte_be_to_cpu_16(ipv4_hdr->packet_id); sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq); rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.eth_saddr)); rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.eth_daddr)); key.ip_src_addr = ipv4_hdr->src_addr; key.ip_dst_addr = ipv4_hdr->dst_addr; key.src_port = tcp_hdr->src_port; key.dst_port = tcp_hdr->dst_port; key.recv_ack = tcp_hdr->recv_ack; /* Search for a matched flow. */ max_flow_num = tbl->max_flow_num; remaining_flow_num = tbl->flow_num; find = 0; for (i = 0; i < max_flow_num && remaining_flow_num; i++) { if (tbl->flows[i].start_index != INVALID_ARRAY_INDEX) { if (is_same_tcp4_flow(tbl->flows[i].key, key)) { find = 1; break; } remaining_flow_num--; } } /* * Fail to find a matched flow. Insert a new flow and store the * packet into the flow. */ if (find == 0) { item_idx = insert_new_item(tbl, pkt, start_time, INVALID_ARRAY_INDEX, sent_seq, ip_id, is_atomic); if (item_idx == INVALID_ARRAY_INDEX) return -1; if (insert_new_flow(tbl, &key, item_idx) == INVALID_ARRAY_INDEX) { /* * Fail to insert a new flow, so delete the * stored packet. */ delete_item(tbl, item_idx, INVALID_ARRAY_INDEX); return -1; } return 0; } /* * Check all packets in the flow and try to find a neighbor for * the input packet. */ cur_idx = tbl->flows[i].start_index; prev_idx = cur_idx; do { cmp = check_seq_option(&(tbl->items[cur_idx]), tcp_hdr, sent_seq, ip_id, pkt->l4_len, tcp_dl, 0, is_atomic); if (cmp) { if (merge_two_tcp_packets(&(tbl->items[cur_idx]), pkt, cmp, sent_seq, ip_id, 0)) return 1; /* * Fail to merge the two packets, as the packet * length is greater than the max value. Store * the packet into the flow. */ if (insert_new_item(tbl, pkt, start_time, cur_idx, sent_seq, ip_id, is_atomic) == INVALID_ARRAY_INDEX) return -1; return 0; } prev_idx = cur_idx; cur_idx = tbl->items[cur_idx].next_pkt_idx; } while (cur_idx != INVALID_ARRAY_INDEX); /* Fail to find a neighbor, so store the packet into the flow. */ if (insert_new_item(tbl, pkt, start_time, prev_idx, sent_seq, ip_id, is_atomic) == INVALID_ARRAY_INDEX) return -1; return 0; } uint16_t error: patch failed: lib/gro/gro_tcp4.c:247 Hunk #7 succeeded at 330 (offset 83 lines). Checking patch lib/gro/gro_tcp4.h... error: while searching for: #ifndef _GRO_TCP4_H_ #define _GRO_TCP4_H_ #define INVALID_ARRAY_INDEX 0xffffffffUL #define GRO_TCP4_TBL_MAX_ITEM_NUM (1024UL * 1024UL) /* Header fields representing a TCP/IPv4 flow */ struct tcp4_flow_key { struct rte_ether_addr eth_saddr; struct rte_ether_addr eth_daddr; uint32_t ip_src_addr; uint32_t ip_dst_addr; uint32_t recv_ack; uint16_t src_port; uint16_t dst_port; }; struct gro_tcp4_flow { error: patch failed: lib/gro/gro_tcp4.h:5 error: while searching for: static inline int is_same_tcp4_flow(struct tcp4_flow_key k1, struct tcp4_flow_key k2) { return (rte_is_same_ether_addr(&k1.eth_saddr, &k2.eth_saddr) && rte_is_same_ether_addr(&k1.eth_daddr, &k2.eth_daddr) && (k1.ip_src_addr == k2.ip_src_addr) && (k1.ip_dst_addr == k2.ip_dst_addr) && (k1.recv_ack == k2.recv_ack) && (k1.src_port == k2.src_port) && (k1.dst_port == k2.dst_port)); } #endif error: patch failed: lib/gro/gro_tcp4.h:143 Checking patch lib/gro/gro_tcp6.c... error: lib/gro/gro_tcp6.c: does not exist in index Checking patch lib/gro/gro_tcp6.h... error: lib/gro/gro_tcp6.h: does not exist in index Checking patch lib/gro/gro_vxlan_tcp4.c... Hunk #1 succeeded at 163 (offset -1 lines). Hunk #2 succeeded at 351 (offset -1 lines). Checking patch lib/gro/meson.build... error: while searching for: sources = files( 'rte_gro.c', 'gro_tcp4.c', 'gro_tcp6.c', 'gro_udp4.c', error: patch failed: lib/gro/meson.build:3 Applied patch lib/gro/gro_tcp.c cleanly. Applying patch lib/gro/gro_tcp4.c with 2 rejects... Hunk #1 applied cleanly. Rejected hunk #2. Hunk #3 applied cleanly. Hunk #4 applied cleanly. Hunk #5 applied cleanly. Rejected hunk #6. Hunk #7 applied cleanly. Applying patch lib/gro/gro_tcp4.h with 2 rejects... Rejected hunk #1. Rejected hunk #2. Applied patch lib/gro/gro_vxlan_tcp4.c cleanly. Applying patch lib/gro/meson.build with 1 reject... Rejected hunk #1. hint: Use 'git am --show-current-patch' to see the failed patch diff a/lib/gro/gro_tcp4.c b/lib/gro/gro_tcp4.c (rejected hunks) @@ -97,98 +85,76 @@ find_an_empty_flow(struct gro_tcp4_tbl *tbl) } static inline uint32_t -insert_new_item(struct gro_tcp4_tbl *tbl, - struct rte_mbuf *pkt, - uint64_t start_time, - uint32_t prev_idx, - uint32_t sent_seq, - uint16_t ip_id, - uint8_t is_atomic) +gro_tcp4_insert_flow(void *tbl, + void *key, + uint32_t item_idx) { - uint32_t item_idx; + struct gro_tcp4_tbl *tcp4_tbl = (struct gro_tcp4_tbl *)tbl; + struct tcp4_flow_key *src_key = (struct tcp4_flow_key *)key; + struct tcp4_flow_key *dst_key; + struct gro_tcp_flow *src_flow; + struct gro_tcp_flow *dst_flow; + uint32_t flow_idx; - item_idx = find_an_empty_item(tbl); - if (item_idx == INVALID_ARRAY_INDEX) + flow_idx = find_an_empty_flow(tcp4_tbl); + if (unlikely(flow_idx == INVALID_ARRAY_INDEX)) return INVALID_ARRAY_INDEX; - tbl->items[item_idx].firstseg = pkt; - tbl->items[item_idx].lastseg = rte_pktmbuf_lastseg(pkt); - tbl->items[item_idx].start_time = start_time; - tbl->items[item_idx].next_pkt_idx = INVALID_ARRAY_INDEX; - tbl->items[item_idx].sent_seq = sent_seq; - tbl->items[item_idx].ip_id = ip_id; - tbl->items[item_idx].nb_merged = 1; - tbl->items[item_idx].is_atomic = is_atomic; - tbl->item_num++; - - /* if the previous packet exists, chain them together. */ - if (prev_idx != INVALID_ARRAY_INDEX) { - tbl->items[item_idx].next_pkt_idx = - tbl->items[prev_idx].next_pkt_idx; - tbl->items[prev_idx].next_pkt_idx = item_idx; - } + dst_key = &(tcp4_tbl->flows[flow_idx].key); + dst_flow = &dst_key->tcp_flow; + src_flow = &src_key->tcp_flow; - return item_idx; -} + ASSIGN_TCP_FLOW_KEY(src_flow, dst_flow) -static inline uint32_t -delete_item(struct gro_tcp4_tbl *tbl, uint32_t item_idx, - uint32_t prev_item_idx) -{ - uint32_t next_idx = tbl->items[item_idx].next_pkt_idx; + dst_key->ip_src_addr = src_key->ip_src_addr; + dst_key->ip_dst_addr = src_key->ip_dst_addr; - /* NULL indicates an empty item */ - tbl->items[item_idx].firstseg = NULL; - tbl->item_num--; - if (prev_item_idx != INVALID_ARRAY_INDEX) - tbl->items[prev_item_idx].next_pkt_idx = next_idx; + tcp4_tbl->flows[flow_idx].start_index = item_idx; + tcp4_tbl->flow_num++; - return next_idx; + return flow_idx; } -static inline uint32_t -insert_new_flow(struct gro_tcp4_tbl *tbl, - struct tcp4_flow_key *src, - uint32_t item_idx) -{ - struct tcp4_flow_key *dst; - uint32_t flow_idx; - - flow_idx = find_an_empty_flow(tbl); - if (unlikely(flow_idx == INVALID_ARRAY_INDEX)) - return INVALID_ARRAY_INDEX; - - dst = &(tbl->flows[flow_idx].key); - - rte_ether_addr_copy(&(src->eth_saddr), &(dst->eth_saddr)); - rte_ether_addr_copy(&(src->eth_daddr), &(dst->eth_daddr)); - dst->ip_src_addr = src->ip_src_addr; - dst->ip_dst_addr = src->ip_dst_addr; - dst->recv_ack = src->recv_ack; - dst->src_port = src->src_port; - dst->dst_port = src->dst_port; - tbl->flows[flow_idx].start_index = item_idx; - tbl->flow_num++; +static uint32_t +gro_tcp4_flow_lookup(void *tbl, void *key) +{ + struct gro_tcp4_tbl *tcp4_tbl = (struct gro_tcp4_tbl *)tbl; + struct tcp4_flow_key *tcp4_key = (struct tcp4_flow_key *)key; + uint32_t max_flow_num = tcp4_tbl->max_flow_num; + uint32_t remaining_flow_num = tcp4_tbl->flow_num; + uint32_t i; - return flow_idx; + /* Search for a matched flow. */ + for (i = 0; i < max_flow_num && remaining_flow_num; i++) { + if (tcp4_tbl->flows[i].start_index != INVALID_ARRAY_INDEX) { + if (is_same_tcp4_flow(tcp4_tbl->flows[i].key, *tcp4_key)) { + return i; + } + remaining_flow_num--; + } + } + return INVALID_ARRAY_INDEX; } -/* - * update the packet length for the flushed packet. - */ -static inline void -update_header(struct gro_tcp_item *item) +static void +gro_tcp4_flow_key_init(void *key, struct rte_tcp_hdr *tcp_hdr) { - struct rte_ipv4_hdr *ipv4_hdr; - struct rte_mbuf *pkt = item->firstseg; + struct tcp4_flow_key *tcp4_key = (struct tcp4_flow_key *)key; + struct gro_tcp_flow *tcp_flow = &tcp4_key->tcp_flow; + + tcp_flow->src_port = tcp_hdr->src_port; + tcp_flow->dst_port = tcp_hdr->dst_port; + tcp_flow->recv_ack = tcp_hdr->recv_ack; - ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) + - pkt->l2_len); - ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len - - pkt->l2_len); } +struct gro_tcp_flow_ops gro_tcp4_flows_ops = { + .tcp_flow_lookup = gro_tcp4_flow_lookup, + .tcp_flow_insert = gro_tcp4_insert_flow, + .tcp_flow_key_init = gro_tcp4_flow_key_init +}; + int32_t gro_tcp4_reassemble(struct rte_mbuf *pkt, struct gro_tcp4_tbl *tbl, @@ -247,87 +202,25 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt, frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset); is_atomic = (frag_off & RTE_IPV4_HDR_DF_FLAG) == RTE_IPV4_HDR_DF_FLAG; ip_id = is_atomic ? 0 : rte_be_to_cpu_16(ipv4_hdr->packet_id); - sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq); - rte_ether_addr_copy(&(eth_hdr->src_addr), &(key.eth_saddr)); - rte_ether_addr_copy(&(eth_hdr->dst_addr), &(key.eth_daddr)); - key.ip_src_addr = ipv4_hdr->src_addr; - key.ip_dst_addr = ipv4_hdr->dst_addr; - key.src_port = tcp_hdr->src_port; - key.dst_port = tcp_hdr->dst_port; - key.recv_ack = tcp_hdr->recv_ack; - - /* Search for a matched flow. */ - max_flow_num = tbl->max_flow_num; - remaining_flow_num = tbl->flow_num; - find = 0; - for (i = 0; i < max_flow_num && remaining_flow_num; i++) { - if (tbl->flows[i].start_index != INVALID_ARRAY_INDEX) { - if (is_same_tcp4_flow(tbl->flows[i].key, key)) { - find = 1; - break; - } - remaining_flow_num--; - } - } - - /* - * Fail to find a matched flow. Insert a new flow and store the - * packet into the flow. - */ - if (find == 0) { - item_idx = insert_new_item(tbl, pkt, start_time, - INVALID_ARRAY_INDEX, sent_seq, ip_id, - is_atomic); - if (item_idx == INVALID_ARRAY_INDEX) - return -1; - if (insert_new_flow(tbl, &key, item_idx) == - INVALID_ARRAY_INDEX) { - /* - * Fail to insert a new flow, so delete the - * stored packet. - */ - delete_item(tbl, item_idx, INVALID_ARRAY_INDEX); - return -1; - } - return 0; - } - - /* - * Check all packets in the flow and try to find a neighbor for - * the input packet. - */ - cur_idx = tbl->flows[i].start_index; - prev_idx = cur_idx; - do { - cmp = check_seq_option(&(tbl->items[cur_idx]), tcp_hdr, - sent_seq, ip_id, pkt->l4_len, tcp_dl, 0, - is_atomic); - if (cmp) { - if (merge_two_tcp_packets(&(tbl->items[cur_idx]), - pkt, cmp, sent_seq, ip_id, 0)) - return 1; - /* - * Fail to merge the two packets, as the packet - * length is greater than the max value. Store - * the packet into the flow. - */ - if (insert_new_item(tbl, pkt, start_time, cur_idx, - sent_seq, ip_id, is_atomic) == - INVALID_ARRAY_INDEX) - return -1; - return 0; - } - prev_idx = cur_idx; - cur_idx = tbl->items[cur_idx].next_pkt_idx; - } while (cur_idx != INVALID_ARRAY_INDEX); + return gro_tcp_reassemble(pkt, tbl, &key, tcp_dl, &gro_tcp4_flows_ops, tbl->items, + &tbl->item_num, tbl->max_item_num, + ip_id, is_atomic, start_time); +} - /* Fail to find a neighbor, so store the packet into the flow. */ - if (insert_new_item(tbl, pkt, start_time, prev_idx, sent_seq, - ip_id, is_atomic) == INVALID_ARRAY_INDEX) - return -1; +/* + * update the packet length for the flushed packet. + */ +static inline void +update_header(struct gro_tcp_item *item) +{ + struct rte_ipv4_hdr *ipv4_hdr; + struct rte_mbuf *pkt = item->firstseg; - return 0; + ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) + + pkt->l2_len); + ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len - + pkt->l2_len); } uint16_t diff a/lib/gro/gro_tcp4.h b/lib/gro/gro_tcp4.h (rejected hunks) @@ -5,19 +5,15 @@ #ifndef _GRO_TCP4_H_ #define _GRO_TCP4_H_ -#define INVALID_ARRAY_INDEX 0xffffffffUL +#include + #define GRO_TCP4_TBL_MAX_ITEM_NUM (1024UL * 1024UL) /* Header fields representing a TCP/IPv4 flow */ struct tcp4_flow_key { - struct rte_ether_addr eth_saddr; - struct rte_ether_addr eth_daddr; + struct gro_tcp_flow tcp_flow; uint32_t ip_src_addr; uint32_t ip_dst_addr; - - uint32_t recv_ack; - uint16_t src_port; - uint16_t dst_port; }; struct gro_tcp4_flow { @@ -143,13 +139,9 @@ uint32_t gro_tcp4_tbl_pkt_count(void *tbl); static inline int is_same_tcp4_flow(struct tcp4_flow_key k1, struct tcp4_flow_key k2) { - return (rte_is_same_ether_addr(&k1.eth_saddr, &k2.eth_saddr) && - rte_is_same_ether_addr(&k1.eth_daddr, &k2.eth_daddr) && - (k1.ip_src_addr == k2.ip_src_addr) && + return ((k1.ip_src_addr == k2.ip_src_addr) && (k1.ip_dst_addr == k2.ip_dst_addr) && - (k1.recv_ack == k2.recv_ack) && - (k1.src_port == k2.src_port) && - (k1.dst_port == k2.dst_port)); + is_same_tcp_flow(&k1.tcp_flow, &k2.tcp_flow)); } #endif diff a/lib/gro/meson.build b/lib/gro/meson.build (rejected hunks) @@ -3,6 +3,7 @@ sources = files( 'rte_gro.c', + 'gro_tcp.c', 'gro_tcp4.c', 'gro_tcp6.c', 'gro_udp4.c', https://lab.dpdk.org/results/dashboard/patchsets/26503/ UNH-IOL DPDK Community Lab