Test-Label: iol-testing Test-Status: WARNING http://dpdk.org/patch/121878 _apply patch failure_ Submitter: Mahipal Challa Date: Thursday, January 12 2023 07:59:26 Applied on: CommitID:7f6b150cb79dad10b82fe004e5b2310e39507381 Apply patch set 121878 failed: Checking patch drivers/compress/octeontx/otx_zip.h... error: while searching for: ZIP_MAX_NCBP_SIZE)/* ~8072ull */ #define ZIP_BUF_SIZE 256 #define ZIP_BURST_SIZE 64 #define ZIP_MAXSEG_SIZE 59460 #define ZIP_EXTRABUF_SIZE 4096 #define ZIP_SGPTR_ALIGN 16 #define ZIP_CMDQ_ALIGN 128 error: patch failed: drivers/compress/octeontx/otx_zip.h:55 error: while searching for: typedef int (*comp_func_t)(struct rte_comp_op *op, struct zipvf_qp *qp, struct zip_stream *zstrm, int num); /** * ZIP private stream structure */ error: patch failed: drivers/compress/octeontx/otx_zip.h:102 Hunk #3 succeeded at 140 (offset -13 lines). error: while searching for: uint32_t max_nb_queue_pairs; /* pointer to device qps */ struct rte_mempool *zip_mp; /* pointer to pools */ } __rte_cache_aligned; static inline void zipvf_prepare_in_buf(union zip_inst_s *inst, struct rte_comp_op *op) { uint32_t offset, inlen; struct rte_mbuf *m_src; inlen = op->src.length; offset = op->src.offset; m_src = op->m_src; /* Prepare direct input data pointer */ inst->s.dg = 0; inst->s.inp_ptr_addr.s.addr = rte_pktmbuf_iova_offset(m_src, offset); inst->s.inp_ptr_ctl.s.length = inlen; } static inline void zipvf_prepare_out_buf(union zip_inst_s *inst, struct rte_comp_op *op) { uint32_t offset; struct rte_mbuf *m_dst; offset = op->dst.offset; m_dst = op->m_dst; /* Prepare direct input data pointer */ inst->s.ds = 0; inst->s.out_ptr_addr.s.addr = rte_pktmbuf_iova_offset(m_dst, offset); inst->s.totaloutputlength = rte_pktmbuf_pkt_len(m_dst) - op->dst.offset; if (inst->s.totaloutputlength == ZIP_MAXSEG_SIZE) inst->s.totaloutputlength += ZIP_EXTRABUF_SIZE; /* DSTOP */ inst->s.out_ptr_ctl.s.length = inst->s.totaloutputlength; } static inline void zipvf_prepare_cmd_stateless(struct rte_comp_op *op, union zip_inst_s *inst) { /* set flush flag to always 1*/ inst->s.ef = 1; error: patch failed: drivers/compress/octeontx/otx_zip.h:161 error: while searching for: /* Set input checksum */ inst->s.adlercrc32 = op->input_chksum; /* Prepare gather buffers */ zipvf_prepare_in_buf(inst, op); zipvf_prepare_out_buf(inst, op); } #ifdef ZIP_DBG error: patch failed: drivers/compress/octeontx/otx_zip.h:217 error: while searching for: union zip_inst_s *cmd83 = (union zip_inst_s *)inst; printf("####### START ########\n"); printf("doneint:%d totaloutputlength:%d\n", cmd83->s.doneint, cmd83->s.totaloutputlength); printf("exnum:%d iv:%d exbits:%d hmif:%d halg:%d\n", cmd83->s.exn, error: patch failed: drivers/compress/octeontx/otx_zip.h:229 Hunk #7 succeeded at 249 (offset -119 lines). Checking patch drivers/compress/octeontx/otx_zip_pmd.c... error: while searching for: union zip_inst_s *inst = zstrm->inst[num]; volatile union zip_zres_s *zresult = NULL; if ((op->m_src->nb_segs > 1) || (op->m_dst->nb_segs > 1) || (op->src.offset > rte_pktmbuf_pkt_len(op->m_src)) || (op->dst.offset > rte_pktmbuf_pkt_len(op->m_dst))) { op->status = RTE_COMP_OP_STATUS_INVALID_ARGS; ZIP_PMD_ERR("Segmented packet is not supported\n"); return 0; } zipvf_prepare_cmd_stateless(op, inst); zresult = (union zip_zres_s *)zstrm->bufs[RES_BUF + num]; zresult->s.compcode = 0; error: patch failed: drivers/compress/octeontx/otx_zip_pmd.c:46 Hunk #3 succeeded at 215 (offset 26 lines). Hunk #4 succeeded at 237 (offset 26 lines). Hunk #5 succeeded at 261 (offset 26 lines). Hunk #6 succeeded at 313 (offset 26 lines). error: while searching for: } } #ifdef ZIP_DBG ZIP_PMD_INFO("ops_enqd[nb_ops:%d]:%d\n", nb_ops, enqd); #endif error: patch failed: drivers/compress/octeontx/otx_zip_pmd.c:482 error: while searching for: /* zstream is reset irrespective of result */ reset_stream(zstrm->inst[i]); zresult->s.compcode = ZIP_COMP_E_NOTDONE; } #ifdef ZIP_DBG error: patch failed: drivers/compress/octeontx/otx_zip_pmd.c:548 Applying patch drivers/compress/octeontx/otx_zip.h with 5 rejects... Rejected hunk #1. Rejected hunk #2. Hunk #3 applied cleanly. Rejected hunk #4. Rejected hunk #5. Rejected hunk #6. Hunk #7 applied cleanly. Applying patch drivers/compress/octeontx/otx_zip_pmd.c with 3 rejects... Hunk #1 applied cleanly. Rejected hunk #2. Hunk #3 applied cleanly. Hunk #4 applied cleanly. Hunk #5 applied cleanly. Hunk #6 applied cleanly. Rejected hunk #7. Rejected hunk #8. diff a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h (rejected hunks) @@ -55,10 +55,13 @@ extern int octtx_zip_logtype_driver; ZIP_MAX_NCBP_SIZE)/* ~8072ull */ #define ZIP_BUF_SIZE 256 +#define ZIP_SGBUF_SIZE (5 * 1024) #define ZIP_BURST_SIZE 64 #define ZIP_MAXSEG_SIZE 59460 #define ZIP_EXTRABUF_SIZE 4096 +#define ZIP_MAX_SEGS 300 +#define ZIP_MAX_DATA_SIZE (16*1024*1024) #define ZIP_SGPTR_ALIGN 16 #define ZIP_CMDQ_ALIGN 128 @@ -102,6 +105,12 @@ struct zipvf_qp; typedef int (*comp_func_t)(struct rte_comp_op *op, struct zipvf_qp *qp, struct zip_stream *zstrm, int num); +/* Scatter Gather list */ +struct zipvf_sginfo { + union zip_zptr_addr_s sg_addr; + union zip_zptr_ctl_s sg_ctl; +} __rte_aligned(16); + /** * ZIP private stream structure */ @@ -161,50 +175,146 @@ struct zip_vf { uint32_t max_nb_queue_pairs; /* pointer to device qps */ struct rte_mempool *zip_mp; + struct rte_mempool *sg_mp; /* pointer to pools */ } __rte_cache_aligned; -static inline void -zipvf_prepare_in_buf(union zip_inst_s *inst, struct rte_comp_op *op) +static inline int +zipvf_prepare_sgl(struct rte_mbuf *buf, int64_t offset, struct zipvf_sginfo *sg_list, + uint32_t data_len, const uint16_t max_segs, struct zipvf_qp *qp) +{ + struct zipvf_sginfo *sginfo = (struct zipvf_sginfo *)sg_list; + uint32_t tot_buf_len, sgidx; + int ret = -EINVAL; + + for (sgidx = tot_buf_len = 0; buf && sgidx < max_segs; buf = buf->next) { + if (offset >= rte_pktmbuf_data_len(buf)) { + offset -= rte_pktmbuf_data_len(buf); + continue; + } + + sginfo[sgidx].sg_ctl.s.length = (uint16_t)(rte_pktmbuf_data_len(buf) - offset); + sginfo[sgidx].sg_addr.s.addr = rte_pktmbuf_iova_offset(buf, offset); + + offset = 0; + tot_buf_len += sginfo[sgidx].sg_ctl.s.length; + + if (tot_buf_len >= data_len) { + sginfo[sgidx].sg_ctl.s.length -= tot_buf_len - data_len; + ret = 0; + break; + } + +#ifdef ZIP_DBG + ZIP_PMD_INFO("ZIP SGL buf[%d], len = %d, iova = 0x%"PRIx64"\n", + sgidx, sginfo[sgidx].sg_ctl.s.length, + sginfo[sgidx].sg_addr.s.addr); +#endif + ++sgidx; + } + + if (unlikely(ret != 0)) { + if (sgidx == max_segs) + ZIP_PMD_ERR("Exceeded max segments in ZIP SGL (%u)", max_segs); + else + ZIP_PMD_ERR("Mbuf chain is too short"); + } + qp->num_sgbuf = ++sgidx; + +#ifdef ZIP_DBG + ZIP_PMD_INFO("Tot_buf_len:%d max_segs:%d\n", tot_buf_len, qp->num_sgbuf); +#endif + return ret; +} + +static inline int +zipvf_prepare_in_buf(union zip_inst_s *inst, struct zipvf_qp *qp, struct rte_comp_op *op) { uint32_t offset, inlen; struct rte_mbuf *m_src; + int ret = 0; inlen = op->src.length; offset = op->src.offset; m_src = op->m_src; + /* Gather input */ + if (op->m_src->next != NULL && inlen > ZIP_MAXSEG_SIZE) { + inst->s.dg = 1; + + ret = zipvf_prepare_sgl(m_src, offset, qp->g_info, inlen, + op->m_src->nb_segs, qp); + + inst->s.inp_ptr_addr.s.addr = rte_mem_virt2iova(qp->g_info); + inst->s.inp_ptr_ctl.s.length = qp->num_sgbuf; + inst->s.inp_ptr_ctl.s.fw = 0; + +#ifdef ZIP_DBG + ZIP_PMD_INFO("Gather(input): len(nb_segs):%d, iova: 0x%"PRIx64"\n", + inst->s.inp_ptr_ctl.s.length, inst->s.inp_ptr_addr.s.addr); +#endif + return ret; + } + /* Prepare direct input data pointer */ inst->s.dg = 0; - inst->s.inp_ptr_addr.s.addr = - rte_pktmbuf_iova_offset(m_src, offset); + inst->s.inp_ptr_addr.s.addr = rte_pktmbuf_iova_offset(m_src, offset); inst->s.inp_ptr_ctl.s.length = inlen; + +#ifdef ZIP_DBG + ZIP_PMD_INFO("Direct input - inlen:%d\n", inlen); +#endif + return ret; } -static inline void -zipvf_prepare_out_buf(union zip_inst_s *inst, struct rte_comp_op *op) +static inline int +zipvf_prepare_out_buf(union zip_inst_s *inst, struct zipvf_qp *qp, struct rte_comp_op *op) { - uint32_t offset; + uint32_t offset, outlen; struct rte_mbuf *m_dst; + int ret = 0; offset = op->dst.offset; m_dst = op->m_dst; + outlen = rte_pktmbuf_pkt_len(m_dst) - op->dst.offset; - /* Prepare direct input data pointer */ + /* Scatter output */ + if (op->m_dst->next != NULL && outlen > ZIP_MAXSEG_SIZE) { + inst->s.ds = 1; + inst->s.totaloutputlength = outlen; /*rte_pktmbuf_pkt_len(m_dst) - op->dst.offset;*/ + + ret = zipvf_prepare_sgl(m_dst, offset, qp->s_info, inst->s.totaloutputlength, + m_dst->nb_segs, qp); + + inst->s.out_ptr_addr.s.addr = rte_mem_virt2iova(qp->s_info); + inst->s.out_ptr_ctl.s.length = qp->num_sgbuf; + +#ifdef ZIP_DBG + ZIP_PMD_INFO("Scatter(output): nb_segs:%d, iova:0x%"PRIx64"\n", + inst->s.out_ptr_ctl.s.length, inst->s.out_ptr_addr.s.addr); +#endif + return ret; + } + + /* Prepare direct output data pointer */ inst->s.ds = 0; - inst->s.out_ptr_addr.s.addr = - rte_pktmbuf_iova_offset(m_dst, offset); - inst->s.totaloutputlength = rte_pktmbuf_pkt_len(m_dst) - - op->dst.offset; + inst->s.out_ptr_addr.s.addr = rte_pktmbuf_iova_offset(m_dst, offset); + inst->s.totaloutputlength = rte_pktmbuf_pkt_len(m_dst) - op->dst.offset; if (inst->s.totaloutputlength == ZIP_MAXSEG_SIZE) inst->s.totaloutputlength += ZIP_EXTRABUF_SIZE; /* DSTOP */ inst->s.out_ptr_ctl.s.length = inst->s.totaloutputlength; + +#ifdef ZIP_DBG + ZIP_PMD_INFO("Direct output - outlen:%d\n", inst->s.totaloutputlength); +#endif + return ret; } -static inline void -zipvf_prepare_cmd_stateless(struct rte_comp_op *op, union zip_inst_s *inst) +static inline int +zipvf_prepare_cmd_stateless(struct rte_comp_op *op, struct zipvf_qp *qp, + union zip_inst_s *inst) { /* set flush flag to always 1*/ inst->s.ef = 1; @@ -217,9 +327,18 @@ zipvf_prepare_cmd_stateless(struct rte_comp_op *op, union zip_inst_s *inst) /* Set input checksum */ inst->s.adlercrc32 = op->input_chksum; - /* Prepare gather buffers */ - zipvf_prepare_in_buf(inst, op); - zipvf_prepare_out_buf(inst, op); + /* Prepare input/output buffers */ + if (zipvf_prepare_in_buf(inst, qp, op)) { + ZIP_PMD_ERR("Con't fill input SGL "); + return -EINVAL; + } + + if (zipvf_prepare_out_buf(inst, qp, op)) { + ZIP_PMD_ERR("Con't fill output SGL "); + return -EINVAL; + } + + return 0; } #ifdef ZIP_DBG @@ -229,6 +348,7 @@ zip_dump_instruction(void *inst) union zip_inst_s *cmd83 = (union zip_inst_s *)inst; printf("####### START ########\n"); + printf("ZIP Instr:0x%"PRIx64"\n", cmd83); printf("doneint:%d totaloutputlength:%d\n", cmd83->s.doneint, cmd83->s.totaloutputlength); printf("exnum:%d iv:%d exbits:%d hmif:%d halg:%d\n", cmd83->s.exn, diff a/drivers/compress/octeontx/otx_zip_pmd.c b/drivers/compress/octeontx/otx_zip_pmd.c (rejected hunks) @@ -46,15 +49,27 @@ zip_process_op(struct rte_comp_op *op, union zip_inst_s *inst = zstrm->inst[num]; volatile union zip_zres_s *zresult = NULL; - if ((op->m_src->nb_segs > 1) || (op->m_dst->nb_segs > 1) || - (op->src.offset > rte_pktmbuf_pkt_len(op->m_src)) || - (op->dst.offset > rte_pktmbuf_pkt_len(op->m_dst))) { + if (op->m_src->nb_segs > 1) + if (rte_mempool_get(qp->vf->sg_mp, (void *)&qp->g_info) < 0) { + ZIP_PMD_ERR("Can't1 allocate object from SG pool"); + return (-ENOMEM); + } + + if (op->m_dst->nb_segs > 1) + if (rte_mempool_get(qp->vf->sg_mp, (void *)&qp->s_info) < 0) { + rte_mempool_put(qp->vf->sg_mp, qp->g_info); + ZIP_PMD_ERR("Can't allocate object from SG pool"); + return (-ENOMEM); + } + + if (zipvf_prepare_cmd_stateless(op, qp, inst)) { op->status = RTE_COMP_OP_STATUS_INVALID_ARGS; - ZIP_PMD_ERR("Segmented packet is not supported\n"); - return 0; - } + rte_mempool_put(qp->vf->sg_mp, qp->g_info); + rte_mempool_put(qp->vf->sg_mp, qp->s_info); - zipvf_prepare_cmd_stateless(op, inst); + ZIP_PMD_ERR("Can't fill SGL buffers"); + return -EINVAL; + } zresult = (union zip_zres_s *)zstrm->bufs[RES_BUF + num]; zresult->s.compcode = 0; @@ -482,6 +527,7 @@ zip_pmd_enqueue_burst(void *queue_pair, } } + qp->enqed = enqd; #ifdef ZIP_DBG ZIP_PMD_INFO("ops_enqd[nb_ops:%d]:%d\n", nb_ops, enqd); #endif @@ -548,6 +594,12 @@ zip_pmd_dequeue_burst(void *queue_pair, /* zstream is reset irrespective of result */ reset_stream(zstrm->inst[i]); zresult->s.compcode = ZIP_COMP_E_NOTDONE; + + if (op->m_src->nb_segs > 1) + rte_mempool_put(qp->vf->sg_mp, qp->g_info); + + if (op->m_dst->nb_segs > 1) + rte_mempool_put(qp->vf->sg_mp, qp->s_info); } #ifdef ZIP_DBG https://lab.dpdk.org/results/dashboard/patchsets/24950/ UNH-IOL DPDK Community Lab