Imported Upstream version 16.07-rc1
[deb_dpdk.git] / drivers / net / bnxt / bnxt_rxr.h
similarity index 65%
rename from app/test-pmd/mempool_osdep.h
rename to drivers/net/bnxt/bnxt_rxr.h
index 6b8df68..f766b26 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ *   Copyright(c) Broadcom Limited.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
  *       notice, this list of conditions and the following disclaimer in
  *       the documentation and/or other materials provided with the
  *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
+ *     * Neither the name of Broadcom Corporation nor the names of its
  *       contributors may be used to endorse or promote products derived
  *       from this software without specific prior written permission.
  *
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef _MEMPOOL_OSDEP_H_
-#define _MEMPOOL_OSDEP_H_
+#ifndef _BNXT_RXR_H_
+#define _BNXT_RXR_H_
 
-#include <rte_mempool.h>
+#define B_RX_DB(db, prod)                                              \
+               (*(uint32_t *)db = (DB_KEY_RX | prod))
 
-/**
- * @file
- * mempool OS specific header.
- */
+struct bnxt_sw_rx_bd {
+       struct rte_mbuf         *mbuf; /* data associated with RX descriptor */
+};
 
-/*
- * Create mempool over objects from mmap(..., MAP_ANONYMOUS, ...).
- */
-struct rte_mempool *
-mempool_anon_create(const char *name, unsigned n, unsigned elt_size,
-       unsigned cache_size, unsigned private_data_size,
-       rte_mempool_ctor_t *mp_init, void *mp_init_arg,
-       rte_mempool_obj_ctor_t *obj_init, void *obj_init_arg,
-       int socket_id, unsigned flags);
-
-#endif /*_RTE_MEMPOOL_OSDEP_H_ */
+struct bnxt_rx_ring_info {
+       uint16_t                rx_prod;
+       void                    *rx_doorbell;
+
+       struct rx_prod_pkt_bd   *rx_desc_ring;
+       struct bnxt_sw_rx_bd    *rx_buf_ring; /* sw ring */
+
+       phys_addr_t             rx_desc_mapping;
+
+       struct bnxt_ring        *rx_ring_struct;
+};
+
+uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
+                              uint16_t nb_pkts);
+void bnxt_free_rx_rings(struct bnxt *bp);
+int bnxt_init_rx_ring_struct(struct bnxt_rx_queue *rxq, unsigned int socket_id);
+int bnxt_init_one_rx_ring(struct bnxt_rx_queue *rxq);
+
+#endif