On Mon, Feb 7, 2022 at 5:54 AM wrote: > > From: Jerin Jacob > > Based on device support and use-case need, there are two different ways > to enable PFC. The first case is the port level PFC configuration, in > this case, rte_eth_dev_priority_flow_ctrl_set() API shall be used to > configure the PFC, and PFC frames will be generated using based on VLAN > TC value. > > The second case is the queue level PFC configuration, in this > case, Any packet field content can be used to steer the packet to the > specific queue using rte_flow or RSS and then use > rte_eth_dev_priority_flow_ctrl_queue_configure() to configure the > TC mapping on each queue. > Based on congestion selected on the specific queue, configured TC > shall be used to generate PFC frames. > > Signed-off-by: Jerin Jacob > Signed-off-by: Sunil Kumar Kori Couple of nits inline. > --- > > v4..v3: > > - Remove RTE_ETH_PFC_QUEUE_CAPA_* and replace with enum rte_eth_fc_mode mode_capa > - More documentaion > - Address the comment from Ferruh in > http://patches.dpdk.org/project/dpdk/patch/20220131180859.2662034-1-jerinj@marvell.com/ > > v3..v1: > > - Introduce rte_eth_dev_priority_flow_ctrl_queue_info_get() to > avoid updates to rte_eth_dev_info > > - Removed devtools/libabigail.abignore changes > - Address the comment from Ferruh in > http://patches.dpdk.org/project/dpdk/patch/20220113102718.3167282-1-jerinj@marvell.com/ > > > doc/guides/nics/features.rst | 7 +- > doc/guides/rel_notes/release_22_03.rst | 5 + > lib/ethdev/ethdev_driver.h | 11 ++ > lib/ethdev/rte_ethdev.c | 139 +++++++++++++++++++++++++ > lib/ethdev/rte_ethdev.h | 100 ++++++++++++++++++ > lib/ethdev/version.map | 4 + > 6 files changed, 264 insertions(+), 2 deletions(-) > ::snip:: > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice > + * > + * A structure used to configure Ethernet priority flow control parameter for s/parameter/parameters > + * ethdev queues. > + * > + * rte_eth_pfc_queue_conf::rx_pause structure shall used to configure given "shall be used" > + * 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 used to configure given "shall be used" > + * 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 */ > + uint8_t tc; > + /**< Traffic class as per PFC (802.1Qbb) spec. The value must be > + * in the range [0, rte_eth_pfc_queue_info::tx_max - 1] > + */ > + } 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 */ > + uint8_t tc; > + /**< Traffic class as per PFC (802.1Qbb) spec. The value must be > + * in the range [0, rte_eth_pfc_queue_info::tx_max - 1] > + */ > + } tx_pause; /* Valid when (mode == FC_TX_PAUSE || mode == FC_FULL) */ ::snip::