X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5_txq.c;h=f128c3d1a5b8a65f74cf0adcffcf375e91a8fa18;hb=fe3620aabacd504a2b6c807bd0abe18cc1a2da12;hp=3373ee66b4890e3f28433fa51989576edff80863;hpb=a13ec19c199377cd8e55ad44191e9be0ac11a9ed;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 3373ee66b4..f128c3d1a5 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -100,7 +100,7 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev) struct mlx5_priv *priv = dev->data->dev_private; uint64_t offloads = (RTE_ETH_TX_OFFLOAD_MULTI_SEGS | RTE_ETH_TX_OFFLOAD_VLAN_INSERT); - struct mlx5_dev_config *config = &priv->config; + struct mlx5_port_config *config = &priv->config; struct mlx5_dev_cap *dev_cap = &priv->sh->dev_cap; if (dev_cap->hw_csum) @@ -109,7 +109,8 @@ mlx5_get_tx_port_offloads(struct rte_eth_dev *dev) RTE_ETH_TX_OFFLOAD_TCP_CKSUM); if (dev_cap->tso) offloads |= RTE_ETH_TX_OFFLOAD_TCP_TSO; - if (priv->sh->config.tx_pp) + if (priv->sh->config.tx_pp || + priv->sh->cdev->config.hca_attr.wait_on_time) offloads |= RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP; if (dev_cap->swp) { if (dev_cap->swp & MLX5_SW_PARSING_CSUM_CAP) @@ -741,7 +742,7 @@ static void txq_set_params(struct mlx5_txq_ctrl *txq_ctrl) { struct mlx5_priv *priv = txq_ctrl->priv; - struct mlx5_dev_config *config = &priv->config; + struct mlx5_port_config *config = &priv->config; struct mlx5_dev_cap *dev_cap = &priv->sh->dev_cap; unsigned int inlen_send; /* Inline data for ordinary SEND.*/ unsigned int inlen_empw; /* Inline data for enhanced MPW. */ @@ -960,7 +961,7 @@ static int txq_adjust_params(struct mlx5_txq_ctrl *txq_ctrl) { struct mlx5_priv *priv = txq_ctrl->priv; - struct mlx5_dev_config *config = &priv->config; + struct mlx5_port_config *config = &priv->config; unsigned int max_inline; max_inline = txq_calc_inline_max(txq_ctrl); @@ -1288,12 +1289,21 @@ mlx5_txq_dynf_timestamp_set(struct rte_eth_dev *dev) int off, nbit; unsigned int i; uint64_t mask = 0; + uint64_t ts_mask; + if (sh->dev_cap.rt_timestamp || + !sh->cdev->config.hca_attr.dev_freq_khz) + ts_mask = MLX5_TS_MASK_SECS << 32; + else + ts_mask = rte_align64pow2(MLX5_TS_MASK_SECS * 1000ull * + sh->cdev->config.hca_attr.dev_freq_khz); + ts_mask = rte_cpu_to_be_64(ts_mask - 1ull); nbit = rte_mbuf_dynflag_lookup (RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, NULL); off = rte_mbuf_dynfield_lookup (RTE_MBUF_DYNFIELD_TIMESTAMP_NAME, NULL); - if (nbit >= 0 && off >= 0 && sh->txpp.refcnt) + if (nbit >= 0 && off >= 0 && + (sh->txpp.refcnt || priv->sh->cdev->config.hca_attr.wait_on_time)) mask = 1ULL << nbit; for (i = 0; i != priv->txqs_n; ++i) { data = (*priv->txqs)[i]; @@ -1302,5 +1312,9 @@ mlx5_txq_dynf_timestamp_set(struct rte_eth_dev *dev) data->sh = sh; data->ts_mask = mask; data->ts_offset = off; + data->rt_timestamp = sh->dev_cap.rt_timestamp; + data->rt_timemask = (data->offloads & + RTE_ETH_TX_OFFLOAD_SEND_ON_TIMESTAMP) ? + ts_mask : 0; } }