| 1070 | } |
| 1071 | |
| 1072 | uint16_t |
| 1073 | dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) |
| 1074 | { |
| 1075 | struct rte_mbuf *mbuf, *mi = NULL; |
| 1076 | struct rte_mempool *mp; |
| 1077 | struct dpaa_bp_info *bp_info; |
| 1078 | struct qm_fd fd_arr[DPAA_TX_BURST_SIZE]; |
| 1079 | uint32_t frames_to_send, loop, sent = 0; |
| 1080 | uint16_t state; |
| 1081 | int ret, realloc_mbuf = 0; |
| 1082 | uint32_t seqn, index, flags[DPAA_TX_BURST_SIZE] = {0}; |
| 1083 | struct dpaa_sw_buf_free buf_to_free[DPAA_MAX_SGS * DPAA_MAX_DEQUEUE_NUM_FRAMES]; |
| 1084 | uint32_t free_count = 0; |
| 1085 | |
| 1086 | if (unlikely(!DPAA_PER_LCORE_PORTAL)) { |
| 1087 | ret = rte_dpaa_portal_init((void *)0); |
| 1088 | if (ret) { |
| 1089 | DPAA_PMD_ERR("Failure in affining portal"); |
| 1090 | return 0; |
| 1091 | } |
| 1092 | } |
| 1093 | |
| 1094 | DPAA_DP_LOG(DEBUG, "Transmitting %d buffers on queue: %p", nb_bufs, q); |
| 1095 | |
| 1096 | while (nb_bufs) { |
| 1097 | frames_to_send = (nb_bufs > DPAA_TX_BURST_SIZE) ? |
| 1098 | DPAA_TX_BURST_SIZE : nb_bufs; |
| 1099 | for (loop = 0; loop < frames_to_send; loop++) { |
| 1100 | mbuf = *(bufs++); |
| 1101 | /* In case the data offset is not multiple of 16, |
| 1102 | * FMAN can stall because of an errata. So reallocate |
| 1103 | * the buffer in such case. |
| 1104 | */ |
| 1105 | if (dpaa_svr_family == SVR_LS1043A_FAMILY && |
| 1106 | (mbuf->data_off & 0x7F) != 0x0) |
| 1107 | realloc_mbuf = 1; |
| 1108 | seqn = *dpaa_seqn(mbuf); |
| 1109 | if (seqn != DPAA_INVALID_MBUF_SEQN) { |
| 1110 | index = seqn - 1; |
| 1111 | if (DPAA_PER_LCORE_DQRR_HELD & (UINT64_C(1) << index)) { |
| 1112 | flags[loop] = |
| 1113 | ((index & QM_EQCR_DCA_IDXMASK) << 8); |
| 1114 | flags[loop] |= QMAN_ENQUEUE_FLAG_DCA; |
| 1115 | DPAA_PER_LCORE_DQRR_SIZE--; |
| 1116 | DPAA_PER_LCORE_DQRR_HELD &= ~(UINT64_C(1) << index); |
| 1117 | } |
| 1118 | } |
| 1119 | |
| 1120 | if (likely(RTE_MBUF_DIRECT(mbuf))) { |
| 1121 | mp = mbuf->pool; |
| 1122 | bp_info = DPAA_MEMPOOL_TO_POOL_INFO(mp); |
| 1123 | if (likely(mp->ops_index == |
| 1124 | bp_info->dpaa_ops_index && |
| 1125 | mbuf->nb_segs == 1 && |
| 1126 | realloc_mbuf == 0 && |
| 1127 | rte_mbuf_refcnt_read(mbuf) == 1)) { |
| 1128 | DPAA_MBUF_TO_CONTIG_FD(mbuf, |
| 1129 | &fd_arr[loop], bp_info->bpid); |
no test coverage detected