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>
26 #include <rte_byteorder.h>
27 #include <rte_common.h>
28 #include <rte_cycles.h>
30 #include <rte_debug.h>
32 #include <rte_malloc.h>
33 #include <rte_ethdev_driver.h>
34 #include <rte_spinlock.h>
36 #include <rte_mempool.h>
39 #include "bnx2x_rxtx.h"
40 #include "bnx2x_logs.h"
42 #define DELAY(x) rte_delay_us(x)
43 #define DELAY_MS(x) rte_delay_ms(x)
44 #define usec_delay(x) DELAY(x)
45 #define msec_delay(x) DELAY(1000*(x))
53 #define min(a,b) RTE_MIN(a,b)
56 #define wmb() rte_wmb()
57 #define rmb() rte_rmb()
59 #define MAX_QUEUES sysconf(_SC_NPROCESSORS_CONF)
61 #define BNX2X_MIN_RX_BUF_SIZE 1024
62 #define BNX2X_MAX_RX_PKT_LEN 15872
63 #define BNX2X_MAX_MAC_ADDRS 1
65 /* Hardware RX tick timer (usecs) */
66 #define BNX2X_RX_TICKS 25
67 /* Hardware TX tick timer (usecs) */
68 #define BNX2X_TX_TICKS 50
69 /* Maximum number of Rx packets to process at a time */
70 #define BNX2X_RX_BUDGET 0xffffffff
72 #define BNX2X_SP_TIMER_PERIOD US_PER_S /* 1 second */
76 /* MAC address operations */
77 struct bnx2x_mac_ops {
78 void (*mac_addr_add)(struct rte_eth_dev *dev,
79 struct rte_ether_addr *addr,
80 uint16_t index, uint32_t pool); /* not implemented yet */
81 void (*mac_addr_remove)(struct rte_eth_dev *dev, uint16_t index); /* not implemented yet */