On Mon, Feb 7, 2022 at 5:54 AM wrote: > > From: Sunil Kumar Kori > > Patch adds command line options to configure queue based > priority flow control. > > - Syntax command is given as below: > > set pfc_queue_ctrl rx \ > tx > > - Example command to configure queue based priority flow control > on rx and tx side for port 0, Rx queue 0, Tx queue 0 with pause > time 2047 > > testpmd> set pfc_queue_ctrl 0 rx on 0 0 tx on 0 0 2047 > > Signed-off-by: Sunil Kumar Kori Couple of minor nits. Otherwise this looks good. Acked-by: Ajit Khaparde > --- > v4..v3: > - fix documentation to explain CLI syntax. > v3..v1: > - Sync up the implementation to use new APIs > > app/test-pmd/cmdline.c | 122 ++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 23 ++++ > 2 files changed, 145 insertions(+) > ::snip:: > + > +static void > +cmd_queue_priority_flow_ctrl_set_parsed(void *parsed_result, > + __rte_unused struct cmdline *cl, > + __rte_unused void *data) > +{ > + struct cmd_queue_priority_flow_ctrl_set_result *res = parsed_result; > + struct rte_eth_pfc_queue_conf pfc_queue_conf; > + int rx_fc_enable, tx_fc_enable; > + int ret; > + > + /* > + * Rx on/off, flow control is enabled/disabled on RX side. This can on the RX side. > + * indicate the RTE_ETH_FC_TX_PAUSE, Transmit pause frame at the Rx > + * side. Tx on/off, flow control is enabled/disabled on TX side. This > + * can indicate the RTE_ETH_FC_RX_PAUSE, Respond to the pause frame at > + * the Tx side. > + */ > + static enum rte_eth_fc_mode rx_tx_onoff_2_mode[2][2] = { > + {RTE_ETH_FC_NONE, RTE_ETH_FC_TX_PAUSE}, > + {RTE_ETH_FC_RX_PAUSE, RTE_ETH_FC_FULL} > + }; > + ::snip: > > +set pfc_queue_ctrl > +~~~~~~~~~~~~~~~~~~ > + > +Set the priority flow control parameter on a given Rx and Tx queue of a port:: > + > + testpmd> set pfc_queue_ctrl rx (on|off) \ > + tx (on|off) > + > +Where: > + > +* ``tx_qid`` (integer): Tx qid for which ``tx_tc`` will be applied and traffic > + will be paused when PFC frame is received with ``tx_tc`` enabled. > + > +* ``tx_tc`` (0-15): TC for which traffic is to be paused for xmit. > + > +* ``rx_qid`` (integer): Rx qid for which threshold will be applied and PFC > + frame will be generated with ``tx_tc`` when exceeds the threshold. when the threshold exceeds. > + > +* ``rx_tc`` (0-15): TC filled in PFC frame for which remote Tx is to be paused. > + > +* ``pause_time`` (integer): Pause quanta filled in the PFC frame for which > + interval, remote Tx will be paused. Valid only if Tx pause is on. > + > set stat_qmap > ~~~~~~~~~~~~~ > > -- > 2.35.1 >