Branch data Line data Source code
1 : : /* SPDX-License-Identifier: BSD-3-Clause
2 : : * Copyright(c) 2017 Intel Corporation
3 : : */
4 : :
5 : : #ifndef _IAVF_ETHDEV_H_
6 : : #define _IAVF_ETHDEV_H_
7 : :
8 : : #include <sys/queue.h>
9 : :
10 : : #include <rte_kvargs.h>
11 : : #include <rte_tm_driver.h>
12 : :
13 : : #include <iavf_prototype.h>
14 : : #include <iavf_adminq_cmd.h>
15 : : #include <iavf_type.h>
16 : :
17 : : #include "iavf_log.h"
18 : : #include "rte_pmd_iavf.h"
19 : :
20 : : #define IAVF_AQ_LEN 32
21 : : #define IAVF_AQ_BUF_SZ 4096
22 : : #define IAVF_RESET_WAIT_CNT 2000
23 : : #define IAVF_RESET_DETECTED_CNT 500
24 : : #define IAVF_RESET_POLL_SCALE 4 /* Poll-interval scale for reset detection */
25 : : #define IAVF_BUF_SIZE_MIN 1024
26 : : #define IAVF_FRAME_SIZE_MAX 9728
27 : : #define IAVF_QUEUE_BASE_ADDR_UNIT 128
28 : :
29 : : #define IAVF_MAX_NUM_QUEUES_DFLT 16
30 : : #define IAVF_MAX_NUM_QUEUES_LV 256
31 : : #define IAVF_CFG_Q_NUM_PER_BUF 32
32 : : #define IAVF_IRQ_MAP_NUM_PER_BUF 128
33 : : #define IAVF_RXTX_QUEUE_CHUNKS_NUM 2
34 : :
35 : : #define IAVF_UC_MACADDR_MAX 32768
36 : : #define IAVF_MC_MACADDR_MAX 64
37 : :
38 : : #define IAVF_DEV_WATCHDOG_PERIOD 2000 /* microseconds, set 0 to disable*/
39 : :
40 : : #define IAVF_DEFAULT_RX_PTHRESH 8
41 : : #define IAVF_DEFAULT_RX_HTHRESH 8
42 : : #define IAVF_DEFAULT_RX_WTHRESH 0
43 : :
44 : : #define IAVF_DEFAULT_RX_FREE_THRESH 32
45 : :
46 : : #define IAVF_DEFAULT_TX_PTHRESH 32
47 : : #define IAVF_DEFAULT_TX_HTHRESH 0
48 : : #define IAVF_DEFAULT_TX_WTHRESH 0
49 : :
50 : : #define IAVF_DEFAULT_TX_FREE_THRESH 32
51 : : #define IAVF_DEFAULT_TX_RS_THRESH 32
52 : :
53 : : #define IAVF_BASIC_OFFLOAD_CAPS ( \
54 : : VF_BASE_MODE_OFFLOADS | \
55 : : VIRTCHNL_VF_OFFLOAD_WB_ON_ITR | \
56 : : VIRTCHNL_VF_OFFLOAD_RX_POLLING)
57 : :
58 : : #define IAVF_RSS_OFFLOAD_ALL ( \
59 : : RTE_ETH_RSS_IPV4 | \
60 : : RTE_ETH_RSS_FRAG_IPV4 | \
61 : : RTE_ETH_RSS_NONFRAG_IPV4_TCP | \
62 : : RTE_ETH_RSS_NONFRAG_IPV4_UDP | \
63 : : RTE_ETH_RSS_NONFRAG_IPV4_SCTP | \
64 : : RTE_ETH_RSS_NONFRAG_IPV4_OTHER | \
65 : : RTE_ETH_RSS_IPV6 | \
66 : : RTE_ETH_RSS_FRAG_IPV6 | \
67 : : RTE_ETH_RSS_NONFRAG_IPV6_TCP | \
68 : : RTE_ETH_RSS_NONFRAG_IPV6_UDP | \
69 : : RTE_ETH_RSS_NONFRAG_IPV6_SCTP | \
70 : : RTE_ETH_RSS_NONFRAG_IPV6_OTHER)
71 : :
72 : : #define IAVF_MISC_VEC_ID RTE_INTR_VEC_ZERO_OFFSET
73 : : #define IAVF_RX_VEC_START RTE_INTR_VEC_RXTX_OFFSET
74 : :
75 : : /* Default queue interrupt throttling time in microseconds */
76 : : #define IAVF_ITR_INDEX_DEFAULT 0
77 : : #define IAVF_QUEUE_ITR_INTERVAL_DEFAULT 32 /* 32 us */
78 : : #define IAVF_QUEUE_ITR_INTERVAL_MAX 8160 /* 8160 us */
79 : :
80 : : #define IAVF_ALARM_INTERVAL 50000 /* us */
81 : : #define IAVF_PHC_SYNC_ALARM_INTERVAL_US 200000
82 : :
83 : : /* The overhead from MTU to max frame size.
84 : : * Considering QinQ packet, the VLAN tag needs to be counted twice.
85 : : */
86 : : #define IAVF_ETH_OVERHEAD \
87 : : (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + RTE_VLAN_HLEN * 2)
88 : : #define IAVF_ETH_MAX_LEN (RTE_ETHER_MTU + IAVF_ETH_OVERHEAD)
89 : :
90 : : #define IAVF_32_BIT_WIDTH (CHAR_BIT * 4)
91 : : #define IAVF_48_BIT_WIDTH (CHAR_BIT * 6)
92 : : #define IAVF_48_BIT_MASK RTE_LEN2MASK(IAVF_48_BIT_WIDTH, uint64_t)
93 : :
94 : : #define IAVF_RX_DESC_EXT_STATUS_FLEXBH_MASK 0x03
95 : : #define IAVF_RX_DESC_EXT_STATUS_FLEXBH_FD_ID 0x01
96 : :
97 : : #define IAVF_BITS_PER_BYTE 8
98 : :
99 : : #define IAVF_VLAN_TAG_PCP_OFFSET 13
100 : :
101 : : #define IAVF_L2TPV2_FLAGS_LEN 0x4000
102 : :
103 : : struct iavf_adapter;
104 : : struct ci_rx_queue;
105 : : struct ci_tx_queue;
106 : :
107 : :
108 : : struct iavf_ipsec_crypto_stats {
109 : : uint64_t icount;
110 : : uint64_t ibytes;
111 : : struct {
112 : : uint64_t count;
113 : : uint64_t sad_miss;
114 : : uint64_t not_processed;
115 : : uint64_t icv_check;
116 : : uint64_t ipsec_length;
117 : : uint64_t misc;
118 : : } ierrors;
119 : : };
120 : :
121 : : struct iavf_mbuf_stats {
122 : : uint64_t tx_pkt_errors;
123 : : };
124 : :
125 : : struct iavf_eth_xstats {
126 : : struct virtchnl_eth_stats eth_stats;
127 : : struct iavf_ipsec_crypto_stats ips_stats;
128 : : struct iavf_mbuf_stats mbuf_stats;
129 : : };
130 : :
131 : : /* Structure that defines a VSI, associated with a adapter. */
132 : : struct iavf_vsi {
133 : : struct iavf_adapter *adapter; /* Backreference to associated adapter */
134 : : uint16_t vsi_id;
135 : : uint16_t nb_qps; /* Number of queue pairs VSI can occupy */
136 : : uint16_t nb_used_qps; /* Number of queue pairs VSI uses */
137 : : uint16_t max_macaddrs; /* Maximum number of MAC addresses */
138 : : uint16_t base_vector;
139 : : uint16_t msix_intr; /* The MSIX interrupt binds to VSI */
140 : : struct iavf_eth_xstats eth_stats_offset;
141 : : };
142 : :
143 : : struct rte_flow;
144 : : TAILQ_HEAD(iavf_flow_list, rte_flow);
145 : :
146 : : struct iavf_flow_parser_node;
147 : : TAILQ_HEAD(iavf_parser_list, iavf_flow_parser_node);
148 : :
149 : : struct iavf_fdir_conf {
150 : : struct virtchnl_fdir_add add_fltr;
151 : : struct virtchnl_fdir_del del_fltr;
152 : : uint64_t input_set;
153 : : uint32_t flow_id;
154 : : uint32_t mark_flag;
155 : : };
156 : :
157 : : struct iavf_fdir_info {
158 : : struct iavf_fdir_conf conf;
159 : : };
160 : :
161 : : struct iavf_fsub_conf {
162 : : struct virtchnl_flow_sub sub_fltr;
163 : : struct virtchnl_flow_unsub unsub_fltr;
164 : : uint64_t input_set;
165 : : uint32_t flow_id;
166 : : };
167 : :
168 : : struct iavf_qv_map {
169 : : uint16_t queue_id;
170 : : uint16_t vector_id;
171 : : };
172 : :
173 : : /* Message type read in admin queue from PF */
174 : : enum iavf_aq_result {
175 : : IAVF_MSG_ERR = -1, /* Meet error when accessing admin queue */
176 : : IAVF_MSG_NON, /* Read nothing from admin queue */
177 : : IAVF_MSG_SYS, /* Read system msg from admin queue */
178 : : IAVF_MSG_CMD, /* Read async command result */
179 : : };
180 : :
181 : : /* Struct to store Traffic Manager node configuration. */
182 : : struct iavf_tm_node {
183 : : TAILQ_ENTRY(iavf_tm_node) node;
184 : : uint32_t id;
185 : : uint32_t tc;
186 : : uint32_t priority;
187 : : uint32_t weight;
188 : : uint32_t reference_count;
189 : : struct iavf_tm_node *parent;
190 : : struct iavf_tm_shaper_profile *shaper_profile;
191 : : struct rte_tm_node_params params;
192 : : };
193 : :
194 : : TAILQ_HEAD(iavf_tm_node_list, iavf_tm_node);
195 : :
196 : : struct iavf_tm_shaper_profile {
197 : : TAILQ_ENTRY(iavf_tm_shaper_profile) node;
198 : : uint32_t shaper_profile_id;
199 : : uint32_t reference_count;
200 : : struct rte_tm_shaper_params profile;
201 : : };
202 : :
203 : : TAILQ_HEAD(iavf_shaper_profile_list, iavf_tm_shaper_profile);
204 : :
205 : : /* node type of Traffic Manager */
206 : : enum iavf_tm_node_type {
207 : : IAVF_TM_NODE_TYPE_PORT,
208 : : IAVF_TM_NODE_TYPE_TC,
209 : : IAVF_TM_NODE_TYPE_QUEUE,
210 : : IAVF_TM_NODE_TYPE_MAX,
211 : : };
212 : :
213 : : /* Struct to store all the Traffic Manager configuration. */
214 : : struct iavf_tm_conf {
215 : : struct iavf_tm_node *root; /* root node - vf vsi */
216 : : struct iavf_tm_node_list tc_list; /* node list for all the TCs */
217 : : struct iavf_tm_node_list queue_list; /* node list for all the queues */
218 : : struct iavf_shaper_profile_list shaper_profile_list;
219 : : uint32_t nb_tc_node;
220 : : uint32_t nb_queue_node;
221 : : bool committed;
222 : : };
223 : :
224 : : /* Struct to store queue TC mapping. Queue is continuous in one TC */
225 : : struct iavf_qtc_map {
226 : : uint8_t tc;
227 : : uint16_t start_queue_id;
228 : : uint16_t queue_count;
229 : : };
230 : :
231 : : /* Structure to store private data specific for VF instance. */
232 : : struct iavf_info {
233 : : uint16_t num_queue_pairs;
234 : : uint16_t max_pkt_len; /* Maximum packet length */
235 : : uint16_t mac_num; /* Number of MAC addresses */
236 : : bool promisc_unicast_enabled;
237 : : bool promisc_multicast_enabled;
238 : :
239 : : struct virtchnl_version_info virtchnl_version;
240 : : struct virtchnl_vf_resource *vf_res; /* VF resource */
241 : : struct virtchnl_vsi_resource *vsi_res; /* LAN VSI */
242 : : struct virtchnl_vlan_caps vlan_v2_caps;
243 : : uint64_t supported_rxdid;
244 : : uint8_t *proto_xtr; /* proto xtr type for all queues */
245 : : volatile RTE_ATOMIC(enum virtchnl_ops) pend_cmd; /* pending command not finished */
246 : : RTE_ATOMIC(uint32_t) pend_cmd_count;
247 : : int cmd_retval; /* return value of the cmd response from PF */
248 : : uint8_t aq_resp[IAVF_AQ_BUF_SZ]; /* buffer to store the adminq response from PF */
249 : : bool aq_intr_enabled;
250 : :
251 : : /** iAVF watchdog enable */
252 : : bool watchdog_enabled;
253 : :
254 : : /* Event from pf */
255 : : bool dev_closed;
256 : : bool link_up;
257 : : uint32_t link_speed;
258 : :
259 : : /* Unicast addrs */
260 : : struct rte_ether_addr mac_addrs[IAVF_UC_MACADDR_MAX];
261 : :
262 : : /* Multicast addrs */
263 : : struct rte_ether_addr mc_addrs[IAVF_MC_MACADDR_MAX];
264 : : uint16_t mc_addrs_num; /* Multicast mac addresses number */
265 : :
266 : : struct iavf_vsi vsi;
267 : : bool vf_reset; /* true for VF reset pending, false for no VF reset */
268 : : iavf_pre_reset_cb_t pre_reset_cb; /* Pre reset callback function ptr */
269 : : iavf_post_reset_cb_t post_reset_cb; /* Post reset callback function ptr */
270 : : void *pre_reset_cb_arg; /* Pre reset callback argument */
271 : : void *post_reset_cb_arg; /* Post reset callback argument */
272 : : uint64_t flags;
273 : :
274 : : uint8_t *rss_lut;
275 : : uint8_t *rss_key;
276 : : uint64_t rss_hf;
277 : : uint16_t nb_msix; /* number of MSI-X interrupts on Rx */
278 : : uint16_t msix_base; /* msix vector base from */
279 : : uint16_t max_rss_qregion; /* max RSS queue region supported by PF */
280 : : struct iavf_qv_map *qv_map; /* queue vector mapping */
281 : : struct iavf_flow_list flow_list;
282 : : rte_spinlock_t flow_ops_lock;
283 : : rte_spinlock_t aq_lock;
284 : : struct iavf_parser_list rss_parser_list;
285 : : struct iavf_parser_list dist_parser_list;
286 : : struct iavf_parser_list ipsec_crypto_parser_list;
287 : :
288 : : struct iavf_fdir_info fdir; /* flow director info */
289 : : /* indicate large VF support enabled or not */
290 : : bool lv_enabled;
291 : :
292 : : struct virtchnl_qos_cap_list *qos_cap;
293 : : struct iavf_qtc_map *qtc_map;
294 : : struct iavf_tm_conf tm_conf;
295 : :
296 : : struct rte_eth_dev *eth_dev;
297 : :
298 : : RTE_ATOMIC(bool)in_reset_recovery;
299 : : bool reset_pending;
300 : : bool pf_reset_in_progress;
301 : : bool start_pending;
302 : :
303 : : uint32_t ptp_caps;
304 : : rte_spinlock_t phc_time_aq_lock;
305 : : };
306 : :
307 : : #define IAVF_MAX_PKT_TYPE 1024
308 : :
309 : : #define IAVF_MAX_QUEUE_NUM 2048
310 : :
311 : : enum iavf_proto_xtr_type {
312 : : IAVF_PROTO_XTR_NONE,
313 : : IAVF_PROTO_XTR_VLAN,
314 : : IAVF_PROTO_XTR_IPV4,
315 : : IAVF_PROTO_XTR_IPV6,
316 : : IAVF_PROTO_XTR_IPV6_FLOW,
317 : : IAVF_PROTO_XTR_TCP,
318 : : IAVF_PROTO_XTR_IP_OFFSET,
319 : : IAVF_PROTO_XTR_IPSEC_CRYPTO_SAID,
320 : : IAVF_PROTO_XTR_MAX,
321 : : };
322 : :
323 : : /**
324 : : * Cache devargs parse result.
325 : : */
326 : : struct iavf_devargs {
327 : : uint8_t proto_xtr_dflt;
328 : : uint8_t proto_xtr[IAVF_MAX_QUEUE_NUM];
329 : : uint16_t quanta_size;
330 : : uint32_t watchdog_period;
331 : : int auto_reset;
332 : : int no_poll_on_link_down;
333 : : uint64_t mbuf_check;
334 : : int enable_lldp;
335 : : };
336 : :
337 : : struct iavf_security_ctx;
338 : :
339 : : enum iavf_rx_func_type {
340 : : IAVF_RX_DISABLED,
341 : : IAVF_RX_DEFAULT,
342 : : IAVF_RX_SCATTERED,
343 : : IAVF_RX_FLEX_RXD,
344 : : IAVF_RX_SCATTERED_FLEX_RXD,
345 : : IAVF_RX_BULK_ALLOC,
346 : : IAVF_RX_BULK_ALLOC_FLEX_RXD,
347 : : IAVF_RX_NEON,
348 : : IAVF_RX_NEON_SCATTERED,
349 : : IAVF_RX_NEON_FLEX_RXD,
350 : : IAVF_RX_NEON_SCATTERED_FLEX_RXD,
351 : : IAVF_RX_AVX2,
352 : : IAVF_RX_AVX2_SCATTERED,
353 : : IAVF_RX_AVX2_OFFLOAD,
354 : : IAVF_RX_AVX2_SCATTERED_OFFLOAD,
355 : : IAVF_RX_AVX2_FLEX_RXD,
356 : : IAVF_RX_AVX2_SCATTERED_FLEX_RXD,
357 : : IAVF_RX_AVX2_FLEX_RXD_OFFLOAD,
358 : : IAVF_RX_AVX2_SCATTERED_FLEX_RXD_OFFLOAD,
359 : : IAVF_RX_AVX512,
360 : : IAVF_RX_AVX512_SCATTERED,
361 : : IAVF_RX_AVX512_OFFLOAD,
362 : : IAVF_RX_AVX512_SCATTERED_OFFLOAD,
363 : : IAVF_RX_AVX512_FLEX_RXD,
364 : : IAVF_RX_AVX512_SCATTERED_FLEX_RXD,
365 : : IAVF_RX_AVX512_FLEX_RXD_OFFLOAD,
366 : : IAVF_RX_AVX512_SCATTERED_FLEX_RXD_OFFLOAD,
367 : : };
368 : :
369 : : enum iavf_tx_func_type {
370 : : IAVF_TX_DISABLED,
371 : : IAVF_TX_DEFAULT,
372 : : IAVF_TX_NEON,
373 : : IAVF_TX_AVX2,
374 : : IAVF_TX_AVX2_OFFLOAD,
375 : : IAVF_TX_AVX2_CTX,
376 : : IAVF_TX_AVX2_CTX_OFFLOAD,
377 : : IAVF_TX_AVX512,
378 : : IAVF_TX_AVX512_OFFLOAD,
379 : : IAVF_TX_AVX512_CTX,
380 : : IAVF_TX_AVX512_CTX_OFFLOAD,
381 : : };
382 : :
383 : : #define IAVF_MBUF_CHECK_F_TX_MBUF (1ULL << 0)
384 : : #define IAVF_MBUF_CHECK_F_TX_SIZE (1ULL << 1)
385 : : #define IAVF_MBUF_CHECK_F_TX_SEGMENT (1ULL << 2)
386 : : #define IAVF_MBUF_CHECK_F_TX_OFFLOAD (1ULL << 3)
387 : :
388 : : /* Structure to store private data for each VF instance. */
389 : : struct iavf_adapter {
390 : : struct iavf_hw hw;
391 : : struct rte_eth_dev_data *dev_data;
392 : : struct iavf_info vf;
393 : : struct iavf_security_ctx *security_ctx;
394 : :
395 : : bool rx_bulk_alloc_allowed;
396 : : alignas(RTE_CACHE_LINE_MIN_SIZE) uint32_t ptype_tbl[IAVF_MAX_PKT_TYPE];
397 : : bool stopped;
398 : : bool closed;
399 : : RTE_ATOMIC(bool) no_poll;
400 : : enum iavf_rx_func_type rx_func_type;
401 : : enum iavf_tx_func_type tx_func_type;
402 : : uint16_t fdir_ref_cnt;
403 : : rte_spinlock_t phc_sync_lock;
404 : : uint8_t phc_sync_ticks;
405 : : bool phc_sync_paused;
406 : : struct iavf_devargs devargs;
407 : : bool mac_primary_set;
408 : : uint16_t tpid; /* VLAN tag identifier */
409 : : };
410 : :
411 : : /* IAVF_DEV_PRIVATE_TO */
412 : : #define IAVF_DEV_PRIVATE_TO_ADAPTER(adapter) \
413 : : ((struct iavf_adapter *)adapter)
414 : : #define IAVF_DEV_PRIVATE_TO_VF(adapter) \
415 : : (&((struct iavf_adapter *)adapter)->vf)
416 : : #define IAVF_DEV_PRIVATE_TO_HW(adapter) \
417 : : (&((struct iavf_adapter *)adapter)->hw)
418 : : #define IAVF_DEV_PRIVATE_TO_IAVF_SECURITY_CTX(adapter) \
419 : : (((struct iavf_adapter *)adapter)->security_ctx)
420 : :
421 : : /* IAVF_VSI_TO */
422 : : #define IAVF_VSI_TO_HW(vsi) \
423 : : (&(((struct iavf_vsi *)vsi)->adapter->hw))
424 : : #define IAVF_VSI_TO_VF(vsi) \
425 : : (&(((struct iavf_vsi *)vsi)->adapter->vf))
426 : :
427 : : static inline void
428 : : iavf_init_adminq_parameter(struct iavf_hw *hw)
429 : : {
430 : 0 : hw->aq.num_arq_entries = IAVF_AQ_LEN;
431 : 0 : hw->aq.num_asq_entries = IAVF_AQ_LEN;
432 : 0 : hw->aq.arq_buf_size = IAVF_AQ_BUF_SZ;
433 : 0 : hw->aq.asq_buf_size = IAVF_AQ_BUF_SZ;
434 : : }
435 : :
436 : : static inline uint16_t
437 : : iavf_calc_itr_interval(int16_t interval)
438 : : {
439 : : if (interval < 0 || interval > IAVF_QUEUE_ITR_INTERVAL_MAX)
440 : : interval = IAVF_QUEUE_ITR_INTERVAL_DEFAULT;
441 : :
442 : : /* Convert to hardware count, as writing each 1 represents 2 us */
443 : : return interval / 2;
444 : : }
445 : :
446 : : /* structure used for sending and checking response of virtchnl ops */
447 : : struct iavf_cmd_info {
448 : : enum virtchnl_ops ops;
449 : : uint8_t *in_args; /* buffer for sending */
450 : : uint32_t in_args_size; /* buffer size for sending */
451 : : uint8_t *out_buffer; /* buffer for response */
452 : : uint32_t out_size; /* buffer size for response */
453 : : };
454 : :
455 : : int iavf_check_api_version(struct iavf_adapter *adapter);
456 : : int iavf_get_vf_resource(struct iavf_adapter *adapter);
457 : : void iavf_dev_event_post(struct rte_eth_dev *dev,
458 : : enum rte_eth_event_type event,
459 : : void *param, size_t param_alloc_size);
460 : : void iavf_dev_event_handler_fini(void);
461 : : int iavf_dev_event_handler_init(void);
462 : : void iavf_handle_virtchnl_msg(struct rte_eth_dev *dev);
463 : : int iavf_enable_vlan_strip(struct iavf_adapter *adapter);
464 : : int iavf_disable_vlan_strip(struct iavf_adapter *adapter);
465 : : int iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid,
466 : : bool rx, bool on);
467 : : int iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,
468 : : bool rx, bool on);
469 : : int iavf_enable_queues(struct iavf_adapter *adapter);
470 : : int iavf_enable_queues_lv(struct iavf_adapter *adapter);
471 : : int iavf_disable_queues(struct iavf_adapter *adapter);
472 : : int iavf_disable_queues_lv(struct iavf_adapter *adapter);
473 : : int iavf_configure_rss_lut(struct iavf_adapter *adapter);
474 : : int iavf_configure_rss_key(struct iavf_adapter *adapter);
475 : : int iavf_configure_queues(struct iavf_adapter *adapter, uint16_t num_queue_pairs);
476 : : int iavf_get_supported_rxdid(struct iavf_adapter *adapter);
477 : : int iavf_config_vlan_strip_v2(struct iavf_adapter *adapter, bool enable);
478 : : int iavf_config_outer_vlan_strip_v2(struct iavf_adapter *adapter, bool enable);
479 : : int iavf_config_vlan_insert_v2(struct iavf_adapter *adapter, bool enable);
480 : : int iavf_config_outer_vlan_insert_v2(struct iavf_adapter *adapter, bool enable);
481 : : int iavf_add_del_vlan_v2(struct iavf_adapter *adapter, uint16_t vlanid,
482 : : bool add);
483 : : int iavf_get_vlan_offload_caps_v2(struct iavf_adapter *adapter);
484 : : int iavf_config_irq_map(struct iavf_adapter *adapter);
485 : : int iavf_config_irq_map_lv(struct iavf_adapter *adapter, uint16_t num);
486 : : void iavf_add_del_secondary_mac_addr(struct iavf_adapter *adapter, bool add);
487 : : int iavf_dev_link_update(struct rte_eth_dev *dev,
488 : : __rte_unused int wait_to_complete);
489 : : void iavf_dev_alarm_handler(void *param);
490 : : void iavf_phc_sync_alarm_start(struct rte_eth_dev *dev);
491 : : void iavf_phc_sync_alarm_stop(struct rte_eth_dev *dev);
492 : : int iavf_query_stats(struct iavf_adapter *adapter,
493 : : struct virtchnl_eth_stats *pstats);
494 : : int iavf_config_promisc(struct iavf_adapter *adapter, bool enable_unicast,
495 : : bool enable_multicast);
496 : : int iavf_add_del_eth_addr(struct iavf_adapter *adapter,
497 : : struct rte_ether_addr *addr, bool add, uint8_t type);
498 : : int iavf_add_del_vlan(struct iavf_adapter *adapter, uint16_t vlanid, bool add);
499 : : int iavf_fdir_add(struct iavf_adapter *adapter, struct iavf_fdir_conf *filter);
500 : : int iavf_fdir_del(struct iavf_adapter *adapter, struct iavf_fdir_conf *filter);
501 : : int iavf_fdir_check(struct iavf_adapter *adapter,
502 : : struct iavf_fdir_conf *filter);
503 : : int iavf_add_del_rss_cfg(struct iavf_adapter *adapter,
504 : : struct virtchnl_rss_cfg *rss_cfg, bool add);
505 : : int iavf_get_hena_caps(struct iavf_adapter *adapter, uint64_t *caps);
506 : : int iavf_set_hena(struct iavf_adapter *adapter, uint64_t hena);
507 : : int iavf_rss_hash_set(struct iavf_adapter *ad, uint64_t rss_hf, bool add);
508 : : int iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,
509 : : struct rte_ether_addr *mc_addrs,
510 : : uint32_t mc_addrs_num, bool add);
511 : : int iavf_request_queues(struct rte_eth_dev *dev, uint16_t num);
512 : : int iavf_get_max_rss_queue_region(struct iavf_adapter *adapter);
513 : : int iavf_get_qos_cap(struct iavf_adapter *adapter);
514 : : int iavf_set_q_bw(struct rte_eth_dev *dev,
515 : : struct virtchnl_queues_bw_cfg *q_bw, uint16_t size);
516 : : int iavf_set_q_tc_map(struct rte_eth_dev *dev,
517 : : struct virtchnl_queue_tc_mapping *q_tc_mapping,
518 : : uint16_t size);
519 : : int iavf_set_vf_quanta_size(struct iavf_adapter *adapter, u16 start_queue_id,
520 : : u16 num_queues);
521 : : void iavf_tm_conf_init(struct rte_eth_dev *dev);
522 : : void iavf_tm_conf_uninit(struct rte_eth_dev *dev);
523 : : int iavf_ipsec_crypto_request(struct iavf_adapter *adapter,
524 : : uint8_t *msg, size_t msg_len,
525 : : uint8_t *resp_msg, size_t resp_msg_len);
526 : : extern const struct rte_tm_ops iavf_tm_ops;
527 : : int iavf_get_ptp_cap(struct iavf_adapter *adapter);
528 : : int iavf_get_phc_time(struct ci_rx_queue *rxq);
529 : : int iavf_flow_sub(struct iavf_adapter *adapter,
530 : : struct iavf_fsub_conf *filter);
531 : : int iavf_flow_unsub(struct iavf_adapter *adapter,
532 : : struct iavf_fsub_conf *filter);
533 : : int iavf_flow_sub_check(struct iavf_adapter *adapter,
534 : : struct iavf_fsub_conf *filter);
535 : : void iavf_dev_watchdog_enable(struct iavf_adapter *adapter);
536 : : void iavf_dev_watchdog_disable(struct iavf_adapter *adapter);
537 : : int iavf_handle_hw_reset(struct rte_eth_dev *dev, bool vf_initiated_reset);
538 : : void iavf_set_no_poll(struct iavf_adapter *adapter, bool link_change);
539 : : bool is_iavf_supported(struct rte_eth_dev *dev);
540 : : void iavf_hash_uninit(struct iavf_adapter *ad);
541 : : void iavf_resume_pending_start(struct rte_eth_dev *dev);
542 : : int iavf_phc_get_time(struct iavf_adapter *adapter, uint64_t *time);
543 : :
544 : : #endif /* _IAVF_ETHDEV_H_ */
|