1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 Marvell.
4 #ifndef __CNXK_ETHDEV_H__
5 #define __CNXK_ETHDEV_H__
10 #include <ethdev_driver.h>
11 #include <ethdev_pci.h>
15 #define CNXK_ETH_DEV_PMD_VERSION "1.0"
17 #define CNXK_NIX_TX_OFFLOAD_CAPA \
18 (DEV_TX_OFFLOAD_MBUF_FAST_FREE | DEV_TX_OFFLOAD_MT_LOCKFREE | \
19 DEV_TX_OFFLOAD_VLAN_INSERT | DEV_TX_OFFLOAD_QINQ_INSERT | \
20 DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_TX_OFFLOAD_OUTER_UDP_CKSUM | \
21 DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_UDP_CKSUM | \
22 DEV_TX_OFFLOAD_SCTP_CKSUM | DEV_TX_OFFLOAD_TCP_TSO | \
23 DEV_TX_OFFLOAD_VXLAN_TNL_TSO | DEV_TX_OFFLOAD_GENEVE_TNL_TSO | \
24 DEV_TX_OFFLOAD_GRE_TNL_TSO | DEV_TX_OFFLOAD_MULTI_SEGS | \
25 DEV_TX_OFFLOAD_IPV4_CKSUM)
27 #define CNXK_NIX_RX_OFFLOAD_CAPA \
28 (DEV_RX_OFFLOAD_CHECKSUM | DEV_RX_OFFLOAD_SCTP_CKSUM | \
29 DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM | DEV_RX_OFFLOAD_SCATTER | \
30 DEV_RX_OFFLOAD_JUMBO_FRAME | DEV_RX_OFFLOAD_OUTER_UDP_CKSUM | \
31 DEV_RX_OFFLOAD_RSS_HASH)
37 /* Max macfilter entries */
38 uint8_t max_mac_entries;
42 /* Pointer back to rte */
43 struct rte_eth_dev *eth_dev;
45 /* HW capabilities / Limitations */
48 uint64_t cq_min_4k : 1;
53 /* Rx and Tx offload capabilities */
54 uint64_t rx_offload_capa;
55 uint64_t tx_offload_capa;
58 /* Default mac address */
59 uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
62 static inline struct cnxk_eth_dev *
63 cnxk_eth_pmd_priv(struct rte_eth_dev *eth_dev)
65 return eth_dev->data->dev_private;
68 /* Common ethdev ops */
69 extern struct eth_dev_ops cnxk_eth_dev_ops;
72 int cnxk_nix_probe(struct rte_pci_driver *pci_drv,
73 struct rte_pci_device *pci_dev);
74 int cnxk_nix_remove(struct rte_pci_device *pci_dev);
76 #endif /* __CNXK_ETHDEV_H__ */