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 4E5C242C72 for ; Fri, 9 Jun 2023 23:56:52 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4DF7240A84; Fri, 9 Jun 2023 23:56:52 +0200 (CEST) Received: from mail-pj1-f97.google.com (mail-pj1-f97.google.com [209.85.216.97]) by mails.dpdk.org (Postfix) with ESMTP id EC4B540A84 for ; Fri, 9 Jun 2023 23:56:48 +0200 (CEST) Received: by mail-pj1-f97.google.com with SMTP id 98e67ed59e1d1-25669acf1b0so1041373a91.0 for ; Fri, 09 Jun 2023 14:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1686347808; x=1688939808; h=cc:to:from:subject:message-id:date:from:to:cc:subject:date :message-id:reply-to; bh=x9ov9d9S9Q+cdJp+N4JQseAPL58+5YoJ5JdLG7atcCE=; b=dQ4V7wvR/BSB66OQvTuAKjGKpMbU42TB9AxSsEiUGXRRIE25yWSsJwAuplppk7FjZu Pbe7DVjKL1wbV51y6eSAihWkrZdwusiD+4JYkXSYZLOKdJgVEoJjhv2edcYwa4JtrCy9 4EWpT5VIcChNtPgFYWZ8a8WPtKdfTUwGzJIKY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686347808; x=1688939808; h=cc:to:from:subject:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x9ov9d9S9Q+cdJp+N4JQseAPL58+5YoJ5JdLG7atcCE=; b=ScFYdNcDuUMYQOH49zFNejQfUGsGaa0jJY2YThJUPCWhRrnzy/dRIP9XyScx7/3Arh QZXuv1P50D+u7b8wUdFMlqHuZDlG+5/AmExMoCvbqBlqZaylSfJVBQSmnC/f/ckDC2uP zgjaRVxPjRPN5ROdGKRQUZPUqC/GBBKOwcJWjJ/SwzYOFrtEKMvQD6lDWyM+5OzDe7b4 tBWtGZJE81ijsofB+oQBej39RutITls1/oHCX8i2TFFx5igiWXJic6bAbqWPe+TfPocr zq8xxX1ms709deEkYWVAB1z2baeYVREzkFq4eYNafkpm5u8HVOMXyk4UJa4fTEjJBQ53 Wbhg== X-Gm-Message-State: AC+VfDySNSLanRIGf6/ZihZpO8fT4foGr4gNTWq4KC8LotAqy98Y9Y7J giRnxxb5N583spKhuo26jTq6fEPiNfE9yEblwU96jYXHPZ/FiN10A3josw== X-Google-Smtp-Source: ACHHUZ781RtXzR9sGaTcc3NrIF7o5NI81oxi9FOvkMzGWIF1vcVgQHEVTOSZQOr5YWyf6mqwpE+jfRFtWX5R X-Received: by 2002:a17:90a:ec17:b0:255:5bde:e6c2 with SMTP id l23-20020a17090aec1700b002555bdee6c2mr2473671pjy.12.1686347808241; Fri, 09 Jun 2023 14:56:48 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [132.177.123.84]) by smtp-relay.gmail.com with ESMTPS id mq9-20020a17090b380900b002586dbf66a8sm469152pjb.17.2023.06.09.14.56.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2023 14:56:48 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Date: Fri, 09 Jun 2023 14:56:48 -0700 (PDT) Message-ID: <6483a020.170a0220.8c629.c787SMTPIN_ADDED_MISSING@mx.google.com> Received: from [172.17.0.3] (unknown [172.18.0.217]) by postal.iol.unh.edu (Postfix) with ESMTP id 67CF6605246B; Fri, 9 Jun 2023 17:56:47 -0400 (EDT) Subject: |WARNING| pw128140 [PATCH] [v2] net/cnxk: add support for reassembly of multi-seg pkts 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/128140 _apply patch failure_ Submitter: Nithin Dabilpuram Date: Monday, June 05 2023 12:22:10 Applied on: CommitID:abaa473297cf21cb81e5348185a7694ae2f221e7 Apply patch set 128140 failed: Checking patch drivers/event/cnxk/cn10k_worker.h... Hunk #2 succeeded at 27 (offset 3 lines). Hunk #3 succeeded at 62 (offset 3 lines). Hunk #4 succeeded at 126 (offset 3 lines). Hunk #5 succeeded at 155 (offset 3 lines). Hunk #6 succeeded at 167 (offset 3 lines). Hunk #7 succeeded at 177 (offset -5 lines). error: while searching for: sa_base = cnxk_nix_sa_base_get(port, ws->lookup_mem); sa_base &= ~(ROC_NIX_INL_SA_BASE_ALIGN - 1); mbuf = (uint64_t)nix_sec_meta_to_mbuf_sc( cq_w1, cq_w5, sa_base, (uintptr_t)&iova, &loff, (struct rte_mbuf *)mbuf, d_off, flags, mbuf_init | ((uint64_t)port) << 48); mp = (struct rte_mempool *)cnxk_nix_inl_metapool_get(port, lookup_mem); meta_aura = mp ? mp->pool_id : m->pool->pool_id; if (loff) roc_npa_aura_op_free(meta_aura, 0, iova); error: patch failed: drivers/event/cnxk/cn10k_worker.h:192 Hunk #9 succeeded at 202 (offset -10 lines). Checking patch drivers/net/cnxk/cn10k_rx.h... error: while searching for: /* Mark frag as get */ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags = hdr->w0.num_frags - 2; cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL; cnxk_ip_reassembly_dynfield(mbuf_prev, off)->next_frag = mbuf; mbuf_prev = mbuf; } /* Frag-2: */ if (hdr->w0.num_frags > 2) { frag_ptr = (uint64_t *)(finfo + 1); wqe = (uint64_t *)(rte_be_to_cpu_64(*frag_ptr)); rlen = ((*(wqe + 10)) >> 16) & 0xFFFF; frag_rx = (union nix_rx_parse_u *)(wqe + 1); frag_size = rlen + frag_rx->lcptr - frag_rx->laptr; frag_rx->pkt_lenm1 = frag_size - 1; mbuf = (struct rte_mbuf *)((uintptr_t)wqe - sizeof(struct rte_mbuf)); *(uint64_t *)(&mbuf->rearm_data) = mbuf_init; mbuf->data_len = frag_size; mbuf->pkt_len = frag_size; mbuf->ol_flags = ol_flags; mbuf->next = NULL; /* Update dynamic field with userdata */ *rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata; /* Mark frag as get */ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags = hdr->w0.num_frags - 3; cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL; cnxk_ip_reassembly_dynfield(mbuf_prev, off)->next_frag = mbuf; mbuf_prev = mbuf; } /* Frag-3: */ if (hdr->w0.num_frags > 3) { wqe = (uint64_t *)(rte_be_to_cpu_64(*(frag_ptr + 1))); rlen = ((*(wqe + 10)) >> 16) & 0xFFFF; frag_rx = (union nix_rx_parse_u *)(wqe + 1); frag_size = rlen + frag_rx->lcptr - frag_rx->laptr; frag_rx->pkt_lenm1 = frag_size - 1; mbuf = (struct rte_mbuf *)((uintptr_t)wqe - sizeof(struct rte_mbuf)); *(uint64_t *)(&mbuf->rearm_data) = mbuf_init; mbuf->data_len = frag_size; mbuf->pkt_len = frag_size; mbuf->ol_flags = ol_flags; mbuf->next = NULL; /* Mark frag as get */ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); /* Update dynamic field with userdata */ *rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata; cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags = hdr->w0.num_frags - 4; cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL; cnxk_ip_reassembly_dynfield(mbuf_prev, off)->next_frag = mbuf; } return head; } static struct rte_mbuf * nix_sec_reassemble_frags(const struct cpt_parse_hdr_s *hdr, uint64_t cq_w1, uint64_t cq_w5, uint64_t mbuf_init) { uint32_t fragx_sum, pkt_hdr_len, l3_hdr_size; uint32_t offset = hdr->w2.fi_offset; union nix_rx_parse_u *inner_rx; uint16_t rlen, data_off, b_off; union nix_rx_parse_u *frag_rx; struct cpt_frag_info_s *finfo; struct rte_mbuf *head, *mbuf; uint64_t *frag_ptr = NULL; rte_iova_t *inner_iova; uint16_t frag_size; uint64_t *wqe; /* Base data offset */ b_off = mbuf_init & 0xFFFFUL; mbuf_init &= ~0xFFFFUL; /* offset of 0 implies 256B, otherwise it implies offset*8B */ offset = (((offset - 1) & 0x1f) + 1) * 8; finfo = RTE_PTR_ADD(hdr, offset); /* Frag-0: */ wqe = (uint64_t *)rte_be_to_cpu_64(hdr->wqe_ptr); inner_rx = (union nix_rx_parse_u *)(wqe + 1); inner_iova = (rte_iova_t *)*(wqe + 9); /* Update only the upper 28-bits from meta pkt parse info */ *((uint64_t *)inner_rx) = ((*((uint64_t *)inner_rx) & ((1ULL << 36) - 1)) | (cq_w1 & ~((1ULL << 36) - 1))); rlen = ((*(wqe + 10)) >> 16) & 0xFFFF; frag_size = rlen + ((cq_w5 >> 16) & 0xFF) - (cq_w5 & 0xFF); fragx_sum = rte_be_to_cpu_16(finfo->w1.frag_size0); pkt_hdr_len = frag_size - fragx_sum; mbuf = (struct rte_mbuf *)((uintptr_t)wqe - sizeof(struct rte_mbuf)); *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | b_off; mbuf->data_len = frag_size; head = mbuf; if (inner_rx->lctype == NPC_LT_LC_IP) { struct rte_ipv4_hdr *hdr = (struct rte_ipv4_hdr *) RTE_PTR_ADD(inner_iova, inner_rx->lcptr); l3_hdr_size = (hdr->version_ihl & 0xf) << 2; } else { struct rte_ipv6_hdr *hdr = (struct rte_ipv6_hdr *) RTE_PTR_ADD(inner_iova, inner_rx->lcptr); size_t ext_len = sizeof(struct rte_ipv6_hdr); uint8_t *nxt_hdr = (uint8_t *)hdr; int nh = hdr->proto; l3_hdr_size = 0; while (nh != -E error: patch failed: drivers/net/cnxk/cn10k_rx.h:214 Hunk #4 succeeded at 521 (offset 114 lines). Hunk #5 succeeded at 534 (offset 114 lines). Hunk #6 succeeded at 607 (offset 114 lines). Hunk #7 succeeded at 639 (offset 114 lines). Hunk #8 succeeded at 664 (offset 114 lines). Hunk #9 succeeded at 723 (offset 114 lines). Hunk #10 succeeded at 756 (offset 114 lines). Hunk #11 succeeded at 830 (offset 114 lines). Hunk #12 succeeded at 943 (offset 114 lines). Hunk #13 succeeded at 1024 (offset 114 lines). Hunk #14 succeeded at 1056 (offset 114 lines). Hunk #15 succeeded at 1154 (offset 114 lines). Hunk #16 succeeded at 1455 (offset 114 lines). Hunk #17 succeeded at 1462 (offset 114 lines). Hunk #18 succeeded at 1852 (offset 114 lines). Applying patch drivers/event/cnxk/cn10k_worker.h with 1 reject... Hunk #1 applied cleanly. Hunk #2 applied cleanly. Hunk #3 applied cleanly. Hunk #4 applied cleanly. Hunk #5 applied cleanly. Hunk #6 applied cleanly. Hunk #7 applied cleanly. Rejected hunk #8. Hunk #9 applied cleanly. Applying patch drivers/net/cnxk/cn10k_rx.h with 1 reject... Hunk #1 applied cleanly. Hunk #2 applied cleanly. Rejected hunk #3. Hunk #4 applied cleanly. Hunk #5 applied cleanly. Hunk #6 applied cleanly. Hunk #7 applied cleanly. Hunk #8 applied cleanly. Hunk #9 applied cleanly. Hunk #10 applied cleanly. Hunk #11 applied cleanly. Hunk #12 applied cleanly. Hunk #13 applied cleanly. Hunk #14 applied cleanly. Hunk #15 applied cleanly. Hunk #16 applied cleanly. Hunk #17 applied cleanly. Hunk #18 applied cleanly. hint: Use 'git am --show-current-patch' to see the failed patch diff a/drivers/event/cnxk/cn10k_worker.h b/drivers/event/cnxk/cn10k_worker.h (rejected hunks) @@ -192,12 +197,14 @@ cn10k_sso_hws_post_process(struct cn10k_sso_hws *ws, uint64_t *u64, sa_base = cnxk_nix_sa_base_get(port, ws->lookup_mem); sa_base &= ~(ROC_NIX_INL_SA_BASE_ALIGN - 1); + cpth = ((uintptr_t)mbuf + (uint16_t)d_off); + mp = (struct rte_mempool *)cnxk_nix_inl_metapool_get(port, lookup_mem); + meta_aura = mp ? mp->pool_id : m->pool->pool_id; + mbuf = (uint64_t)nix_sec_meta_to_mbuf_sc( cq_w1, cq_w5, sa_base, (uintptr_t)&iova, &loff, (struct rte_mbuf *)mbuf, d_off, flags, mbuf_init | ((uint64_t)port) << 48); - mp = (struct rte_mempool *)cnxk_nix_inl_metapool_get(port, lookup_mem); - meta_aura = mp ? mp->pool_id : m->pool->pool_id; if (loff) roc_npa_aura_op_free(meta_aura, 0, iova); diff a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h (rejected hunks) @@ -214,218 +311,95 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr, /* Mark frag as get */ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); - cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags = - hdr->w0.num_frags - 2; - cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL; - cnxk_ip_reassembly_dynfield(mbuf_prev, off)->next_frag = mbuf; - mbuf_prev = mbuf; + num_frags--; + frag_i++; } + cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags = 0; + cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL; - /* Frag-2: */ - if (hdr->w0.num_frags > 2) { - frag_ptr = (uint64_t *)(finfo + 1); - wqe = (uint64_t *)(rte_be_to_cpu_64(*frag_ptr)); - rlen = ((*(wqe + 10)) >> 16) & 0xFFFF; - - frag_rx = (union nix_rx_parse_u *)(wqe + 1); - frag_size = rlen + frag_rx->lcptr - frag_rx->laptr; - frag_rx->pkt_lenm1 = frag_size - 1; - - mbuf = (struct rte_mbuf *)((uintptr_t)wqe - - sizeof(struct rte_mbuf)); - *(uint64_t *)(&mbuf->rearm_data) = mbuf_init; - mbuf->data_len = frag_size; - mbuf->pkt_len = frag_size; - mbuf->ol_flags = ol_flags; - mbuf->next = NULL; - - /* Update dynamic field with userdata */ - *rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata; - - /* Mark frag as get */ - RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); - - cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags = - hdr->w0.num_frags - 3; - cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL; - cnxk_ip_reassembly_dynfield(mbuf_prev, off)->next_frag = mbuf; - mbuf_prev = mbuf; - } - - /* Frag-3: */ - if (hdr->w0.num_frags > 3) { - wqe = (uint64_t *)(rte_be_to_cpu_64(*(frag_ptr + 1))); - rlen = ((*(wqe + 10)) >> 16) & 0xFFFF; - - frag_rx = (union nix_rx_parse_u *)(wqe + 1); - frag_size = rlen + frag_rx->lcptr - frag_rx->laptr; - frag_rx->pkt_lenm1 = frag_size - 1; - - mbuf = (struct rte_mbuf *)((uintptr_t)wqe - - sizeof(struct rte_mbuf)); - *(uint64_t *)(&mbuf->rearm_data) = mbuf_init; - mbuf->data_len = frag_size; - mbuf->pkt_len = frag_size; - mbuf->ol_flags = ol_flags; - mbuf->next = NULL; - - /* Mark frag as get */ - RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); - - /* Update dynamic field with userdata */ - *rte_security_dynfield(mbuf) = (uint64_t)inb_priv->userdata; - - cnxk_ip_reassembly_dynfield(mbuf, off)->nb_frags = - hdr->w0.num_frags - 4; - cnxk_ip_reassembly_dynfield(mbuf, off)->next_frag = NULL; - cnxk_ip_reassembly_dynfield(mbuf_prev, off)->next_frag = mbuf; - } return head; } -static struct rte_mbuf * -nix_sec_reassemble_frags(const struct cpt_parse_hdr_s *hdr, uint64_t cq_w1, - uint64_t cq_w5, uint64_t mbuf_init) +static __rte_always_inline struct rte_mbuf * +nix_sec_reassemble_frags(const struct cpt_parse_hdr_s *hdr, struct rte_mbuf *head, + uint64_t cq_w1, uint64_t cq_w5, uint64_t mbuf_init) { - uint32_t fragx_sum, pkt_hdr_len, l3_hdr_size; - uint32_t offset = hdr->w2.fi_offset; - union nix_rx_parse_u *inner_rx; - uint16_t rlen, data_off, b_off; + uint8_t num_frags = hdr->w0.num_frags; union nix_rx_parse_u *frag_rx; - struct cpt_frag_info_s *finfo; - struct rte_mbuf *head, *mbuf; - uint64_t *frag_ptr = NULL; - rte_iova_t *inner_iova; + struct rte_mbuf *next_mbufs[3]; + uint16_t data_off, b_off; + const uint8_t *m_ipptr; + uint16_t l3_hdr_size; + struct rte_mbuf *mbuf; uint16_t frag_size; + uint64_t fsz_w1; uint64_t *wqe; /* Base data offset */ b_off = mbuf_init & 0xFFFFUL; mbuf_init &= ~0xFFFFUL; - /* offset of 0 implies 256B, otherwise it implies offset*8B */ - offset = (((offset - 1) & 0x1f) + 1) * 8; - finfo = RTE_PTR_ADD(hdr, offset); + /* Get list of all fragments and frag sizes */ + fsz_w1 = nix_sec_reass_frags_get(hdr, next_mbufs); /* Frag-0: */ - wqe = (uint64_t *)rte_be_to_cpu_64(hdr->wqe_ptr); - inner_rx = (union nix_rx_parse_u *)(wqe + 1); - inner_iova = (rte_iova_t *)*(wqe + 9); + wqe = (uint64_t *)(head + 1); - /* Update only the upper 28-bits from meta pkt parse info */ - *((uint64_t *)inner_rx) = ((*((uint64_t *)inner_rx) & ((1ULL << 36) - 1)) | - (cq_w1 & ~((1ULL << 36) - 1))); - - rlen = ((*(wqe + 10)) >> 16) & 0xFFFF; - frag_size = rlen + ((cq_w5 >> 16) & 0xFF) - (cq_w5 & 0xFF); - fragx_sum = rte_be_to_cpu_16(finfo->w1.frag_size0); - pkt_hdr_len = frag_size - fragx_sum; - - mbuf = (struct rte_mbuf *)((uintptr_t)wqe - sizeof(struct rte_mbuf)); - *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | b_off; - mbuf->data_len = frag_size; - head = mbuf; - - if (inner_rx->lctype == NPC_LT_LC_IP) { - struct rte_ipv4_hdr *hdr = (struct rte_ipv4_hdr *) - RTE_PTR_ADD(inner_iova, inner_rx->lcptr); - - l3_hdr_size = (hdr->version_ihl & 0xf) << 2; - } else { - struct rte_ipv6_hdr *hdr = (struct rte_ipv6_hdr *) - RTE_PTR_ADD(inner_iova, inner_rx->lcptr); - size_t ext_len = sizeof(struct rte_ipv6_hdr); - uint8_t *nxt_hdr = (uint8_t *)hdr; - int nh = hdr->proto; - - l3_hdr_size = 0; - while (nh != -EINVAL) { - nxt_hdr += ext_len; - l3_hdr_size += ext_len; - nh = rte_ipv6_get_next_ext(nxt_hdr, nh, &ext_len); - } - } + /* First fragment data len is already update by caller */ + m_ipptr = ((const uint8_t *)hdr + ((cq_w5 >> 16) & 0xFF)); + nix_sec_reass_first_frag_update(head, m_ipptr, fsz_w1, cq_w1, &l3_hdr_size); + fsz_w1 >>= 16; /* Frag-1: */ - wqe = (uint64_t *)(rte_be_to_cpu_64(hdr->frag1_wqe_ptr)); - frag_size = rte_be_to_cpu_16(finfo->w1.frag_size1); + head->next = next_mbufs[0]; + mbuf = next_mbufs[0]; + wqe = (uint64_t *)(mbuf + 1); frag_rx = (union nix_rx_parse_u *)(wqe + 1); + frag_size = fsz_w1 & 0xFFFF; + fsz_w1 >>= 16; - mbuf->next = (struct rte_mbuf *)((uintptr_t)wqe - sizeof(struct rte_mbuf)); - mbuf = mbuf->next; data_off = b_off + frag_rx->lcptr + l3_hdr_size; *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | data_off; mbuf->data_len = frag_size; - fragx_sum += frag_size; /* Mark frag as get */ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); /* Frag-2: */ - if (hdr->w0.num_frags > 2) { - frag_ptr = (uint64_t *)(finfo + 1); - wqe = (uint64_t *)(rte_be_to_cpu_64(*frag_ptr)); - frag_size = rte_be_to_cpu_16(finfo->w1.frag_size2); + if (num_frags > 2) { + mbuf->next = next_mbufs[1]; + mbuf = next_mbufs[1]; + wqe = (uint64_t *)(mbuf + 1); frag_rx = (union nix_rx_parse_u *)(wqe + 1); + frag_size = fsz_w1 & 0xFFFF; + fsz_w1 >>= 16; - mbuf->next = (struct rte_mbuf *)((uintptr_t)wqe - sizeof(struct rte_mbuf)); - mbuf = mbuf->next; data_off = b_off + frag_rx->lcptr + l3_hdr_size; *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | data_off; mbuf->data_len = frag_size; - fragx_sum += frag_size; /* Mark frag as get */ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); } /* Frag-3: */ - if (hdr->w0.num_frags > 3) { - wqe = (uint64_t *)(rte_be_to_cpu_64(*(frag_ptr + 1))); - frag_size = rte_be_to_cpu_16(finfo->w1.frag_size3); + if (num_frags > 3) { + mbuf->next = next_mbufs[2]; + mbuf = next_mbufs[2]; + wqe = (uint64_t *)(mbuf + 1); frag_rx = (union nix_rx_parse_u *)(wqe + 1); + frag_size = fsz_w1 & 0xFFFF; + fsz_w1 >>= 16; - mbuf->next = (struct rte_mbuf *)((uintptr_t)wqe - sizeof(struct rte_mbuf)); - mbuf = mbuf->next; data_off = b_off + frag_rx->lcptr + l3_hdr_size; *(uint64_t *)(&mbuf->rearm_data) = mbuf_init | data_off; mbuf->data_len = frag_size; - fragx_sum += frag_size; /* Mark frag as get */ RTE_MEMPOOL_CHECK_COOKIES(mbuf->pool, (void **)&mbuf, 1, 1); } - if (inner_rx->lctype == NPC_LT_LC_IP) { - struct rte_ipv4_hdr *hdr = (struct rte_ipv4_hdr *) - RTE_PTR_ADD(inner_iova, inner_rx->lcptr); - - hdr->fragment_offset = 0; - hdr->total_length = rte_cpu_to_be_16(fragx_sum + l3_hdr_size); - hdr->hdr_checksum = 0; - hdr->hdr_checksum = rte_ipv4_cksum(hdr); - - inner_rx->pkt_lenm1 = pkt_hdr_len + fragx_sum - 1; - } else { - /* Remove the frag header by moving header 8 bytes forward */ - struct rte_ipv6_hdr *hdr = (struct rte_ipv6_hdr *) - RTE_PTR_ADD(inner_iova, inner_rx->lcptr); - - hdr->payload_len = rte_cpu_to_be_16(fragx_sum + l3_hdr_size - - 8 - sizeof(struct rte_ipv6_hdr)); - - rte_memcpy(rte_pktmbuf_mtod_offset(head, void *, 8), - rte_pktmbuf_mtod(head, void *), - inner_rx->lcptr + sizeof(struct rte_ipv6_hdr)); - - inner_rx->pkt_lenm1 = pkt_hdr_len + fragx_sum - 8 - 1; - head->data_len -= 8; - head->data_off += 8; - } - mbuf->next = NULL; - head->pkt_len = inner_rx->pkt_lenm1 + 1; - head->nb_segs = hdr->w0.num_frags; - + head->nb_segs = num_frags; return head; } https://lab.dpdk.org/results/dashboard/patchsets/26540/ UNH-IOL DPDK Community Lab