Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ice: Replace ice specific DSCP mapping num with a kernel define

Replace ice driver specific DSCP mapping number defines
ICE_DSCP_NUM_VAL and IIDC_MAX_DSCP_MAPPING with
an equivalent kernel define DSCP_MAX.

Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

authored by

Tatyana Nikolova and committed by
Tony Nguyen
8239b771 d9251a56

+9 -9
+1 -1
drivers/net/ethernet/intel/ice/ice_dcb.c
··· 1288 1288 tlv->ouisubtype = htonl(ouisubtype); 1289 1289 1290 1290 /* bytes 0 - 63 - IPv4 DSCP2UP LUT */ 1291 - for (i = 0; i < ICE_DSCP_NUM_VAL; i++) { 1291 + for (i = 0; i < DSCP_MAX; i++) { 1292 1292 /* IPv4 mapping */ 1293 1293 buf[i] = dcbcfg->dscp_map[i]; 1294 1294 /* IPv6 mapping */
+2 -2
drivers/net/ethernet/intel/ice/ice_dcb_nl.c
··· 754 754 if (!ice_is_feature_supported(pf, ICE_F_DSCP)) 755 755 return -EOPNOTSUPP; 756 756 757 - if (app->protocol >= ICE_DSCP_NUM_VAL) { 757 + if (app->protocol >= DSCP_MAX) { 758 758 netdev_err(netdev, "DSCP value 0x%04X out of range\n", 759 759 app->protocol); 760 760 return -EINVAL; ··· 931 931 /* if the last DSCP mapping just got deleted, need to switch 932 932 * to L2 VLAN QoS mode 933 933 */ 934 - if (bitmap_empty(new_cfg->dscp_mapped, ICE_DSCP_NUM_VAL) && 934 + if (bitmap_empty(new_cfg->dscp_mapped, DSCP_MAX) && 935 935 new_cfg->pfc_mode == ICE_QOS_MODE_DSCP) { 936 936 ret = ice_aq_set_pfc_mode(&pf->hw, 937 937 ICE_AQC_PFC_VLAN_BASED_PFC,
+1 -1
drivers/net/ethernet/intel/ice/ice_idc.c
··· 225 225 226 226 qos->pfc_mode = dcbx_cfg->pfc_mode; 227 227 if (qos->pfc_mode == IIDC_DSCP_PFC_MODE) 228 - for (i = 0; i < IIDC_MAX_DSCP_MAPPING; i++) 228 + for (i = 0; i < DSCP_MAX; i++) 229 229 qos->dscp_map[i] = dcbx_cfg->dscp_map[i]; 230 230 } 231 231 EXPORT_SYMBOL_GPL(ice_get_qos_params);
+3 -3
drivers/net/ethernet/intel/ice/ice_type.h
··· 19 19 #include "ice_vlan_mode.h" 20 20 #include "ice_fwlog.h" 21 21 #include <linux/wait.h> 22 + #include <net/dscp.h> 22 23 23 24 static inline bool ice_is_tc_ena(unsigned long bitmap, u8 tc) 24 25 { ··· 696 695 697 696 #define ICE_MAX_USER_PRIORITY 8 698 697 #define ICE_DCBX_MAX_APPS 64 699 - #define ICE_DSCP_NUM_VAL 64 700 698 #define ICE_LLDPDU_SIZE 1500 701 699 #define ICE_TLV_STATUS_OPER 0x1 702 700 #define ICE_TLV_STATUS_SYNC 0x2 ··· 718 718 u8 pfc_mode; 719 719 struct ice_dcb_app_priority_table app[ICE_DCBX_MAX_APPS]; 720 720 /* when DSCP mapping defined by user set its bit to 1 */ 721 - DECLARE_BITMAP(dscp_mapped, ICE_DSCP_NUM_VAL); 721 + DECLARE_BITMAP(dscp_mapped, DSCP_MAX); 722 722 /* array holding DSCP -> UP/TC values for DSCP L3 QoS mode */ 723 - u8 dscp_map[ICE_DSCP_NUM_VAL]; 723 + u8 dscp_map[DSCP_MAX]; 724 724 u8 dcbx_mode; 725 725 #define ICE_DCBX_MODE_CEE 0x1 726 726 #define ICE_DCBX_MODE_IEEE 0x2
+2 -2
include/linux/net/intel/iidc_rdma.h
··· 10 10 #include <linux/if_ether.h> 11 11 #include <linux/kernel.h> 12 12 #include <linux/netdevice.h> 13 + #include <net/dscp.h> 13 14 14 15 enum iidc_rdma_event_type { 15 16 IIDC_RDMA_EVENT_BEFORE_MTU_CHANGE, ··· 33 32 }; 34 33 35 34 #define IIDC_MAX_USER_PRIORITY 8 36 - #define IIDC_MAX_DSCP_MAPPING 64 37 35 #define IIDC_DSCP_PFC_MODE 0x1 38 36 39 37 /* Struct to hold per RDMA Qset info */ ··· 63 63 u8 vport_priority_type; 64 64 u8 num_tc; 65 65 u8 pfc_mode; 66 - u8 dscp_map[IIDC_MAX_DSCP_MAPPING]; 66 + u8 dscp_map[DSCP_MAX]; 67 67 }; 68 68 69 69 struct iidc_rdma_event {