dpdk/drivers/net/ixgbe/rte_pmd_ixgbe.h
<<
>>
Prefs
   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 */
  30int 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 */
  46int 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 */
  64int 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 */
  82int 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 */
 100int 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 */
 117int 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 */
 133int 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
 152int 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 */
 171int
 172rte_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 */
 190int 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 */
 202int 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 */
 216int 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 */
 232int 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 */
 253int 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 */
 275int 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*    RTE_ETH_VMDQ_ACCEPT_UNTAG, RTE_ETH_VMDQ_ACCEPT_HASH_UC,
 289*    RTE_ETH_VMDQ_ACCEPT_BROADCAST and RTE_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*/
 300int
 301rte_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*/
 320int
 321rte_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*/
 339int
 340rte_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*/
 361int
 362rte_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 */
 382int 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 */
 404int 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 */
 420int 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 */
 437int 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 */
 454int 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 */
 478int 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 */
 504int 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 */
 528int 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 */
 542int 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 */
 564int 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 */
 576int 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 */
 589int
 590rte_pmd_ixgbe_mdio_lock(uint16_t port);
 591
 592/**
 593 * Release swfw semaphore lock used for MDIO access
 594 *
 595 * @param port
 596 *   The port identifier of the Ethernet device.
 597 * @return
 598 *   - (0) if successful.
 599 *   - (-ENOTSUP) if hardware doesn't support.
 600 *   - (-ENODEV) if *port* invalid.
 601 */
 602int
 603rte_pmd_ixgbe_mdio_unlock(uint16_t port);
 604
 605/**
 606 * Read PHY register using MDIO without MDIO lock
 607 * The lock must be taken separately before calling this
 608 * API
 609 * @param port
 610 *   The port identifier of the Ethernet device.
 611 * @param reg_addr
 612 *   32 bit PHY Register
 613 * @param dev_type
 614 *   Used to define device base address
 615 * @param phy_data
 616 *   Pointer for reading PHY register data
 617 * @return
 618 *   - (0) if successful.
 619 *   - (-ENOTSUP) if hardware doesn't support.
 620 *   - (-ENODEV) if *port* invalid.
 621 *   - (IXGBE_ERR_PHY) If PHY read command failed
 622 */
 623int
 624rte_pmd_ixgbe_mdio_unlocked_read(uint16_t port, uint32_t reg_addr,
 625                                 uint32_t dev_type, uint16_t *phy_data);
 626
 627/**
 628 * Write data to PHY register using without MDIO lock
 629 * The lock must be taken separately before calling this
 630 * API
 631 *
 632 * @param port
 633 *   The port identifier of the Ethernet device.
 634 * @param reg_addr
 635 *   32 bit PHY Register
 636 * @param dev_type
 637 *   Used to define device base address
 638 * @param phy_data
 639 *   Data to write to PHY register
 640 * @return
 641 *   - (0) if successful.
 642 *   - (-ENOTSUP) if hardware doesn't support.
 643 *   - (-ENODEV) if *port* invalid.
 644 *   - (IXGBE_ERR_PHY) If PHY read command failed
 645 */
 646int
 647rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr,
 648                                  uint32_t dev_type, uint16_t phy_data);
 649
 650/**
 651 * Response sent back to ixgbe driver from user app after callback
 652 */
 653enum rte_pmd_ixgbe_mb_event_rsp {
 654        RTE_PMD_IXGBE_MB_EVENT_NOOP_ACK,  /**< skip mbox request and ACK */
 655        RTE_PMD_IXGBE_MB_EVENT_NOOP_NACK, /**< skip mbox request and NACK */
 656        RTE_PMD_IXGBE_MB_EVENT_PROCEED,  /**< proceed with mbox request  */
 657        RTE_PMD_IXGBE_MB_EVENT_MAX       /**< max value of this enum */
 658};
 659
 660/**
 661 * Data sent to the user application when the callback is executed.
 662 */
 663struct rte_pmd_ixgbe_mb_event_param {
 664        uint16_t vfid;     /**< Virtual Function number */
 665        uint16_t msg_type; /**< VF to PF message type, defined in ixgbe_mbx.h */
 666        uint16_t retval;   /**< return value */
 667        void *msg;         /**< pointer to message */
 668};
 669enum {
 670        RTE_PMD_IXGBE_BYPASS_MODE_NONE,
 671        RTE_PMD_IXGBE_BYPASS_MODE_NORMAL,
 672        RTE_PMD_IXGBE_BYPASS_MODE_BYPASS,
 673        RTE_PMD_IXGBE_BYPASS_MODE_ISOLATE,
 674        RTE_PMD_IXGBE_BYPASS_MODE_NUM,
 675};
 676
 677#define RTE_PMD_IXGBE_BYPASS_MODE_VALID(x)        \
 678        ((x) > RTE_PMD_IXGBE_BYPASS_MODE_NONE &&  \
 679        (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM)
 680
 681enum {
 682        RTE_PMD_IXGBE_BYPASS_EVENT_NONE,
 683        RTE_PMD_IXGBE_BYPASS_EVENT_START,
 684        RTE_PMD_IXGBE_BYPASS_EVENT_OS_ON = RTE_PMD_IXGBE_BYPASS_EVENT_START,
 685        RTE_PMD_IXGBE_BYPASS_EVENT_POWER_ON,
 686        RTE_PMD_IXGBE_BYPASS_EVENT_OS_OFF,
 687        RTE_PMD_IXGBE_BYPASS_EVENT_POWER_OFF,
 688        RTE_PMD_IXGBE_BYPASS_EVENT_TIMEOUT,
 689        RTE_PMD_IXGBE_BYPASS_EVENT_NUM
 690};
 691
 692#define RTE_PMD_IXGBE_BYPASS_EVENT_VALID(x)       \
 693        ((x) > RTE_PMD_IXGBE_BYPASS_EVENT_NONE && \
 694        (x) < RTE_PMD_IXGBE_BYPASS_MODE_NUM)
 695
 696enum {
 697        RTE_PMD_IXGBE_BYPASS_TMT_OFF,     /* timeout disabled. */
 698        RTE_PMD_IXGBE_BYPASS_TMT_1_5_SEC, /* timeout for 1.5 seconds */
 699        RTE_PMD_IXGBE_BYPASS_TMT_2_SEC,   /* timeout for 2 seconds */
 700        RTE_PMD_IXGBE_BYPASS_TMT_3_SEC,   /* timeout for 3 seconds */
 701        RTE_PMD_IXGBE_BYPASS_TMT_4_SEC,   /* timeout for 4 seconds */
 702        RTE_PMD_IXGBE_BYPASS_TMT_8_SEC,   /* timeout for 8 seconds */
 703        RTE_PMD_IXGBE_BYPASS_TMT_16_SEC,  /* timeout for 16 seconds */
 704        RTE_PMD_IXGBE_BYPASS_TMT_32_SEC,  /* timeout for 32 seconds */
 705        RTE_PMD_IXGBE_BYPASS_TMT_NUM
 706};
 707
 708#define RTE_PMD_IXGBE_BYPASS_TMT_VALID(x)       \
 709        ((x) == RTE_PMD_IXGBE_BYPASS_TMT_OFF || \
 710        ((x) > RTE_PMD_IXGBE_BYPASS_TMT_OFF &&  \
 711        (x) < RTE_PMD_IXGBE_BYPASS_TMT_NUM))
 712
 713/**
 714 * @param port
 715 *   The port identifier of the Ethernet device.
 716 * @param enable
 717 *    0 to disable and nonzero to enable 'SBP' bit in FCTRL register
 718 *    to receive all packets
 719 * @return
 720 *   - (0) if successful.
 721 *   - (-ENODEV) if *port* invalid.
 722 *   - (-ENOTSUP) if hardware doesn't support this feature.
 723 */
 724int
 725rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable);
 726
 727/**
 728 * Get port fdir info
 729 *
 730 * @param port
 731 *   The port identifier of the Ethernet device.
 732 * @param fdir_info
 733 *   The fdir info of the port
 734 * @return
 735 *   - (0) if successful.
 736 *   - (-ENODEV) if *port* invalid.
 737 *   - (-ENOTSUP) if operation not supported.
 738 */
 739__rte_experimental
 740int
 741rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info);
 742
 743/**
 744 * Get port fdir status
 745 *
 746 * @param port
 747 *   The port identifier of the Ethernet device.
 748 * @param fdir_stats
 749 *   The fdir status of the port
 750 * @return
 751 *   - (0) if successful.
 752 *   - (-ENODEV) if *port* invalid.
 753 *   - (-ENOTSUP) if operation not supported.
 754 */
 755__rte_experimental
 756int
 757rte_pmd_ixgbe_get_fdir_stats(uint16_t port,
 758                             struct rte_eth_fdir_stats *fdir_stats);
 759#endif /* _PMD_IXGBE_H_ */
 760