MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dpaa2_dev_tx

Function dpaa2_dev_tx

dpdk/drivers/net/dpaa2/dpaa2_rxtx.c:1234–1487  ·  view source on GitHub ↗

* Callback to handle sending packets through WRIOP based interface */

Source from the content-addressed store, hash-verified

1232 * Callback to handle sending packets through WRIOP based interface
1233 */
1234uint16_t
1235dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
1236{
1237 /* Function to transmit the frames to given device and VQ*/
1238 uint32_t loop, retry_count;
1239 int32_t ret;
1240 struct qbman_fd fd_arr[MAX_TX_RING_SLOTS];
1241 struct rte_mbuf *mi;
1242 uint32_t frames_to_send;
1243 struct rte_mempool *mp;
1244 struct qbman_eq_desc eqdesc;
1245 struct dpaa2_queue *dpaa2_q = (struct dpaa2_queue *)queue;
1246 struct qbman_swp *swp;
1247 uint16_t num_tx = 0;
1248 uint16_t bpid;
1249 struct rte_eth_dev_data *eth_data = dpaa2_q->eth_data;
1250 struct dpaa2_dev_priv *priv = eth_data->dev_private;
1251 uint32_t flags[MAX_TX_RING_SLOTS] = {0};
1252 struct sw_buf_free buf_to_free[DPAA2_MAX_SGS * dpaa2_dqrr_size];
1253 uint32_t free_count = 0;
1254
1255 if (unlikely(!DPAA2_PER_LCORE_DPIO)) {
1256 ret = dpaa2_affine_qbman_swp();
1257 if (ret) {
1258 DPAA2_PMD_ERR(
1259 "Failed to allocate IO portal, tid: %d",
1260 rte_gettid());
1261 return 0;
1262 }
1263 }
1264 swp = DPAA2_PER_LCORE_PORTAL;
1265
1266 DPAA2_PMD_DP_DEBUG("===> eth_data =%p, fqid =%d\n",
1267 eth_data, dpaa2_q->fqid);
1268
1269#ifdef RTE_LIBRTE_IEEE1588
1270 /* IEEE1588 driver need pointer to tx confirmation queue
1271 * corresponding to last packet transmitted for reading
1272 * the timestamp
1273 */
1274 if ((*bufs)->ol_flags & RTE_MBUF_F_TX_IEEE1588_TMST) {
1275 priv->next_tx_conf_queue = dpaa2_q->tx_conf_queue;
1276 dpaa2_dev_tx_conf(dpaa2_q->tx_conf_queue);
1277 priv->tx_timestamp = 0;
1278 }
1279#endif
1280
1281 /*Prepare enqueue descriptor*/
1282 qbman_eq_desc_clear(&eqdesc);
1283 qbman_eq_desc_set_no_orp(&eqdesc, DPAA2_EQ_RESP_ERR_FQ);
1284 qbman_eq_desc_set_fq(&eqdesc, dpaa2_q->fqid);
1285
1286 /*Clear the unused FD fields before sending*/
1287 while (nb_pkts) {
1288 /*Check if the queue is congested*/
1289 retry_count = 0;
1290 while (qbman_result_SCN_state(dpaa2_q->cscn)) {
1291 retry_count++;

Callers

nothing calls this directly

Calls 15

dpaa2_affine_qbman_swpFunction · 0.85
rte_gettidFunction · 0.85
dpaa2_dev_tx_confFunction · 0.85
qbman_eq_desc_clearFunction · 0.85
qbman_eq_desc_set_no_orpFunction · 0.85
qbman_eq_desc_set_fqFunction · 0.85
qbman_result_SCN_stateFunction · 0.85
rte_mbuf_refcnt_readFunction · 0.85
rte_vlan_insertFunction · 0.85
rte_mempool_from_objFunction · 0.85
enable_tx_tstampFunction · 0.85

Tested by

no test coverage detected