1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2016 Intel Corporation 3 */ 4 5 /** 6 * @file rte_pmd_ixgbe.h 7 * ixgbe PMD specific functions. 8 * 9 **/ 10 11 #ifndef _PMD_IXGBE_H_ 12 #define _PMD_IXGBE_H_ 13 14 #include <rte_compat.h> 15 #include <rte_ethdev.h> 16 #include <rte_ether.h> 17 18 /** 19 * Notify VF when PF link status changes. 20 * 21 * @param port 22 * The port identifier of the Ethernet device. 23 * @param vf 24 * VF id. 25 * @return 26 * - (0) if successful. 27 * - (-ENODEV) if *port* invalid. 28 * - (-EINVAL) if *vf* invalid. 29 */ 30 int rte_pmd_ixgbe_ping_vf(uint16_t port, uint16_t vf); 31 32 /** 33 * Set the VF MAC address. 34 * 35 * @param port 36 * The port identifier of the Ethernet device. 37 * @param vf 38 * VF id. 39 * @param mac_addr 40 * VF MAC address. 41 * @return 42 * - (0) if successful. 43 * - (-ENODEV) if *port* invalid. 44 * - (-EINVAL) if *vf* or *mac_addr* is invalid. 45 */ 46 int rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, 47 struct rte_ether_addr *mac_addr); 48 49 /** 50 * Enable/Disable VF VLAN anti spoofing. 51 * 52 * @param port 53 * The port identifier of the Ethernet device. 54 * @param vf 55 * VF on which to set VLAN anti spoofing. 56 * @param on 57 * 1 - Enable VFs VLAN anti spoofing. 58 * 0 - Disable VFs VLAN anti spoofing. 59 * @return 60 * - (0) if successful. 61 * - (-ENODEV) if *port* invalid. 62 * - (-EINVAL) if bad parameter. 63 */ 64 int rte_pmd_ixgbe_set_vf_vlan_anti_spoof(uint16_t port, uint16_t vf, 65 uint8_t on); 66 67 /** 68 * Enable/Disable VF MAC anti spoofing. 69 * 70 * @param port 71 * The port identifier of the Ethernet device. 72 * @param vf 73 * VF on which to set MAC anti spoofing. 74 * @param on 75 * 1 - Enable VFs MAC anti spoofing. 76 * 0 - Disable VFs MAC anti spoofing. 77 * @return 78 * - (0) if successful. 79 * - (-ENODEV) if *port* invalid. 80 * - (-EINVAL) if bad parameter. 81 */ 82 int rte_pmd_ixgbe_set_vf_mac_anti_spoof(uint16_t port, uint16_t vf, uint8_t on); 83 84 /** 85 * Enable/Disable vf vlan insert 86 * 87 * @param port 88 * The port identifier of the Ethernet device. 89 * @param vf 90 * ID specifying VF. 91 * @param vlan_id 92 * 0 - Disable VF's vlan insert. 93 * n - Enable; n is inserted as the vlan id. 94 * 95 * @return 96 * - (0) if successful. 97 * - (-ENODEV) if *port* invalid. 98 * - (-EINVAL) if bad parameter. 99 */ 100 int rte_pmd_ixgbe_set_vf_vlan_insert(uint16_t port, uint16_t vf, 101 uint16_t vlan_id); 102 103 /** 104 * Enable/Disable tx loopback 105 * 106 * @param port 107 * The port identifier of the Ethernet device. 108 * @param on 109 * 1 - Enable tx loopback. 110 * 0 - Disable tx loopback. 111 * 112 * @return 113 * - (0) if successful. 114 * - (-ENODEV) if *port* invalid. 115 * - (-EINVAL) if bad parameter. 116 */ 117 int rte_pmd_ixgbe_set_tx_loopback(uint16_t port, uint8_t on); 118 119 /** 120 * set all queues drop enable bit 121 * 122 * @param port 123 * The port identifier of the Ethernet device. 124 * @param on 125 * 1 - set the queue drop enable bit for all pools. 126 * 0 - reset the queue drop enable bit for all pools. 127 * 128 * @return 129 * - (0) if successful. 130 * - (-ENODEV) if *port* invalid. 131 * - (-EINVAL) if bad parameter. 132 */ 133 int rte_pmd_ixgbe_set_all_queues_drop_en(uint16_t port, uint8_t on); 134 135 /** 136 * set drop enable bit in the VF split rx control register 137 * 138 * @param port 139 * The port identifier of the Ethernet device. 140 * @param vf 141 * ID specifying VF. 142 * @param on 143 * 1 - set the drop enable bit in the split rx control register. 144 * 0 - reset the drop enable bit in the split rx control register. 145 * 146 * @return 147 * - (0) if successful. 148 * - (-ENODEV) if *port* invalid. 149 * - (-EINVAL) if bad parameter. 150 */ 151 152 int rte_pmd_ixgbe_set_vf_split_drop_en(uint16_t port, uint16_t vf, uint8_t on); 153 154 /** 155 * Enable/Disable vf vlan strip for all queues in a pool 156 * 157 * @param port 158 * The port identifier of the Ethernet device. 159 * @param vf 160 * ID specifying VF. 161 * @param on 162 * 1 - Enable VF's vlan strip on RX queues. 163 * 0 - Disable VF's vlan strip on RX queues. 164 * 165 * @return 166 * - (0) if successful. 167 * - (-ENOTSUP) if hardware doesn't support this feature. 168 * - (-ENODEV) if *port* invalid. 169 * - (-EINVAL) if bad parameter. 170 */ 171 int 172 rte_pmd_ixgbe_set_vf_vlan_stripq(uint16_t port, uint16_t vf, uint8_t on); 173 174 /** 175 * Enable MACsec offload. 176 * 177 * @param port 178 * The port identifier of the Ethernet device. 179 * @param en 180 * 1 - Enable encryption (encrypt and add integrity signature). 181 * 0 - Disable encryption (only add integrity signature). 182 * @param rp 183 * 1 - Enable replay protection. 184 * 0 - Disable replay protection. 185 * @return 186 * - (0) if successful. 187 * - (-ENODEV) if *port* invalid. 188 * - (-ENOTSUP) if hardware doesn't support this feature. 189 */ 190 int rte_pmd_ixgbe_macsec_enable(uint16_t port, uint8_t en, uint8_t rp); 191 192 /** 193 * Disable MACsec offload. 194 * 195 * @param port 196 * The port identifier of the Ethernet device. 197 * @return 198 * - (0) if successful. 199 * - (-ENODEV) if *port* invalid. 200 * - (-ENOTSUP) if hardware doesn't support this feature. 201 */ 202 int rte_pmd_ixgbe_macsec_disable(uint16_t port); 203 204 /** 205 * Configure Tx SC (Secure Connection). 206 * 207 * @param port 208 * The port identifier of the Ethernet device. 209 * @param mac 210 * The MAC address on the local side. 211 * @return 212 * - (0) if successful. 213 * - (-ENODEV) if *port* invalid. 214 * - (-ENOTSUP) if hardware doesn't support this feature. 215 */ 216 int rte_pmd_ixgbe_macsec_config_txsc(uint16_t port, uint8_t *mac); 217 218 /** 219 * Configure Rx SC (Secure Connection). 220 * 221 * @param port 222 * The port identifier of the Ethernet device. 223 * @param mac 224 * The MAC address on the remote side. 225 * @param pi 226 * The PI (port identifier) on the remote side. 227 * @return 228 * - (0) if successful. 229 * - (-ENODEV) if *port* invalid. 230 * - (-ENOTSUP) if hardware doesn't support this feature. 231 */ 232 int rte_pmd_ixgbe_macsec_config_rxsc(uint16_t port, uint8_t *mac, uint16_t pi); 233 234 /** 235 * Enable Tx SA (Secure Association). 236 * 237 * @param port 238 * The port identifier of the Ethernet device. 239 * @param idx 240 * The SA to be enabled (0 or 1). 241 * @param an 242 * The association number on the local side. 243 * @param pn 244 * The packet number on the local side. 245 * @param key 246 * The key on the local side. 247 * @return 248 * - (0) if successful. 249 * - (-ENODEV) if *port* invalid. 250 * - (-ENOTSUP) if hardware doesn't support this feature. 251 * - (-EINVAL) if bad parameter. 252 */ 253 int rte_pmd_ixgbe_macsec_select_txsa(uint16_t port, uint8_t idx, uint8_t an, 254 uint32_t pn, uint8_t *key); 255 256 /** 257 * Enable Rx SA (Secure Association). 258 * 259 * @param port 260 * The port identifier of the Ethernet device. 261 * @param idx 262 * The SA to be enabled (0 or 1) 263 * @param an 264 * The association number on the remote side. 265 * @param pn 266 * The packet number on the remote side. 267 * @param key 268 * The key on the remote side. 269 * @return 270 * - (0) if successful. 271 * - (-ENODEV) if *port* invalid. 272 * - (-ENOTSUP) if hardware doesn't support this feature. 273 * - (-EINVAL) if bad parameter. 274 */ 275 int rte_pmd_ixgbe_macsec_select_rxsa(uint16_t port, uint8_t idx, uint8_t an, 276 uint32_t pn, uint8_t *key); 277 278 /** 279 * Set RX L2 Filtering mode of a VF of an Ethernet device. 280 * 281 * @param port 282 * The port identifier of the Ethernet device. 283 * @param vf 284 * VF id. 285 * @param rx_mask 286 * The RX mode mask, which is one or more of accepting Untagged Packets, 287 * packets that match the PFUTA table, Broadcast and Multicast Promiscuous. 288 * ETH_VMDQ_ACCEPT_UNTAG,ETH_VMDQ_ACCEPT_HASH_UC, 289 * ETH_VMDQ_ACCEPT_BROADCAST and ETH_VMDQ_ACCEPT_MULTICAST will be used 290 * in rx_mode. 291 * @param on 292 * 1 - Enable a VF RX mode. 293 * 0 - Disable a VF RX mode. 294 * @return 295 * - (0) if successful. 296 * - (-ENOTSUP) if hardware doesn't support. 297 * - (-ENODEV) if *port_id* invalid. 298 * - (-EINVAL) if bad parameter. 299 */ 300 int 301 rte_pmd_ixgbe_set_vf_rxmode(uint16_t port, uint16_t vf, uint16_t rx_mask, 302 uint8_t on); 303 304 /** 305 * Enable or disable a VF traffic receive of an Ethernet device. 306 * 307 * @param port 308 * The port identifier of the Ethernet device. 309 * @param vf 310 * VF id. 311 * @param on 312 * 1 - Enable a VF traffic receive. 313 * 0 - Disable a VF traffic receive. 314 * @return 315 * - (0) if successful. 316 * - (-ENOTSUP) if hardware doesn't support. 317 * - (-ENODEV) if *port_id* invalid. 318 * - (-EINVAL) if bad parameter. 319 */ 320 int 321 rte_pmd_ixgbe_set_vf_rx(uint16_t port, uint16_t vf, uint8_t on); 322 323 /** 324 * Enable or disable a VF traffic transmit of the Ethernet device. 325 * 326 * @param port 327 * The port identifier of the Ethernet device. 328 * @param vf 329 * VF id. 330 * @param on 331 * 1 - Enable a VF traffic transmit. 332 * 0 - Disable a VF traffic transmit. 333 * @return 334 * - (0) if successful. 335 * - (-ENODEV) if *port_id* invalid. 336 * - (-ENOTSUP) if hardware doesn't support. 337 * - (-EINVAL) if bad parameter. 338 */ 339 int 340 rte_pmd_ixgbe_set_vf_tx(uint16_t port, uint16_t vf, uint8_t on); 341 342 /** 343 * Enable/Disable hardware VF VLAN filtering by an Ethernet device of 344 * received VLAN packets tagged with a given VLAN Tag Identifier. 345 * 346 * @param port 347 * The port identifier of the Ethernet device. 348 * @param vlan 349 * The VLAN Tag Identifier whose filtering must be enabled or disabled. 350 * @param vf_mask 351 * Bitmap listing which VFs participate in the VLAN filtering. 352 * @param vlan_on 353 * 1 - Enable VFs VLAN filtering. 354 * 0 - Disable VFs VLAN filtering. 355 * @return 356 * - (0) if successful. 357 * - (-ENOTSUP) if hardware doesn't support. 358 * - (-ENODEV) if *port_id* invalid. 359 * - (-EINVAL) if bad parameter. 360 */ 361 int 362 rte_pmd_ixgbe_set_vf_vlan_filter(uint16_t port, uint16_t vlan, 363 uint64_t vf_mask, uint8_t vlan_on); 364 365 /** 366 * Set the rate limitation for a vf on an Ethernet device. 367 * 368 * @param port 369 * The port identifier of the Ethernet device. 370 * @param vf 371 * VF id. 372 * @param tx_rate 373 * The tx rate allocated from the total link speed for this VF id. 374 * @param q_msk 375 * The queue mask which need to set the rate. 376 * @return 377 * - (0) if successful. 378 * - (-ENOTSUP) if hardware doesn't support this feature. 379 * - (-ENODEV) if *port_id* invalid. 380 * - (-EINVAL) if bad parameter. 381 */ 382 int rte_pmd_ixgbe_set_vf_rate_limit(uint16_t port, uint16_t vf, 383 uint16_t tx_rate, uint64_t q_msk); 384 385 /** 386 * Set all the TCs' bandwidth weight. 387 * 388 * The bw_weight means the percentage occupied by the TC. 389 * It can be taken as the relative min bandwidth setting. 390 * 391 * @param port 392 * The port identifier of the Ethernet device. 393 * @param tc_num 394 * Number of TCs. 395 * @param bw_weight 396 * An array of relative bandwidth weight for all the TCs. 397 * The summary of the bw_weight should be 100. 398 * @return 399 * - (0) if successful. 400 * - (-ENODEV) if *port* invalid. 401 * - (-EINVAL) if bad parameter. 402 * - (-ENOTSUP) not supported by firmware. 403 */ 404 int rte_pmd_ixgbe_set_tc_bw_alloc(uint16_t port, 405 uint8_t tc_num, 406 uint8_t *bw_weight); 407 408 409 /** 410 * Initialize bypass logic. This function needs to be called before 411 * executing any other bypass API. 412 * 413 * @param port 414 * The port identifier of the Ethernet device. 415 * @return 416 * - (0) if successful. 417 * - (-ENOTSUP) if hardware doesn't support. 418 * - (-EINVAL) if bad parameter. 419 */ 420 int rte_pmd_ixgbe_bypass_init(uint16_t port); 421 422 /** 423 * Return bypass state. 424 * 425 * @param port 426 * The port identifier of the Ethernet device. 427 * @param state 428 * The return bypass state. 429 * - (1) Normal mode 430 * - (2) Bypass mode 431 * - (3) Isolate mode 432 * @return 433 * - (0) if successful. 434 * - (-ENOTSUP) if hardware doesn't support. 435 * - (-EINVAL) if bad parameter. 436 */ 437 int rte_pmd_ixgbe_bypass_state_show(uint16_t port, uint32_t *state); 438 439 /** 440 * Set bypass state 441 * 442 * @param port 443 * The port identifier of the Ethernet device. 444 * @param new_state 445 * The current bypass state. 446 * - (1) Normal mode 447 * - (2) Bypass mode 448 * - (3) Isolate mode 449 * @return 450 * - (0) if successful. 451 * - (-ENOTSUP) if hardware doesn't support. 452 * - (-EINVAL) if bad parameter. 453 */ 454 int rte_pmd_ixgbe_bypass_state_set(uint16_t port, uint32_t *new_state); 455 456 /** 457 * Return bypass state when given event occurs. 458 * 459 * @param port 460 * The port identifier of the Ethernet device. 461 * @param event 462 * The bypass event 463 * - (1) Main power on (power button is pushed) 464 * - (2) Auxiliary power on (power supply is being plugged) 465 * - (3) Main power off (system shutdown and power supply is left plugged in) 466 * - (4) Auxiliary power off (power supply is being unplugged) 467 * - (5) Display or set the watchdog timer 468 * @param state 469 * The bypass state when given event occurred. 470 * - (1) Normal mode 471 * - (2) Bypass mode 472 * - (3) Isolate mode 473 * @return 474 * - (0) if successful. 475 * - (-ENOTSUP) if hardware doesn't support. 476 * - (-EINVAL) if bad parameter. 477 */ 478 int rte_pmd_ixgbe_bypass_event_show(uint16_t port, 479 uint32_t event, 480 uint32_t *state); 481 482 /** 483 * Set bypass state when given event occurs. 484 * 485 * @param port 486 * The port identifier of the Ethernet device. 487 * @param event 488 * The bypass event 489 * - (1) Main power on (power button is pushed) 490 * - (2) Auxiliary power on (power supply is being plugged) 491 * - (3) Main power off (system shutdown and power supply is left plugged in) 492 * - (4) Auxiliary power off (power supply is being unplugged) 493 * - (5) Display or set the watchdog timer 494 * @param state 495 * The assigned state when given event occurs. 496 * - (1) Normal mode 497 * - (2) Bypass mode 498 * - (3) Isolate mode 499 * @return 500 * - (0) if successful. 501 * - (-ENOTSUP) if hardware doesn't support. 502 * - (-EINVAL) if bad parameter. 503 */ 504 int rte_pmd_ixgbe_bypass_event_store(uint16_t port, 505 uint32_t event, 506 uint32_t state); 507 508 /** 509 * Set bypass watchdog timeout count. 510 * 511 * @param port 512 * The port identifier of the Ethernet device. 513 * @param timeout 514 * The timeout to be set. 515 * - (0) 0 seconds (timer is off) 516 * - (1) 1.5 seconds 517 * - (2) 2 seconds 518 * - (3) 3 seconds 519 * - (4) 4 seconds 520 * - (5) 8 seconds 521 * - (6) 16 seconds 522 * - (7) 32 seconds 523 * @return 524 * - (0) if successful. 525 * - (-ENOTSUP) if hardware doesn't support. 526 * - (-EINVAL) if bad parameter. 527 */ 528 int rte_pmd_ixgbe_bypass_wd_timeout_store(uint16_t port, uint32_t timeout); 529 530 /** 531 * Get bypass firmware version. 532 * 533 * @param port 534 * The port identifier of the Ethernet device. 535 * @param ver 536 * The firmware version 537 * @return 538 * - (0) if successful. 539 * - (-ENOTSUP) if hardware doesn't support. 540 * - (-EINVAL) if bad parameter. 541 */ 542 int rte_pmd_ixgbe_bypass_ver_show(uint16_t port, uint32_t *ver); 543 544 /** 545 * Return bypass watchdog timeout in seconds 546 * 547 * @param port 548 * The port identifier of the Ethernet device. 549 * @param wd_timeout 550 * The return watchdog timeout. "0" represents timer expired 551 * - (0) 0 seconds (timer is off) 552 * - (1) 1.5 seconds 553 * - (2) 2 seconds 554 * - (3) 3 seconds 555 * - (4) 4 seconds 556 * - (5) 8 seconds 557 * - (6) 16 seconds 558 * - (7) 32 seconds 559 * @return 560 * - (0) if successful. 561 * - (-ENOTSUP) if hardware doesn't support. 562 * - (-EINVAL) if bad parameter. 563 */ 564 int rte_pmd_ixgbe_bypass_wd_timeout_show(uint16_t port, uint32_t *wd_timeout); 565 566 /** 567 * Reset bypass watchdog timer 568 * 569 * @param port 570 * The port identifier of the Ethernet device. 571 * @return 572 * - (0) if successful. 573 * - (-ENOTSUP) if hardware doesn't support. 574 * - (-EINVAL) if bad parameter. 575 */ 576 int rte_pmd_ixgbe_bypass_wd_reset(uint16_t port); 577 578 /** 579 * Acquire swfw semaphore lock for MDIO access 580 * 581 * @param port 582 * The port identifier of the Ethernet device. 583 * @return 584 * - (0) if successful. 585 * - (-ENOTSUP) if hardware doesn't support. 586 * - (-ENODEV) if *port* invalid. 587 * - (IXGBE_ERR_SWFW_SYNC) If sw/fw semaphore acquisition failed 588 */ 589 __rte_experimental 590 int 591 rte_pmd_ixgbe_mdio_lock(uint16_t port); 592 593 /** 594 * Release swfw semaphore lock used for MDIO access 595 * 596 * @param port 597 * The port identifier of the Ethernet device. 598 * @return 599 * - (0) if successful. 600 * - (-ENOTSUP) if hardware doesn't support. 601 * - (-ENODEV) if *port* invalid. 602 */ 603 __rte_experimental 604 int 605 rte_pmd_ixgbe_mdio_unlock(uint16_t port); 606 607 /** 608 * Read PHY register using MDIO without MDIO lock 609 * The lock must be taken separately before calling this 610 * API 611 * @param port 612 * The port identifier of the Ethernet device. 613 * @param reg_addr 614 * 32 bit PHY Register 615 * @param dev_type 616 * Used to define device base address 617 * @param phy_data 618 * Pointer for reading PHY register data 619 * @return 620 * - (0) if successful. 621 * - (-ENOTSUP) if hardware doesn't support. 622 * - (-ENODEV) if *port* invalid. 623 * - (IXGBE_ERR_PHY) If PHY read command failed 624 */ 625 __rte_experimental 626 int 627 rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr, 628 uint32_t dev_type, uint16_t *phy_data); 629 630 /** 631 * Write data to PHY register using without MDIO lock 632 * The lock must be taken separately before calling this 633 * API 634 * 635 * @param port 636 * The port identifier of the Ethernet device. 637 * @param reg_addr 638 * 32 bit PHY Register 639 * @param dev_type 640 * Used to define device base address 641 * @param phy_data 642 * Data to write to PHY register 643 * @return 644 * - (0) if successful. 645 * - (-ENOTSUP) if hardware doesn't support. 646 * - (-ENODEV) if *port* invalid. 647 * - (IXGBE_ERR_PHY) If PHY read command failed 648 */ 649 __rte_experimental 650 int 651 rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr, 652 uint32_t dev_type, uint16_t phy_data); 653 654 /** 655 * Response sent back to ixgbe driver from user app after callback 656 */ 657 enum rte_pmd_ixgbe_mb_event_rsp { 658 RTE_PMD_IXGBE_MB_EVENT_NOOP_ACK, /**< skip mbox request and ACK */ 659 RTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */ 660 RTE_PMD_IXGBE_MB_EVENT_PROCEED, /**< proceed with mbox request */ 661 RTE_PMD_IXGBE_MB_EVENT_MAX /**< max value of this enum */ 662 }; 663 664 /** 665 * Data sent to the user application when the callback is executed. 666 */ 667 struct rte_pmd_ixgbe_mb_event_param { 668 uint16_t vfid; /**< Virtual Function number */ 669 uint16_t msg_type; /**< VF to PF message type, defined in ixgbe_mbx.h */ 670 uint16_t retval; /**< return value */ 671 void *msg; /**< pointer to message */ 672 }; 673 enum { 674 RTE_PMD_IXGBE_BYPASS_MODE_NONE, 675 RTE_PMD_IXGBE_BYPASS_MODE_NORMAL, 676 RTE_PMD_IXGBE_BYPASS_MODE_BYPASS, 677 RTE_PMD_IXGBE_BYPASS_MODE_ISOLATE, 678 RTE_PMD_IXGBE_BYPASS_MODE_NUM, 679 }; 680 681 #define RTE_PMD_IXGBE_BYPASS_MODE_VALID(x) \ 682 ((x) > RTE_PMD_IXGBE_BYPASS_MODE_NONE && \ 683 (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM) 684 685 enum { 686 RTE_PMD_IXGBE_BYPASS_EVENT_NONE, 687 RTE_PMD_IXGBE_BYPASS_EVENT_START, 688 RTE_PMD_IXGBE_BYPASS_EVENT_OS_ON = RTE_PMD_IXGBE_BYPASS_EVENT_START, 689 RTE_PMD_IXGBE_BYPASS_EVENT_POWER_ON, 690 RTE_PMD_IXGBE_BYPASS_EVENT_OS_OFF, 691 RTE_PMD_IXGBE_BYPASS_EVENT_POWER_OFF, 692 RTE_PMD_IXGBE_BYPASS_EVENT_TIMEOUT, 693 RTE_PMD_IXGBE_BYPASS_EVENT_NUM 694 }; 695 696 #define RTE_PMD_IXGBE_BYPASS_EVENT_VALID(x) \ 697 ((x) > RTE_PMD_IXGBE_BYPASS_EVENT_NONE && \ 698 (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM) 699 700 enum { 701 RTE_PMD_IXGBE_BYPASS_TMT_OFF, /* timeout disabled. */ 702 RTE_PMD_IXGBE_BYPASS_TMT_1_5_SEC, /* timeout for 1.5 seconds */ 703 RTE_PMD_IXGBE_BYPASS_TMT_2_SEC, /* timeout for 2 seconds */ 704 RTE_PMD_IXGBE_BYPASS_TMT_3_SEC, /* timeout for 3 seconds */ 705 RTE_PMD_IXGBE_BYPASS_TMT_4_SEC, /* timeout for 4 seconds */ 706 RTE_PMD_IXGBE_BYPASS_TMT_8_SEC, /* timeout for 8 seconds */ 707 RTE_PMD_IXGBE_BYPASS_TMT_16_SEC, /* timeout for 16 seconds */ 708 RTE_PMD_IXGBE_BYPASS_TMT_32_SEC, /* timeout for 32 seconds */ 709 RTE_PMD_IXGBE_BYPASS_TMT_NUM 710 }; 711 712 #define RTE_PMD_IXGBE_BYPASS_TMT_VALID(x) \ 713 ((x) == RTE_PMD_IXGBE_BYPASS_TMT_OFF || \ 714 ((x) > RTE_PMD_IXGBE_BYPASS_TMT_OFF && \ 715 (x) < RTE_PMD_IXGBE_BYPASS_TMT_NUM)) 716 717 /** 718 * @param port 719 * The port identifier of the Ethernet device. 720 * @param enable 721 * 0 to disable and nonzero to enable 'SBP' bit in FCTRL register 722 * to receive all packets 723 * @return 724 * - (0) if successful. 725 * - (-ENODEV) if *port* invalid. 726 * - (-ENOTSUP) if hardware doesn't support this feature. 727 */ 728 __rte_experimental 729 int 730 rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable); 731 732 /** 733 * Get port fdir info 734 * 735 * @param port 736 * The port identifier of the Ethernet device. 737 * @param fdir_info 738 * The fdir info of the port 739 * @return 740 * - (0) if successful. 741 * - (-ENODEV) if *port* invalid. 742 * - (-ENOTSUP) if operation not supported. 743 */ 744 __rte_experimental 745 int 746 rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info); 747 748 /** 749 * Get port fdir status 750 * 751 * @param port 752 * The port identifier of the Ethernet device. 753 * @param fdir_stats 754 * The fdir status of the port 755 * @return 756 * - (0) if successful. 757 * - (-ENODEV) if *port* invalid. 758 * - (-ENOTSUP) if operation not supported. 759 */ 760 __rte_experimental 761 int 762 rte_pmd_ixgbe_get_fdir_stats(uint16_t port, 763 struct rte_eth_fdir_stats *fdir_stats); 764 #endif /* _PMD_IXGBE_H_ */ 765