4 * Copyright (c) 2015-2017 Atomic Rules LLC
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
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
17 * * Neither the name of copyright holder 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.
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.
34 #ifndef _ARK_GLOBAL_H_
35 #define _ARK_GLOBAL_H_
41 #include <rte_ethdev.h>
42 #include <rte_malloc.h>
43 #include <rte_memcpy.h>
44 #include <rte_string_fns.h>
45 #include <rte_cycles.h>
46 #include <rte_kvargs.h>
48 #include <rte_version.h>
50 #define ETH_ARK_ARG_MAXLEN 64
51 #define ARK_SYSCTRL_BASE 0x0
52 #define ARK_PKTGEN_BASE 0x10000
53 #define ARK_MPU_RX_BASE 0x20000
54 #define ARK_UDM_BASE 0x30000
55 #define ARK_MPU_TX_BASE 0x40000
56 #define ARK_DDM_BASE 0x60000
57 #define ARK_CMAC_BASE 0x80000
58 #define ARK_PKTDIR_BASE 0xa0000
59 #define ARK_PKTCHKR_BASE 0x90000
60 #define ARK_RCPACING_BASE 0xb0000
61 #define ARK_EXTERNAL_BASE 0x100000
62 #define ARK_MPU_QOFFSET 0x00100
63 #define ARK_MAX_PORTS 8
66 #define offset16(n) ((n) / 2)
67 #define offset32(n) ((n) / 4)
68 #define offset64(n) ((n) / 8)
70 /* Maximum length of arg list in bytes */
71 #define ARK_MAX_ARG_LEN 256
74 * Structure to store private data for each PF/VF instance.
76 #define def_ptr(type, name) \
86 /* User extension private data */
91 /* Packet generator/checker args */
92 char pkt_gen_args[ARK_MAX_ARG_LEN];
93 char pkt_chkr_args[ARK_MAX_ARG_LEN];
97 struct rte_eth_dev *eth_dev;
104 /* Application Bar */
108 typedef uint32_t *ark_t;