@@ -1877,17 +1877,19 @@ int i40e_pci_sriov_configure(struct pci_dev *pdev, int num_vfs)
1877
1877
/***********************virtual channel routines******************/
1878
1878
1879
1879
/**
1880
- * i40e_vc_send_msg_to_vf
1880
+ * i40e_vc_send_msg_to_vf_ex
1881
1881
* @vf: pointer to the VF info
1882
1882
* @v_opcode: virtual channel opcode
1883
1883
* @v_retval: virtual channel return value
1884
1884
* @msg: pointer to the msg buffer
1885
1885
* @msglen: msg length
1886
+ * @is_quiet: true for not printing unsuccessful return values, false otherwise
1886
1887
*
1887
1888
* send msg to VF
1888
1889
**/
1889
- static int i40e_vc_send_msg_to_vf (struct i40e_vf * vf , u32 v_opcode ,
1890
- u32 v_retval , u8 * msg , u16 msglen )
1890
+ static int i40e_vc_send_msg_to_vf_ex (struct i40e_vf * vf , u32 v_opcode ,
1891
+ u32 v_retval , u8 * msg , u16 msglen ,
1892
+ bool is_quiet )
1891
1893
{
1892
1894
struct i40e_pf * pf ;
1893
1895
struct i40e_hw * hw ;
@@ -1903,7 +1905,7 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
1903
1905
abs_vf_id = vf -> vf_id + hw -> func_caps .vf_base_id ;
1904
1906
1905
1907
/* single place to detect unsuccessful return values */
1906
- if (v_retval ) {
1908
+ if (v_retval && ! is_quiet ) {
1907
1909
vf -> num_invalid_msgs ++ ;
1908
1910
dev_info (& pf -> pdev -> dev , "VF %d failed opcode %d, retval: %d\n" ,
1909
1911
vf -> vf_id , v_opcode , v_retval );
@@ -1933,6 +1935,23 @@ static int i40e_vc_send_msg_to_vf(struct i40e_vf *vf, u32 v_opcode,
1933
1935
return 0 ;
1934
1936
}
1935
1937
1938
+ /**
1939
+ * i40e_vc_send_msg_to_vf
1940
+ * @vf: pointer to the VF info
1941
+ * @v_opcode: virtual channel opcode
1942
+ * @v_retval: virtual channel return value
1943
+ * @msg: pointer to the msg buffer
1944
+ * @msglen: msg length
1945
+ *
1946
+ * send msg to VF
1947
+ **/
1948
+ static int i40e_vc_send_msg_to_vf (struct i40e_vf * vf , u32 v_opcode ,
1949
+ u32 v_retval , u8 * msg , u16 msglen )
1950
+ {
1951
+ return i40e_vc_send_msg_to_vf_ex (vf , v_opcode , v_retval ,
1952
+ msg , msglen , false);
1953
+ }
1954
+
1936
1955
/**
1937
1956
* i40e_vc_send_resp_to_vf
1938
1957
* @vf: pointer to the VF info
@@ -2695,6 +2714,7 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg)
2695
2714
* i40e_check_vf_permission
2696
2715
* @vf: pointer to the VF info
2697
2716
* @al: MAC address list from virtchnl
2717
+ * @is_quiet: set true for printing msg without opcode info, false otherwise
2698
2718
*
2699
2719
* Check that the given list of MAC addresses is allowed. Will return -EPERM
2700
2720
* if any address in the list is not valid. Checks the following conditions:
@@ -2709,13 +2729,15 @@ static int i40e_vc_get_stats_msg(struct i40e_vf *vf, u8 *msg)
2709
2729
* addresses might not be accurate.
2710
2730
**/
2711
2731
static inline int i40e_check_vf_permission (struct i40e_vf * vf ,
2712
- struct virtchnl_ether_addr_list * al )
2732
+ struct virtchnl_ether_addr_list * al ,
2733
+ bool * is_quiet )
2713
2734
{
2714
2735
struct i40e_pf * pf = vf -> pf ;
2715
2736
struct i40e_vsi * vsi = pf -> vsi [vf -> lan_vsi_idx ];
2716
2737
int mac2add_cnt = 0 ;
2717
2738
int i ;
2718
2739
2740
+ * is_quiet = false;
2719
2741
for (i = 0 ; i < al -> num_elements ; i ++ ) {
2720
2742
struct i40e_mac_filter * f ;
2721
2743
u8 * addr = al -> list [i ].addr ;
@@ -2739,6 +2761,7 @@ static inline int i40e_check_vf_permission(struct i40e_vf *vf,
2739
2761
!ether_addr_equal (addr , vf -> default_lan_addr .addr )) {
2740
2762
dev_err (& pf -> pdev -> dev ,
2741
2763
"VF attempting to override administratively set MAC address, bring down and up the VF interface to resume normal operation\n" );
2764
+ * is_quiet = true;
2742
2765
return - EPERM ;
2743
2766
}
2744
2767
@@ -2775,6 +2798,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
2775
2798
(struct virtchnl_ether_addr_list * )msg ;
2776
2799
struct i40e_pf * pf = vf -> pf ;
2777
2800
struct i40e_vsi * vsi = NULL ;
2801
+ bool is_quiet = false;
2778
2802
i40e_status ret = 0 ;
2779
2803
int i ;
2780
2804
@@ -2791,7 +2815,7 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
2791
2815
*/
2792
2816
spin_lock_bh (& vsi -> mac_filter_hash_lock );
2793
2817
2794
- ret = i40e_check_vf_permission (vf , al );
2818
+ ret = i40e_check_vf_permission (vf , al , & is_quiet );
2795
2819
if (ret ) {
2796
2820
spin_unlock_bh (& vsi -> mac_filter_hash_lock );
2797
2821
goto error_param ;
@@ -2829,8 +2853,8 @@ static int i40e_vc_add_mac_addr_msg(struct i40e_vf *vf, u8 *msg)
2829
2853
2830
2854
error_param :
2831
2855
/* send the response to the VF */
2832
- return i40e_vc_send_resp_to_vf (vf , VIRTCHNL_OP_ADD_ETH_ADDR ,
2833
- ret );
2856
+ return i40e_vc_send_msg_to_vf_ex (vf , VIRTCHNL_OP_ADD_ETH_ADDR ,
2857
+ ret , NULL , 0 , is_quiet );
2834
2858
}
2835
2859
2836
2860
/**
0 commit comments