@@ -2883,15 +2883,27 @@ static u32 ice_parse_hdrs(struct ethtool_rxnfc *nfc)
28832883 return hdrs ;
28842884}
28852885
2886+ #define ICE_FLOW_HASH_FLD_IPV4_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA)
2887+ #define ICE_FLOW_HASH_FLD_IPV6_SA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)
2888+ #define ICE_FLOW_HASH_FLD_IPV4_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)
2889+ #define ICE_FLOW_HASH_FLD_IPV6_DA BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_DA)
2890+ #define ICE_FLOW_HASH_FLD_TCP_SRC_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_SRC_PORT)
2891+ #define ICE_FLOW_HASH_FLD_TCP_DST_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_TCP_DST_PORT)
2892+ #define ICE_FLOW_HASH_FLD_UDP_SRC_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_SRC_PORT)
2893+ #define ICE_FLOW_HASH_FLD_UDP_DST_PORT BIT_ULL(ICE_FLOW_FIELD_IDX_UDP_DST_PORT)
2894+ #define ICE_FLOW_HASH_FLD_SCTP_SRC_PORT \
2895+ BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT)
2896+ #define ICE_FLOW_HASH_FLD_SCTP_DST_PORT \
2897+ BIT_ULL(ICE_FLOW_FIELD_IDX_SCTP_DST_PORT)
2898+
28862899/**
28872900 * ice_parse_hash_flds - parses hash fields from RSS hash input
28882901 * @nfc: ethtool rxnfc command
2889- * @symm: true if Symmetric Topelitz is set
28902902 *
28912903 * This function parses the rxnfc command and returns intended
28922904 * hash fields for RSS configuration
28932905 */
2894- static u64 ice_parse_hash_flds (struct ethtool_rxnfc * nfc , bool symm )
2906+ static u64 ice_parse_hash_flds (struct ethtool_rxnfc * nfc )
28952907{
28962908 u64 hfld = ICE_HASH_INVALID ;
28972909
@@ -2900,12 +2912,6 @@ static u64 ice_parse_hash_flds(struct ethtool_rxnfc *nfc, bool symm)
29002912 case TCP_V4_FLOW :
29012913 case UDP_V4_FLOW :
29022914 case SCTP_V4_FLOW :
2903- case GTPU_V4_FLOW :
2904- case GTPC_V4_FLOW :
2905- case GTPC_TEID_V4_FLOW :
2906- case GTPU_EH_V4_FLOW :
2907- case GTPU_UL_V4_FLOW :
2908- case GTPU_DL_V4_FLOW :
29092915 if (nfc -> data & RXH_IP_SRC )
29102916 hfld |= ICE_FLOW_HASH_FLD_IPV4_SA ;
29112917 if (nfc -> data & RXH_IP_DST )
@@ -2914,12 +2920,6 @@ static u64 ice_parse_hash_flds(struct ethtool_rxnfc *nfc, bool symm)
29142920 case TCP_V6_FLOW :
29152921 case UDP_V6_FLOW :
29162922 case SCTP_V6_FLOW :
2917- case GTPU_V6_FLOW :
2918- case GTPC_V6_FLOW :
2919- case GTPC_TEID_V6_FLOW :
2920- case GTPU_EH_V6_FLOW :
2921- case GTPU_UL_V6_FLOW :
2922- case GTPU_DL_V6_FLOW :
29232923 if (nfc -> data & RXH_IP_SRC )
29242924 hfld |= ICE_FLOW_HASH_FLD_IPV6_SA ;
29252925 if (nfc -> data & RXH_IP_DST )
@@ -2958,33 +2958,6 @@ static u64 ice_parse_hash_flds(struct ethtool_rxnfc *nfc, bool symm)
29582958 }
29592959 }
29602960
2961- if (nfc -> data & RXH_GTP_TEID ) {
2962- switch (nfc -> flow_type ) {
2963- case GTPC_TEID_V4_FLOW :
2964- case GTPC_TEID_V6_FLOW :
2965- hfld |= ICE_FLOW_HASH_FLD_GTPC_TEID ;
2966- break ;
2967- case GTPU_V4_FLOW :
2968- case GTPU_V6_FLOW :
2969- hfld |= ICE_FLOW_HASH_FLD_GTPU_IP_TEID ;
2970- break ;
2971- case GTPU_EH_V4_FLOW :
2972- case GTPU_EH_V6_FLOW :
2973- hfld |= ICE_FLOW_HASH_FLD_GTPU_EH_TEID ;
2974- break ;
2975- case GTPU_UL_V4_FLOW :
2976- case GTPU_UL_V6_FLOW :
2977- hfld |= ICE_FLOW_HASH_FLD_GTPU_UP_TEID ;
2978- break ;
2979- case GTPU_DL_V4_FLOW :
2980- case GTPU_DL_V6_FLOW :
2981- hfld |= ICE_FLOW_HASH_FLD_GTPU_DWN_TEID ;
2982- break ;
2983- default :
2984- break ;
2985- }
2986- }
2987-
29882961 return hfld ;
29892962}
29902963
@@ -3014,7 +2987,7 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
30142987 }
30152988
30162989 symm = !!(vsi -> rss_hfunc == ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ );
3017- hashed_flds = ice_parse_hash_flds (nfc , symm );
2990+ hashed_flds = ice_parse_hash_flds (nfc );
30182991 if (hashed_flds == ICE_HASH_INVALID ) {
30192992 dev_dbg (dev , "Invalid hash fields, vsi num = %d\n" ,
30202993 vsi -> vsi_num );
@@ -3033,7 +3006,7 @@ ice_set_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
30333006 cfg .hdr_type = ICE_RSS_ANY_HEADERS ;
30343007 cfg .symm = symm ;
30353008
3036- status = ice_add_rss_cfg (& pf -> hw , vsi , & cfg );
3009+ status = ice_add_rss_cfg (& pf -> hw , vsi -> idx , & cfg );
30373010 if (status ) {
30383011 dev_dbg (dev , "ice_add_rss_cfg failed, vsi num = %d, error = %d\n" ,
30393012 vsi -> vsi_num , status );
@@ -3054,7 +3027,6 @@ ice_get_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
30543027 struct ice_pf * pf = vsi -> back ;
30553028 struct device * dev ;
30563029 u64 hash_flds ;
3057- bool symm ;
30583030 u32 hdrs ;
30593031
30603032 dev = ice_pf_to_dev (pf );
@@ -3073,7 +3045,7 @@ ice_get_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
30733045 return ;
30743046 }
30753047
3076- hash_flds = ice_get_rss_cfg (& pf -> hw , vsi -> idx , hdrs , & symm );
3048+ hash_flds = ice_get_rss_cfg (& pf -> hw , vsi -> idx , hdrs );
30773049 if (hash_flds == ICE_HASH_INVALID ) {
30783050 dev_dbg (dev , "No hash fields found for the given header type, vsi num = %d\n" ,
30793051 vsi -> vsi_num );
@@ -3097,13 +3069,6 @@ ice_get_rss_hash_opt(struct ice_vsi *vsi, struct ethtool_rxnfc *nfc)
30973069 hash_flds & ICE_FLOW_HASH_FLD_UDP_DST_PORT ||
30983070 hash_flds & ICE_FLOW_HASH_FLD_SCTP_DST_PORT )
30993071 nfc -> data |= (u64 )RXH_L4_B_2_3 ;
3100-
3101- if (hash_flds & ICE_FLOW_HASH_FLD_GTPC_TEID ||
3102- hash_flds & ICE_FLOW_HASH_FLD_GTPU_IP_TEID ||
3103- hash_flds & ICE_FLOW_HASH_FLD_GTPU_EH_TEID ||
3104- hash_flds & ICE_FLOW_HASH_FLD_GTPU_UP_TEID ||
3105- hash_flds & ICE_FLOW_HASH_FLD_GTPU_DWN_TEID )
3106- nfc -> data |= (u64 )RXH_GTP_TEID ;
31073072}
31083073
31093074/**
@@ -3708,7 +3673,6 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
37083673 struct netlink_ext_ack * extack )
37093674{
37103675 struct ice_netdev_priv * np = netdev_priv (netdev );
3711- u8 hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_TPLZ ;
37123676 struct ice_vsi * vsi = np -> vsi ;
37133677 struct ice_pf * pf = vsi -> back ;
37143678 struct device * dev ;
@@ -3719,9 +3683,6 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
37193683 rxfh -> hfunc != ETH_RSS_HASH_TOP )
37203684 return - EOPNOTSUPP ;
37213685
3722- if (rxfh -> rss_context )
3723- return - EOPNOTSUPP ;
3724-
37253686 if (!test_bit (ICE_FLAG_RSS_ENA , pf -> flags )) {
37263687 /* RSS not supported return error here */
37273688 netdev_warn (netdev , "RSS is not configured on this VSI!\n" );
@@ -3733,19 +3694,11 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
37333694 return - EOPNOTSUPP ;
37343695 }
37353696
3736- /* Update the VSI's hash function */
3737- if (rxfh -> input_xfrm & RXH_XFRM_SYM_XOR )
3738- hfunc = ICE_AQ_VSI_Q_OPT_RSS_HASH_SYM_TPLZ ;
3739-
3740- err = ice_set_rss_hfunc (vsi , hfunc );
3741- if (err )
3742- return err ;
3743-
37443697 if (rxfh -> key ) {
37453698 if (!vsi -> rss_hkey_user ) {
3746- vsi -> rss_hkey_user =
3747- devm_kzalloc ( dev , ICE_VSIQF_HKEY_ARRAY_SIZE ,
3748- GFP_KERNEL );
3699+ vsi -> rss_hkey_user = devm_kzalloc ( dev ,
3700+ ICE_VSIQF_HKEY_ARRAY_SIZE ,
3701+ GFP_KERNEL );
37493702 if (!vsi -> rss_hkey_user )
37503703 return - ENOMEM ;
37513704 }
@@ -3767,8 +3720,9 @@ ice_set_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh,
37673720 /* Each 32 bits pointed by 'indir' is stored with a lut entry */
37683721 if (rxfh -> indir ) {
37693722 int i ;
3723+ u16 table_size = (u16 )vsi -> rss_table_size ;
37703724
3771- for (i = 0 ; i < vsi -> rss_table_size ; i ++ )
3725+ for (i = 0 ; i < table_size ; i ++ )
37723726 vsi -> rss_lut_user [i ] = (u8 )(rxfh -> indir [i ]);
37733727 } else {
37743728 ice_fill_rss_lut (vsi -> rss_lut_user , vsi -> rss_table_size ,
0 commit comments