* |SUCCESS| pw128140 [PATCH v2] net/cnxk: add support for reassembly of multi-seg pkts
[not found] <20230605122210.474789-1-ndabilpuram@marvell.com>
@ 2023-06-05 12:23 ` checkpatch
2023-06-05 12:25 ` |WARNING| " qemudev
1 sibling, 0 replies; 5+ messages in thread
From: checkpatch @ 2023-06-05 12:23 UTC (permalink / raw)
To: test-report
Test-Label: checkpatch
Test-Status: SUCCESS
http://dpdk.org/patch/128140
_coding style OK_
^ permalink raw reply [flat|nested] 5+ messages in thread
* |WARNING| pw128140 [PATCH v2] net/cnxk: add support for reassembly of multi-seg pkts
[not found] <20230605122210.474789-1-ndabilpuram@marvell.com>
2023-06-05 12:23 ` |SUCCESS| pw128140 [PATCH v2] net/cnxk: add support for reassembly of multi-seg pkts checkpatch
@ 2023-06-05 12:25 ` qemudev
1 sibling, 0 replies; 5+ messages in thread
From: qemudev @ 2023-06-05 12:25 UTC (permalink / raw)
To: test-report; +Cc: Nithin Dabilpuram, zhoumin
Test-Label: loongarch-compilation
Test-Status: WARNING
http://dpdk.org/patch/128140
_apply patch failure_
Submitter: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date: Mon, 5 Jun 2023 17:52:10 +0530
DPDK git baseline: Repo:dpdk
Branch: main
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
error: drivers/event/cnxk/cn10k_worker.h: patch does not apply
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
error: drivers/net/cnxk/cn10k_rx.h: patch does not apply
^ permalink raw reply [flat|nested] 5+ messages in thread
* |WARNING| pw128140 [PATCH] [v2] net/cnxk: add support for reassembly of multi-seg pkts
@ 2023-06-05 12:49 dpdklab
0 siblings, 0 replies; 5+ messages in thread
From: dpdklab @ 2023-06-05 12:49 UTC (permalink / raw)
To: test-report; +Cc: dpdk-test-reports
Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/128140
_apply patch failure_
Submitter: Nithin Dabilpuram <ndabilpuram@marvell.com>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* |WARNING| pw128140 [PATCH] [v2] net/cnxk: add support for reassembly of multi-seg pkts
@ 2023-06-09 21:56 dpdklab
0 siblings, 0 replies; 5+ messages in thread
From: dpdklab @ 2023-06-09 21:56 UTC (permalink / raw)
To: test-report; +Cc: dpdk-test-reports
Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/128140
_apply patch failure_
Submitter: Nithin Dabilpuram <ndabilpuram@marvell.com>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* |WARNING| pw128140 [PATCH] [v2] net/cnxk: add support for reassembly of multi-seg pkts
@ 2023-06-10 17:48 dpdklab
0 siblings, 0 replies; 5+ messages in thread
From: dpdklab @ 2023-06-10 17:48 UTC (permalink / raw)
To: test-report; +Cc: dpdk-test-reports
Test-Label: iol-testing
Test-Status: WARNING
http://dpdk.org/patch/128140
_apply patch failure_
Submitter: Nithin Dabilpuram <ndabilpuram@marvell.com>
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-10 17:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230605122210.474789-1-ndabilpuram@marvell.com>
2023-06-05 12:23 ` |SUCCESS| pw128140 [PATCH v2] net/cnxk: add support for reassembly of multi-seg pkts checkpatch
2023-06-05 12:25 ` |WARNING| " qemudev
2023-06-05 12:49 |WARNING| pw128140 [PATCH] [v2] " dpdklab
2023-06-09 21:56 dpdklab
2023-06-10 17:48 dpdklab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).