1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (c) 2013-2015 Brocade Communications Systems, Inc. 3 * Copyright (c) 2015-2018 Cavium Inc. 4 * All rights reserved. 5 * www.cavium.com 6 */ 7 8 #ifndef PMD_BNX2X_ETHDEV_H 9 #define PMD_BNX2X_ETHDEV_H 10 11 #include <sys/queue.h> 12 #include <sys/param.h> 13 #include <sys/user.h> 14 #include <sys/stat.h> 15 16 #include <stdio.h> 17 #include <stdlib.h> 18 #include <stdbool.h> 19 #include <errno.h> 20 #include <stdint.h> 21 #include <string.h> 22 #include <unistd.h> 23 #include <stdarg.h> 24 #include <inttypes.h> 25 #include <assert.h> 26 27 #include <rte_byteorder.h> 28 #include <rte_common.h> 29 #include <rte_cycles.h> 30 #include <rte_log.h> 31 #include <rte_debug.h> 32 #include <rte_pci.h> 33 #include <rte_malloc.h> 34 #include <ethdev_driver.h> 35 #include <rte_spinlock.h> 36 #include <rte_eal.h> 37 #include <rte_mempool.h> 38 #include <rte_mbuf.h> 39 40 #include "bnx2x_rxtx.h" 41 #include "bnx2x_logs.h" 42 43 #define DELAY(x) rte_delay_us(x) 44 #define DELAY_MS(x) rte_delay_ms(x) 45 #define usec_delay(x) DELAY(x) 46 #define msec_delay(x) DELAY(1000*(x)) 47 48 #define FALSE 0 49 #define TRUE 1 50 51 #define min(a,b) RTE_MIN(a,b) 52 53 #define mb() rte_mb() 54 #define wmb() rte_wmb() 55 #define rmb() rte_rmb() 56 57 #define MAX_QUEUES sysconf(_SC_NPROCESSORS_CONF) 58 59 #define BNX2X_MIN_RX_BUF_SIZE 1024 60 #define BNX2X_MAX_RX_PKT_LEN 15872 61 #define BNX2X_MAX_MAC_ADDRS 1 62 63 /* Hardware RX tick timer (usecs) */ 64 #define BNX2X_RX_TICKS 25 65 /* Hardware TX tick timer (usecs) */ 66 #define BNX2X_TX_TICKS 50 67 /* Maximum number of Rx packets to process at a time */ 68 #define BNX2X_RX_BUDGET 0xffffffff 69 70 #define BNX2X_SP_TIMER_PERIOD US_PER_S /* 1 second */ 71 72 #endif 73 74 /* MAC address operations */ 75 struct bnx2x_mac_ops { 76 void (*mac_addr_add)(struct rte_eth_dev *dev, 77 struct rte_ether_addr *addr, 78 uint16_t index, uint32_t pool); /* not implemented yet */ 79 void (*mac_addr_remove)(struct rte_eth_dev *dev, uint16_t index); /* not implemented yet */ 80 }; 81