1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Intel Corporation
3 */
4
5 #ifndef _RTE_ETHDEV_DRIVER_H_
6 #define _RTE_ETHDEV_DRIVER_H_
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 /**
13 * @file
14 *
15 * RTE Ethernet Device PMD API
16 *
17 * These APIs for the use from Ethernet drivers, user applications shouldn't
18 * use them.
19 *
20 */
21
22 #include <rte_ethdev.h>
23
24 /**
25 * @internal
26 * Structure used to hold information about the callbacks to be called for a
27 * queue on Rx and Tx.
28 */
29 struct rte_eth_rxtx_callback {
30 struct rte_eth_rxtx_callback *next;
31 union{
32 rte_rx_callback_fn rx;
33 rte_tx_callback_fn tx;
34 } fn;
35 void *param;
36 };
37
38 /**
39 * @internal
40 * The generic data structure associated with each Ethernet device.
41 *
42 * Pointers to burst-oriented packet receive and transmit functions are
43 * located at the beginning of the structure, along with the pointer to
44 * where all the data elements for the particular device are stored in shared
45 * memory. This split allows the function pointer and driver data to be per-
46 * process, while the actual configuration data for the device is shared.
47 */
48 struct rte_eth_dev {
49 eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function */
50 eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function */
51
52 /** Pointer to PMD transmit prepare function */
53 eth_tx_prep_t tx_pkt_prepare;
54 /** Get the number of used Rx descriptors */
55 eth_rx_queue_count_t rx_queue_count;
56 /** Check the status of a Rx descriptor */
57 eth_rx_descriptor_status_t rx_descriptor_status;
58 /** Check the status of a Tx descriptor */
59 eth_tx_descriptor_status_t tx_descriptor_status;
60
61 /**
62 * Device data that is shared between primary and secondary processes
63 */
64 struct rte_eth_dev_data *data;
65 void *process_private; /**< Pointer to per-process device data */
66 const struct eth_dev_ops *dev_ops; /**< Functions exported by PMD */
67 struct rte_device *device; /**< Backing device */
68 struct rte_intr_handle *intr_handle; /**< Device interrupt handle */
69
70 /** User application callbacks for NIC interrupts */
71 struct rte_eth_dev_cb_list link_intr_cbs;
72 /**
73 * User-supplied functions called from rx_burst to post-process
74 * received packets before passing them to the user
75 */
76 struct rte_eth_rxtx_callback *post_rx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
77 /**
78 * User-supplied functions called from tx_burst to pre-process
79 * received packets before passing them to the driver for transmission
80 */
81 struct rte_eth_rxtx_callback *pre_tx_burst_cbs[RTE_MAX_QUEUES_PER_PORT];
82
83 enum rte_eth_dev_state state; /**< Flag indicating the port state */
84 void *security_ctx; /**< Context for security ops */
85 } __rte_cache_aligned;
86
87 struct rte_eth_dev_sriov;
88 struct rte_eth_dev_owner;
89
90 /**
91 * @internal
92 * The data part, with no function pointers, associated with each Ethernet
93 * device. This structure is safe to place in shared memory to be common
94 * among different processes in a multi-process configuration.
95 */
96 struct rte_eth_dev_data {
97 char name[RTE_ETH_NAME_MAX_LEN]; /**< Unique identifier name */
98
99 void **rx_queues; /**< Array of pointers to Rx queues */
100 void **tx_queues; /**< Array of pointers to Tx queues */
101 uint16_t nb_rx_queues; /**< Number of Rx queues */
102 uint16_t nb_tx_queues; /**< Number of Tx queues */
103
104 struct rte_eth_dev_sriov sriov; /**< SRIOV data */
105
106 /** PMD-specific private data. @see rte_eth_dev_release_port() */
107 void *dev_private;
108
109 struct rte_eth_link dev_link; /**< Link-level information & status */
110 struct rte_eth_conf dev_conf; /**< Configuration applied to device */
111 uint16_t mtu; /**< Maximum Transmission Unit */
112
113 /** Common Rx buffer size handled by all queues */
114 uint32_t min_rx_buf_size;
115
116 uint64_t rx_mbuf_alloc_failed; /**< Rx ring mbuf allocation failures */
117
118 /** Device Ethernet link address. @see rte_eth_dev_release_port() */
119 struct rte_ether_addr *mac_addrs;
120 /** Bitmap associating MAC addresses to pools */
121 uint64_t mac_pool_sel[RTE_ETH_NUM_RECEIVE_MAC_ADDR];
122 /**
123 * Device Ethernet MAC addresses of hash filtering.
124 * @see rte_eth_dev_release_port()
125 */
126 struct rte_ether_addr *hash_mac_addrs;
127
128 uint16_t port_id; /**< Device [external] port identifier */
129
130 __extension__
131 uint8_t /** Rx promiscuous mode ON(1) / OFF(0) */
132 promiscuous : 1,
133 /** Rx of scattered packets is ON(1) / OFF(0) */
134 scattered_rx : 1,
135 /** Rx all multicast mode ON(1) / OFF(0) */
136 all_multicast : 1,
137 /** Device state: STARTED(1) / STOPPED(0) */
138 dev_started : 1,
139 /** Rx LRO is ON(1) / OFF(0) */
140 lro : 1,
141 /**
142 * Indicates whether the device is configured:
143 * CONFIGURED(1) / NOT CONFIGURED(0)
144 */
145 dev_configured : 1,
146 /**
147 * Indicates whether the flow engine is configured:
148 * CONFIGURED(1) / NOT CONFIGURED(0)
149 */
150 flow_configured : 1;
151
152 /** Queues state: HAIRPIN(2) / STARTED(1) / STOPPED(0) */
153 uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT];
154 /** Queues state: HAIRPIN(2) / STARTED(1) / STOPPED(0) */
155 uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT];
156
157 uint32_t dev_flags; /**< Capabilities */
158 int numa_node; /**< NUMA node connection */
159
160 /** VLAN filter configuration */
161 struct rte_vlan_filter_conf vlan_filter_conf;
162
163 struct rte_eth_dev_owner owner; /**< The port owner */
164
165 /**
166 * Switch-specific identifier.
167 * Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
168 */
169 uint16_t representor_id;
170 /**
171 * Port ID of the backing device.
172 * This device will be used to query representor info and calculate
173 * representor IDs. Valid if RTE_ETH_DEV_REPRESENTOR in dev_flags.
174 */
175 uint16_t backer_port_id;
176
177 pthread_mutex_t flow_ops_mutex; /**< rte_flow ops mutex */
178 } __rte_cache_aligned;
179
180 /**
181 * @internal
182 * The pool of *rte_eth_dev* structures. The size of the pool
183 * is configured at compile-time in the <rte_ethdev.c> file.
184 */
185 extern struct rte_eth_dev rte_eth_devices[];
186
187 /** @internal Declaration of the hairpin peer queue information structure. */
188 struct rte_hairpin_peer_info;
189
190 /*
191 * Definitions of all functions exported by an Ethernet driver through the
192 * generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
193 * structure associated with an Ethernet device.
194 */
195
196 /** @internal Ethernet device configuration. */
197 typedef int (*eth_dev_configure_t)(struct rte_eth_dev *dev);
198
199 /** @internal Function used to start a configured Ethernet device. */
200 typedef int (*eth_dev_start_t)(struct rte_eth_dev *dev);
201
202 /** @internal Function used to stop a configured Ethernet device. */
203 typedef int (*eth_dev_stop_t)(struct rte_eth_dev *dev);
204
205 /** @internal Function used to link up a configured Ethernet device. */
206 typedef int (*eth_dev_set_link_up_t)(struct rte_eth_dev *dev);
207
208 /** @internal Function used to link down a configured Ethernet device. */
209 typedef int (*eth_dev_set_link_down_t)(struct rte_eth_dev *dev);
210
211 /** @internal Function used to close a configured Ethernet device. */
212 typedef int (*eth_dev_close_t)(struct rte_eth_dev *dev);
213
214 /** @internal Function used to reset a configured Ethernet device. */
215 typedef int (*eth_dev_reset_t)(struct rte_eth_dev *dev);
216
217 /** @internal Function used to detect an Ethernet device removal. */
218 typedef int (*eth_is_removed_t)(struct rte_eth_dev *dev);
219
220 /**
221 * @internal
222 * Function used to enable the Rx promiscuous mode of an Ethernet device.
223 *
224 * @param dev
225 * ethdev handle of port.
226 *
227 * @return
228 * Negative errno value on error, 0 on success.
229 *
230 * @retval 0
231 * Success, promiscuous mode is enabled.
232 * @retval -ENOTSUP
233 * Promiscuous mode is not supported.
234 * @retval -ENODEV
235 * Device is gone.
236 * @retval -E_RTE_SECONDARY
237 * Function was called from a secondary process instance and not supported.
238 * @retval -ETIMEDOUT
239 * Attempt to enable promiscuous mode failed because of timeout.
240 * @retval -EAGAIN
241 * Failed to enable promiscuous mode.
242 */
243 typedef int (*eth_promiscuous_enable_t)(struct rte_eth_dev *dev);
244
245 /**
246 * @internal
247 * Function used to disable the Rx promiscuous mode of an Ethernet device.
248 *
249 * @param dev
250 * ethdev handle of port.
251 *
252 * @return
253 * Negative errno value on error, 0 on success.
254 *
255 * @retval 0
256 * Success, promiscuous mode is disabled.
257 * @retval -ENOTSUP
258 * Promiscuous mode disabling is not supported.
259 * @retval -ENODEV
260 * Device is gone.
261 * @retval -E_RTE_SECONDARY
262 * Function was called from a secondary process instance and not supported.
263 * @retval -ETIMEDOUT
264 * Attempt to disable promiscuous mode failed because of timeout.
265 * @retval -EAGAIN
266 * Failed to disable promiscuous mode.
267 */
268 typedef int (*eth_promiscuous_disable_t)(struct rte_eth_dev *dev);
269
270 /**
271 * @internal
272 * Enable the receipt of all multicast packets by an Ethernet device.
273 *
274 * @param dev
275 * ethdev handle of port.
276 *
277 * @return
278 * Negative errno value on error, 0 on success.
279 *
280 * @retval 0
281 * Success, all-multicast mode is enabled.
282 * @retval -ENOTSUP
283 * All-multicast mode is not supported.
284 * @retval -ENODEV
285 * Device is gone.
286 * @retval -E_RTE_SECONDARY
287 * Function was called from a secondary process instance and not supported.
288 * @retval -ETIMEDOUT
289 * Attempt to enable all-multicast mode failed because of timeout.
290 * @retval -EAGAIN
291 * Failed to enable all-multicast mode.
292 */
293 typedef int (*eth_allmulticast_enable_t)(struct rte_eth_dev *dev);
294
295 /**
296 * @internal
297 * Disable the receipt of all multicast packets by an Ethernet device.
298 *
299 * @param dev
300 * ethdev handle of port.
301 *
302 * @return
303 * Negative errno value on error, 0 on success.
304 *
305 * @retval 0
306 * Success, all-multicast mode is disabled.
307 * @retval -ENOTSUP
308 * All-multicast mode disabling is not supported.
309 * @retval -ENODEV
310 * Device is gone.
311 * @retval -E_RTE_SECONDARY
312 * Function was called from a secondary process instance and not supported.
313 * @retval -ETIMEDOUT
314 * Attempt to disable all-multicast mode failed because of timeout.
315 * @retval -EAGAIN
316 * Failed to disable all-multicast mode.
317 */
318 typedef int (*eth_allmulticast_disable_t)(struct rte_eth_dev *dev);
319
320 /**
321 * @internal
322 * Get link speed, duplex mode and state (up/down) of an Ethernet device.
323 */
324 typedef int (*eth_link_update_t)(struct rte_eth_dev *dev,
325 int wait_to_complete);
326
327 /** @internal Get global I/O statistics of an Ethernet device. */
328 typedef int (*eth_stats_get_t)(struct rte_eth_dev *dev,
329 struct rte_eth_stats *igb_stats);
330
331 /**
332 * @internal
333 * Reset global I/O statistics of an Ethernet device to 0.
334 *
335 * @param dev
336 * ethdev handle of port.
337 *
338 * @return
339 * Negative errno value on error, 0 on success.
340 *
341 * @retval 0
342 * Success, statistics has been reset.
343 * @retval -ENOTSUP
344 * Resetting statistics is not supported.
345 * @retval -EINVAL
346 * Resetting statistics is not valid.
347 * @retval -ENOMEM
348 * Not enough memory to get the stats.
349 */
350 typedef int (*eth_stats_reset_t)(struct rte_eth_dev *dev);
351
352 /** @internal Get extended stats of an Ethernet device. */
353 typedef int (*eth_xstats_get_t)(struct rte_eth_dev *dev,
354 struct rte_eth_xstat *stats, unsigned int n);
355
356 /**
357 * @internal
358 * Get extended stats of an Ethernet device.
359 *
360 * @param dev
361 * ethdev handle of port.
362 * @param ids
363 * IDs array to retrieve specific statistics. Must not be NULL.
364 * @param values
365 * A pointer to a table to be filled with device statistics values.
366 * Must not be NULL.
367 * @param n
368 * Element count in @p ids and @p values.
369 *
370 * @return
371 * - A number of filled in stats.
372 * - A negative value on error.
373 */
374 typedef int (*eth_xstats_get_by_id_t)(struct rte_eth_dev *dev,
375 const uint64_t *ids,
376 uint64_t *values,
377 unsigned int n);
378
379 /**
380 * @internal
381 * Reset extended stats of an Ethernet device.
382 *
383 * @param dev
384 * ethdev handle of port.
385 *
386 * @return
387 * Negative errno value on error, 0 on success.
388 *
389 * @retval 0
390 * Success, statistics has been reset.
391 * @retval -ENOTSUP
392 * Resetting statistics is not supported.
393 * @retval -EINVAL
394 * Resetting statistics is not valid.
395 * @retval -ENOMEM
396 * Not enough memory to get the stats.
397 */
398 typedef int (*eth_xstats_reset_t)(struct rte_eth_dev *dev);
399
400 /** @internal Get names of extended stats of an Ethernet device. */
401 typedef int (*eth_xstats_get_names_t)(struct rte_eth_dev *dev,
402 struct rte_eth_xstat_name *xstats_names, unsigned int size);
403
404 /**
405 * @internal
406 * Get names of extended stats of an Ethernet device.
407 *
408 * @param dev
409 * ethdev handle of port.
410 * @param ids
411 * IDs array to retrieve specific statistics. Must not be NULL.
412 * @param xstats_names
413 * An rte_eth_xstat_name array of at least @p size elements to be filled.
414 * Must not be NULL.
415 * @param size
416 * Element count in @p ids and @p xstats_names.
417 *
418 * @return
419 * - A number of filled in stats.
420 * - A negative value on error.
421 */
422 typedef int (*eth_xstats_get_names_by_id_t)(struct rte_eth_dev *dev,
423 const uint64_t *ids, struct rte_eth_xstat_name *xstats_names,
424 unsigned int size);
425
426 /**
427 * @internal
428 * Set a queue statistics mapping for a Tx/Rx queue of an Ethernet device.
429 */
430 typedef int (*eth_queue_stats_mapping_set_t)(struct rte_eth_dev *dev,
431 uint16_t queue_id,
432 uint8_t stat_idx,
433 uint8_t is_rx);
434
435 /** @internal Get specific information of an Ethernet device. */
436 typedef int (*eth_dev_infos_get_t)(struct rte_eth_dev *dev,
437 struct rte_eth_dev_info *dev_info);
438
439 /** @internal Get supported ptypes of an Ethernet device. */
440 typedef const uint32_t *(*eth_dev_supported_ptypes_get_t)(struct rte_eth_dev *dev);
441
442 /**
443 * @internal
444 * Inform Ethernet device about reduced range of packet types to handle.
445 *
446 * @param dev
447 * The Ethernet device identifier.
448 * @param ptype_mask
449 * The ptype family that application is interested in should be bitwise OR of
450 * RTE_PTYPE_*_MASK or 0.
451 * @return
452 * - (0) if Success.
453 */
454 typedef int (*eth_dev_ptypes_set_t)(struct rte_eth_dev *dev,
455 uint32_t ptype_mask);
456
457 /** @internal Start Rx and Tx of a queue of an Ethernet device. */
458 typedef int (*eth_queue_start_t)(struct rte_eth_dev *dev,
459 uint16_t queue_id);
460
461 /** @internal Stop Rx and Tx of a queue of an Ethernet device. */
462 typedef int (*eth_queue_stop_t)(struct rte_eth_dev *dev,
463 uint16_t queue_id);
464
465 /** @internal Set up a receive queue of an Ethernet device. */
466 typedef int (*eth_rx_queue_setup_t)(struct rte_eth_dev *dev,
467 uint16_t rx_queue_id,
468 uint16_t nb_rx_desc,
469 unsigned int socket_id,
470 const struct rte_eth_rxconf *rx_conf,
471 struct rte_mempool *mb_pool);
472
473 /** @internal Setup a transmit queue of an Ethernet device. */
474 typedef int (*eth_tx_queue_setup_t)(struct rte_eth_dev *dev,
475 uint16_t tx_queue_id,
476 uint16_t nb_tx_desc,
477 unsigned int socket_id,
478 const struct rte_eth_txconf *tx_conf);
479
480 /** @internal Enable interrupt of a receive queue of an Ethernet device. */
481 typedef int (*eth_rx_enable_intr_t)(struct rte_eth_dev *dev,
482 uint16_t rx_queue_id);
483
484 /** @internal Disable interrupt of a receive queue of an Ethernet device. */
485 typedef int (*eth_rx_disable_intr_t)(struct rte_eth_dev *dev,
486 uint16_t rx_queue_id);
487
488 /** @internal Release memory resources allocated by given Rx/Tx queue. */
489 typedef void (*eth_queue_release_t)(struct rte_eth_dev *dev,
490 uint16_t queue_id);
491
492 /** @internal Get firmware information of an Ethernet device. */
493 typedef int (*eth_fw_version_get_t)(struct rte_eth_dev *dev,
494 char *fw_version, size_t fw_size);
495
496 /** @internal Force mbufs to be from Tx ring. */
497 typedef int (*eth_tx_done_cleanup_t)(void *txq, uint32_t free_cnt);
498
499 typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
500 uint16_t rx_queue_id, struct rte_eth_rxq_info *qinfo);
501
502 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
503 uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
504
505 typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
506 uint16_t queue_id, struct rte_eth_burst_mode *mode);
507
508 /** @internal Set MTU. */
509 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
510
511 /** @internal Filtering of a VLAN Tag Identifier by an Ethernet device. */
512 typedef int (*vlan_filter_set_t)(struct rte_eth_dev *dev,
513 uint16_t vlan_id,
514 int on);
515
516 /** @internal Set the outer/inner VLAN-TPID by an Ethernet device. */
517 typedef int (*vlan_tpid_set_t)(struct rte_eth_dev *dev,
518 enum rte_vlan_type type, uint16_t tpid);
519
520 /** @internal Set VLAN offload function by an Ethernet device. */
521 typedef int (*vlan_offload_set_t)(struct rte_eth_dev *dev, int mask);
522
523 /** @internal Set port based Tx VLAN insertion by an Ethernet device. */
524 typedef int (*vlan_pvid_set_t)(struct rte_eth_dev *dev,
525 uint16_t vlan_id,
526 int on);
527
528 /** @internal VLAN stripping enable/disable by an queue of Ethernet device. */
529 typedef void (*vlan_strip_queue_set_t)(struct rte_eth_dev *dev,
530 uint16_t rx_queue_id,
531 int on);
532
533 /** @internal Get current flow control parameter on an Ethernet device. */
534 typedef int (*flow_ctrl_get_t)(struct rte_eth_dev *dev,
535 struct rte_eth_fc_conf *fc_conf);
536
537 /** @internal Setup flow control parameter on an Ethernet device. */
538 typedef int (*flow_ctrl_set_t)(struct rte_eth_dev *dev,
539 struct rte_eth_fc_conf *fc_conf);
540
541 /** @internal Setup priority flow control parameter on an Ethernet device. */
542 typedef int (*priority_flow_ctrl_set_t)(struct rte_eth_dev *dev,
543 struct rte_eth_pfc_conf *pfc_conf);
544
545 /** @internal Get info for queue based PFC on an Ethernet device. */
546 typedef int (*priority_flow_ctrl_queue_info_get_t)(struct rte_eth_dev *dev,
547 struct rte_eth_pfc_queue_info *pfc_queue_info);
548 /** @internal Configure queue based PFC parameter on an Ethernet device. */
549 typedef int (*priority_flow_ctrl_queue_config_t)(struct rte_eth_dev *dev,
550 struct rte_eth_pfc_queue_conf *pfc_queue_conf);
551
552 /** @internal Update RSS redirection table on an Ethernet device. */
553 typedef int (*reta_update_t)(struct rte_eth_dev *dev,
554 struct rte_eth_rss_reta_entry64 *reta_conf,
555 uint16_t reta_size);
556
557 /** @internal Query RSS redirection table on an Ethernet device. */
558 typedef int (*reta_query_t)(struct rte_eth_dev *dev,
559 struct rte_eth_rss_reta_entry64 *reta_conf,
560 uint16_t reta_size);
561
562 /** @internal Update RSS hash configuration of an Ethernet device. */
563 typedef int (*rss_hash_update_t)(struct rte_eth_dev *dev,
564 struct rte_eth_rss_conf *rss_conf);
565
566 /** @internal Get current RSS hash configuration of an Ethernet device. */
567 typedef int (*rss_hash_conf_get_t)(struct rte_eth_dev *dev,
568 struct rte_eth_rss_conf *rss_conf);
569
570 /** @internal Turn on SW controllable LED on an Ethernet device. */
571 typedef int (*eth_dev_led_on_t)(struct rte_eth_dev *dev);
572
573 /** @internal Turn off SW controllable LED on an Ethernet device. */
574 typedef int (*eth_dev_led_off_t)(struct rte_eth_dev *dev);
575
576 /** @internal Remove MAC address from receive address register. */
577 typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
578
579 /** @internal Set a MAC address into Receive Address Register. */
580 typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
581 struct rte_ether_addr *mac_addr,
582 uint32_t index,
583 uint32_t vmdq);
584
585 /** @internal Set a MAC address into Receive Address Register. */
586 typedef int (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
587 struct rte_ether_addr *mac_addr);
588
589 /** @internal Set a Unicast Hash bitmap. */
590 typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
591 struct rte_ether_addr *mac_addr,
592 uint8_t on);
593
594 /** @internal Set all Unicast Hash bitmap. */
595 typedef int (*eth_uc_all_hash_table_set_t)(struct rte_eth_dev *dev,
596 uint8_t on);
597
598 /** @internal Set queue Tx rate. */
599 typedef int (*eth_set_queue_rate_limit_t)(struct rte_eth_dev *dev,
600 uint16_t queue_idx,
601 uint16_t tx_rate);
602
603 /** @internal Add tunneling UDP port. */
604 typedef int (*eth_udp_tunnel_port_add_t)(struct rte_eth_dev *dev,
605 struct rte_eth_udp_tunnel *tunnel_udp);
606
607 /** @internal Delete tunneling UDP port. */
608 typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
609 struct rte_eth_udp_tunnel *tunnel_udp);
610
611 /** @internal set the list of multicast addresses on an Ethernet device. */
612 typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
613 struct rte_ether_addr *mc_addr_set,
614 uint32_t nb_mc_addr);
615
616 /** @internal Function used to enable IEEE1588/802.1AS timestamping. */
617 typedef int (*eth_timesync_enable_t)(struct rte_eth_dev *dev);
618
619 /** @internal Function used to disable IEEE1588/802.1AS timestamping. */
620 typedef int (*eth_timesync_disable_t)(struct rte_eth_dev *dev);
621
622 /** @internal Function used to read an Rx IEEE1588/802.1AS timestamp. */
623 typedef int (*eth_timesync_read_rx_timestamp_t)(struct rte_eth_dev *dev,
624 struct timespec *timestamp,
625 uint32_t flags);
626
627 /** @internal Function used to read a Tx IEEE1588/802.1AS timestamp. */
628 typedef int (*eth_timesync_read_tx_timestamp_t)(struct rte_eth_dev *dev,
629 struct timespec *timestamp);
630
631 /** @internal Function used to adjust the device clock. */
632 typedef int (*eth_timesync_adjust_time)(struct rte_eth_dev *dev, int64_t);
633
634 /** @internal Function used to get time from the device clock. */
635 typedef int (*eth_timesync_read_time)(struct rte_eth_dev *dev,
636 struct timespec *timestamp);
637
638 /** @internal Function used to get time from the device clock. */
639 typedef int (*eth_timesync_write_time)(struct rte_eth_dev *dev,
640 const struct timespec *timestamp);
641
642 /** @internal Function used to get the current value of the device clock. */
643 typedef int (*eth_read_clock)(struct rte_eth_dev *dev,
644 uint64_t *timestamp);
645
646 /** @internal Retrieve registers. */
647 typedef int (*eth_get_reg_t)(struct rte_eth_dev *dev,
648 struct rte_dev_reg_info *info);
649
650 /** @internal Retrieve EEPROM size. */
651 typedef int (*eth_get_eeprom_length_t)(struct rte_eth_dev *dev);
652
653 /** @internal Retrieve EEPROM data. */
654 typedef int (*eth_get_eeprom_t)(struct rte_eth_dev *dev,
655 struct rte_dev_eeprom_info *info);
656
657 /** @internal Program EEPROM data. */
658 typedef int (*eth_set_eeprom_t)(struct rte_eth_dev *dev,
659 struct rte_dev_eeprom_info *info);
660
661 /** @internal Retrieve type and size of plugin module EEPROM. */
662 typedef int (*eth_get_module_info_t)(struct rte_eth_dev *dev,
663 struct rte_eth_dev_module_info *modinfo);
664
665 /** @internal Retrieve plugin module EEPROM data. */
666 typedef int (*eth_get_module_eeprom_t)(struct rte_eth_dev *dev,
667 struct rte_dev_eeprom_info *info);
668
669 struct rte_flow_ops;
670 /**
671 * @internal
672 * Get flow operations.
673 *
674 * If the flow API is not supported for the specified device,
675 * the driver can return NULL.
676 */
677 typedef int (*eth_flow_ops_get_t)(struct rte_eth_dev *dev,
678 const struct rte_flow_ops **ops);
679
680 /** @internal Get Traffic Management (TM) operations on an Ethernet device. */
681 typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops);
682
683 /** @internal Get Traffic Metering and Policing (MTR) operations. */
684 typedef int (*eth_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
685
686 /** @internal Get DCB information on an Ethernet device. */
687 typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev,
688 struct rte_eth_dcb_info *dcb_info);
689
690 /** @internal Test if a port supports specific mempool ops. */
691 typedef int (*eth_pool_ops_supported_t)(struct rte_eth_dev *dev,
692 const char *pool);
693
694 /**
695 * @internal
696 * Get the hairpin capabilities.
697 *
698 * @param dev
699 * ethdev handle of port.
700 * @param cap
701 * returns the hairpin capabilities from the device.
702 *
703 * @return
704 * Negative errno value on error, 0 on success.
705 *
706 * @retval 0
707 * Success, hairpin is supported.
708 * @retval -ENOTSUP
709 * Hairpin is not supported.
710 */
711 typedef int (*eth_hairpin_cap_get_t)(struct rte_eth_dev *dev,
712 struct rte_eth_hairpin_cap *cap);
713
714 /**
715 * @internal
716 * Setup Rx hairpin queue.
717 *
718 * @param dev
719 * ethdev handle of port.
720 * @param rx_queue_id
721 * the selected Rx queue index.
722 * @param nb_rx_desc
723 * the requested number of descriptors for this queue. 0 - use PMD default.
724 * @param conf
725 * the Rx hairpin configuration structure.
726 *
727 * @return
728 * Negative errno value on error, 0 on success.
729 *
730 * @retval 0
731 * Success, hairpin is supported.
732 * @retval -ENOTSUP
733 * Hairpin is not supported.
734 * @retval -EINVAL
735 * One of the parameters is invalid.
736 * @retval -ENOMEM
737 * Unable to allocate resources.
738 */
739 typedef int (*eth_rx_hairpin_queue_setup_t)
740 (struct rte_eth_dev *dev, uint16_t rx_queue_id,
741 uint16_t nb_rx_desc,
742 const struct rte_eth_hairpin_conf *conf);
743
744 /**
745 * @internal
746 * Setup Tx hairpin queue.
747 *
748 * @param dev
749 * ethdev handle of port.
750 * @param tx_queue_id
751 * the selected Tx queue index.
752 * @param nb_tx_desc
753 * the requested number of descriptors for this queue. 0 - use PMD default.
754 * @param conf
755 * the Tx hairpin configuration structure.
756 *
757 * @return
758 * Negative errno value on error, 0 on success.
759 *
760 * @retval 0
761 * Success, hairpin is supported.
762 * @retval -ENOTSUP
763 * Hairpin is not supported.
764 * @retval -EINVAL
765 * One of the parameters is invalid.
766 * @retval -ENOMEM
767 * Unable to allocate resources.
768 */
769 typedef int (*eth_tx_hairpin_queue_setup_t)
770 (struct rte_eth_dev *dev, uint16_t tx_queue_id,
771 uint16_t nb_tx_desc,
772 const struct rte_eth_hairpin_conf *hairpin_conf);
773
774 /**
775 * @internal
776 * Get Forward Error Correction(FEC) capability.
777 *
778 * @param dev
779 * ethdev handle of port.
780 * @param speed_fec_capa
781 * speed_fec_capa is out only with per-speed capabilities.
782 * @param num
783 * a number of elements in an speed_fec_capa array.
784 *
785 * @return
786 * Negative errno value on error, positive value on success.
787 *
788 * @retval positive value
789 * A non-negative value lower or equal to num: success. The return value
790 * is the number of entries filled in the fec capa array.
791 * A non-negative value higher than num: error, the given fec capa array
792 * is too small. The return value corresponds to the num that should
793 * be given to succeed. The entries in the fec capa array are not valid
794 * and shall not be used by the caller.
795 * @retval -ENOTSUP
796 * Operation is not supported.
797 * @retval -EIO
798 * Device is removed.
799 * @retval -EINVAL
800 * *num* or *speed_fec_capa* invalid.
801 */
802 typedef int (*eth_fec_get_capability_t)(struct rte_eth_dev *dev,
803 struct rte_eth_fec_capa *speed_fec_capa, unsigned int num);
804
805 /**
806 * @internal
807 * Get Forward Error Correction(FEC) mode.
808 *
809 * @param dev
810 * ethdev handle of port.
811 * @param fec_capa
812 * a bitmask of enabled FEC modes. If AUTO bit is set, other
813 * bits specify FEC modes which may be negotiated. If AUTO
814 * bit is clear, specify FEC modes to be used (only one valid
815 * mode per speed may be set).
816 *
817 * @return
818 * Negative errno value on error, 0 on success.
819 *
820 * @retval 0
821 * Success, get FEC success.
822 * @retval -ENOTSUP
823 * Operation is not supported.
824 * @retval -EIO
825 * Device is removed.
826 */
827 typedef int (*eth_fec_get_t)(struct rte_eth_dev *dev,
828 uint32_t *fec_capa);
829
830 /**
831 * @internal
832 * Set Forward Error Correction(FEC) mode.
833 *
834 * @param dev
835 * ethdev handle of port.
836 * @param fec_capa
837 * bitmask of allowed FEC modes. It must be only one
838 * if AUTO is disabled. If AUTO is enabled, other
839 * bits specify FEC modes which may be negotiated.
840 *
841 * @return
842 * Negative errno value on error, 0 on success.
843 *
844 * @retval 0
845 * Success, set FEC success.
846 * @retval -ENOTSUP
847 * Operation is not supported.
848 * @retval -EINVAL
849 * Unsupported FEC mode requested.
850 * @retval -EIO
851 * Device is removed.
852 */
853 typedef int (*eth_fec_set_t)(struct rte_eth_dev *dev, uint32_t fec_capa);
854
855 /**
856 * @internal
857 * Get all hairpin Tx/Rx peer ports of the current device, if any.
858 *
859 * @param dev
860 * ethdev handle of port.
861 * @param peer_ports
862 * array to save the ports list.
863 * @param len
864 * array length.
865 * @param direction
866 * value to decide the current to peer direction
867 * positive - used as Tx to get all peer Rx ports.
868 * zero - used as Rx to get all peer Tx ports.
869 *
870 * @return
871 * Negative errno value on error, 0 or positive on success.
872 *
873 * @retval 0
874 * Success, no peer ports.
875 * @retval >0
876 * Actual number of the peer ports.
877 * @retval -ENOTSUP
878 * Get peer ports API is not supported.
879 * @retval -EINVAL
880 * One of the parameters is invalid.
881 */
882 typedef int (*hairpin_get_peer_ports_t)(struct rte_eth_dev *dev,
883 uint16_t *peer_ports, size_t len,
884 uint32_t direction);
885
886 /**
887 * @internal
888 * Bind all hairpin Tx queues of one port to the Rx queues of the peer port.
889 *
890 * @param dev
891 * ethdev handle of port.
892 * @param rx_port
893 * the peer Rx port.
894 *
895 * @return
896 * Negative errno value on error, 0 on success.
897 *
898 * @retval 0
899 * Success, bind successfully.
900 * @retval -ENOTSUP
901 * Bind API is not supported.
902 * @retval -EINVAL
903 * One of the parameters is invalid.
904 * @retval -EBUSY
905 * Device is not started.
906 */
907 typedef int (*eth_hairpin_bind_t)(struct rte_eth_dev *dev,
908 uint16_t rx_port);
909
910 /**
911 * @internal
912 * Unbind all hairpin Tx queues of one port from the Rx queues of the peer port.
913 *
914 * @param dev
915 * ethdev handle of port.
916 * @param rx_port
917 * the peer Rx port.
918 *
919 * @return
920 * Negative errno value on error, 0 on success.
921 *
922 * @retval 0
923 * Success, unbind successfully.
924 * @retval -ENOTSUP
925 * Bind API is not supported.
926 * @retval -EINVAL
927 * One of the parameters is invalid.
928 * @retval -EBUSY
929 * Device is already stopped.
930 */
931 typedef int (*eth_hairpin_unbind_t)(struct rte_eth_dev *dev,
932 uint16_t rx_port);
933
934 /** @internal Update and fetch peer queue information. */
935 typedef int (*eth_hairpin_queue_peer_update_t)
936 (struct rte_eth_dev *dev, uint16_t peer_queue,
937 struct rte_hairpin_peer_info *current_info,
938 struct rte_hairpin_peer_info *peer_info, uint32_t direction);
939
940 /** @internal Bind peer queue to the current queue with fetched information. */
941 typedef int (*eth_hairpin_queue_peer_bind_t)
942 (struct rte_eth_dev *dev, uint16_t cur_queue,
943 struct rte_hairpin_peer_info *peer_info, uint32_t direction);
944
945 /** @internal Unbind peer queue from the current queue. */
946 typedef int (*eth_hairpin_queue_peer_unbind_t)
947 (struct rte_eth_dev *dev, uint16_t cur_queue, uint32_t direction);
948
949 /**
950 * @internal
951 * Get address of memory location whose contents will change whenever there is
952 * new data to be received on an Rx queue.
953 *
954 * @param rxq
955 * Ethdev queue pointer.
956 * @param pmc
957 * The pointer to power-optimized monitoring condition structure.
958 * @return
959 * Negative errno value on error, 0 on success.
960 *
961 * @retval 0
962 * Success
963 * @retval -EINVAL
964 * Invalid parameters
965 */
966 typedef int (*eth_get_monitor_addr_t)(void *rxq,
967 struct rte_power_monitor_cond *pmc);
968
969 /**
970 * @internal
971 * Get representor info to be able to calculate the unique representor ID.
972 *
973 * Caller should pass NULL as pointer of info to get number of entries,
974 * allocate info buffer according to returned entry number, then call
975 * again with buffer to get real info.
976 *
977 * To calculate the representor ID, caller should iterate each entry,
978 * match controller index, pf index, vf or sf start index and range,
979 * then calculate representor ID from offset to vf/sf start index.
980 * @see rte_eth_representor_id_get.
981 *
982 * @param dev
983 * Ethdev handle of port.
984 * @param [out] info
985 * Pointer to memory to save device representor info.
986 * @return
987 * Negative errno value on error, number of info entries otherwise.
988 */
989
990 typedef int (*eth_representor_info_get_t)(struct rte_eth_dev *dev,
991 struct rte_eth_representor_info *info);
992
993 /**
994 * @internal
995 * Negotiate the NIC's ability to deliver specific kinds of metadata to the PMD.
996 *
997 * @param dev
998 * Port (ethdev) handle
999 *
1000 * @param[inout] features
1001 * Feature selection buffer
1002 *
1003 * @return
1004 * Negative errno value on error, zero otherwise
1005 */
1006 typedef int (*eth_rx_metadata_negotiate_t)(struct rte_eth_dev *dev,
1007 uint64_t *features);
1008
1009 /**
1010 * @internal
1011 * Get IP reassembly offload capability of a PMD.
1012 *
1013 * @param dev
1014 * Port (ethdev) handle
1015 *
1016 * @param[out] conf
1017 * IP reassembly capability supported by the PMD
1018 *
1019 * @return
1020 * Negative errno value on error, zero otherwise
1021 */
1022 typedef int (*eth_ip_reassembly_capability_get_t)(struct rte_eth_dev *dev,
1023 struct rte_eth_ip_reassembly_params *capa);
1024
1025 /**
1026 * @internal
1027 * Get IP reassembly offload configuration parameters set in PMD.
1028 *
1029 * @param dev
1030 * Port (ethdev) handle
1031 *
1032 * @param[out] conf
1033 * Configuration parameters for IP reassembly.
1034 *
1035 * @return
1036 * Negative errno value on error, zero otherwise
1037 */
1038 typedef int (*eth_ip_reassembly_conf_get_t)(struct rte_eth_dev *dev,
1039 struct rte_eth_ip_reassembly_params *conf);
1040
1041 /**
1042 * @internal
1043 * Set configuration parameters for enabling IP reassembly offload in hardware.
1044 *
1045 * @param dev
1046 * Port (ethdev) handle
1047 *
1048 * @param[in] conf
1049 * Configuration parameters for IP reassembly.
1050 *
1051 * @return
1052 * Negative errno value on error, zero otherwise
1053 */
1054 typedef int (*eth_ip_reassembly_conf_set_t)(struct rte_eth_dev *dev,
1055 const struct rte_eth_ip_reassembly_params *conf);
1056
1057 /**
1058 * @internal
1059 * Dump private info from device to a file.
1060 *
1061 * @param dev
1062 * Port (ethdev) handle.
1063 * @param file
1064 * A pointer to a file for output.
1065 *
1066 * @return
1067 * Negative value on error, 0 on success.
1068 *
1069 * @retval 0
1070 * Success
1071 * @retval -EINVAL
1072 * Invalid file
1073 */
1074 typedef int (*eth_dev_priv_dump_t)(struct rte_eth_dev *dev, FILE *file);
1075
1076 /**
1077 * @internal A structure containing the functions exported by an Ethernet driver.
1078 */
1079 struct eth_dev_ops {
1080 eth_dev_configure_t dev_configure; /**< Configure device */
1081 eth_dev_start_t dev_start; /**< Start device */
1082 eth_dev_stop_t dev_stop; /**< Stop device */
1083 eth_dev_set_link_up_t dev_set_link_up; /**< Device link up */
1084 eth_dev_set_link_down_t dev_set_link_down; /**< Device link down */
1085 eth_dev_close_t dev_close; /**< Close device */
1086 eth_dev_reset_t dev_reset; /**< Reset device */
1087 eth_link_update_t link_update; /**< Get device link state */
1088 /** Check if the device was physically removed */
1089 eth_is_removed_t is_removed;
1090
1091 eth_promiscuous_enable_t promiscuous_enable; /**< Promiscuous ON */
1092 eth_promiscuous_disable_t promiscuous_disable;/**< Promiscuous OFF */
1093 eth_allmulticast_enable_t allmulticast_enable;/**< Rx multicast ON */
1094 eth_allmulticast_disable_t allmulticast_disable;/**< Rx multicast OFF */
1095 eth_mac_addr_remove_t mac_addr_remove; /**< Remove MAC address */
1096 eth_mac_addr_add_t mac_addr_add; /**< Add a MAC address */
1097 eth_mac_addr_set_t mac_addr_set; /**< Set a MAC address */
1098 /** Set list of multicast addresses */
1099 eth_set_mc_addr_list_t set_mc_addr_list;
1100 mtu_set_t mtu_set; /**< Set MTU */
1101
1102 /** Get generic device statistics */
1103 eth_stats_get_t stats_get;
1104 /** Reset generic device statistics */
1105 eth_stats_reset_t stats_reset;
1106 /** Get extended device statistics */
1107 eth_xstats_get_t xstats_get;
1108 /** Reset extended device statistics */
1109 eth_xstats_reset_t xstats_reset;
1110 /** Get names of extended statistics */
1111 eth_xstats_get_names_t xstats_get_names;
1112 /** Configure per queue stat counter mapping */
1113 eth_queue_stats_mapping_set_t queue_stats_mapping_set;
1114
1115 eth_dev_infos_get_t dev_infos_get; /**< Get device info */
1116 /** Retrieve Rx queue information */
1117 eth_rxq_info_get_t rxq_info_get;
1118 /** Retrieve Tx queue information */
1119 eth_txq_info_get_t txq_info_get;
1120 eth_burst_mode_get_t rx_burst_mode_get; /**< Get Rx burst mode */
1121 eth_burst_mode_get_t tx_burst_mode_get; /**< Get Tx burst mode */
1122 eth_fw_version_get_t fw_version_get; /**< Get firmware version */
1123
1124 /** Get packet types supported and identified by device */
1125 eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
1126 /**
1127 * Inform Ethernet device about reduced range of packet types to
1128 * handle
1129 */
1130 eth_dev_ptypes_set_t dev_ptypes_set;
1131
1132 /** Filter VLAN Setup */
1133 vlan_filter_set_t vlan_filter_set;
1134 /** Outer/Inner VLAN TPID Setup */
1135 vlan_tpid_set_t vlan_tpid_set;
1136 /** VLAN Stripping on queue */
1137 vlan_strip_queue_set_t vlan_strip_queue_set;
1138 /** Set VLAN Offload */
1139 vlan_offload_set_t vlan_offload_set;
1140 /** Set port based Tx VLAN insertion */
1141 vlan_pvid_set_t vlan_pvid_set;
1142
1143 eth_queue_start_t rx_queue_start;/**< Start Rx for a queue */
1144 eth_queue_stop_t rx_queue_stop; /**< Stop Rx for a queue */
1145 eth_queue_start_t tx_queue_start;/**< Start Tx for a queue */
1146 eth_queue_stop_t tx_queue_stop; /**< Stop Tx for a queue */
1147 eth_rx_queue_setup_t rx_queue_setup;/**< Set up device Rx queue */
1148 eth_queue_release_t rx_queue_release; /**< Release Rx queue */
1149
1150 /** Enable Rx queue interrupt */
1151 eth_rx_enable_intr_t rx_queue_intr_enable;
1152 /** Disable Rx queue interrupt */
1153 eth_rx_disable_intr_t rx_queue_intr_disable;
1154
1155 eth_tx_queue_setup_t tx_queue_setup;/**< Set up device Tx queue */
1156 eth_queue_release_t tx_queue_release; /**< Release Tx queue */
1157 eth_tx_done_cleanup_t tx_done_cleanup;/**< Free Tx ring mbufs */
1158
1159 eth_dev_led_on_t dev_led_on; /**< Turn on LED */
1160 eth_dev_led_off_t dev_led_off; /**< Turn off LED */
1161
1162 flow_ctrl_get_t flow_ctrl_get; /**< Get flow control */
1163 flow_ctrl_set_t flow_ctrl_set; /**< Setup flow control */
1164 /** Setup priority flow control */
1165 priority_flow_ctrl_set_t priority_flow_ctrl_set;
1166 /** Priority flow control queue info get */
1167 priority_flow_ctrl_queue_info_get_t priority_flow_ctrl_queue_info_get;
1168 /** Priority flow control queue configure */
1169 priority_flow_ctrl_queue_config_t priority_flow_ctrl_queue_config;
1170
1171 /** Set Unicast Table Array */
1172 eth_uc_hash_table_set_t uc_hash_table_set;
1173 /** Set Unicast hash bitmap */
1174 eth_uc_all_hash_table_set_t uc_all_hash_table_set;
1175
1176 /** Add UDP tunnel port */
1177 eth_udp_tunnel_port_add_t udp_tunnel_port_add;
1178 /** Delete UDP tunnel port */
1179 eth_udp_tunnel_port_del_t udp_tunnel_port_del;
1180
1181 /** Set queue rate limit */
1182 eth_set_queue_rate_limit_t set_queue_rate_limit;
1183
1184 /** Configure RSS hash protocols and hashing key */
1185 rss_hash_update_t rss_hash_update;
1186 /** Get current RSS hash configuration */
1187 rss_hash_conf_get_t rss_hash_conf_get;
1188 /** Update redirection table */
1189 reta_update_t reta_update;
1190 /** Query redirection table */
1191 reta_query_t reta_query;
1192
1193 eth_get_reg_t get_reg; /**< Get registers */
1194 eth_get_eeprom_length_t get_eeprom_length; /**< Get EEPROM length */
1195 eth_get_eeprom_t get_eeprom; /**< Get EEPROM data */
1196 eth_set_eeprom_t set_eeprom; /**< Set EEPROM */
1197
1198 /** Get plugin module EEPROM attribute */
1199 eth_get_module_info_t get_module_info;
1200 /** Get plugin module EEPROM data */
1201 eth_get_module_eeprom_t get_module_eeprom;
1202
1203 eth_flow_ops_get_t flow_ops_get; /**< Get flow operations */
1204
1205 eth_get_dcb_info get_dcb_info; /**< Get DCB information */
1206
1207 /** Turn IEEE1588/802.1AS timestamping on */
1208 eth_timesync_enable_t timesync_enable;
1209 /** Turn IEEE1588/802.1AS timestamping off */
1210 eth_timesync_disable_t timesync_disable;
1211 /** Read the IEEE1588/802.1AS Rx timestamp */
1212 eth_timesync_read_rx_timestamp_t timesync_read_rx_timestamp;
1213 /** Read the IEEE1588/802.1AS Tx timestamp */
1214 eth_timesync_read_tx_timestamp_t timesync_read_tx_timestamp;
1215 /** Adjust the device clock */
1216 eth_timesync_adjust_time timesync_adjust_time;
1217 /** Get the device clock time */
1218 eth_timesync_read_time timesync_read_time;
1219 /** Set the device clock time */
1220 eth_timesync_write_time timesync_write_time;
1221
1222 eth_read_clock read_clock;
1223
1224 /** Get extended device statistic values by ID */
1225 eth_xstats_get_by_id_t xstats_get_by_id;
1226 /** Get name of extended device statistics by ID */
1227 eth_xstats_get_names_by_id_t xstats_get_names_by_id;
1228
1229 /** Get Traffic Management (TM) operations */
1230 eth_tm_ops_get_t tm_ops_get;
1231
1232 /** Get Traffic Metering and Policing (MTR) operations */
1233 eth_mtr_ops_get_t mtr_ops_get;
1234
1235 /** Test if a port supports specific mempool ops */
1236 eth_pool_ops_supported_t pool_ops_supported;
1237
1238 /** Returns the hairpin capabilities */
1239 eth_hairpin_cap_get_t hairpin_cap_get;
1240 /** Set up device Rx hairpin queue */
1241 eth_rx_hairpin_queue_setup_t rx_hairpin_queue_setup;
1242 /** Set up device Tx hairpin queue */
1243 eth_tx_hairpin_queue_setup_t tx_hairpin_queue_setup;
1244
1245 /** Get Forward Error Correction(FEC) capability */
1246 eth_fec_get_capability_t fec_get_capability;
1247 /** Get Forward Error Correction(FEC) mode */
1248 eth_fec_get_t fec_get;
1249 /** Set Forward Error Correction(FEC) mode */
1250 eth_fec_set_t fec_set;
1251
1252 /** Get hairpin peer ports list */
1253 hairpin_get_peer_ports_t hairpin_get_peer_ports;
1254 /** Bind all hairpin Tx queues of device to the peer port Rx queues */
1255 eth_hairpin_bind_t hairpin_bind;
1256 /** Unbind all hairpin Tx queues from the peer port Rx queues */
1257 eth_hairpin_unbind_t hairpin_unbind;
1258 /** Pass the current queue info and get the peer queue info */
1259 eth_hairpin_queue_peer_update_t hairpin_queue_peer_update;
1260 /** Set up the connection between the pair of hairpin queues */
1261 eth_hairpin_queue_peer_bind_t hairpin_queue_peer_bind;
1262 /** Disconnect the hairpin queues of a pair from each other */
1263 eth_hairpin_queue_peer_unbind_t hairpin_queue_peer_unbind;
1264
1265 /** Get power monitoring condition for Rx queue */
1266 eth_get_monitor_addr_t get_monitor_addr;
1267
1268 /** Get representor info */
1269 eth_representor_info_get_t representor_info_get;
1270
1271 /**
1272 * Negotiate the NIC's ability to deliver specific
1273 * kinds of metadata to the PMD
1274 */
1275 eth_rx_metadata_negotiate_t rx_metadata_negotiate;
1276
1277 /** Get IP reassembly capability */
1278 eth_ip_reassembly_capability_get_t ip_reassembly_capability_get;
1279 /** Get IP reassembly configuration */
1280 eth_ip_reassembly_conf_get_t ip_reassembly_conf_get;
1281 /** Set IP reassembly configuration */
1282 eth_ip_reassembly_conf_set_t ip_reassembly_conf_set;
1283
1284 /** Dump private info from device */
1285 eth_dev_priv_dump_t eth_dev_priv_dump;
1286 };
1287
1288 /**
1289 * @internal
1290 * Check if the selected Rx queue is hairpin queue.
1291 *
1292 * @param dev
1293 * Pointer to the selected device.
1294 * @param queue_id
1295 * The selected queue.
1296 *
1297 * @return
1298 * - (1) if the queue is hairpin queue, 0 otherwise.
1299 */
1300 __rte_internal
1301 int rte_eth_dev_is_rx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
1302
1303 /**
1304 * @internal
1305 * Check if the selected Tx queue is hairpin queue.
1306 *
1307 * @param dev
1308 * Pointer to the selected device.
1309 * @param queue_id
1310 * The selected queue.
1311 *
1312 * @return
1313 * - (1) if the queue is hairpin queue, 0 otherwise.
1314 */
1315 __rte_internal
1316 int rte_eth_dev_is_tx_hairpin_queue(struct rte_eth_dev *dev, uint16_t queue_id);
1317
1318 /**
1319 * @internal
1320 * Returns a ethdev slot specified by the unique identifier name.
1321 *
1322 * @param name
1323 * The pointer to the Unique identifier name for each Ethernet device
1324 * @return
1325 * - The pointer to the ethdev slot, on success. NULL on error
1326 */
1327 __rte_internal
1328 struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
1329
1330 /**
1331 * @internal
1332 * Allocates a new ethdev slot for an Ethernet device and returns the pointer
1333 * to that slot for the driver to use.
1334 *
1335 * @param name Unique identifier name for each Ethernet device
1336 * @return
1337 * - Slot in the rte_dev_devices array for a new device;
1338 */
1339 __rte_internal
1340 struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
1341
1342 /**
1343 * @internal
1344 * Attach to the ethdev already initialized by the primary
1345 * process.
1346 *
1347 * @param name Ethernet device's name.
1348 * @return
1349 * - Success: Slot in the rte_dev_devices array for attached
1350 * device.
1351 * - Error: Null pointer.
1352 */
1353 __rte_internal
1354 struct rte_eth_dev *rte_eth_dev_attach_secondary(const char *name);
1355
1356 /**
1357 * @internal
1358 * Notify RTE_ETH_EVENT_DESTROY and release the specified ethdev port.
1359 *
1360 * The following PMD-managed data fields will be freed:
1361 * - dev_private
1362 * - mac_addrs
1363 * - hash_mac_addrs
1364 * If one of these fields should not be freed,
1365 * it must be reset to NULL by the PMD, typically in dev_close method.
1366 *
1367 * @param eth_dev
1368 * Device to be detached.
1369 * @return
1370 * - 0 on success, negative on error
1371 */
1372 __rte_internal
1373 int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
1374
1375 /**
1376 * @internal
1377 * Release device queues and clear its configuration to force the user
1378 * application to reconfigure it. It is for internal use only.
1379 *
1380 * @param dev
1381 * Pointer to struct rte_eth_dev.
1382 *
1383 * @return
1384 * void
1385 */
1386 __rte_internal
1387 void rte_eth_dev_internal_reset(struct rte_eth_dev *dev);
1388
1389 /**
1390 * @internal Executes all the user application registered callbacks for
1391 * the specific device. It is for DPDK internal user only. User
1392 * application should not call it directly.
1393 *
1394 * @param dev
1395 * Pointer to struct rte_eth_dev.
1396 * @param event
1397 * Eth device interrupt event type.
1398 * @param ret_param
1399 * To pass data back to user application.
1400 * This allows the user application to decide if a particular function
1401 * is permitted or not.
1402 *
1403 * @return
1404 * int
1405 */
1406 __rte_internal
1407 int rte_eth_dev_callback_process(struct rte_eth_dev *dev,
1408 enum rte_eth_event_type event, void *ret_param);
1409
1410 /**
1411 * @internal
1412 * This is the last step of device probing.
1413 * It must be called after a port is allocated and initialized successfully.
1414 *
1415 * The notification RTE_ETH_EVENT_NEW is sent to other entities
1416 * (libraries and applications).
1417 * The state is set as RTE_ETH_DEV_ATTACHED.
1418 *
1419 * @param dev
1420 * New ethdev port.
1421 */
1422 __rte_internal
1423 void rte_eth_dev_probing_finish(struct rte_eth_dev *dev);
1424
1425 /**
1426 * Create memzone for HW rings.
1427 * malloc can't be used as the physical address is needed.
1428 * If the memzone is already created, then this function returns a ptr
1429 * to the old one.
1430 *
1431 * @param eth_dev
1432 * The *eth_dev* pointer is the address of the *rte_eth_dev* structure
1433 * @param name
1434 * The name of the memory zone
1435 * @param queue_id
1436 * The index of the queue to add to name
1437 * @param size
1438 * The sizeof of the memory area
1439 * @param align
1440 * Alignment for resulting memzone. Must be a power of 2.
1441 * @param socket_id
1442 * The *socket_id* argument is the socket identifier in case of NUMA.
1443 */
1444 __rte_internal
1445 const struct rte_memzone *
1446 rte_eth_dma_zone_reserve(const struct rte_eth_dev *eth_dev, const char *name,
1447 uint16_t queue_id, size_t size,
1448 unsigned align, int socket_id);
1449
1450 /**
1451 * Free previously allocated memzone for HW rings.
1452 *
1453 * @param eth_dev
1454 * The *eth_dev* pointer is the address of the *rte_eth_dev* structure
1455 * @param name
1456 * The name of the memory zone
1457 * @param queue_id
1458 * The index of the queue to add to name
1459 * @return
1460 * Negative errno value on error, 0 on success.
1461 */
1462 __rte_internal
1463 int
1464 rte_eth_dma_zone_free(const struct rte_eth_dev *eth_dev, const char *name,
1465 uint16_t queue_id);
1466
1467 /**
1468 * @internal
1469 * Atomically set the link status for the specific device.
1470 * It is for use by DPDK device driver use only.
1471 * User applications should not call it
1472 *
1473 * @param dev
1474 * Pointer to struct rte_eth_dev.
1475 * @param link
1476 * New link status value.
1477 * @return
1478 * Same convention as eth_link_update operation.
1479 * 0 if link up status has changed
1480 * -1 if link up status was unchanged
1481 */
1482 static inline int
rte_eth_linkstatus_set(struct rte_eth_dev * dev,const struct rte_eth_link * new_link)1483 rte_eth_linkstatus_set(struct rte_eth_dev *dev,
1484 const struct rte_eth_link *new_link)
1485 {
1486 uint64_t *dev_link = (uint64_t *)&(dev->data->dev_link);
1487 union {
1488 uint64_t val64;
1489 struct rte_eth_link link;
1490 } orig;
1491
1492 RTE_BUILD_BUG_ON(sizeof(*new_link) != sizeof(uint64_t));
1493
1494 orig.val64 = __atomic_exchange_n(dev_link, *(const uint64_t *)new_link,
1495 __ATOMIC_SEQ_CST);
1496
1497 return (orig.link.link_status == new_link->link_status) ? -1 : 0;
1498 }
1499
1500 /**
1501 * @internal
1502 * Atomically get the link speed and status.
1503 *
1504 * @param dev
1505 * Pointer to struct rte_eth_dev.
1506 * @param link
1507 * link status value.
1508 */
1509 static inline void
rte_eth_linkstatus_get(const struct rte_eth_dev * dev,struct rte_eth_link * link)1510 rte_eth_linkstatus_get(const struct rte_eth_dev *dev,
1511 struct rte_eth_link *link)
1512 {
1513 uint64_t *src = (uint64_t *)&(dev->data->dev_link);
1514 uint64_t *dst = (uint64_t *)link;
1515
1516 RTE_BUILD_BUG_ON(sizeof(*link) != sizeof(uint64_t));
1517
1518 *dst = __atomic_load_n(src, __ATOMIC_SEQ_CST);
1519 }
1520
1521 /**
1522 * @internal
1523 * Dummy DPDK callback for Rx/Tx packet burst.
1524 *
1525 * @param queue
1526 * Pointer to Rx/Tx queue
1527 * @param pkts
1528 * Packet array
1529 * @param nb_pkts
1530 * Number of packets in packet array
1531 */
1532 __rte_internal
1533 uint16_t
1534 rte_eth_pkt_burst_dummy(void *queue __rte_unused,
1535 struct rte_mbuf **pkts __rte_unused,
1536 uint16_t nb_pkts __rte_unused);
1537
1538 /**
1539 * Allocate an unique switch domain identifier.
1540 *
1541 * A pool of switch domain identifiers which can be allocated on request. This
1542 * will enabled devices which support the concept of switch domains to request
1543 * a switch domain ID which is guaranteed to be unique from other devices
1544 * running in the same process.
1545 *
1546 * @param domain_id
1547 * switch domain identifier parameter to pass back to application
1548 *
1549 * @return
1550 * Negative errno value on error, 0 on success.
1551 */
1552 __rte_internal
1553 int
1554 rte_eth_switch_domain_alloc(uint16_t *domain_id);
1555
1556 /**
1557 * Free switch domain.
1558 *
1559 * Return a switch domain identifier to the pool of free identifiers after it is
1560 * no longer in use by device.
1561 *
1562 * @param domain_id
1563 * switch domain identifier to free
1564 *
1565 * @return
1566 * Negative errno value on error, 0 on success.
1567 */
1568 __rte_internal
1569 int
1570 rte_eth_switch_domain_free(uint16_t domain_id);
1571
1572 /**
1573 * Generic Ethernet device arguments
1574 *
1575 * One type of representor each structure.
1576 */
1577 struct rte_eth_devargs {
1578 uint16_t mh_controllers[RTE_MAX_MULTI_HOST_CTRLS];
1579 /** controller/s number in case of multi-host */
1580 uint16_t nb_mh_controllers;
1581 /** number of controllers in multi-host controllers field */
1582 uint16_t ports[RTE_MAX_ETHPORTS];
1583 /** port/s number to enable on a multi-port single function */
1584 uint16_t nb_ports;
1585 /** number of ports in ports field */
1586 uint16_t representor_ports[RTE_MAX_ETHPORTS];
1587 /** representor port/s identifier to enable on device */
1588 uint16_t nb_representor_ports;
1589 /** number of ports in representor port field */
1590 enum rte_eth_representor_type type; /* type of representor */
1591 };
1592
1593 /**
1594 * PMD helper function to get representor ID from location detail.
1595 *
1596 * Get representor ID from controller, pf and (sf or vf).
1597 * The mapping is retrieved from rte_eth_representor_info_get().
1598 *
1599 * For backward compatibility, if no representor info, direct
1600 * map legacy VF (no controller and pf).
1601 *
1602 * @param port_id
1603 * Port ID of the backing device.
1604 * @param type
1605 * Representor type.
1606 * @param controller
1607 * Controller ID, -1 if unspecified.
1608 * @param pf
1609 * PF port ID, -1 if unspecified.
1610 * @param representor_port
1611 * VF or SF representor port number, -1 if unspecified.
1612 * @param repr_id
1613 * Pointer to output representor ID.
1614 *
1615 * @return
1616 * Negative errno value on error, 0 on success.
1617 */
1618 __rte_internal
1619 int
1620 rte_eth_representor_id_get(uint16_t port_id,
1621 enum rte_eth_representor_type type,
1622 int controller, int pf, int representor_port,
1623 uint16_t *repr_id);
1624
1625 /**
1626 * PMD helper function to parse ethdev arguments
1627 *
1628 * @param devargs
1629 * device arguments
1630 * @param eth_devargs
1631 * parsed ethdev specific arguments.
1632 *
1633 * @return
1634 * Negative errno value on error, 0 on success.
1635 */
1636 __rte_internal
1637 int
1638 rte_eth_devargs_parse(const char *devargs, struct rte_eth_devargs *eth_devargs);
1639
1640
1641 typedef int (*ethdev_init_t)(struct rte_eth_dev *ethdev, void *init_params);
1642 typedef int (*ethdev_bus_specific_init)(struct rte_eth_dev *ethdev,
1643 void *bus_specific_init_params);
1644
1645 /**
1646 * PMD helper function for the creation of a new ethdev ports.
1647 *
1648 * @param device
1649 * rte_device handle.
1650 * @param name
1651 * port name.
1652 * @param priv_data_size
1653 * size of private data required for port.
1654 * @param bus_specific_init
1655 * port bus specific initialisation callback function
1656 * @param bus_init_params
1657 * port bus specific initialisation parameters
1658 * @param ethdev_init
1659 * device specific port initialization callback function
1660 * @param init_params
1661 * port initialisation parameters
1662 *
1663 * @return
1664 * Negative errno value on error, 0 on success.
1665 */
1666 __rte_internal
1667 int
1668 rte_eth_dev_create(struct rte_device *device, const char *name,
1669 size_t priv_data_size,
1670 ethdev_bus_specific_init bus_specific_init, void *bus_init_params,
1671 ethdev_init_t ethdev_init, void *init_params);
1672
1673
1674 typedef int (*ethdev_uninit_t)(struct rte_eth_dev *ethdev);
1675
1676 /**
1677 * PMD helper function for cleaning up the resources of a ethdev port on it's
1678 * destruction.
1679 *
1680 * @param ethdev
1681 * ethdev handle of port.
1682 * @param ethdev_uninit
1683 * device specific port un-initialise callback function
1684 *
1685 * @return
1686 * Negative errno value on error, 0 on success.
1687 */
1688 __rte_internal
1689 int
1690 rte_eth_dev_destroy(struct rte_eth_dev *ethdev, ethdev_uninit_t ethdev_uninit);
1691
1692 /**
1693 * @internal
1694 * Pass the current hairpin queue HW and/or SW information to the peer queue
1695 * and fetch back the information of the peer queue.
1696 *
1697 * @param peer_port
1698 * Peer port identifier of the Ethernet device.
1699 * @param peer_queue
1700 * Peer queue index of the port.
1701 * @param cur_info
1702 * Pointer to the current information structure.
1703 * @param peer_info
1704 * Pointer to the peer information, output.
1705 * @param direction
1706 * Direction to pass the information.
1707 * positive - pass Tx queue information and get peer Rx queue information
1708 * zero - pass Rx queue information and get peer Tx queue information
1709 *
1710 * @return
1711 * Negative errno value on error, 0 on success.
1712 */
1713 __rte_internal
1714 int
1715 rte_eth_hairpin_queue_peer_update(uint16_t peer_port, uint16_t peer_queue,
1716 struct rte_hairpin_peer_info *cur_info,
1717 struct rte_hairpin_peer_info *peer_info,
1718 uint32_t direction);
1719
1720 /**
1721 * @internal
1722 * Configure current hairpin queue with the peer information fetched to create
1723 * the connection (bind) with peer queue in the specified direction.
1724 * This function might need to be called twice to fully create the connections.
1725 *
1726 * @param cur_port
1727 * Current port identifier of the Ethernet device.
1728 * @param cur_queue
1729 * Current queue index of the port.
1730 * @param peer_info
1731 * Pointer to the peer information, input.
1732 * @param direction
1733 * Direction to create the connection.
1734 * positive - bind current Tx queue to peer Rx queue
1735 * zero - bind current Rx queue to peer Tx queue
1736 *
1737 * @return
1738 * Negative errno value on error, 0 on success.
1739 */
1740 __rte_internal
1741 int
1742 rte_eth_hairpin_queue_peer_bind(uint16_t cur_port, uint16_t cur_queue,
1743 struct rte_hairpin_peer_info *peer_info,
1744 uint32_t direction);
1745
1746 /**
1747 * @internal
1748 * Get rte_eth_dev from device name. The device name should be specified
1749 * as below:
1750 * - PCIe address (Domain:Bus:Device.Function), for example 0000:2:00.0
1751 * - SoC device name, for example fsl-gmac0
1752 * - vdev dpdk name, for example net_[pcap0|null0|tap0]
1753 *
1754 * @param name
1755 * PCI address or name of the device
1756 * @return
1757 * - rte_eth_dev if successful
1758 * - NULL on failure
1759 */
1760 __rte_internal
1761 struct rte_eth_dev*
1762 rte_eth_dev_get_by_name(const char *name);
1763
1764 /**
1765 * @internal
1766 * Reset the current queue state and configuration to disconnect (unbind) it
1767 * from the peer queue.
1768 * This function might need to be called twice to disconnect each other.
1769 *
1770 * @param cur_port
1771 * Current port identifier of the Ethernet device.
1772 * @param cur_queue
1773 * Current queue index of the port.
1774 * @param direction
1775 * Direction to destroy the connection.
1776 * positive - unbind current Tx queue from peer Rx queue
1777 * zero - unbind current Rx queue from peer Tx queue
1778 *
1779 * @return
1780 * Negative errno value on error, 0 on success.
1781 */
1782 __rte_internal
1783 int
1784 rte_eth_hairpin_queue_peer_unbind(uint16_t cur_port, uint16_t cur_queue,
1785 uint32_t direction);
1786
1787 /**
1788 * @internal
1789 * Register mbuf dynamic field and flag for IP reassembly incomplete case.
1790 */
1791 __rte_internal
1792 int
1793 rte_eth_ip_reassembly_dynfield_register(int *field_offset, int *flag);
1794
1795
1796 /*
1797 * Legacy ethdev API used internally by drivers.
1798 */
1799
1800 enum rte_filter_type {
1801 RTE_ETH_FILTER_NONE = 0,
1802 RTE_ETH_FILTER_ETHERTYPE,
1803 RTE_ETH_FILTER_FLEXIBLE,
1804 RTE_ETH_FILTER_SYN,
1805 RTE_ETH_FILTER_NTUPLE,
1806 RTE_ETH_FILTER_TUNNEL,
1807 RTE_ETH_FILTER_FDIR,
1808 RTE_ETH_FILTER_HASH,
1809 RTE_ETH_FILTER_L2_TUNNEL,
1810 };
1811
1812 /**
1813 * Define all structures for Ethertype Filter type.
1814 */
1815
1816 #define RTE_ETHTYPE_FLAGS_MAC 0x0001 /**< If set, compare mac */
1817 #define RTE_ETHTYPE_FLAGS_DROP 0x0002 /**< If set, drop packet when match */
1818
1819 /**
1820 * A structure used to define the ethertype filter entry
1821 * to support RTE_ETH_FILTER_ETHERTYPE data representation.
1822 */
1823 struct rte_eth_ethertype_filter {
1824 struct rte_ether_addr mac_addr; /**< Mac address to match */
1825 uint16_t ether_type; /**< Ether type to match */
1826 uint16_t flags; /**< Flags from RTE_ETHTYPE_FLAGS_* */
1827 uint16_t queue; /**< Queue assigned to when match */
1828 };
1829
1830 /**
1831 * A structure used to define the TCP syn filter entry
1832 * to support RTE_ETH_FILTER_SYN data representation.
1833 */
1834 struct rte_eth_syn_filter {
1835 /** 1 - higher priority than other filters, 0 - lower priority */
1836 uint8_t hig_pri;
1837 uint16_t queue; /**< Queue assigned to when match */
1838 };
1839
1840 /**
1841 * filter type of tunneling packet
1842 */
1843 #define RTE_ETH_TUNNEL_FILTER_OMAC 0x01 /**< filter by outer MAC addr */
1844 #define RTE_ETH_TUNNEL_FILTER_OIP 0x02 /**< filter by outer IP Addr */
1845 #define RTE_ETH_TUNNEL_FILTER_TENID 0x04 /**< filter by tenant ID */
1846 #define RTE_ETH_TUNNEL_FILTER_IMAC 0x08 /**< filter by inner MAC addr */
1847 #define RTE_ETH_TUNNEL_FILTER_IVLAN 0x10 /**< filter by inner VLAN ID */
1848 #define RTE_ETH_TUNNEL_FILTER_IIP 0x20 /**< filter by inner IP addr */
1849
1850 #define RTE_ETH_TUNNEL_FILTER_IMAC_IVLAN (RTE_ETH_TUNNEL_FILTER_IMAC | \
1851 RTE_ETH_TUNNEL_FILTER_IVLAN)
1852 #define RTE_ETH_TUNNEL_FILTER_IMAC_IVLAN_TENID (RTE_ETH_TUNNEL_FILTER_IMAC | \
1853 RTE_ETH_TUNNEL_FILTER_IVLAN | \
1854 RTE_ETH_TUNNEL_FILTER_TENID)
1855 #define RTE_ETH_TUNNEL_FILTER_IMAC_TENID (RTE_ETH_TUNNEL_FILTER_IMAC | \
1856 RTE_ETH_TUNNEL_FILTER_TENID)
1857 #define RTE_ETH_TUNNEL_FILTER_OMAC_TENID_IMAC (RTE_ETH_TUNNEL_FILTER_OMAC | \
1858 RTE_ETH_TUNNEL_FILTER_TENID | \
1859 RTE_ETH_TUNNEL_FILTER_IMAC)
1860
1861 /**
1862 * Select IPv4 or IPv6 for tunnel filters.
1863 */
1864 enum rte_tunnel_iptype {
1865 RTE_TUNNEL_IPTYPE_IPV4 = 0, /**< IPv4 */
1866 RTE_TUNNEL_IPTYPE_IPV6, /**< IPv6 */
1867 };
1868
1869 /**
1870 * Tunneling Packet filter configuration.
1871 */
1872 struct rte_eth_tunnel_filter_conf {
1873 struct rte_ether_addr outer_mac; /**< Outer MAC address to match */
1874 struct rte_ether_addr inner_mac; /**< Inner MAC address to match */
1875 uint16_t inner_vlan; /**< Inner VLAN to match */
1876 enum rte_tunnel_iptype ip_type; /**< IP address type */
1877 /**
1878 * Outer destination IP address to match if ETH_TUNNEL_FILTER_OIP
1879 * is set in filter_type, or inner destination IP address to match
1880 * if ETH_TUNNEL_FILTER_IIP is set in filter_type.
1881 */
1882 union {
1883 uint32_t ipv4_addr; /**< IPv4 address in big endian */
1884 uint32_t ipv6_addr[4]; /**< IPv6 address in big endian */
1885 } ip_addr;
1886 /** Flags from ETH_TUNNEL_FILTER_XX - see above */
1887 uint16_t filter_type;
1888 enum rte_eth_tunnel_type tunnel_type; /**< Tunnel Type */
1889 uint32_t tenant_id; /**< Tenant ID to match: VNI, GRE key... */
1890 uint16_t queue_id; /**< Queue assigned to if match */
1891 };
1892
1893 #ifdef __cplusplus
1894 }
1895 #endif
1896
1897 #endif /* _RTE_ETHDEV_DRIVER_H_ */
1898