net/dpaa: support Tx and Rx queue setup
[dpdk.git] / drivers / net / dpaa / dpaa_rxtx.h
1 /*-
2  *   BSD LICENSE
3  *
4  *   Copyright 2016 Freescale Semiconductor, Inc. All rights reserved.
5  *   Copyright 2017 NXP.
6  *
7  *   Redistribution and use in source and binary forms, with or without
8  *   modification, are permitted provided that the following conditions
9  *   are met:
10  *
11  *     * Redistributions of source code must retain the above copyright
12  *       notice, this list of conditions and the following disclaimer.
13  *     * Redistributions in binary form must reproduce the above copyright
14  *       notice, this list of conditions and the following disclaimer in
15  *       the documentation and/or other materials provided with the
16  *       distribution.
17  *     * Neither the name of  Freescale Semiconductor, Inc nor the names of its
18  *       contributors may be used to endorse or promote products derived
19  *       from this software without specific prior written permission.
20  *
21  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #ifndef __DPDK_RXTX_H__
35 #define __DPDK_RXTX_H__
36
37 /* internal offset from where IC is copied to packet buffer*/
38 #define DEFAULT_ICIOF          32
39 /* IC transfer size */
40 #define DEFAULT_ICSZ    48
41
42 /* IC offsets from buffer header address */
43 #define DEFAULT_RX_ICEOF        16
44
45 #define DPAA_MAX_DEQUEUE_NUM_FRAMES    63
46         /** <Maximum number of frames to be dequeued in a single rx call*/
47 /* FD structure masks and offset */
48 #define DPAA_FD_FORMAT_MASK 0xE0000000
49 #define DPAA_FD_OFFSET_MASK 0x1FF00000
50 #define DPAA_FD_LENGTH_MASK 0xFFFFF
51 #define DPAA_FD_FORMAT_SHIFT 29
52 #define DPAA_FD_OFFSET_SHIFT 20
53
54 uint16_t dpaa_eth_queue_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs);
55
56 uint16_t dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs);
57
58 uint16_t dpaa_eth_tx_drop_all(void *q  __rte_unused,
59                               struct rte_mbuf **bufs __rte_unused,
60                               uint16_t nb_bufs __rte_unused);
61 #endif