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

Function mlx5_txpp_stop

dpdk/drivers/net/mlx5/mlx5_txpp.c:927–947  ·  view source on GitHub ↗

* Stops and destroys packet pacing infrastructure on specified device. * * @param dev * Pointer to Ethernet device structure. * * @return * 0 on success, a negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

925 * 0 on success, a negative errno value otherwise and rte_errno is set.
926 */
927void
928mlx5_txpp_stop(struct rte_eth_dev *dev)
929{
930 struct mlx5_priv *priv = dev->data->dev_private;
931 struct mlx5_dev_ctx_shared *sh = priv->sh;
932
933 if (!priv->txpp_en) {
934 /* Packet pacing is already disabled for the device. */
935 return;
936 }
937 priv->txpp_en = 0;
938 claim_zero(pthread_mutex_lock(&sh->txpp.mutex));
939 MLX5_ASSERT(sh->txpp.refcnt);
940 if (!sh->txpp.refcnt || --sh->txpp.refcnt) {
941 claim_zero(pthread_mutex_unlock(&sh->txpp.mutex));
942 return;
943 }
944 /* No references any more, do actual destroy. */
945 mlx5_txpp_destroy(sh);
946 claim_zero(pthread_mutex_unlock(&sh->txpp.mutex));
947}
948
949/*
950 * Read the current clock counter of an Ethernet device

Callers 2

mlx5_trigger.cFile · 0.85
mlx5_dev_stopFunction · 0.85

Calls 3

pthread_mutex_lockFunction · 0.85
pthread_mutex_unlockFunction · 0.85
mlx5_txpp_destroyFunction · 0.85

Tested by

no test coverage detected