@@ -1075,19 +1075,7 @@ ethtool_set_rxfh_fields(struct net_device *dev, u32 cmd, void __user *useraddr)
1075
1075
if (rc )
1076
1076
return rc ;
1077
1077
1078
- if (cmd == ETHTOOL_SRXCLSRLINS && info .fs .flow_type & FLOW_RSS ) {
1079
- /* Nonzero ring with RSS only makes sense
1080
- * if NIC adds them together
1081
- */
1082
- if (!ops -> cap_rss_rxnfc_adds &&
1083
- ethtool_get_flow_spec_ring (info .fs .ring_cookie ))
1084
- return - EINVAL ;
1085
-
1086
- if (!xa_load (& dev -> ethtool -> rss_ctx , info .rss_context ))
1087
- return - EINVAL ;
1088
- }
1089
-
1090
- if (cmd == ETHTOOL_SRXFH && ops -> get_rxfh ) {
1078
+ if (ops -> get_rxfh ) {
1091
1079
struct ethtool_rxfh_param rxfh = {};
1092
1080
1093
1081
rc = ops -> get_rxfh (dev , & rxfh );
@@ -1099,15 +1087,7 @@ ethtool_set_rxfh_fields(struct net_device *dev, u32 cmd, void __user *useraddr)
1099
1087
return rc ;
1100
1088
}
1101
1089
1102
- rc = ops -> set_rxnfc (dev , & info );
1103
- if (rc )
1104
- return rc ;
1105
-
1106
- if (cmd == ETHTOOL_SRXCLSRLINS &&
1107
- ethtool_rxnfc_copy_to_user (useraddr , & info , info_size , NULL ))
1108
- return - EFAULT ;
1109
-
1110
- return 0 ;
1090
+ return ops -> set_rxnfc (dev , & info );
1111
1091
}
1112
1092
1113
1093
static noinline_for_stack int
@@ -1117,7 +1097,6 @@ ethtool_get_rxfh_fields(struct net_device *dev, u32 cmd, void __user *useraddr)
1117
1097
size_t info_size = sizeof (info );
1118
1098
const struct ethtool_ops * ops = dev -> ethtool_ops ;
1119
1099
int ret ;
1120
- void * rule_buf = NULL ;
1121
1100
1122
1101
if (!ops -> get_rxnfc )
1123
1102
return - EOPNOTSUPP ;
@@ -1126,25 +1105,11 @@ ethtool_get_rxfh_fields(struct net_device *dev, u32 cmd, void __user *useraddr)
1126
1105
if (ret )
1127
1106
return ret ;
1128
1107
1129
- if (info .cmd == ETHTOOL_GRXCLSRLALL ) {
1130
- if (info .rule_cnt > 0 ) {
1131
- if (info .rule_cnt <= KMALLOC_MAX_SIZE / sizeof (u32 ))
1132
- rule_buf = kcalloc (info .rule_cnt , sizeof (u32 ),
1133
- GFP_USER );
1134
- if (!rule_buf )
1135
- return - ENOMEM ;
1136
- }
1137
- }
1138
-
1139
- ret = ops -> get_rxnfc (dev , & info , rule_buf );
1108
+ ret = ops -> get_rxnfc (dev , & info , NULL );
1140
1109
if (ret < 0 )
1141
- goto err_out ;
1142
-
1143
- ret = ethtool_rxnfc_copy_to_user (useraddr , & info , info_size , rule_buf );
1144
- err_out :
1145
- kfree (rule_buf );
1110
+ return ret ;
1146
1111
1147
- return ret ;
1112
+ return ethtool_rxnfc_copy_to_user ( useraddr , & info , info_size , NULL ) ;
1148
1113
}
1149
1114
1150
1115
static noinline_for_stack int ethtool_set_rxnfc (struct net_device * dev ,
@@ -1175,18 +1140,6 @@ static noinline_for_stack int ethtool_set_rxnfc(struct net_device *dev,
1175
1140
return - EINVAL ;
1176
1141
}
1177
1142
1178
- if (cmd == ETHTOOL_SRXFH && ops -> get_rxfh ) {
1179
- struct ethtool_rxfh_param rxfh = {};
1180
-
1181
- rc = ops -> get_rxfh (dev , & rxfh );
1182
- if (rc )
1183
- return rc ;
1184
-
1185
- rc = ethtool_check_xfrm_rxfh (rxfh .input_xfrm , info .data );
1186
- if (rc )
1187
- return rc ;
1188
- }
1189
-
1190
1143
rc = ops -> set_rxnfc (dev , & info );
1191
1144
if (rc )
1192
1145
return rc ;
0 commit comments