X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fethdev%2Frte_ethdev.h;h=ce40164a07710b7e73c015afaab7c11c063d63b8;hb=6e858b4d9244cf53505589673755ab18ac2a4a83;hp=147cc1ced36aeda8c3f71c74df35308330c0566b;hpb=b1cb30352d5c159cb06f81077bda38ca8a7cc425;p=dpdk.git diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 147cc1ced3..ce40164a07 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -1408,6 +1408,59 @@ struct rte_eth_pfc_conf { uint8_t priority; /**< VLAN User Priority. */ }; +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * A structure used to retrieve information of queue based PFC. + */ +struct rte_eth_pfc_queue_info { + /** + * Maximum supported traffic class as per PFC (802.1Qbb) specification. + */ + uint8_t tc_max; + /** PFC queue mode capabilities. */ + enum rte_eth_fc_mode mode_capa; +}; + +/** + * @warning + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice + * + * A structure used to configure Ethernet priority flow control parameters for + * ethdev queues. + * + * rte_eth_pfc_queue_conf::rx_pause structure shall be used to configure given + * tx_qid with corresponding tc. When ethdev device receives PFC frame with + * rte_eth_pfc_queue_conf::rx_pause::tc, traffic will be paused on + * rte_eth_pfc_queue_conf::rx_pause::tx_qid for that tc. + * + * rte_eth_pfc_queue_conf::tx_pause structure shall be used to configure given + * rx_qid. When rx_qid is congested, PFC frames are generated with + * rte_eth_pfc_queue_conf::rx_pause::tc and + * rte_eth_pfc_queue_conf::rx_pause::pause_time to the peer. + */ +struct rte_eth_pfc_queue_conf { + enum rte_eth_fc_mode mode; /**< Link flow control mode */ + + struct { + uint16_t tx_qid; /**< Tx queue ID */ + /** Traffic class as per PFC (802.1Qbb) spec. The value must be + * in the range [0, rte_eth_pfc_queue_info::tx_max - 1] + */ + uint8_t tc; + } rx_pause; /* Valid when (mode == FC_RX_PAUSE || mode == FC_FULL) */ + + struct { + uint16_t pause_time; /**< Pause quota in the Pause frame */ + uint16_t rx_qid; /**< Rx queue ID */ + /** Traffic class as per PFC (802.1Qbb) spec. The value must be + * in the range [0, rte_eth_pfc_queue_info::tx_max - 1] + */ + uint8_t tc; + } tx_pause; /* Valid when (mode == FC_TX_PAUSE || mode == FC_FULL) */ +}; + /** * Tunnel type for device-specific classifier configuration. * @see rte_eth_udp_tunnel @@ -4158,6 +4211,54 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id, int rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *mac_addr, uint32_t pool); +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Retrieve the information for queue based PFC. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param pfc_queue_info + * A pointer to a structure of type *rte_eth_pfc_queue_info* to be filled with + * the information about queue based PFC. + * @return + * - (0) if successful. + * - (-ENOTSUP) if support for priority_flow_ctrl_queue_info_get does not exist. + * - (-ENODEV) if *port_id* invalid. + * - (-EINVAL) if bad parameter. + */ +__rte_experimental +int rte_eth_dev_priority_flow_ctrl_queue_info_get(uint16_t port_id, + struct rte_eth_pfc_queue_info *pfc_queue_info); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Configure the queue based priority flow control for a given queue + * for Ethernet device. + * + * @note When an ethdev port switches to queue based PFC mode, the + * unconfigured queues shall be configured by the driver with + * default values such as lower priority value for TC etc. + * + * @param port_id + * The port identifier of the Ethernet device. + * @param pfc_queue_conf + * The pointer to the structure of the priority flow control parameters + * for the queue. + * @return + * - (0) if successful. + * - (-ENOTSUP) if hardware doesn't support queue based PFC mode. + * - (-ENODEV) if *port_id* invalid. + * - (-EINVAL) if bad parameter + * - (-EIO) if flow control setup queue failure + */ +__rte_experimental +int rte_eth_dev_priority_flow_ctrl_queue_configure(uint16_t port_id, + struct rte_eth_pfc_queue_conf *pfc_queue_conf); + /** * Remove a MAC address from the internal array of addresses. *