New upstream version 18.02
[deb_dpdk.git] / drivers / net / vmxnet3 / vmxnet3_ring.h
index b50d2b0..552180e 100644 (file)
@@ -1,34 +1,5 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
- *   All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       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
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2010-2014 Intel Corporation
  */
 
 #ifndef _VMXNET3_RING_H_
@@ -42,6 +13,9 @@
 #define VMXNET3_DEF_TX_RING_SIZE 512
 #define VMXNET3_DEF_RX_RING_SIZE 128
 
+/* Default rx data ring desc size */
+#define VMXNET3_DEF_RXDATA_DESC_SIZE 128
+
 #define VMXNET3_SUCCESS 0
 #define VMXNET3_FAIL   -1
 
@@ -138,9 +112,11 @@ typedef struct vmxnet3_tx_queue {
        uint32_t                     qid;
        struct Vmxnet3_TxQueueDesc   *shared;
        struct vmxnet3_txq_stats     stats;
+       const struct rte_memzone     *mz;
        bool                         stopped;
        uint16_t                     queue_id;      /**< Device TX queue index. */
-       uint8_t                      port_id;       /**< Device port identifier. */
+       uint16_t                     port_id;       /**< Device port identifier. */
+       uint16_t                     txdata_desc_size;
 } vmxnet3_tx_queue_t;
 
 struct vmxnet3_rxq_stats {
@@ -150,20 +126,31 @@ struct vmxnet3_rxq_stats {
        uint64_t                     rx_buf_alloc_failure;
 };
 
+struct vmxnet3_rx_data_ring {
+       uint8_t  *base;
+       uint64_t basePA;
+       uint32_t size;
+};
+
 typedef struct vmxnet3_rx_queue {
        struct rte_mempool          *mp;
        struct vmxnet3_hw           *hw;
        struct vmxnet3_cmd_ring     cmd_ring[VMXNET3_RX_CMDRING_SIZE];
        struct vmxnet3_comp_ring    comp_ring;
+       struct vmxnet3_rx_data_ring data_ring;
+       uint16_t                    data_desc_size;
        uint32_t                    qid1;
        uint32_t                    qid2;
+       /* rqID in RCD for buffer from data ring */
+       uint32_t                    data_ring_qid;
        Vmxnet3_RxQueueDesc         *shared;
        struct rte_mbuf             *start_seg;
        struct rte_mbuf             *last_seg;
        struct vmxnet3_rxq_stats    stats;
+       const struct rte_memzone    *mz;
        bool                        stopped;
        uint16_t                    queue_id;      /**< Device RX queue index. */
-       uint8_t                     port_id;       /**< Device port identifier. */
+       uint16_t                    port_id;       /**< Device port identifier. */
 } vmxnet3_rx_queue_t;
 
 #endif /* _VMXNET3_RING_H_ */