@@ -426,6 +426,108 @@ The DCF PMD needs to advertise and acquire DCF capability which allows DCF to
426426send AdminQ commands that it would like to execute over to the PF and receive
427427responses for the same from PF.
428428
429+ Data Center Bridging (DCB) and Priority Flow Control (PFC)
430+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
431+
432+ The ice PMD supports Data Center Bridging (DCB) and Priority Flow Control (PFC).
433+ These features enable Quality of Service (QoS) in data center environments by allowing
434+ traffic classification and prioritization across multiple traffic classes.
435+
436+ DCB Configuration
437+ +++++++++++++++++
438+
439+ DCB can be enabled by configuring the device with ``RTE_ETH_MQ_RX_DCB_FLAG `` in the Rx mode
440+ during device configuration.
441+
442+ The ice PMD supports:
443+
444+ * 4 or 8 traffic classes (TCs)
445+ * VLAN Priority to Traffic Class mapping
446+
447+ Limitations:
448+
449+ * All TCs are configured with Enhanced Transmission Selection (ETS) with even bandwidth allocation
450+ * Queues are evenly distributed across configured TCs
451+ * The number of queues must be evenly divisible by the number of traffic classes
452+ * The number of queues per TC must be a power of 2
453+ * Traffic classes must be configured contiguously starting from TC 0
454+
455+ Example DCB configuration in testpmd:
456+
457+ .. code-block :: console
458+
459+ dpdk-testpmd -a 0000:18:00.0 -- -i --nb-cores=8 --rxq=8 --txq=8
460+ port stop 0
461+ port config 0 dcb vt off 4 pfc off
462+ port start 0
463+
464+ This configures 4 traffic classes with 2 queues per TC.
465+
466+ Example DCB configuration in application code:
467+
468+ .. code-block :: c
469+
470+ struct rte_eth_conf port_conf = {
471+ .rxmode = {
472+ .mq_mode = RTE_ETH_MQ_RX_DCB,
473+ },
474+ .rx_adv_conf = {
475+ .dcb_rx_conf = {
476+ .nb_tcs = RTE_ETH_4_TCS,
477+ .dcb_tc = {0, 1, 2, 3, 0, 1, 2, 3}, /* Map priorities to TCs */
478+ },
479+ },
480+ };
481+
482+ ret = rte_eth_dev_configure(port_id, nb_rx_queues, nb_tx_queues, &port_conf);
483+
484+ PFC Configuration
485+ +++++++++++++++++
486+
487+ Priority Flow Control (PFC) provides a mechanism to pause and resume traffic
488+ on individual traffic classes, enabling lossless Ethernet for specific priorities.
489+
490+ PFC can be configured per priority using the ``rte_eth_dev_priority_flow_ctrl_set() `` API.
491+ Each traffic class can be independently configured with:
492+
493+ * RX pause only
494+ * TX pause only
495+ * Full duplex pause
496+ * No pause (disabled)
497+
498+ PFC operates in VLAN-based mode and requires DCB to be configured first.
499+
500+ Features:
501+
502+ * Per-TC pause control (XON/XOFF)
503+ * Configurable high/low watermarks for buffer management
504+ * Configurable pause quanta
505+ * PFC statistics exposed via xstats
506+
507+ Example PFC configuration in testpmd:
508+
509+ .. code-block :: console
510+
511+ set pfc_ctrl rx on tx on 100000 50000 65535 0 0
512+
513+ This enables PFC on port 0 priority 0 with high watermark of 100000 bytes,
514+ low watermark of 50000 bytes, and pause time of 65535.
515+
516+ Example PFC configuration using DPDK API:
517+
518+ .. code-block :: c
519+
520+ struct rte_eth_pfc_conf pfc_conf;
521+
522+ pfc_conf.fc.mode = RTE_ETH_FC_FULL; /* Enable full duplex pause */
523+ pfc_conf.fc.high_water = 100000; /* High watermark in bytes */
524+ pfc_conf.fc.low_water = 50000; /* Low watermark in bytes */
525+ pfc_conf.fc.pause_time = 0xFFFF; /* Pause quanta (in 512 bit-time units) */
526+ pfc_conf.priority = 0; /* Configure PFC for priority 0 */
527+
528+ ret = rte_eth_dev_priority_flow_ctrl_set(port_id, &pfc_conf);
529+
530+
429531 Forward Error Correction (FEC)
430532~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
431533
0 commit comments