1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2019 Intel Corporation
5 #ifndef _IPN3KE_ETHDEV_H_
6 #define _IPN3KE_ETHDEV_H_
13 #include <netinet/in.h>
14 #include <sys/queue.h>
17 #include <rte_flow_driver.h>
18 #include <rte_ethdev_driver.h>
19 #include <rte_ethdev_vdev.h>
20 #include <rte_malloc.h>
21 #include <rte_memcpy.h>
22 #include <rte_bus_vdev.h>
23 #include <rte_kvargs.h>
24 #include <rte_spinlock.h>
26 #include <rte_cycles.h>
27 #include <rte_bus_ifpga.h>
28 #include <rte_tm_driver.h>
30 #define IPN3KE_TM_SCRATCH_RW 0
33 enum ipn3ke_tm_node_level {
34 IPN3KE_TM_NODE_LEVEL_PORT,
35 IPN3KE_TM_NODE_LEVEL_VT,
36 IPN3KE_TM_NODE_LEVEL_COS,
37 IPN3KE_TM_NODE_LEVEL_MAX,
40 /* TM Shaper Profile */
41 struct ipn3ke_tm_shaper_profile {
46 struct rte_tm_shaper_params params;
49 TAILQ_HEAD(ipn3ke_tm_shaper_profile_list, ipn3ke_tm_shaper_profile);
52 #define IPN3KE_TDROP_TH1_MASK 0x1ffffff
53 #define IPN3KE_TDROP_TH1_SHIFT (25)
54 #define IPN3KE_TDROP_TH2_MASK 0x1ffffff
56 /* TM TDROP Profile */
57 struct ipn3ke_tm_tdrop_profile {
58 uint32_t tdrop_profile_id;
63 struct rte_tm_wred_params params;
66 /* TM node priority */
67 enum ipn3ke_tm_node_state {
68 IPN3KE_TM_NODE_STATE_IDLE = 0,
69 IPN3KE_TM_NODE_STATE_CONFIGURED_ADD,
70 IPN3KE_TM_NODE_STATE_CONFIGURED_DEL,
71 IPN3KE_TM_NODE_STATE_COMMITTED,
72 IPN3KE_TM_NODE_STATE_MAX,
75 TAILQ_HEAD(ipn3ke_tm_node_list, ipn3ke_tm_node);
78 struct ipn3ke_tm_node {
79 TAILQ_ENTRY(ipn3ke_tm_node) node;
83 enum ipn3ke_tm_node_state node_state;
84 uint32_t parent_node_id;
87 struct ipn3ke_tm_node *parent_node;
88 struct ipn3ke_tm_shaper_profile shaper_profile;
89 struct ipn3ke_tm_tdrop_profile *tdrop_profile;
90 struct rte_tm_node_params params;
91 struct rte_tm_node_stats stats;
93 struct ipn3ke_tm_node_list children_node_list;
96 /* IPN3KE TM Hierarchy Specification */
97 struct ipn3ke_tm_hierarchy {
98 struct ipn3ke_tm_node *port_node;
99 /*struct ipn3ke_tm_node_list vt_node_list;*/
100 /*struct ipn3ke_tm_node_list cos_node_list;*/
102 uint32_t n_shaper_profiles;
103 /*uint32_t n_shared_shapers;*/
104 uint32_t n_tdrop_profiles;
106 uint32_t n_cos_nodes;
108 struct ipn3ke_tm_node *port_commit_node;
109 struct ipn3ke_tm_node_list vt_commit_node_list;
110 struct ipn3ke_tm_node_list cos_commit_node_list;
112 /*uint32_t n_tm_nodes[IPN3KE_TM_NODE_LEVEL_MAX];*/
115 struct ipn3ke_tm_internals {
116 /** Hierarchy specification
118 * -Hierarchy is unfrozen at init and when port is stopped.
119 * -Hierarchy is frozen on successful hierarchy commit.
120 * -Run-time hierarchy changes are not allowed, therefore it makes
121 * sense to keep the hierarchy frozen after the port is started.
123 struct ipn3ke_tm_hierarchy h;
124 int hierarchy_frozen;
129 #define IPN3KE_TM_COS_NODE_NUM (64 * 1024)
130 #define IPN3KE_TM_VT_NODE_NUM (IPN3KE_TM_COS_NODE_NUM / 8)
131 #define IPN3KE_TM_10G_PORT_NODE_NUM (8)
132 #define IPN3KE_TM_25G_PORT_NODE_NUM (4)
134 #define IPN3KE_TM_NODE_LEVEL_MOD (100000)
135 #define IPN3KE_TM_NODE_MOUNT_MAX (8)
137 #define IPN3KE_TM_TDROP_PROFILE_NUM (2 * 1024)
139 /* TM node priority */
140 enum ipn3ke_tm_node_priority {
141 IPN3KE_TM_NODE_PRIORITY_NORMAL0 = 0,
142 IPN3KE_TM_NODE_PRIORITY_LOW,
143 IPN3KE_TM_NODE_PRIORITY_NORMAL1,
144 IPN3KE_TM_NODE_PRIORITY_HIGHEST,
147 #define IPN3KE_TM_NODE_WEIGHT_MAX UINT8_MAX
149 /** Set a bit in the uint32 variable */
150 #define IPN3KE_BIT_SET(var, pos) \
151 ((var) |= ((uint32_t)1 << ((pos))))
153 /** Reset the bit in the variable */
154 #define IPN3KE_BIT_RESET(var, pos) \
155 ((var) &= ~((uint32_t)1 << ((pos))))
157 /** Check the bit is set in the variable */
158 #define IPN3KE_BIT_ISSET(var, pos) \
159 (((var) & ((uint32_t)1 << ((pos)))) ? 1 : 0)
163 #define IPN3KE_HW_BASE 0x4000000
165 #define IPN3KE_CAPABILITY_REGISTERS_BLOCK_OFFSET \
166 (IPN3KE_HW_BASE + hw->hw_cap.capability_registers_block_offset)
168 #define IPN3KE_STATUS_REGISTERS_BLOCK_OFFSET \
169 (IPN3KE_HW_BASE + hw->hw_cap.status_registers_block_offset)
171 #define IPN3KE_CTRL_RESET \
172 (IPN3KE_HW_BASE + hw->hw_cap.control_registers_block_offset)
174 #define IPN3KE_CTRL_MTU \
175 (IPN3KE_HW_BASE + hw->hw_cap.control_registers_block_offset + 4)
177 #define IPN3KE_CLASSIFY_OFFSET \
178 (IPN3KE_HW_BASE + hw->hw_cap.classify_offset)
180 #define IPN3KE_POLICER_OFFSET \
181 (IPN3KE_HW_BASE + hw->hw_cap.policer_offset)
183 #define IPN3KE_RSS_KEY_ARRAY_OFFSET \
184 (IPN3KE_HW_BASE + hw->hw_cap.rss_key_array_offset)
186 #define IPN3KE_RSS_INDIRECTION_TABLE_ARRAY_OFFSET \
187 (IPN3KE_HW_BASE + hw->hw_cap.rss_indirection_table_array_offset)
189 #define IPN3KE_DMAC_MAP_OFFSET \
190 (IPN3KE_HW_BASE + hw->hw_cap.dmac_map_offset)
192 #define IPN3KE_QM_OFFSET \
193 (IPN3KE_HW_BASE + hw->hw_cap.qm_offset)
195 #define IPN3KE_CCB_OFFSET \
196 (IPN3KE_HW_BASE + hw->hw_cap.ccb_offset)
198 #define IPN3KE_QOS_OFFSET \
199 (IPN3KE_HW_BASE + hw->hw_cap.qos_offset)
201 struct ipn3ke_hw_cap {
202 uint32_t version_number;
203 uint32_t capability_registers_block_offset;
204 uint32_t status_registers_block_offset;
205 uint32_t control_registers_block_offset;
206 uint32_t classify_offset;
207 uint32_t classy_size;
208 uint32_t policer_offset;
209 uint32_t policer_entry_size;
210 uint32_t rss_key_array_offset;
211 uint32_t rss_key_entry_size;
212 uint32_t rss_indirection_table_array_offset;
213 uint32_t rss_indirection_table_entry_size;
214 uint32_t dmac_map_offset;
215 uint32_t dmac_map_size;
219 uint32_t ccb_entry_size;
223 uint32_t num_rx_flow; /* Default: 64K */
224 uint32_t num_rss_blocks; /* Default: 512 */
225 uint32_t num_dmac_map; /* Default: 1K */
226 uint32_t num_tx_flow; /* Default: 64K */
227 uint32_t num_smac_map; /* Default: 1K */
229 uint32_t link_speed_mbps;
233 * Strucute to store private data for each representor instance
236 TAILQ_ENTRY(ipn3ke_rpst) next; /**< Next in device list. */
237 uint16_t switch_domain_id;
240 struct rte_eth_dev *ethdev;
242 struct ipn3ke_hw *hw;
243 struct rte_eth_dev *i40e_pf_eth;
244 uint16_t i40e_pf_eth_port_id;
245 struct rte_eth_link ori_linfo;
246 struct ipn3ke_tm_internals tm;
247 /**< Private data store of assocaiated physical function */
248 struct rte_ether_addr mac_addr;
252 #define MAP_UUID_10G_LOW 0xffffffffffffffff
253 #define MAP_UUID_10G_HIGH 0xffffffffffffffff
254 #define IPN3KE_UUID_10G_LOW 0xc000c9660d824272
255 #define IPN3KE_UUID_10G_HIGH 0x9aeffe5f84570612
256 #define IPN3KE_UUID_VBNG_LOW 0x8991165349d23ff9
257 #define IPN3KE_UUID_VBNG_HIGH 0xb74cf419d15a481f
258 #define IPN3KE_UUID_25G_LOW 0xb7d9bac566bfbc80
259 #define IPN3KE_UUID_25G_HIGH 0xb07bac1aeef54d67
261 #define IPN3KE_AFU_BUF_SIZE_MIN 1024
262 #define IPN3KE_AFU_FRAME_SIZE_MAX 9728
264 #define IPN3KE_RAWDEV_ATTR_LEN_MAX (64)
266 typedef int (*ipn3ke_indirect_mac_read_t)(struct ipn3ke_hw *hw,
267 uint32_t *rd_data, uint32_t addr, uint32_t mac_num,
268 uint32_t eth_wrapper_sel);
270 typedef int (*ipn3ke_indirect_mac_write_t)(struct ipn3ke_hw *hw,
271 uint32_t wr_data, uint32_t addr, uint32_t mac_num,
272 uint32_t eth_wrapper_sel);
275 struct rte_eth_dev *eth_dev;
278 struct rte_afu_id afu_id;
279 struct rte_rawdev *rawdev;
281 struct ipn3ke_hw_cap hw_cap;
283 struct ifpga_rawdevg_retimer_info retimer;
285 uint16_t switch_domain_id;
288 uint32_t tm_hw_enable;
289 uint32_t flow_hw_enable;
294 struct ipn3ke_flow_list flow_list;
295 uint32_t flow_max_entries;
296 uint32_t flow_num_entries;
298 struct ipn3ke_tm_node *nodes;
299 struct ipn3ke_tm_node *port_nodes;
300 struct ipn3ke_tm_node *vt_nodes;
301 struct ipn3ke_tm_node *cos_nodes;
303 struct ipn3ke_tm_tdrop_profile *tdrop_profile;
304 uint32_t tdrop_profile_num;
307 uint32_t ccb_seg_free;
308 uint32_t ccb_seg_num;
311 uint8_t *eth_group_bar[2];
312 /**< MAC Register read */
313 ipn3ke_indirect_mac_read_t f_mac_read;
314 /**< MAC Register write */
315 ipn3ke_indirect_mac_write_t f_mac_write;
322 * Helper macro for drivers that need to convert to struct rte_afu_device.
324 #define RTE_DEV_TO_AFU(ptr) \
325 container_of(ptr, struct rte_afu_device, device)
327 #define RTE_DEV_TO_AFU_CONST(ptr) \
328 container_of(ptr, const struct rte_afu_device, device)
330 #define RTE_ETH_DEV_TO_AFU(eth_dev) \
331 RTE_DEV_TO_AFU((eth_dev)->device)
337 #define IPN3KE_PCI_REG(reg) rte_read32(reg)
338 #define IPN3KE_PCI_REG_ADDR(a, reg) \
339 ((volatile uint32_t *)((char *)(a)->hw_addr + (reg)))
340 static inline uint32_t ipn3ke_read_addr(volatile void *addr)
342 return rte_le_to_cpu_32(IPN3KE_PCI_REG(addr));
345 #define WCMD 0x8000000000000000
346 #define RCMD 0x4000000000000000
347 #define UPL_BASE 0x10000
348 static inline uint32_t _ipn3ke_indrct_read(struct ipn3ke_hw *hw,
351 uint64_t word_offset;
352 uint64_t read_data = 0;
353 uint64_t indirect_value;
354 volatile void *indirect_addrs;
356 word_offset = (addr & 0x1FFFFFF) >> 2;
357 indirect_value = RCMD | word_offset << 32;
358 indirect_addrs = hw->hw_addr + (uint32_t)(UPL_BASE | 0x10);
362 rte_write64((rte_cpu_to_le_64(indirect_value)), indirect_addrs);
364 indirect_addrs = hw->hw_addr + (uint32_t)(UPL_BASE | 0x18);
365 while ((read_data >> 32) != 1)
366 read_data = rte_read64(indirect_addrs);
368 return rte_le_to_cpu_32(read_data);
371 static inline void _ipn3ke_indrct_write(struct ipn3ke_hw *hw,
372 uint32_t addr, uint32_t value)
374 uint64_t word_offset;
375 uint64_t indirect_value;
376 volatile void *indirect_addrs = 0;
378 word_offset = (addr & 0x1FFFFFF) >> 2;
379 indirect_value = WCMD | word_offset << 32 | value;
380 indirect_addrs = hw->hw_addr + (uint32_t)(UPL_BASE | 0x10);
382 rte_write64((rte_cpu_to_le_64(indirect_value)), indirect_addrs);
386 #define IPN3KE_PCI_REG_WRITE(reg, value) \
387 rte_write32((rte_cpu_to_le_32(value)), reg)
389 #define IPN3KE_PCI_REG_WRITE_RELAXED(reg, value) \
390 rte_write32_relaxed((rte_cpu_to_le_32(value)), reg)
392 #define IPN3KE_READ_REG(hw, reg) \
393 _ipn3ke_indrct_read((hw), (reg))
395 #define IPN3KE_WRITE_REG(hw, reg, value) \
396 _ipn3ke_indrct_write((hw), (reg), (value))
398 #define IPN3KE_MASK_READ_REG(hw, reg, x, mask) \
399 ((mask) & IPN3KE_READ_REG((hw), ((reg) + (0x4 * (x)))))
401 #define IPN3KE_MASK_WRITE_REG(hw, reg, x, value, mask) \
402 IPN3KE_WRITE_REG((hw), ((reg) + (0x4 * (x))), ((mask) & (value)))
404 #define IPN3KE_DEV_PRIVATE_TO_HW(dev) \
405 (((struct ipn3ke_rpst *)(dev)->data->dev_private)->hw)
407 #define IPN3KE_DEV_PRIVATE_TO_RPST(dev) \
408 ((struct ipn3ke_rpst *)(dev)->data->dev_private)
410 #define IPN3KE_DEV_PRIVATE_TO_TM(dev) \
411 (&(((struct ipn3ke_rpst *)(dev)->data->dev_private)->tm))
413 /* Byte address of IPN3KE internal module */
414 #define IPN3KE_TM_VERSION (IPN3KE_QM_OFFSET + 0x0000)
415 #define IPN3KE_TM_SCRATCH (IPN3KE_QM_OFFSET + 0x0004)
416 #define IPN3KE_TM_STATUS (IPN3KE_QM_OFFSET + 0x0008)
417 #define IPN3KE_TM_MISC_STATUS (IPN3KE_QM_OFFSET + 0x0010)
418 #define IPN3KE_TM_MISC_WARNING_0 (IPN3KE_QM_OFFSET + 0x0040)
419 #define IPN3KE_TM_MISC_MON_0 (IPN3KE_QM_OFFSET + 0x0048)
420 #define IPN3KE_TM_MISC_FATAL_0 (IPN3KE_QM_OFFSET + 0x0050)
421 #define IPN3KE_TM_BW_MON_CTRL_1 (IPN3KE_QM_OFFSET + 0x0080)
422 #define IPN3KE_TM_BW_MON_CTRL_2 (IPN3KE_QM_OFFSET + 0x0084)
423 #define IPN3KE_TM_BW_MON_RATE (IPN3KE_QM_OFFSET + 0x0088)
424 #define IPN3KE_TM_STATS_CTRL (IPN3KE_QM_OFFSET + 0x0100)
425 #define IPN3KE_TM_STATS_DATA_0 (IPN3KE_QM_OFFSET + 0x0110)
426 #define IPN3KE_TM_STATS_DATA_1 (IPN3KE_QM_OFFSET + 0x0114)
427 #define IPN3KE_QM_UID_CONFIG_CTRL (IPN3KE_QM_OFFSET + 0x0200)
428 #define IPN3KE_QM_UID_CONFIG_DATA (IPN3KE_QM_OFFSET + 0x0204)
430 #define IPN3KE_BM_VERSION (IPN3KE_QM_OFFSET + 0x4000)
431 #define IPN3KE_BM_STATUS (IPN3KE_QM_OFFSET + 0x4008)
432 #define IPN3KE_BM_STORE_CTRL (IPN3KE_QM_OFFSET + 0x4010)
433 #define IPN3KE_BM_STORE_STATUS (IPN3KE_QM_OFFSET + 0x4018)
434 #define IPN3KE_BM_STORE_MON (IPN3KE_QM_OFFSET + 0x4028)
435 #define IPN3KE_BM_WARNING_0 (IPN3KE_QM_OFFSET + 0x4040)
436 #define IPN3KE_BM_MON_0 (IPN3KE_QM_OFFSET + 0x4048)
437 #define IPN3KE_BM_FATAL_0 (IPN3KE_QM_OFFSET + 0x4050)
438 #define IPN3KE_BM_DRAM_ACCESS_CTRL (IPN3KE_QM_OFFSET + 0x4100)
439 #define IPN3KE_BM_DRAM_ACCESS_DATA_0 (IPN3KE_QM_OFFSET + 0x4120)
440 #define IPN3KE_BM_DRAM_ACCESS_DATA_1 (IPN3KE_QM_OFFSET + 0x4124)
441 #define IPN3KE_BM_DRAM_ACCESS_DATA_2 (IPN3KE_QM_OFFSET + 0x4128)
442 #define IPN3KE_BM_DRAM_ACCESS_DATA_3 (IPN3KE_QM_OFFSET + 0x412C)
443 #define IPN3KE_BM_DRAM_ACCESS_DATA_4 (IPN3KE_QM_OFFSET + 0x4130)
444 #define IPN3KE_BM_DRAM_ACCESS_DATA_5 (IPN3KE_QM_OFFSET + 0x4134)
445 #define IPN3KE_BM_DRAM_ACCESS_DATA_6 (IPN3KE_QM_OFFSET + 0x4138)
447 #define IPN3KE_QM_VERSION (IPN3KE_QM_OFFSET + 0x8000)
448 #define IPN3KE_QM_STATUS (IPN3KE_QM_OFFSET + 0x8008)
449 #define IPN3KE_QM_LL_TABLE_MON (IPN3KE_QM_OFFSET + 0x8018)
450 #define IPN3KE_QM_WARNING_0 (IPN3KE_QM_OFFSET + 0x8040)
451 #define IPN3KE_QM_MON_0 (IPN3KE_QM_OFFSET + 0x8048)
452 #define IPN3KE_QM_FATAL_0 (IPN3KE_QM_OFFSET + 0x8050)
453 #define IPN3KE_QM_FATAL_1 (IPN3KE_QM_OFFSET + 0x8054)
454 #define IPN3KE_LL_TABLE_ACCESS_CTRL (IPN3KE_QM_OFFSET + 0x8100)
455 #define IPN3KE_LL_TABLE_ACCESS_DATA_0 (IPN3KE_QM_OFFSET + 0x8110)
456 #define IPN3KE_LL_TABLE_ACCESS_DATA_1 (IPN3KE_QM_OFFSET + 0x8114)
458 #define IPN3KE_CCB_ERROR (IPN3KE_CCB_OFFSET + 0x0008)
459 #define IPN3KE_CCB_NSEGFREE (IPN3KE_CCB_OFFSET + 0x200000)
460 #define IPN3KE_CCB_NSEGFREE_MASK 0x3FFFFF
461 #define IPN3KE_CCB_PSEGMAX_COEF (IPN3KE_CCB_OFFSET + 0x200008)
462 #define IPN3KE_CCB_PSEGMAX_COEF_MASK 0xFFFFF
463 #define IPN3KE_CCB_NSEG_P (IPN3KE_CCB_OFFSET + 0x200080)
464 #define IPN3KE_CCB_NSEG_MASK 0x3FFFFF
465 #define IPN3KE_CCB_QPROFILE_Q (IPN3KE_CCB_OFFSET + 0x240000)
466 #define IPN3KE_CCB_QPROFILE_MASK 0x7FF
467 #define IPN3KE_CCB_PROFILE_P (IPN3KE_CCB_OFFSET + 0x280000)
468 #define IPN3KE_CCB_PROFILE_MASK 0x1FFFFFF
469 #define IPN3KE_CCB_PROFILE_MS (IPN3KE_CCB_OFFSET + 0xC)
470 #define IPN3KE_CCB_PROFILE_MS_MASK 0x1FFFFFF
471 #define IPN3KE_CCB_LR_LB_DBG_CTRL (IPN3KE_CCB_OFFSET + 0x2C0000)
472 #define IPN3KE_CCB_LR_LB_DBG_DONE (IPN3KE_CCB_OFFSET + 0x2C0004)
473 #define IPN3KE_CCB_LR_LB_DBG_RDATA (IPN3KE_CCB_OFFSET + 0x2C000C)
475 #define IPN3KE_QOS_MAP_L1_X (IPN3KE_QOS_OFFSET + 0x000000)
476 #define IPN3KE_QOS_MAP_L1_MASK 0x1FFF
477 #define IPN3KE_QOS_MAP_L2_X (IPN3KE_QOS_OFFSET + 0x040000)
478 #define IPN3KE_QOS_MAP_L2_MASK 0x7
479 #define IPN3KE_QOS_TYPE_MASK 0x3
480 #define IPN3KE_QOS_TYPE_L1_X (IPN3KE_QOS_OFFSET + 0x200000)
481 #define IPN3KE_QOS_TYPE_L2_X (IPN3KE_QOS_OFFSET + 0x240000)
482 #define IPN3KE_QOS_TYPE_L3_X (IPN3KE_QOS_OFFSET + 0x280000)
483 #define IPN3KE_QOS_SCH_WT_MASK 0xFF
484 #define IPN3KE_QOS_SCH_WT_L1_X (IPN3KE_QOS_OFFSET + 0x400000)
485 #define IPN3KE_QOS_SCH_WT_L2_X (IPN3KE_QOS_OFFSET + 0x440000)
486 #define IPN3KE_QOS_SCH_WT_L3_X (IPN3KE_QOS_OFFSET + 0x480000)
487 #define IPN3KE_QOS_SHAP_WT_MASK 0x3FFF
488 #define IPN3KE_QOS_SHAP_WT_L1_X (IPN3KE_QOS_OFFSET + 0x600000)
489 #define IPN3KE_QOS_SHAP_WT_L2_X (IPN3KE_QOS_OFFSET + 0x640000)
490 #define IPN3KE_QOS_SHAP_WT_L3_X (IPN3KE_QOS_OFFSET + 0x680000)
492 #define IPN3KE_CLF_BASE_DST_MAC_ADDR_HI (IPN3KE_CLASSIFY_OFFSET + 0x0000)
493 #define IPN3KE_CLF_BASE_DST_MAC_ADDR_LOW (IPN3KE_CLASSIFY_OFFSET + 0x0004)
494 #define IPN3KE_CLF_QINQ_STAG (IPN3KE_CLASSIFY_OFFSET + 0x0008)
495 #define IPN3KE_CLF_LKUP_ENABLE (IPN3KE_CLASSIFY_OFFSET + 0x000C)
496 #define IPN3KE_CLF_DFT_FLOW_ID (IPN3KE_CLASSIFY_OFFSET + 0x0040)
497 #define IPN3KE_CLF_RX_PARSE_CFG (IPN3KE_CLASSIFY_OFFSET + 0x0080)
498 #define IPN3KE_CLF_RX_STATS_CFG (IPN3KE_CLASSIFY_OFFSET + 0x00C0)
499 #define IPN3KE_CLF_RX_STATS_RPT (IPN3KE_CLASSIFY_OFFSET + 0x00C4)
500 #define IPN3KE_CLF_RX_TEST (IPN3KE_CLASSIFY_OFFSET + 0x0400)
502 #define IPN3KE_CLF_EM_VERSION (IPN3KE_CLASSIFY_OFFSET + 0x40000 + 0x0000)
503 #define IPN3KE_CLF_EM_NUM (IPN3KE_CLASSIFY_OFFSET + 0x40000 + 0x0008)
504 #define IPN3KE_CLF_EM_KEY_WDTH (IPN3KE_CLASSIFY_OFFSET + 0x40000 + 0x000C)
505 #define IPN3KE_CLF_EM_RES_WDTH (IPN3KE_CLASSIFY_OFFSET + 0x40000 + 0x0010)
506 #define IPN3KE_CLF_EM_ALARMS (IPN3KE_CLASSIFY_OFFSET + 0x40000 + 0x0014)
507 #define IPN3KE_CLF_EM_DRC_RLAT (IPN3KE_CLASSIFY_OFFSET + 0x40000 + 0x0018)
509 #define IPN3KE_CLF_MHL_VERSION (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x0000)
510 #define IPN3KE_CLF_MHL_GEN_CTRL (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x0018)
511 #define IPN3KE_CLF_MHL_MGMT_CTRL (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x0020)
512 #define IPN3KE_CLF_MHL_MGMT_CTRL_BIT_BUSY 31
513 #define IPN3KE_CLF_MHL_MGMT_CTRL_FLUSH 0x0
514 #define IPN3KE_CLF_MHL_MGMT_CTRL_INSERT 0x1
515 #define IPN3KE_CLF_MHL_MGMT_CTRL_DELETE 0x2
516 #define IPN3KE_CLF_MHL_MGMT_CTRL_SEARCH 0x3
517 #define IPN3KE_CLF_MHL_FATAL_0 (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x0050)
518 #define IPN3KE_CLF_MHL_MON_0 (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x0060)
519 #define IPN3KE_CLF_MHL_TOTAL_ENTRIES (IPN3KE_CLASSIFY_OFFSET + \
521 #define IPN3KE_CLF_MHL_ONEHIT_BUCKETS (IPN3KE_CLASSIFY_OFFSET + \
523 #define IPN3KE_CLF_MHL_KEY_MASK 0xFFFFFFFF
524 #define IPN3KE_CLF_MHL_KEY_0 (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x1000)
525 #define IPN3KE_CLF_MHL_KEY_1 (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x1004)
526 #define IPN3KE_CLF_MHL_KEY_2 (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x1008)
527 #define IPN3KE_CLF_MHL_KEY_3 (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x100C)
528 #define IPN3KE_CLF_MHL_RES_MASK 0xFFFFFFFF
529 #define IPN3KE_CLF_MHL_RES (IPN3KE_CLASSIFY_OFFSET + 0x50000 + 0x2000)
532 ipn3ke_rpst_dev_set_link_up(struct rte_eth_dev *dev);
534 ipn3ke_rpst_dev_set_link_down(struct rte_eth_dev *dev);
536 ipn3ke_rpst_link_update(struct rte_eth_dev *ethdev,
537 __rte_unused int wait_to_complete);
539 ipn3ke_rpst_promiscuous_enable(struct rte_eth_dev *ethdev);
541 ipn3ke_rpst_promiscuous_disable(struct rte_eth_dev *ethdev);
543 ipn3ke_rpst_allmulticast_enable(struct rte_eth_dev *ethdev);
545 ipn3ke_rpst_allmulticast_disable(struct rte_eth_dev *ethdev);
547 ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev,
548 struct rte_ether_addr *mac_addr);
550 ipn3ke_rpst_mtu_set(struct rte_eth_dev *ethdev, uint16_t mtu);
553 ipn3ke_rpst_init(struct rte_eth_dev *ethdev, void *init_params);
555 ipn3ke_rpst_uninit(struct rte_eth_dev *ethdev);
557 ipn3ke_hw_tm_init(struct ipn3ke_hw *hw);
559 ipn3ke_tm_init(struct ipn3ke_rpst *rpst);
561 ipn3ke_tm_ops_get(struct rte_eth_dev *ethdev,
565 /* IPN3KE_MASK is a macro used on 32 bit registers */
566 #define IPN3KE_MASK(mask, shift) ((mask) << (shift))
568 #define IPN3KE_MAC_CTRL_BASE_0 0x00000000
569 #define IPN3KE_MAC_CTRL_BASE_1 0x00008000
571 #define IPN3KE_MAC_STATS_MASK 0xFFFFFFFFF
573 /* All the address are in 4Bytes*/
574 #define IPN3KE_MAC_PRIMARY_MAC_ADDR0 0x0010
575 #define IPN3KE_MAC_PRIMARY_MAC_ADDR1 0x0011
577 #define IPN3KE_MAC_MAC_RESET_CONTROL 0x001F
578 #define IPN3KE_MAC_MAC_RESET_CONTROL_TX_SHIFT 0
579 #define IPN3KE_MAC_MAC_RESET_CONTROL_TX_MASK \
580 IPN3KE_MASK(0x1, IPN3KE_MAC_MAC_RESET_CONTROL_TX_SHIFT)
582 #define IPN3KE_MAC_MAC_RESET_CONTROL_RX_SHIFT 8
583 #define IPN3KE_MAC_MAC_RESET_CONTROL_RX_MASK \
584 IPN3KE_MASK(0x1, IPN3KE_MAC_MAC_RESET_CONTROL_RX_SHIFT)
586 #define IPN3KE_MAC_TX_PACKET_CONTROL 0x0020
587 #define IPN3KE_MAC_TX_PACKET_CONTROL_SHIFT 0
588 #define IPN3KE_MAC_TX_PACKET_CONTROL_MASK \
589 IPN3KE_MASK(0x1, IPN3KE_MAC_TX_PACKET_CONTROL_SHIFT)
591 #define IPN3KE_MAC_TX_SRC_ADDR_OVERRIDE 0x002A
592 #define IPN3KE_MAC_TX_SRC_ADDR_OVERRIDE_SHIFT 0
593 #define IPN3KE_MAC_TX_SRC_ADDR_OVERRIDE_MASK \
594 IPN3KE_MASK(0x1, IPN3KE_MAC_TX_SRC_ADDR_OVERRIDE_SHIFT)
596 #define IPN3KE_MAC_TX_FRAME_MAXLENGTH 0x002C
597 #define IPN3KE_MAC_TX_FRAME_MAXLENGTH_SHIFT 0
598 #define IPN3KE_MAC_TX_FRAME_MAXLENGTH_MASK \
599 IPN3KE_MASK(0xFFFF, IPN3KE_MAC_TX_FRAME_MAXLENGTH_SHIFT)
601 #define IPN3KE_MAC_TX_PAUSEFRAME_CONTROL 0x0040
602 #define IPN3KE_MAC_TX_PAUSEFRAME_CONTROL_SHIFT 0
603 #define IPN3KE_MAC_TX_PAUSEFRAME_CONTROL_MASK \
604 IPN3KE_MASK(0x3, IPN3KE_MAC_TX_PAUSEFRAME_CONTROL_SHIFT)
606 #define IPN3KE_MAC_TX_PAUSEFRAME_QUANTA 0x0042
607 #define IPN3KE_MAC_TX_PAUSEFRAME_QUANTA_SHIFT 0
608 #define IPN3KE_MAC_TX_PAUSEFRAME_QUANTA_MASK \
609 IPN3KE_MASK(0xFFFF, IPN3KE_MAC_TX_PAUSEFRAME_QUANTA_SHIFT)
611 #define IPN3KE_MAC_TX_PAUSEFRAME_HOLDOFF_QUANTA 0x0043
612 #define IPN3KE_MAC_TX_PAUSEFRAME_HOLDOFF_QUANTA_SHIFT 0
613 #define IPN3KE_MAC_TX_PAUSEFRAME_HOLDOFF_QUANTA_MASK \
614 IPN3KE_MASK(0xFFFF, IPN3KE_MAC_TX_PAUSEFRAME_HOLDOFF_QUANTA_SHIFT)
616 #define IPN3KE_MAC_TX_PAUSEFRAME_ENABLE 0x0044
617 #define IPN3KE_MAC_TX_PAUSEFRAME_ENABLE_CFG_SHIFT 0
618 #define IPN3KE_MAC_TX_PAUSEFRAME_ENABLE_CFG_MASK \
619 IPN3KE_MASK(0x1, IPN3KE_MAC_TX_PAUSEFRAME_ENABLE_CFG_SHIFT)
621 #define IPN3KE_MAC_TX_PAUSEFRAME_ENABLE_TYPE_SHIFT 1
622 #define IPN3KE_MAC_TX_PAUSEFRAME_ENABLE_TYPE_MASK \
623 IPN3KE_MASK(0x3, IPN3KE_MAC_TX_PAUSEFRAME_ENABLE_TYPE_SHIFT)
625 #define IPN3KE_MAC_RX_TRANSFER_CONTROL 0x00A0
626 #define IPN3KE_MAC_RX_TRANSFER_CONTROL_SHIFT 0x0
627 #define IPN3KE_MAC_RX_TRANSFER_CONTROL_MASK \
628 IPN3KE_MASK(0x1, IPN3KE_MAC_RX_TRANSFER_CONTROL_SHIFT)
630 #define IPN3KE_MAC_RX_FRAME_CONTROL 0x00AC
631 #define IPN3KE_MAC_RX_FRAME_CONTROL_EN_ALLUCAST_SHIFT 0x0
632 #define IPN3KE_MAC_RX_FRAME_CONTROL_EN_ALLUCAST_MASK \
633 IPN3KE_MASK(0x1, IPN3KE_MAC_RX_FRAME_CONTROL_EN_ALLUCAST_SHIFT)
635 #define IPN3KE_MAC_RX_FRAME_CONTROL_EN_ALLMCAST_SHIFT 0x1
636 #define IPN3KE_MAC_RX_FRAME_CONTROL_EN_ALLMCAST_MASK \
637 IPN3KE_MASK(0x1, IPN3KE_MAC_RX_FRAME_CONTROL_EN_ALLMCAST_SHIFT)
639 #define IPN3KE_VLAN_TAG_SIZE 4
641 * The overhead from MTU to max frame size.
642 * Considering QinQ packet, the VLAN tag needs to be counted twice.
644 #define IPN3KE_ETH_OVERHEAD \
645 (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + IPN3KE_VLAN_TAG_SIZE * 2)
647 #define IPN3KE_MAC_FRAME_SIZE_MAX 9728
648 #define IPN3KE_MAC_RX_FRAME_MAXLENGTH 0x00AE
649 #define IPN3KE_MAC_RX_FRAME_MAXLENGTH_SHIFT 0
650 #define IPN3KE_MAC_RX_FRAME_MAXLENGTH_MASK \
651 IPN3KE_MASK(0xFFFF, IPN3KE_MAC_RX_FRAME_MAXLENGTH_SHIFT)
653 #define IPN3KE_MAC_TX_STATS_CLR 0x0140
654 #define IPN3KE_MAC_TX_STATS_CLR_CLEAR_SHIFT 0
655 #define IPN3KE_MAC_TX_STATS_CLR_CLEAR_MASK \
656 IPN3KE_MASK(0x1, IPN3KE_MAC_TX_STATS_CLR_CLEAR_SHIFT)
658 #define IPN3KE_MAC_RX_STATS_CLR 0x01C0
659 #define IPN3KE_MAC_RX_STATS_CLR_CLEAR_SHIFT 0
660 #define IPN3KE_MAC_RX_STATS_CLR_CLEAR_MASK \
661 IPN3KE_MASK(0x1, IPN3KE_MAC_RX_STATS_CLR_CLEAR_SHIFT)
663 /*tx_stats_framesOK*/
664 #define IPN3KE_MAC_TX_STATS_FRAMESOK_HI 0x0142
665 #define IPN3KE_MAC_TX_STATS_FRAMESOK_LOW 0x0143
667 /*rx_stats_framesOK*/
668 #define IPN3KE_MAC_RX_STATS_FRAMESOK_HI 0x01C2
669 #define IPN3KE_MAC_RX_STATS_FRAMESOK_LOW 0x01C3
671 /*tx_stats_framesErr*/
672 #define IPN3KE_MAC_TX_STATS_FRAMESERR_HI 0x0144
673 #define IPN3KE_MAC_TX_STATS_FRAMESERR_LOW 0x0145
675 /*rx_stats_framesErr*/
676 #define IPN3KE_MAC_RX_STATS_FRAMESERR_HI 0x01C4
677 #define IPN3KE_MAC_RX_STATS_FRAMESERR_LOW 0x01C5
679 /*rx_stats_framesCRCErr*/
680 #define IPN3KE_MAC_RX_STATS_FRAMESCRCERR_HI 0x01C6
681 #define IPN3KE_MAC_RX_STATS_FRAMESCRCERR_LOW 0x01C7
683 /*tx_stats_octetsOK 64b*/
684 #define IPN3KE_MAC_TX_STATS_OCTETSOK_HI 0x0148
685 #define IPN3KE_MAC_TX_STATS_OCTETSOK_LOW 0x0149
687 /*rx_stats_octetsOK 64b*/
688 #define IPN3KE_MAC_RX_STATS_OCTETSOK_HI 0x01C8
689 #define IPN3KE_MAC_RX_STATS_OCTETSOK_LOW 0x01C9
691 /*tx_stats_pauseMACCtrl_Frames*/
692 #define IPN3KE_MAC_TX_STATS_PAUSEMACCTRL_FRAMES_HI 0x014A
693 #define IPN3KE_MAC_TX_STATS_PAUSEMACCTRL_FRAMES_LOW 0x014B
695 /*rx_stats_pauseMACCtrl_Frames*/
696 #define IPN3KE_MAC_RX_STATS_PAUSEMACCTRL_FRAMES_HI 0x01CA
697 #define IPN3KE_MAC_RX_STATS_PAUSEMACCTRL_FRAMES_LOW 0x01CB
699 /*tx_stats_ifErrors*/
700 #define IPN3KE_MAC_TX_STATS_IFERRORS_HI 0x014C
701 #define IPN3KE_MAC_TX_STATS_IFERRORS_LOW 0x014D
703 /*rx_stats_ifErrors*/
704 #define IPN3KE_MAC_RX_STATS_IFERRORS_HI 0x01CC
705 #define IPN3KE_MAC_RX_STATS_IFERRORS_LOW 0x01CD
707 /*tx_stats_unicast_FramesOK*/
708 #define IPN3KE_MAC_TX_STATS_UNICAST_FRAMESOK_HI 0x014E
709 #define IPN3KE_MAC_TX_STATS_UNICAST_FRAMESOK_LOW 0x014F
711 /*rx_stats_unicast_FramesOK*/
712 #define IPN3KE_MAC_RX_STATS_UNICAST_FRAMESOK_HI 0x01CE
713 #define IPN3KE_MAC_RX_STATS_UNICAST_FRAMESOK_LOW 0x01CF
715 /*tx_stats_unicast_FramesErr*/
716 #define IPN3KE_MAC_TX_STATS_UNICAST_FRAMESERR_HI 0x0150
717 #define IPN3KE_MAC_TX_STATS_UNICAST_FRAMESERR_LOW 0x0151
719 /*rx_stats_unicast_FramesErr*/
720 #define IPN3KE_MAC_RX_STATS_UNICAST_FRAMESERR_HI 0x01D0
721 #define IPN3KE_MAC_RX_STATS_UNICAST_FRAMESERR_LOW 0x01D1
723 /*tx_stats_multicast_FramesOK*/
724 #define IPN3KE_MAC_TX_STATS_MULTICAST_FRAMESOK_HI 0x0152
725 #define IPN3KE_MAC_TX_STATS_MULTICAST_FRAMESOK_LOW 0x0153
727 /*rx_stats_multicast_FramesOK*/
728 #define IPN3KE_MAC_RX_STATS_MULTICAST_FRAMESOK_HI 0x01D2
729 #define IPN3KE_MAC_RX_STATS_MULTICAST_FRAMESOK_LOW 0x01D3
731 /*tx_stats_multicast_FramesErr*/
732 #define IPN3KE_MAC_TX_STATS_MULTICAST_FRAMESERR_HI 0x0154
733 #define IPN3KE_MAC_TX_STATS_MULTICAST_FRAMESERR_LOW 0x0155
735 /*rx_stats_multicast_FramesErr*/
736 #define IPN3KE_MAC_RX_STATS_MULTICAST_FRAMESERR_HI 0x01D4
737 #define IPN3KE_MAC_RX_STATS_MULTICAST_FRAMESERR_LOW 0x01D5
739 /*tx_stats_broadcast_FramesOK*/
740 #define IPN3KE_MAC_TX_STATS_BROADCAST_FRAMESOK_HI 0x0156
741 #define IPN3KE_MAC_TX_STATS_BROADCAST_FRAMESOK_LOW 0x0157
743 /*rx_stats_broadcast_FramesOK*/
744 #define IPN3KE_MAC_RX_STATS_BROADCAST_FRAMESOK_HI 0x01D6
745 #define IPN3KE_MAC_RX_STATS_BROADCAST_FRAMESOK_LOW 0x01D7
747 /*tx_stats_broadcast_FramesErr*/
748 #define IPN3KE_MAC_TX_STATS_BROADCAST_FRAMESERR_HI 0x0158
749 #define IPN3KE_MAC_TX_STATS_BROADCAST_FRAMESERR_LOW 0x0159
751 /*rx_stats_broadcast_FramesErr*/
752 #define IPN3KE_MAC_RX_STATS_BROADCAST_FRAMESERR_HI 0x01D8
753 #define IPN3KE_MAC_RX_STATS_BROADCAST_FRAMESERR_LOW 0x01D9
755 /*tx_stats_etherStatsOctets 64b*/
756 #define IPN3KE_MAC_TX_STATS_ETHERSTATSOCTETS_HI 0x015A
757 #define IPN3KE_MAC_TX_STATS_ETHERSTATSOCTETS_LOW 0x015B
759 /*rx_stats_etherStatsOctets 64b*/
760 #define IPN3KE_MAC_RX_STATS_ETHERSTATSOCTETS_HI 0x01DA
761 #define IPN3KE_MAC_RX_STATS_ETHERSTATSOCTETS_LOW 0x01DB
763 /*tx_stats_etherStatsPkts*/
764 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS_HI 0x015C
765 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS_LOW 0x015D
767 /*rx_stats_etherStatsPkts*/
768 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS_HI 0x01DC
769 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS_LOW 0x01DD
771 /*tx_stats_etherStatsUndersizePkts*/
772 #define IPN3KE_MAC_TX_STATS_ETHERSTATSUNDERSIZEPKTS_HI 0x015E
773 #define IPN3KE_MAC_TX_STATS_ETHERSTATSUNDERSIZEPKTS_LOW 0x015F
775 /*rx_stats_etherStatsUndersizePkts*/
776 #define IPN3KE_MAC_RX_STATS_ETHERSTATSUNDERSIZEPKTS_HI 0x01DE
777 #define IPN3KE_MAC_RX_STATS_ETHERSTATSUNDERSIZEPKTS_LOW 0x01DF
779 /*tx_stats_etherStatsOversizePkts*/
780 #define IPN3KE_MAC_TX_STATS_ETHERSTATSOVERSIZEPKTS_HI 0x0160
781 #define IPN3KE_MAC_TX_STATS_ETHERSTATSOVERSIZEPKTS_LOW 0x0161
783 /*rx_stats_etherStatsOversizePkts*/
784 #define IPN3KE_MAC_RX_STATS_ETHERSTATSOVERSIZEPKTS_HI 0x01E0
785 #define IPN3KE_MAC_RX_STATS_ETHERSTATSOVERSIZEPKTS_LOW 0x01E1
787 /*tx_stats_etherStatsPkts64Octets*/
788 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS64OCTETS_HI 0x0162
789 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS64OCTETS_LOW 0x0163
791 /*rx_stats_etherStatsPkts64Octets*/
792 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS64OCTETS_HI 0x01E2
793 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS64OCTETS_LOW 0x01E3
795 /*tx_stats_etherStatsPkts65to127Octets*/
796 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS65TO127OCTETS_HI 0x0164
797 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS65TO127OCTETS_LOW 0x0165
799 /*rx_stats_etherStatsPkts65to127Octets*/
800 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS65TO127OCTETS_HI 0x01E4
801 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS65TO127OCTETS_LOW 0x01E5
803 /*tx_stats_etherStatsPkts128to255Octets*/
804 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS128TO255OCTETS_HI 0x0166
805 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS128TO255OCTETS_LOW 0x0167
807 /*rx_stats_etherStatsPkts128to255Octets*/
808 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS128TO255OCTETS_HI 0x01E6
809 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS128TO255OCTETS_LOW 0x01E7
811 /*tx_stats_etherStatsPkts256to511Octet*/
812 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS256TO511OCTET_HI 0x0168
813 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS256TO511OCTET_LOW 0x0169
815 /*rx_stats_etherStatsPkts256to511Octets*/
816 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS256TO511OCTETS_HI 0x01E8
817 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS256TO511OCTETS_LOW 0x01E9
819 /*tx_stats_etherStatsPkts512to1023Octets*/
820 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS512TO1023OCTETS_HI 0x016A
821 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS512TO1023OCTETS_LOW 0x016B
823 /*rx_stats_etherStatsPkts512to1023Octets*/
824 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS512TO1023OCTETS_HI 0x01EA
825 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS512TO1023OCTETS_LOW 0x01EB
827 /*tx_stats_etherStatPkts1024to1518Octets*/
828 #define IPN3KE_MAC_TX_STATS_ETHERSTATPKTS1024TO1518OCTETS_HI 0x016C
829 #define IPN3KE_MAC_TX_STATS_ETHERSTATPKTS1024TO1518OCTETS_LOW 0x016D
831 /*rx_stats_etherStatPkts1024to1518Octets*/
832 #define IPN3KE_MAC_RX_STATS_ETHERSTATPKTS1024TO1518OCTETS_HI 0x01EC
833 #define IPN3KE_MAC_RX_STATS_ETHERSTATPKTS1024TO1518OCTETS_LOW 0x01ED
835 /*tx_stats_etherStatsPkts1519toXOctets*/
836 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS1519TOXOCTETS_HI 0x016E
837 #define IPN3KE_MAC_TX_STATS_ETHERSTATSPKTS1519TOXOCTETS_LOW 0x016F
839 /*rx_stats_etherStatsPkts1519toXOctets*/
840 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS1519TOXOCTETS_HI 0x01EE
841 #define IPN3KE_MAC_RX_STATS_ETHERSTATSPKTS1519TOXOCTETS_LOW 0x01EF
843 /*rx_stats_etherStatsFragments*/
844 #define IPN3KE_MAC_RX_STATS_ETHERSTATSFRAGMENTS_HI 0x01F0
845 #define IPN3KE_MAC_RX_STATS_ETHERSTATSFRAGMENTS_LOW 0x01F1
847 /*rx_stats_etherStatsJabbers*/
848 #define IPN3KE_MAC_RX_STATS_ETHERSTATSJABBERS_HI 0x01F2
849 #define IPN3KE_MAC_RX_STATS_ETHERSTATSJABBERS_LOW 0x01F3
851 /*rx_stats_etherStatsCRCErr*/
852 #define IPN3KE_MAC_RX_STATS_ETHERSTATSCRCERR_HI 0x01F4
853 #define IPN3KE_MAC_RX_STATS_ETHERSTATSCRCERR_LOW 0x01F5
855 /*tx_stats_unicastMACCtrlFrames*/
856 #define IPN3KE_MAC_TX_STATS_UNICASTMACCTRLFRAMES_HI 0x0176
857 #define IPN3KE_MAC_TX_STATS_UNICASTMACCTRLFRAMES_LOW 0x0177
859 /*rx_stats_unicastMACCtrlFrames*/
860 #define IPN3KE_MAC_RX_STATS_UNICASTMACCTRLFRAMES_HI 0x01F6
861 #define IPN3KE_MAC_RX_STATS_UNICASTMACCTRLFRAMES_LOW 0x01F7
863 /*tx_stats_multicastMACCtrlFrames*/
864 #define IPN3KE_MAC_TX_STATS_MULTICASTMACCTRLFRAMES_HI 0x0178
865 #define IPN3KE_MAC_TX_STATS_MULTICASTMACCTRLFRAMES_LOW 0x0179
867 /*rx_stats_multicastMACCtrlFrames*/
868 #define IPN3KE_MAC_RX_STATS_MULTICASTMACCTRLFRAMES_HI 0x01F8
869 #define IPN3KE_MAC_RX_STATS_MULTICASTMACCTRLFRAMES_LOW 0x01F9
871 /*tx_stats_broadcastMACCtrlFrames*/
872 #define IPN3KE_MAC_TX_STATS_BROADCASTMACCTRLFRAMES_HI 0x017A
873 #define IPN3KE_MAC_TX_STATS_BROADCASTMACCTRLFRAMES_LOW 0x017B
875 /*rx_stats_broadcastMACCtrlFrames*/
876 #define IPN3KE_MAC_RX_STATS_BROADCASTMACCTRLFRAMES_HI 0x01FA
877 #define IPN3KE_MAC_RX_STATS_BROADCASTMACCTRLFRAMES_LOW 0x01FB
879 /*tx_stats_PFCMACCtrlFrames*/
880 #define IPN3KE_MAC_TX_STATS_PFCMACCTRLFRAMES_HI 0x017C
881 #define IPN3KE_MAC_TX_STATS_PFCMACCTRLFRAMES_LOW 0x017D
883 /*rx_stats_PFCMACCtrlFrames*/
884 #define IPN3KE_MAC_RX_STATS_PFCMACCTRLFRAMES_HI 0x01FC
885 #define IPN3KE_MAC_RX_STATS_PFCMACCTRLFRAMES_LOW 0x01FD
887 static inline void ipn3ke_xmac_tx_enable(struct ipn3ke_hw *hw,
888 uint32_t mac_num, uint32_t eth_group_sel)
890 #define IPN3KE_XMAC_TX_ENABLE (0 & (IPN3KE_MAC_TX_PACKET_CONTROL_MASK))
892 (*hw->f_mac_write)(hw,
893 IPN3KE_XMAC_TX_ENABLE,
894 IPN3KE_MAC_TX_PACKET_CONTROL,
899 static inline void ipn3ke_xmac_tx_disable(struct ipn3ke_hw *hw,
900 uint32_t mac_num, uint32_t eth_group_sel)
902 #define IPN3KE_XMAC_TX_DISABLE (1 & (IPN3KE_MAC_TX_PACKET_CONTROL_MASK))
904 (*hw->f_mac_write)(hw,
905 IPN3KE_XMAC_TX_DISABLE,
906 IPN3KE_MAC_TX_PACKET_CONTROL,
911 static inline void ipn3ke_xmac_rx_enable(struct ipn3ke_hw *hw,
912 uint32_t mac_num, uint32_t eth_group_sel)
914 #define IPN3KE_XMAC_RX_ENABLE (0 & (IPN3KE_MAC_RX_TRANSFER_CONTROL_MASK))
916 (*hw->f_mac_write)(hw,
917 IPN3KE_XMAC_RX_ENABLE,
918 IPN3KE_MAC_RX_TRANSFER_CONTROL,
923 static inline void ipn3ke_xmac_rx_disable(struct ipn3ke_hw *hw,
924 uint32_t mac_num, uint32_t eth_group_sel)
926 #define IPN3KE_XMAC_RX_DISABLE (1 & (IPN3KE_MAC_RX_TRANSFER_CONTROL_MASK))
928 (*hw->f_mac_write)(hw,
929 IPN3KE_XMAC_RX_DISABLE,
930 IPN3KE_MAC_RX_TRANSFER_CONTROL,
935 static inline void ipn3ke_xmac_smac_ovd_dis(struct ipn3ke_hw *hw,
936 uint32_t mac_num, uint32_t eth_group_sel)
938 #define IPN3KE_XMAC_SMAC_OVERRIDE_DISABLE (0 & \
939 (IPN3KE_MAC_TX_SRC_ADDR_OVERRIDE_MASK))
941 (*hw->f_mac_write)(hw,
942 IPN3KE_XMAC_SMAC_OVERRIDE_DISABLE,
943 IPN3KE_MAC_TX_SRC_ADDR_OVERRIDE,
948 static inline void ipn3ke_xmac_tx_clr_stcs(struct ipn3ke_hw *hw,
949 uint32_t mac_num, uint32_t eth_group_sel)
951 #define IPN3KE_XMAC_TX_CLR_STCS (1 & \
952 (IPN3KE_MAC_TX_STATS_CLR_CLEAR_MASK))
954 (*hw->f_mac_write)(hw,
955 IPN3KE_XMAC_TX_CLR_STCS,
956 IPN3KE_MAC_TX_STATS_CLR,
961 static inline void ipn3ke_xmac_rx_clr_stcs(struct ipn3ke_hw *hw,
962 uint32_t mac_num, uint32_t eth_group_sel)
964 #define IPN3KE_XMAC_RX_CLR_STCS (1 & \
965 (IPN3KE_MAC_RX_STATS_CLR_CLEAR_MASK))
967 (*hw->f_mac_write)(hw,
968 IPN3KE_XMAC_RX_CLR_STCS,
969 IPN3KE_MAC_RX_STATS_CLR,
975 #endif /* _IPN3KE_ETHDEV_H_ */