/* SPDX-License-Identifier: BSD-3-Clause
*
- * Copyright (c) 2007-2018 Solarflare Communications Inc.
- * All rights reserved.
+ * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2007-2019 Solarflare Communications Inc.
*/
#include "efx.h"
enp->en_mod_flags &= ~EFX_MOD_TX;
}
+ __checkReturn size_t
+efx_txq_size(
+ __in const efx_nic_t *enp,
+ __in unsigned int ndescs)
+{
+ const efx_nic_cfg_t *encp = efx_nic_cfg_get(enp);
+
+ return (ndescs * encp->enc_tx_desc_size);
+}
+
+ __checkReturn unsigned int
+efx_txq_nbufs(
+ __in const efx_nic_t *enp,
+ __in unsigned int ndescs)
+{
+ return (EFX_DIV_ROUND_UP(efx_txq_size(enp, ndescs), EFX_BUF_SIZE));
+}
+
__checkReturn efx_rc_t
efx_tx_qcreate(
__in efx_nic_t *enp,
* Fragments must not span 4k boundaries.
* Here it is a stricter requirement than the maximum length.
*/
- EFSYS_ASSERT(P2ROUNDUP(start + 1,
+ EFSYS_ASSERT(EFX_P2ROUNDUP(efsys_dma_addr_t, start + 1,
etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= end);
EFX_TX_DESC(etp, start, size, ebp->eb_eop, added);
* Fragments must not span 4k boundaries.
* Here it is a stricter requirement than the maximum length.
*/
- EFSYS_ASSERT(P2ROUNDUP(addr + 1,
+ EFSYS_ASSERT(EFX_P2ROUNDUP(efsys_dma_addr_t, addr + 1,
etp->et_enp->en_nic_cfg.enc_tx_dma_desc_boundary) >= addr + size);
EFSYS_PROBE4(tx_desc_dma_create, unsigned int, etp->et_index,