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