Test-Label: iol-testing Test-Status: WARNING http://dpdk.org/patch/117844 _apply patch failure_ Submitter: Andrew Boyer Date: Tuesday, October 11 2022 00:50:13 Applied on: CommitID:f13604fad12a81383da7b04821a4befb3d01e2ed Apply patch set 117844 failed: Checking patch drivers/net/ionic/ionic_dev.h... Hunk #1 succeeded at 136 (offset -1 lines). Checking patch drivers/net/ionic/ionic_lif.c... Hunk #1 succeeded at 593 (offset 27 lines). Hunk #2 succeeded at 644 (offset 27 lines). error: while searching for: int ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index, uint16_t nrxq_descs, struct ionic_rx_qcq **rxq_out) { struct ionic_rx_qcq *rxq; uint16_t flags; int err; flags = IONIC_QCQ_F_SG; err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq), error: patch failed: drivers/net/ionic/ionic_lif.c:698 Hunk #4 succeeded at 742 (offset 2 lines). Hunk #5 succeeded at 751 (offset 2 lines). Hunk #6 succeeded at 780 (offset 2 lines). Hunk #7 succeeded at 811 (offset 2 lines). Hunk #8 succeeded at 838 (offset 2 lines). Checking patch drivers/net/ionic/ionic_lif.h... error: while searching for: /* cacheline2 */ struct rte_mempool *mb_pool; uint16_t frame_size; /* Based on configured MTU */ uint16_t flags; /* cacheline3 (inside stats) */ error: patch failed: drivers/net/ionic/ionic_lif.h:81 Hunk #2 succeeded at 198 (offset -3 lines). Checking patch drivers/net/ionic/ionic_rxtx.c... Hunk #1 succeeded at 731 (offset -1 lines). error: while searching for: uint64_t pkt_flags = 0; uint32_t pkt_type; struct ionic_rx_stats *stats = &rxq->stats; uint32_t buf_size = (uint16_t) (rte_pktmbuf_data_room_size(rxq->mb_pool) - RTE_PKTMBUF_HEADROOM); uint32_t left; void **info; error: patch failed: drivers/net/ionic/ionic_rxtx.c:773 Hunk #3 succeeded at 824 (offset 18 lines). Hunk #4 succeeded at 939 (offset 18 lines). error: while searching for: info = IONIC_INFO_PTR(q, q->head_idx); nsegs = (rxq->frame_size + buf_size - 1) / buf_size; desc = &desc_base[q->head_idx]; dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(rxm)); desc->addr = dma_addr; desc->len = buf_size; size = buf_size; desc->opcode = (nsegs > 1) ? IONIC_RXQ_DESC_OPCODE_SG : IONIC_RXQ_DESC_OPCODE_SIMPLE; rxm->next = NULL; prev_rxm_seg = rxm; sg_desc = &sg_desc_base[q->head_idx]; elem = sg_desc->elems; for (j = 0; j < nsegs - 1 && j < IONIC_RX_MAX_SG_ELEMS; j++) { struct rte_mbuf *rxm_seg; rte_iova_t data_iova; error: patch failed: drivers/net/ionic/ionic_rxtx.c:943 error: while searching for: return -ENOMEM; } data_iova = rte_mbuf_data_iova(rxm_seg); dma_addr = rte_cpu_to_le_64(data_iova); elem->addr = dma_addr; elem->len = buf_size; size += buf_size; elem++; rxm_seg->next = NULL; prev_rxm_seg->next = rxm_seg; prev_rxm_seg = rxm_seg; } if (size < rxq->frame_size) IONIC_PRINT(ERR, "Rx SG size is not sufficient (%d < %d)", size, rxq->frame_size); info[0] = rxm; q->head_idx = Q_NEXT_TO_POST(q, 1); error: patch failed: drivers/net/ionic/ionic_rxtx.c:967 error: while searching for: { uint8_t *rx_queue_state = eth_dev->data->rx_queue_state; struct ionic_rx_qcq *rxq; int err; if (rx_queue_state[rx_queue_id] == RTE_ETH_QUEUE_STATE_STARTED) { error: patch failed: drivers/net/ionic/ionic_rxtx.c:1000 error: while searching for: } rxq = eth_dev->data->rx_queues[rx_queue_id]; rxq->frame_size = rxq->qcq.lif->frame_size - RTE_ETHER_CRC_LEN; IONIC_PRINT(DEBUG, "Starting RX queue %u, %u descs, size %u", rx_queue_id, rxq->qcq.q.num_descs, rxq->frame_size); err = ionic_lif_rxq_init(rxq); if (err) error: patch failed: drivers/net/ionic/ionic_rxtx.c:1009 Applied patch drivers/net/ionic/ionic_dev.h cleanly. Applying patch drivers/net/ionic/ionic_lif.c 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. Applying patch drivers/net/ionic/ionic_lif.h with 1 reject... Rejected hunk #1. Hunk #2 applied cleanly. Applying patch drivers/net/ionic/ionic_rxtx.c with 5 rejects... Hunk #1 applied cleanly. Rejected hunk #2. Hunk #3 applied cleanly. Hunk #4 applied cleanly. Rejected hunk #5. Rejected hunk #6. Rejected hunk #7. Rejected hunk #8. diff a/drivers/net/ionic/ionic_lif.c b/drivers/net/ionic/ionic_lif.c (rejected hunks) @@ -698,14 +700,38 @@ ionic_qcq_free(struct ionic_qcq *qcq) int ionic_rx_qcq_alloc(struct ionic_lif *lif, uint32_t socket_id, uint32_t index, - uint16_t nrxq_descs, struct ionic_rx_qcq **rxq_out) + uint16_t nrxq_descs, struct rte_mempool *mb_pool, + struct ionic_rx_qcq **rxq_out) { struct ionic_rx_qcq *rxq; - uint16_t flags; + uint16_t flags, seg_size, hdr_seg_size, max_segs, max_segs_fw; + uint32_t max_mtu; int err; flags = IONIC_QCQ_F_SG; + seg_size = rte_pktmbuf_data_room_size(mb_pool); + + /* The first mbuf needs to leave headroom */ + hdr_seg_size = seg_size - RTE_PKTMBUF_HEADROOM; + + max_mtu = rte_le_to_cpu_32(lif->adapter->ident.lif.eth.max_mtu); + + max_segs_fw = IONIC_RX_MAX_SG_ELEMS + 1; + + /* + * Calculate how many fragment pointers might be stored in queue. + */ + max_segs = 1 + (max_mtu + RTE_PKTMBUF_HEADROOM - 1) / seg_size; + + IONIC_PRINT(DEBUG, "rxq %u frame_size %u seg_size %u max_segs %u", + index, lif->frame_size, seg_size, max_segs); + if (max_segs > max_segs_fw) { + IONIC_PRINT(ERR, "Rx mbuf size insufficient (%d > %d avail)", + max_segs, max_segs_fw); + return -EINVAL; + } + err = ionic_qcq_alloc(lif, IONIC_QTYPE_RXQ, sizeof(struct ionic_rx_qcq), diff a/drivers/net/ionic/ionic_lif.h b/drivers/net/ionic/ionic_lif.h (rejected hunks) @@ -81,6 +81,8 @@ struct ionic_rx_qcq { /* cacheline2 */ struct rte_mempool *mb_pool; uint16_t frame_size; /* Based on configured MTU */ + uint16_t hdr_seg_size; /* Length of first segment of RX chain */ + uint16_t seg_size; /* Length of all subsequent segments */ uint16_t flags; /* cacheline3 (inside stats) */ diff a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c (rejected hunks) @@ -773,9 +773,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, uint64_t pkt_flags = 0; uint32_t pkt_type; struct ionic_rx_stats *stats = &rxq->stats; - uint32_t buf_size = (uint16_t) - (rte_pktmbuf_data_room_size(rxq->mb_pool) - - RTE_PKTMBUF_HEADROOM); uint32_t left; void **info; @@ -943,21 +935,18 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) info = IONIC_INFO_PTR(q, q->head_idx); - nsegs = (rxq->frame_size + buf_size - 1) / buf_size; - desc = &desc_base[q->head_idx]; dma_addr = rte_cpu_to_le_64(rte_mbuf_data_iova_default(rxm)); desc->addr = dma_addr; - desc->len = buf_size; - size = buf_size; - desc->opcode = (nsegs > 1) ? IONIC_RXQ_DESC_OPCODE_SG : + desc->len = rxq->hdr_seg_size; + desc->opcode = (q->num_segs > 1) ? IONIC_RXQ_DESC_OPCODE_SG : IONIC_RXQ_DESC_OPCODE_SIMPLE; rxm->next = NULL; prev_rxm_seg = rxm; sg_desc = &sg_desc_base[q->head_idx]; elem = sg_desc->elems; - for (j = 0; j < nsegs - 1 && j < IONIC_RX_MAX_SG_ELEMS; j++) { + for (j = 0; j < q->num_segs - 1u; j++) { struct rte_mbuf *rxm_seg; rte_iova_t data_iova; @@ -967,21 +956,18 @@ ionic_rx_fill(struct ionic_rx_qcq *rxq) return -ENOMEM; } + rxm_seg->data_off = 0; data_iova = rte_mbuf_data_iova(rxm_seg); dma_addr = rte_cpu_to_le_64(data_iova); elem->addr = dma_addr; - elem->len = buf_size; - size += buf_size; + elem->len = rxq->seg_size; elem++; + rxm_seg->next = NULL; prev_rxm_seg->next = rxm_seg; prev_rxm_seg = rxm_seg; } - if (size < rxq->frame_size) - IONIC_PRINT(ERR, "Rx SG size is not sufficient (%d < %d)", - size, rxq->frame_size); - info[0] = rxm; q->head_idx = Q_NEXT_TO_POST(q, 1); @@ -1000,6 +986,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) { uint8_t *rx_queue_state = eth_dev->data->rx_queue_state; struct ionic_rx_qcq *rxq; + struct ionic_queue *q; int err; if (rx_queue_state[rx_queue_id] == RTE_ETH_QUEUE_STATE_STARTED) { @@ -1009,11 +996,16 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) } rxq = eth_dev->data->rx_queues[rx_queue_id]; + q = &rxq->qcq.q; rxq->frame_size = rxq->qcq.lif->frame_size - RTE_ETHER_CRC_LEN; - IONIC_PRINT(DEBUG, "Starting RX queue %u, %u descs, size %u", - rx_queue_id, rxq->qcq.q.num_descs, rxq->frame_size); + /* Recalculate segment count based on MTU */ + q->num_segs = 1 + + (rxq->frame_size + RTE_PKTMBUF_HEADROOM - 1) / rxq->seg_size; + + IONIC_PRINT(DEBUG, "Starting RX queue %u, %u descs, size %u segs %u", + rx_queue_id, q->num_descs, rxq->frame_size, q->num_segs); err = ionic_lif_rxq_init(rxq); if (err) https://lab.dpdk.org/results/dashboard/patchsets/23885/ UNH-IOL DPDK Community Lab