@@ -873,25 +873,13 @@ static u8 hclgevf_get_rss_hash_bits(struct ethtool_rxnfc *nfc)
873
873
return hash_sets ;
874
874
}
875
875
876
- static int hclgevf_set_rss_tuple (struct hnae3_handle * handle ,
877
- struct ethtool_rxnfc * nfc )
876
+ static int hclgevf_init_rss_tuple_cmd (struct hnae3_handle * handle ,
877
+ struct ethtool_rxnfc * nfc ,
878
+ struct hclgevf_rss_input_tuple_cmd * req )
878
879
{
879
880
struct hclgevf_dev * hdev = hclgevf_ae_get_hdev (handle );
880
881
struct hclgevf_rss_cfg * rss_cfg = & hdev -> rss_cfg ;
881
- struct hclgevf_rss_input_tuple_cmd * req ;
882
- struct hclgevf_desc desc ;
883
882
u8 tuple_sets ;
884
- int ret ;
885
-
886
- if (hdev -> ae_dev -> dev_version < HNAE3_DEVICE_VERSION_V2 )
887
- return - EOPNOTSUPP ;
888
-
889
- if (nfc -> data &
890
- ~(RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3 ))
891
- return - EINVAL ;
892
-
893
- req = (struct hclgevf_rss_input_tuple_cmd * )desc .data ;
894
- hclgevf_cmd_setup_basic_desc (& desc , HCLGEVF_OPC_RSS_INPUT_TUPLE , false);
895
883
896
884
req -> ipv4_tcp_en = rss_cfg -> rss_tuple_sets .ipv4_tcp_en ;
897
885
req -> ipv4_udp_en = rss_cfg -> rss_tuple_sets .ipv4_udp_en ;
@@ -936,6 +924,35 @@ static int hclgevf_set_rss_tuple(struct hnae3_handle *handle,
936
924
return - EINVAL ;
937
925
}
938
926
927
+ return 0 ;
928
+ }
929
+
930
+ static int hclgevf_set_rss_tuple (struct hnae3_handle * handle ,
931
+ struct ethtool_rxnfc * nfc )
932
+ {
933
+ struct hclgevf_dev * hdev = hclgevf_ae_get_hdev (handle );
934
+ struct hclgevf_rss_cfg * rss_cfg = & hdev -> rss_cfg ;
935
+ struct hclgevf_rss_input_tuple_cmd * req ;
936
+ struct hclgevf_desc desc ;
937
+ int ret ;
938
+
939
+ if (hdev -> ae_dev -> dev_version < HNAE3_DEVICE_VERSION_V2 )
940
+ return - EOPNOTSUPP ;
941
+
942
+ if (nfc -> data &
943
+ ~(RXH_IP_SRC | RXH_IP_DST | RXH_L4_B_0_1 | RXH_L4_B_2_3 ))
944
+ return - EINVAL ;
945
+
946
+ req = (struct hclgevf_rss_input_tuple_cmd * )desc .data ;
947
+ hclgevf_cmd_setup_basic_desc (& desc , HCLGEVF_OPC_RSS_INPUT_TUPLE , false);
948
+
949
+ ret = hclgevf_init_rss_tuple_cmd (handle , nfc , req );
950
+ if (ret ) {
951
+ dev_err (& hdev -> pdev -> dev ,
952
+ "failed to init rss tuple cmd, ret = %d\n" , ret );
953
+ return ret ;
954
+ }
955
+
939
956
ret = hclgevf_cmd_send (& hdev -> hw , & desc , 1 );
940
957
if (ret ) {
941
958
dev_err (& hdev -> pdev -> dev ,
0 commit comments