X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fbnxt%2Fbnxt_rxq.h;h=0331c2381001065952627adb0cffb67f47d543ab;hb=06d1a5d056b30dd18b1e4abc98c19cde57a8016c;hp=be945c535ba9550cbee0a75eb84c77469fb5fcfc;hpb=cec43bbf3805911eec0081681faa6dea6a06e7a9;p=dpdk.git diff --git a/drivers/net/bnxt/bnxt_rxq.h b/drivers/net/bnxt/bnxt_rxq.h index be945c535b..0331c23810 100644 --- a/drivers/net/bnxt/bnxt_rxq.h +++ b/drivers/net/bnxt/bnxt_rxq.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2014-2018 Broadcom + * Copyright(c) 2014-2021 Broadcom * All rights reserved. */ @@ -7,33 +7,30 @@ #define _BNXT_RQX_H_ /* Maximum receive burst supported in vector mode. */ -#define RTE_BNXT_MAX_RX_BURST 32U +#define RTE_BNXT_MAX_RX_BURST 64U + +/* Drop by default when receive desc is not available. */ +#define BNXT_DEFAULT_RX_DROP_EN 1 struct bnxt; struct bnxt_rx_ring_info; struct bnxt_cp_ring_info; struct bnxt_rx_queue { - rte_spinlock_t lock; /* Synchronize between rx_queue_stop - * and fast path - */ struct rte_mempool *mb_pool; /* mbuf pool for RX ring */ - struct rte_mbuf *pkt_first_seg; /* 1st seg of pkt */ - struct rte_mbuf *pkt_last_seg; /* Last seg of pkt */ uint64_t mbuf_initializer; /* val to init mbuf */ uint16_t nb_rx_desc; /* num of RX desc */ - uint16_t rx_tail; /* cur val of RDT register */ - uint16_t nb_rx_hold; /* num held free RX desc */ uint16_t rx_free_thresh; /* max free RX desc to hold */ uint16_t queue_id; /* RX queue index */ #if defined(RTE_ARCH_X86) || defined(RTE_ARCH_ARM64) uint16_t rxrearm_nb; /* number of descs to reinit. */ uint16_t rxrearm_start; /* next desc index to reinit. */ #endif - uint16_t reg_idx; /* RX queue register index */ uint16_t port_id; /* Device port identifier */ uint8_t crc_len; /* 0 if CRC stripped, 4 otherwise */ uint8_t rx_deferred_start; /* not in global dev start */ uint8_t rx_started; /* RX queue is started */ + uint8_t drop_en; /* Drop when rx desc not available. */ + uint8_t in_reset; /* Rx ring is scheduled for reset */ struct bnxt *bp; int index; @@ -42,13 +39,14 @@ struct bnxt_rx_queue { uint32_t rx_buf_size; struct bnxt_rx_ring_info *rx_ring; struct bnxt_cp_ring_info *cp_ring; + struct rte_mbuf fake_mbuf; rte_atomic64_t rx_mbuf_alloc_fail; const struct rte_memzone *mz; }; void bnxt_free_rxq_stats(struct bnxt_rx_queue *rxq); int bnxt_mq_rx_configure(struct bnxt *bp); -void bnxt_rx_queue_release_op(void *rx_queue); +void bnxt_rx_queue_release_op(struct rte_eth_dev *dev, uint16_t queue_idx); int bnxt_rx_queue_setup_op(struct rte_eth_dev *eth_dev, uint16_t queue_idx, uint16_t nb_desc, @@ -65,4 +63,6 @@ int bnxt_rx_queue_start(struct rte_eth_dev *dev, int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id); void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue *rxq); +int bnxt_need_agg_ring(struct rte_eth_dev *eth_dev); +void bnxt_free_rxq_mem(struct bnxt_rx_queue *rxq); #endif