iPXE
mlx_nodnic_data_structures.h
Go to the documentation of this file.
1 #ifndef NODNIC_NODNICDATASTRUCTURES_H_
2 #define NODNIC_NODNICDATASTRUCTURES_H_
3 
4 /*
5  * Copyright (C) 2015 Mellanox Technologies Ltd.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of the
10  * License, or any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20  * 02110-1301, USA.
21  */
22 
23 FILE_LICENCE ( GPL2_OR_LATER );
24 
25 #include "../../mlx_utils/include/public/mlx_utils.h"
26 
27 /* todo: fix coding convention */
28 #define NODNIC_MEMORY_ALIGN 0x1000
29 
30 #define NODNIC_MAX_MAC_FILTERS 5
31 #define NODNIC_MAX_MGID_FILTERS 4
32 
36 typedef struct _nodnic_qp nodnic_qp;
37 typedef struct _nodnic_cq nodnic_cq;
38 typedef struct _nodnic_eq nodnic_eq;
39 typedef struct _nodnic_qp_db nodnic_qp_db;
41 
42 /* NODNIC Port states
43  * Bit 0 - port open/close
44  * Bit 1 - port is [not] in disabling DMA
45  * 0 - closed and not disabling DMA
46  * 1 - opened and not disabling DMA
47  * 3 - opened and disabling DMA
48  */
49 #define NODNIC_PORT_OPENED 0b00000001
50 #define NODNIC_PORT_DISABLING_DMA 0b00000010
51 
52 typedef enum {
53  ConnectX3 = 0,
56 
57 
58 typedef enum {
65 typedef enum {
70 
71 
72 #define RECV_WQE_SIZE 16
73 #define NODNIC_WQBB_SIZE 64
74 /** A nodnic send wqbb */
77 };
78 
83 };
84 struct nodnic_ring {
86  /** Work queue entries */
87  /* TODO: add to memory entity */
90  /** Size of work queue */
92  /** Next work queue entry index
93  *
94  * This is the index of the next entry to be filled (i.e. the
95  * first empty entry). This value is not bounded by num_wqes;
96  * users must logical-AND with (num_wqes-1) to generate an
97  * array index.
98  */
104 };
105 
109 };
110 
111 
114  void *wqe_virt;
115 };
116 struct _nodnic_qp{
120 };
121 
122 struct _nodnic_cq{
123  /** cq entries */
127  /** cq */
130 };
131 
132 struct _nodnic_eq{
137 };
144  mlx_boolean num_ports; // 0 - single port, 1 - dual port
146 #ifdef DEVICE_CX3
147  mlx_uint8 crspace_doorbells;
148 #endif
153 };
154 
155 #ifdef DEVICE_CX3
156 /* This is the structure of the data in the scratchpad
157  * Read/Write data from/to its field using PCI accesses only */
158 typedef struct _nodnic_port_data_flow_gw nodnic_port_data_flow_gw;
159 struct _nodnic_port_data_flow_gw {
160  mlx_uint32 send_doorbell;
161  mlx_uint32 recv_doorbell;
163  mlx_uint32 armcq_cq_ci_dword;
164  mlx_uint32 dma_en;
165 } __attribute__ ((packed));
166 #endif
167 
168 typedef struct _nodnic_uar_priv{
171  void *virt;
172  unsigned long phys;
173 } nodnic_uar;
174 
178 
179  //nodnic structure offset in init segment
181 
183 
190 #ifdef DEVICE_CX3
191  mlx_void *crspace_clear_int;
192 #endif
194 };
195 
208  IN nodnic_port_priv *port_priv,
209  IN struct nodnic_ring *ring,
212  IN nodnic_port_priv *port_priv,
213  IN struct nodnic_ring *ring,
216  IN nodnic_port_priv *port_priv,
218 #ifdef DEVICE_CX3
219  nodnic_port_data_flow_gw *data_flow_gw;
220 #endif
221 };
222 
226 } __attribute ( ( packed ) );
227 
230 } __attribute ( ( packed ) );
231 #endif /* STUB_NODNIC_NODNICDATASTRUCTURES_H_ */
uint8_t mlx_boolean
#define __attribute__(x)
Definition: compiler.h:10
mlx_status(* send_doorbell)(IN nodnic_port_priv *port_priv, IN struct nodnic_ring *ring, IN mlx_uint16 index)
struct nodnic_doorbell arm_cq_doorbell
struct nodnic_send_ring send
struct _nodnic_qp_db __attribute((packed))
nodnic_device_priv * device
nodnic_qp_db * qp_doorbell_record
mlx_status(* set_dma)(IN nodnic_port_priv *port_priv, IN mlx_boolean value)
mlx_void * cq_virt
cq entries
struct nodnic_send_wqbb * wqe_virt
mlx_physical_address wqe_physical
Work queue entries.
mlx_physical_address doorbell_physical
pseudo_bit_t reserved2[0x00005]
Definition: arbel.h:24
mlx_uint32 num_wqes
Next work queue entry index.
uint32_t mlx_uint32
mlx_physical_address eq_physical
mlx_mac_address mac_filters[5]
nodnic_hardware_format hardware_format
nodnic_device_capabilites device_cap
struct _nodnic_uar_priv nodnic_uar
struct nodnic_doorbell recv_doorbell
mlx_uint8 force_align[NODNIC_WQBB_SIZE]
pseudo_bit_t value[0x00020]
Definition: arbel.h:13
nodnic_queue_pair_type type
struct nodnic_recv_ring receive
size_t mlx_size
mlx_status(* recv_doorbell)(IN nodnic_port_priv *port_priv, IN struct nodnic_ring *ring, IN mlx_uint16 index)
struct nodnic_doorbell send_doorbell
uint16_t mlx_uint16
void mlx_void
#define IN
Definition: mlx_utils.h:28
FILE_LICENCE(GPL2_OR_LATER)
#define NODNIC_WQBB_SIZE
uint8_t mlx_uint8
mlx_physical_address cq_physical
int mlx_status
uint64_t mlx_uint64
uint64_t index
Index of the first segment within the content.
Definition: pccrc.h:21
nodnic_arm_cq_db * arm_cq_doorbell_record
unsigned long int dword
Definition: smc9000.h:40
unsigned long mlx_physical_address
mlx_size wq_size
Size of work queue.