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