1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2017 Intel Corporation. 3 * All rights reserved. 4 */ 5 6 #ifndef _RTE_EVENT_ETH_RX_ADAPTER_ 7 #define _RTE_EVENT_ETH_RX_ADAPTER_ 8 9 /** 10 * @file 11 * 12 * RTE Event Ethernet Rx Adapter 13 * 14 * An eventdev-based packet processing application enqueues/dequeues mbufs 15 * to/from the event device. Packet flow from the ethernet device to the event 16 * device can be accomplished using either HW or SW mechanisms depending on the 17 * platform and the particular combination of ethernet and event devices. The 18 * event ethernet Rx adapter provides common APIs to configure the packet flow 19 * from the ethernet devices to event devices across both these transfer 20 * mechanisms. 21 * 22 * The adapter uses a EAL service core function for SW based packet transfer 23 * and uses the eventdev PMD functions to configure HW based packet transfer 24 * between the ethernet device and the event device. 25 * 26 * The ethernet Rx event adapter's functions are: 27 * - rte_event_eth_rx_adapter_create_ext() 28 * - rte_event_eth_rx_adapter_create() 29 * - rte_event_eth_rx_adapter_create_with_params() 30 * - rte_event_eth_rx_adapter_free() 31 * - rte_event_eth_rx_adapter_queue_add() 32 * - rte_event_eth_rx_adapter_queue_del() 33 * - rte_event_eth_rx_adapter_start() 34 * - rte_event_eth_rx_adapter_stop() 35 * - rte_event_eth_rx_adapter_stats_get() 36 * - rte_event_eth_rx_adapter_stats_reset() 37 * - rte_event_eth_rx_adapter_queue_conf_get() 38 * - rte_event_eth_rx_adapter_queue_stats_get() 39 * - rte_event_eth_rx_adapter_queue_stats_reset() 40 * 41 * The application creates an ethernet to event adapter using 42 * rte_event_eth_rx_adapter_create_ext() or rte_event_eth_rx_adapter_create() 43 * or rte_event_eth_rx_adapter_create_with_params() functions. 44 * The adapter needs to know which ethernet rx queues to poll for mbufs as well 45 * as event device parameters such as the event queue identifier, event 46 * priority and scheduling type that the adapter should use when constructing 47 * events. The rte_event_eth_rx_adapter_queue_add() function is provided for 48 * this purpose. 49 * The servicing weight parameter in the rte_event_eth_rx_adapter_queue_conf 50 * is applicable when the Rx adapter uses a service core function and is 51 * intended to provide application control of the frequency of polling ethernet 52 * device receive queues, for example, the application may want to poll higher 53 * priority queues with a higher frequency but at the same time not starve 54 * lower priority queues completely. If this parameter is zero and the receive 55 * interrupt is enabled when configuring the device, the receive queue is 56 * interrupt driven; else, the queue is assigned a servicing weight of one. 57 * 58 * The application can start/stop the adapter using the 59 * rte_event_eth_rx_adapter_start() and the rte_event_eth_rx_adapter_stop() 60 * functions. If the adapter uses a rte_service function, then the application 61 * is also required to assign a core to the service function and control the 62 * service core using the rte_service APIs. The 63 * rte_event_eth_rx_adapter_service_id_get() function can be used to retrieve 64 * the service function ID of the adapter in this case. 65 * 66 * For SW based packet transfers, i.e., when the 67 * RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT is not set in the adapter's 68 * capabilities flags for a particular ethernet device, the service function 69 * temporarily enqueues events to an event buffer before batch enqueuing these 70 * to the event device. If the buffer fills up, the service function stops 71 * dequeuing packets from the ethernet device. The application may want to 72 * monitor the buffer fill level and instruct the service function to 73 * selectively buffer events. The application may also use some other 74 * criteria to decide which packets should enter the event device even when 75 * the event buffer fill level is low or may want to enqueue packets to an 76 * internal event port. The rte_event_eth_rx_adapter_cb_register() function 77 * allows the application to register a callback that selects which packets are 78 * enqueued to the event device by the SW adapter. The callback interface is 79 * event based so the callback can also modify the event data if it needs to. 80 */ 81 82 #ifdef __cplusplus 83 extern "C" { 84 #endif 85 86 #include <stdint.h> 87 88 #include <rte_service.h> 89 90 #include "rte_eventdev.h" 91 92 #define RTE_EVENT_ETH_RX_ADAPTER_MAX_INSTANCE 32 93 94 /* struct rte_event_eth_rx_adapter_queue_conf flags definitions */ 95 #define RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID 0x1 96 /**< This flag indicates the flow identifier is valid 97 * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags 98 */ 99 #define RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR 0x2 100 /**< This flag indicates that mbufs arriving on the queue need to be vectorized 101 * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags 102 */ 103 104 /** 105 * Adapter configuration structure that the adapter configuration callback 106 * function is expected to fill out 107 * @see rte_event_eth_rx_adapter_conf_cb 108 */ 109 struct rte_event_eth_rx_adapter_conf { 110 uint8_t event_port_id; 111 /**< Event port identifier, the adapter enqueues mbuf events to this 112 * port. 113 */ 114 uint32_t max_nb_rx; 115 /**< The adapter can return early if it has processed at least 116 * max_nb_rx mbufs. This isn't treated as a requirement; batching may 117 * cause the adapter to process more than max_nb_rx mbufs. 118 */ 119 }; 120 121 /** 122 * Function type used for adapter configuration callback. The callback is 123 * used to fill in members of the struct rte_event_eth_rx_adapter_conf, this 124 * callback is invoked when creating a SW service for packet transfer from 125 * ethdev queues to the event device. The SW service is created within the 126 * rte_event_eth_rx_adapter_queue_add() function if SW based packet transfers 127 * from ethdev queues to the event device are required. 128 * 129 * @param id 130 * Adapter identifier. 131 * 132 * @param dev_id 133 * Event device identifier. 134 * 135 * @param [out] conf 136 * Structure that needs to be populated by this callback. 137 * 138 * @param arg 139 * Argument to the callback. This is the same as the conf_arg passed to the 140 * rte_event_eth_rx_adapter_create_ext(). 141 */ 142 typedef int (*rte_event_eth_rx_adapter_conf_cb) (uint8_t id, uint8_t dev_id, 143 struct rte_event_eth_rx_adapter_conf *conf, 144 void *arg); 145 146 /** 147 * Rx queue configuration structure 148 */ 149 struct rte_event_eth_rx_adapter_queue_conf { 150 uint32_t rx_queue_flags; 151 /**< Flags for handling received packets 152 * @see RTE_EVENT_ETH_RX_ADAPTER_QUEUE_FLOW_ID_VALID 153 */ 154 uint16_t servicing_weight; 155 /**< Relative polling frequency of ethernet receive queue when the 156 * adapter uses a service core function for ethernet to event device 157 * transfers. If it is set to zero, the Rx queue is interrupt driven 158 * (unless rx queue interrupts are not enabled for the ethernet 159 * device). 160 */ 161 struct rte_event ev; 162 /**< 163 * The values from the following event fields will be used when 164 * queuing mbuf events: 165 * - event_queue_id: Targeted event queue ID for received packets. 166 * - event_priority: Event priority of packets from this Rx queue in 167 * the event queue relative to other events. 168 * - sched_type: Scheduling type for packets from this Rx queue. 169 * - flow_id: If the RTE_ETH_RX_EVENT_ADAPTER_QUEUE_FLOW_ID_VALID bit 170 * is set in rx_queue_flags, this flow_id is used for all 171 * packets received from this queue. Otherwise the flow ID 172 * is set to the RSS hash of the src and dst IPv4/6 173 * addresses. 174 * 175 * The event adapter sets ev.event_type to RTE_EVENT_TYPE_ETHDEV in the 176 * enqueued event. 177 */ 178 uint16_t vector_sz; 179 /**< 180 * Indicates the maximum number for mbufs to combine and form a vector. 181 * Should be within 182 * @see rte_event_eth_rx_adapter_vector_limits::min_vector_sz 183 * @see rte_event_eth_rx_adapter_vector_limits::max_vector_sz 184 * Valid when RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR flag is set in 185 * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags 186 */ 187 uint64_t vector_timeout_ns; 188 /**< 189 * Indicates the maximum number of nanoseconds to wait for receiving 190 * mbufs. Should be within vectorization limits of the 191 * adapter 192 * @see rte_event_eth_rx_adapter_vector_limits::min_vector_ns 193 * @see rte_event_eth_rx_adapter_vector_limits::max_vector_ns 194 * Valid when RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR flag is set in 195 * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags 196 */ 197 struct rte_mempool *vector_mp; 198 /**< 199 * Indicates the mempool that should be used for allocating 200 * rte_event_vector container. 201 * Should be created by using `rte_event_vector_pool_create`. 202 * Valid when RTE_EVENT_ETH_RX_ADAPTER_QUEUE_EVENT_VECTOR flag is set in 203 * @see rte_event_eth_rx_adapter_queue_conf::rx_queue_flags. 204 */ 205 uint16_t event_buf_size; 206 /**< event buffer size for this queue */ 207 }; 208 209 /** 210 * A structure used to retrieve statistics for an 211 * eth rx adapter queue. 212 */ 213 struct rte_event_eth_rx_adapter_queue_stats { 214 uint64_t rx_event_buf_count; 215 /**< Rx event buffered count */ 216 uint64_t rx_event_buf_size; 217 /**< Rx event buffer size */ 218 uint64_t rx_poll_count; 219 /**< Receive queue poll count */ 220 uint64_t rx_packets; 221 /**< Received packet count */ 222 uint64_t rx_dropped; 223 /**< Received packet dropped count */ 224 }; 225 226 /** 227 * A structure used to retrieve statistics for an eth rx adapter instance. 228 */ 229 struct rte_event_eth_rx_adapter_stats { 230 uint64_t rx_poll_count; 231 /**< Receive queue poll count */ 232 uint64_t rx_packets; 233 /**< Received packet count */ 234 uint64_t rx_enq_count; 235 /**< Eventdev enqueue count */ 236 uint64_t rx_enq_retry; 237 /**< Eventdev enqueue retry count */ 238 uint64_t rx_dropped; 239 /**< Received packet dropped count */ 240 uint64_t rx_enq_start_ts; 241 /**< Rx enqueue start timestamp */ 242 uint64_t rx_enq_block_cycles; 243 /**< Cycles for which the service is blocked by the event device, 244 * i.e, the service fails to enqueue to the event device. 245 */ 246 uint64_t rx_enq_end_ts; 247 /**< Latest timestamp at which the service is unblocked 248 * by the event device. The start, end timestamps and 249 * block cycles can be used to compute the percentage of 250 * cycles the service is blocked by the event device. 251 */ 252 uint64_t rx_intr_packets; 253 /**< Received packet count for interrupt mode Rx queues */ 254 uint64_t rx_event_buf_count; 255 /**< Rx event buffered count */ 256 uint64_t rx_event_buf_size; 257 /**< Rx event buffer size */ 258 }; 259 260 /** 261 * A structure used to retrieve eth rx adapter vector limits. 262 */ 263 struct rte_event_eth_rx_adapter_vector_limits { 264 uint16_t min_sz; 265 /**< Minimum vector limit configurable. 266 * @see rte_event_eth_rx_adapter_event_vector_config::vector_sz 267 */ 268 uint16_t max_sz; 269 /**< Maximum vector limit configurable. 270 * @see rte_event_eth_rx_adapter_event_vector_config::vector_sz 271 */ 272 uint8_t log2_sz; 273 /**< True if the size configured should be in log2. 274 * @see rte_event_eth_rx_adapter_event_vector_config::vector_sz 275 */ 276 uint64_t min_timeout_ns; 277 /**< Minimum vector timeout configurable. 278 * @see rte_event_eth_rx_adapter_event_vector_config::vector_timeout_ns 279 */ 280 uint64_t max_timeout_ns; 281 /**< Maximum vector timeout configurable. 282 * @see rte_event_eth_rx_adapter_event_vector_config::vector_timeout_ns 283 */ 284 }; 285 286 /** 287 * A structure to hold adapter config params 288 */ 289 struct rte_event_eth_rx_adapter_params { 290 uint16_t event_buf_size; 291 /**< size of event buffer for the adapter. 292 * This value is rounded up for better buffer utilization 293 * and performance. 294 */ 295 bool use_queue_event_buf; 296 /**< flag to indicate that event buffer is separate for each queue */ 297 }; 298 299 /** 300 * 301 * Callback function invoked by the SW adapter before it continues 302 * to process events. The callback is passed the size of the enqueue 303 * buffer in the SW adapter and the occupancy of the buffer. The 304 * callback can use these values to decide which events are 305 * enqueued to the event device by the SW adapter. The callback may 306 * also enqueue events internally using its own event port. The SW 307 * adapter populates the event information based on the Rx queue 308 * configuration in the adapter. The callback can modify the this event 309 * information for the events to be enqueued by the SW adapter. 310 * 311 * The callback return value is the number of events from the 312 * beginning of the event array that are to be enqueued by 313 * the SW adapter. It is the callback's responsibility to arrange 314 * these events at the beginning of the array, if these events are 315 * not contiguous in the original array. The *nb_dropped* parameter is 316 * a pointer to the number of events dropped by the callback, this 317 * number is used by the adapter to indicate the number of dropped packets 318 * as part of its statistics. 319 * 320 * @param eth_dev_id 321 * Port identifier of the Ethernet device. 322 * @param queue_id 323 * Receive queue index. 324 * @param enqueue_buf_size 325 * Total enqueue buffer size. 326 * @param enqueue_buf_count 327 * Event count in enqueue buffer. 328 * @param[in, out] ev 329 * Event array. 330 * @param nb_event 331 * Event array length. 332 * @param cb_arg 333 * Callback argument. 334 * @param[out] nb_dropped 335 * Packets dropped by callback. 336 * @return 337 * - The number of events to be enqueued by the SW adapter. 338 */ 339 typedef uint16_t (*rte_event_eth_rx_adapter_cb_fn)(uint16_t eth_dev_id, 340 uint16_t queue_id, 341 uint32_t enqueue_buf_size, 342 uint32_t enqueue_buf_count, 343 struct rte_event *ev, 344 uint16_t nb_event, 345 void *cb_arg, 346 uint16_t *nb_dropped); 347 348 /** 349 * Create a new ethernet Rx event adapter with the specified identifier. 350 * 351 * @param id 352 * The identifier of the ethernet Rx event adapter. 353 * 354 * @param dev_id 355 * The identifier of the device to configure. 356 * 357 * @param conf_cb 358 * Callback function that fills in members of a 359 * struct rte_event_eth_rx_adapter_conf struct passed into 360 * it. 361 * 362 * @param conf_arg 363 * Argument that is passed to the conf_cb function. 364 * 365 * @return 366 * - 0: Success 367 * - <0: Error code on failure 368 */ 369 int rte_event_eth_rx_adapter_create_ext(uint8_t id, uint8_t dev_id, 370 rte_event_eth_rx_adapter_conf_cb conf_cb, 371 void *conf_arg); 372 373 /** 374 * Create a new ethernet Rx event adapter with the specified identifier. 375 * This function uses an internal configuration function that creates an event 376 * port. This default function reconfigures the event device with an 377 * additional event port and setups up the event port using the port_config 378 * parameter passed into this function. In case the application needs more 379 * control in configuration of the service, it should use the 380 * rte_event_eth_rx_adapter_create_ext() version. 381 * 382 * @param id 383 * The identifier of the ethernet Rx event adapter. 384 * 385 * @param dev_id 386 * The identifier of the device to configure. 387 * 388 * @param port_config 389 * Argument of type *rte_event_port_conf* that is passed to the conf_cb 390 * function. 391 * 392 * @return 393 * - 0: Success 394 * - <0: Error code on failure 395 */ 396 int rte_event_eth_rx_adapter_create(uint8_t id, uint8_t dev_id, 397 struct rte_event_port_conf *port_config); 398 399 /** 400 * This is a variant of rte_event_eth_rx_adapter_create() with additional 401 * adapter params specified in ``struct rte_event_eth_rx_adapter_params``. 402 * 403 * @param id 404 * The identifier of the ethernet Rx event adapter. 405 * 406 * @param dev_id 407 * The identifier of the event device to configure. 408 * 409 * @param port_config 410 * Argument of type *rte_event_port_conf* that is passed to the conf_cb 411 * function. 412 * 413 * @param rxa_params 414 * Pointer to struct rte_event_eth_rx_adapter_params. 415 * In case of NULL, default values are used. 416 * 417 * @return 418 * - 0: Success 419 * - <0: Error code on failure 420 */ 421 __rte_experimental 422 int rte_event_eth_rx_adapter_create_with_params(uint8_t id, uint8_t dev_id, 423 struct rte_event_port_conf *port_config, 424 struct rte_event_eth_rx_adapter_params *rxa_params); 425 426 /** 427 * Free an event adapter 428 * 429 * @param id 430 * Adapter identifier. 431 * 432 * @return 433 * - 0: Success 434 * - <0: Error code on failure, If the adapter still has Rx queues 435 * added to it, the function returns -EBUSY. 436 */ 437 int rte_event_eth_rx_adapter_free(uint8_t id); 438 439 /** 440 * Add receive queue to an event adapter. After a queue has been 441 * added to the event adapter, the result of the application calling 442 * rte_eth_rx_burst(eth_dev_id, rx_queue_id, ..) is undefined. 443 * 444 * @param id 445 * Adapter identifier. 446 * 447 * @param eth_dev_id 448 * Port identifier of Ethernet device. 449 * 450 * @param rx_queue_id 451 * Ethernet device receive queue index. 452 * If rx_queue_id is -1, then all Rx queues configured for 453 * the device are added. If the ethdev Rx queues can only be 454 * connected to a single event queue then rx_queue_id is 455 * required to be -1. 456 * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 457 * 458 * @param conf 459 * Additional configuration structure of type *rte_event_eth_rx_adapter_conf* 460 * 461 * @return 462 * - 0: Success, Receive queue added correctly. 463 * - <0: Error code on failure. 464 * - (-EIO) device reconfiguration and restart error. The adapter reconfigures 465 * the event device with an additional port if it is required to use a service 466 * function for packet transfer from the ethernet device to the event device. 467 * If the device had been started before this call, this error code indicates 468 * an error in restart following an error in reconfiguration, i.e., a 469 * combination of the two error codes. 470 */ 471 int rte_event_eth_rx_adapter_queue_add(uint8_t id, 472 uint16_t eth_dev_id, 473 int32_t rx_queue_id, 474 const struct rte_event_eth_rx_adapter_queue_conf *conf); 475 476 /** 477 * Delete receive queue from an event adapter. 478 * 479 * @param id 480 * Adapter identifier. 481 * 482 * @param eth_dev_id 483 * Port identifier of Ethernet device. 484 * 485 * @param rx_queue_id 486 * Ethernet device receive queue index. 487 * If rx_queue_id is -1, then all Rx queues configured for 488 * the device are deleted. If the ethdev Rx queues can only be 489 * connected to a single event queue then rx_queue_id is 490 * required to be -1. 491 * @see RTE_EVENT_ETH_RX_ADAPTER_CAP_MULTI_EVENTQ 492 * 493 * @return 494 * - 0: Success, Receive queue deleted correctly. 495 * - <0: Error code on failure. 496 */ 497 int rte_event_eth_rx_adapter_queue_del(uint8_t id, uint16_t eth_dev_id, 498 int32_t rx_queue_id); 499 500 /** 501 * Start ethernet Rx event adapter 502 * 503 * @param id 504 * Adapter identifier. 505 * 506 * @return 507 * - 0: Success, Adapter started correctly. 508 * - <0: Error code on failure. 509 * 510 * @note 511 * The eventdev to which the event_eth_rx_adapter is connected needs to 512 * be started before calling rte_event_eth_rx_adapter_start(). 513 */ 514 int rte_event_eth_rx_adapter_start(uint8_t id); 515 516 /** 517 * Stop ethernet Rx event adapter 518 * 519 * @param id 520 * Adapter identifier. 521 * 522 * @return 523 * - 0: Success, Adapter started correctly. 524 * - <0: Error code on failure. 525 */ 526 int rte_event_eth_rx_adapter_stop(uint8_t id); 527 528 /** 529 * Retrieve statistics for an adapter 530 * 531 * @param id 532 * Adapter identifier. 533 * 534 * @param [out] stats 535 * A pointer to structure used to retrieve statistics for an adapter. 536 * 537 * @return 538 * - 0: Success, retrieved successfully. 539 * - <0: Error code on failure. 540 */ 541 int rte_event_eth_rx_adapter_stats_get(uint8_t id, 542 struct rte_event_eth_rx_adapter_stats *stats); 543 544 /** 545 * Reset statistics for an adapter. 546 * 547 * @param id 548 * Adapter identifier. 549 * 550 * @return 551 * - 0: Success, statistics reset successfully. 552 * - <0: Error code on failure. 553 */ 554 int rte_event_eth_rx_adapter_stats_reset(uint8_t id); 555 556 /** 557 * Retrieve the service ID of an adapter. If the adapter doesn't use 558 * a rte_service function, this function returns -ESRCH. 559 * 560 * @param id 561 * Adapter identifier. 562 * 563 * @param [out] service_id 564 * A pointer to a uint32_t, to be filled in with the service id. 565 * 566 * @return 567 * - 0: Success 568 * - <0: Error code on failure, if the adapter doesn't use a rte_service 569 * function, this function returns -ESRCH. 570 */ 571 int rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id); 572 573 /** 574 * Register callback to process Rx packets, this is supported for 575 * SW based packet transfers. 576 * @see rte_event_eth_rx_cb_fn 577 * 578 * @param id 579 * Adapter identifier. 580 * @param eth_dev_id 581 * Port identifier of Ethernet device. 582 * @param cb_fn 583 * Callback function. 584 * @param cb_arg 585 * Callback arg. 586 * @return 587 * - 0: Success 588 * - <0: Error code on failure. 589 */ 590 int rte_event_eth_rx_adapter_cb_register(uint8_t id, uint16_t eth_dev_id, 591 rte_event_eth_rx_adapter_cb_fn cb_fn, 592 void *cb_arg); 593 594 /** 595 * Retrieve vector limits for a given event dev and eth dev pair. 596 * @see rte_event_eth_rx_adapter_vector_limits 597 * 598 * @param dev_id 599 * Event device identifier. 600 * @param eth_port_id 601 * Port identifier of the ethernet device. 602 * @param [out] limits 603 * A pointer to rte_event_eth_rx_adapter_vector_limits structure that has to 604 * be filled. 605 * 606 * @return 607 * - 0: Success. 608 * - <0: Error code on failure. 609 */ 610 int rte_event_eth_rx_adapter_vector_limits_get( 611 uint8_t dev_id, uint16_t eth_port_id, 612 struct rte_event_eth_rx_adapter_vector_limits *limits); 613 614 /** 615 * Retrieve Rx queue config information. 616 * 617 * @param id 618 * Adapter identifier. 619 620 * @param eth_dev_id 621 * Port identifier of Ethernet device. 622 623 * @param rx_queue_id 624 * Ethernet device receive queue index. 625 626 * @param[out] queue_conf 627 * Pointer to struct rte_event_eth_rx_adapter_queue_conf 628 629 * @return 630 * - 0: Success, Receive queue added correctly. 631 * - <0: Error code on failure. 632 */ 633 __rte_experimental 634 int rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, 635 uint16_t eth_dev_id, 636 uint16_t rx_queue_id, 637 struct rte_event_eth_rx_adapter_queue_conf *queue_conf); 638 639 /** 640 * Retrieve Rx queue statistics. 641 * 642 * @param id 643 * Adapter identifier. 644 * 645 * @param eth_dev_id 646 * Port identifier of Ethernet device. 647 * 648 * @param rx_queue_id 649 * Ethernet device receive queue index. 650 * 651 * @param[out] stats 652 * Pointer to struct rte_event_eth_rx_adapter_queue_stats 653 * 654 * @return 655 * - 0: Success, queue buffer stats retrieved. 656 * - <0: Error code on failure. 657 */ 658 __rte_experimental 659 int 660 rte_event_eth_rx_adapter_queue_stats_get(uint8_t id, 661 uint16_t eth_dev_id, 662 uint16_t rx_queue_id, 663 struct rte_event_eth_rx_adapter_queue_stats *stats); 664 665 /** 666 * Reset Rx queue statistics. 667 * 668 * @param id 669 * Adapter identifier. 670 * 671 * @param eth_dev_id 672 * Port identifier of Ethernet device. 673 * 674 * @param rx_queue_id 675 * Ethernet device receive queue index. 676 * 677 * @return 678 * - 0: Success, queue buffer stats retrieved. 679 * - <0: Error code on failure. 680 */ 681 __rte_experimental 682 int 683 rte_event_eth_rx_adapter_queue_stats_reset(uint8_t id, 684 uint16_t eth_dev_id, 685 uint16_t rx_queue_id); 686 687 #ifdef __cplusplus 688 } 689 #endif 690 #endif /* _RTE_EVENT_ETH_RX_ADAPTER_ */ 691