1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2021 HiSilicon Limited
5 #ifndef _HNS3_COMMON_H_
6 #define _HNS3_COMMON_H_
10 #include "hns3_ethdev.h"
13 HNS3_IO_FUNC_HINT_NONE = 0,
14 HNS3_IO_FUNC_HINT_VEC,
15 HNS3_IO_FUNC_HINT_SVE,
16 HNS3_IO_FUNC_HINT_SIMPLE,
17 HNS3_IO_FUNC_HINT_COMMON
20 #define HNS3_DEVARG_RX_FUNC_HINT "rx_func_hint"
21 #define HNS3_DEVARG_TX_FUNC_HINT "tx_func_hint"
23 #define HNS3_DEVARG_DEV_CAPS_MASK "dev_caps_mask"
25 #define HNS3_DEVARG_MBX_TIME_LIMIT_MS "mbx_time_limit_ms"
27 #define MSEC_PER_SEC 1000L
28 #define USEC_PER_MSEC 1000L
30 void hns3_clock_gettime(struct timeval *tv);
31 uint64_t hns3_clock_calctime_ms(struct timeval *tv);
32 uint64_t hns3_clock_gettime_ms(void);
34 void hns3_parse_devargs(struct rte_eth_dev *dev);
36 int hns3_configure_all_mc_mac_addr(struct hns3_adapter *hns, bool del);
37 int hns3_configure_all_mac_addr(struct hns3_adapter *hns, bool del);
38 int hns3_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr,
39 __rte_unused uint32_t idx, __rte_unused uint32_t pool);
41 void hns3_remove_mac_addr(struct rte_eth_dev *dev, uint32_t idx);
42 int hns3_set_mc_mac_addr_list(struct rte_eth_dev *dev,
43 struct rte_ether_addr *mc_addr_set,
45 void hns3_ether_format_addr(char *buf, uint16_t size,
46 const struct rte_ether_addr *ether_addr);
48 #endif /* _HNS3_COMMON_H_ */