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

Function mrvl_flush_bpool

dpdk/drivers/net/mvpp2/mrvl_ethdev.c:1040–1071  ·  view source on GitHub ↗

* Flush hardware bpool (buffer-pool). * * @param dev * Pointer to Ethernet device structure. */

Source from the content-addressed store, hash-verified

1038 * Pointer to Ethernet device structure.
1039 */
1040static void
1041mrvl_flush_bpool(struct rte_eth_dev *dev)
1042{
1043 struct mrvl_priv *priv = dev->data->dev_private;
1044 struct pp2_hif *hif;
1045 uint32_t num;
1046 int ret;
1047 unsigned int core_id = rte_lcore_id();
1048
1049 if (core_id == LCORE_ID_ANY)
1050 core_id = rte_get_main_lcore();
1051
1052 hif = mrvl_get_hif(priv, core_id);
1053
1054 ret = pp2_bpool_get_num_buffs(priv->bpool, &num);
1055 if (ret) {
1056 MRVL_LOG(ERR, "Failed to get bpool buffers number");
1057 return;
1058 }
1059
1060 while (num--) {
1061 struct pp2_buff_inf inf;
1062 uint64_t addr;
1063
1064 ret = pp2_bpool_get_buff(hif, priv->bpool, &inf);
1065 if (ret)
1066 break;
1067
1068 addr = cookie_addr_high | inf.cookie;
1069 rte_pktmbuf_free((struct rte_mbuf *)addr);
1070 }
1071}
1072
1073/**
1074 * DPDK callback to stop the device.

Callers 1

mrvl_dev_closeFunction · 0.85

Calls 4

rte_lcore_idFunction · 0.85
rte_get_main_lcoreFunction · 0.85
mrvl_get_hifFunction · 0.85
rte_pktmbuf_freeFunction · 0.85

Tested by

no test coverage detected