ice: add support for DSCP QoS for IDC
authorDave Ertman <david.m.ertman@intel.com>
Tue, 23 Nov 2021 18:25:36 +0000 (10:25 -0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 3 Feb 2022 23:22:03 +0000 (15:22 -0800)
The ice driver provides QoS information to auxiliary drivers
through the exported function ice_get_qos_params.  This function
doesn't currently support L3 DSCP QoS.

Add the necessary defines, structure elements and code to support
DSCP QoS through the IIDC functions.

Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_idc.c
include/linux/net/intel/iidc.h

index fc3580167e7b5bee6969e30ad197080b2bdd7d4b..263a2e7577a21bf3646b34840cc11a68c1c3af04 100644 (file)
@@ -227,6 +227,11 @@ void ice_get_qos_params(struct ice_pf *pf, struct iidc_qos_params *qos)
 
        for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
                qos->tc_info[i].rel_bw = dcbx_cfg->etscfg.tcbwtable[i];
+
+       qos->pfc_mode = dcbx_cfg->pfc_mode;
+       if (qos->pfc_mode == IIDC_DSCP_PFC_MODE)
+               for (i = 0; i < IIDC_MAX_DSCP_MAPPING; i++)
+                       qos->dscp_map[i] = dcbx_cfg->dscp_map[i];
 }
 EXPORT_SYMBOL_GPL(ice_get_qos_params);
 
index 1289593411d352d4071620a465a25ffa94e15b69..1c1332e4df260f88818b41ffda0b7fb88e035a7b 100644 (file)
@@ -32,6 +32,8 @@ enum iidc_rdma_protocol {
 };
 
 #define IIDC_MAX_USER_PRIORITY         8
+#define IIDC_MAX_DSCP_MAPPING          64
+#define IIDC_DSCP_PFC_MODE             0x1
 
 /* Struct to hold per RDMA Qset info */
 struct iidc_rdma_qset_params {
@@ -60,6 +62,8 @@ struct iidc_qos_params {
        u8 vport_relative_bw;
        u8 vport_priority_type;
        u8 num_tc;
+       u8 pfc_mode;
+       u8 dscp_map[IIDC_MAX_DSCP_MAPPING];
 };
 
 struct iidc_event {