1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2013-2015 Brocade Communications Systems, Inc.
3 * Copyright (c) 2015-2018 Cavium Inc.
8 #ifndef PMD_BNX2X_ETHDEV_H
9 #define PMD_BNX2X_ETHDEV_H
11 #include <sys/queue.h>
12 #include <sys/param.h>
27 #include <rte_byteorder.h>
28 #include <rte_common.h>
29 #include <rte_cycles.h>
31 #include <rte_debug.h>
33 #include <rte_malloc.h>
34 #include <rte_ethdev_driver.h>
35 #include <rte_spinlock.h>
37 #include <rte_mempool.h>
40 #include "bnx2x_rxtx.h"
41 #include "bnx2x_logs.h"
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))
51 #define min(a,b) RTE_MIN(a,b)
54 #define wmb() rte_wmb()
55 #define rmb() rte_rmb()
57 #define MAX_QUEUES sysconf(_SC_NPROCESSORS_CONF)
59 #define BNX2X_MIN_RX_BUF_SIZE 1024
60 #define BNX2X_MAX_RX_PKT_LEN 15872
61 #define BNX2X_MAX_MAC_ADDRS 1
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
70 #define BNX2X_SP_TIMER_PERIOD US_PER_S /* 1 second */
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 */