@@ -1121,12 +1121,13 @@ static int i40e_vc_send_resp_to_vf(struct i40e_vf *vf,
1121
1121
*
1122
1122
* called from the VF to request the API version used by the PF
1123
1123
**/
1124
- static int i40e_vc_get_version_msg (struct i40e_vf * vf )
1124
+ static int i40e_vc_get_version_msg (struct i40e_vf * vf , u8 * msg )
1125
1125
{
1126
1126
struct i40e_virtchnl_version_info info = {
1127
1127
I40E_VIRTCHNL_VERSION_MAJOR , I40E_VIRTCHNL_VERSION_MINOR
1128
1128
};
1129
1129
1130
+ vf -> vf_ver = * (struct i40e_virtchnl_version_info * )msg ;
1130
1131
return i40e_vc_send_msg_to_vf (vf , I40E_VIRTCHNL_OP_VERSION ,
1131
1132
I40E_SUCCESS , (u8 * )& info ,
1132
1133
sizeof (struct
@@ -1141,7 +1142,7 @@ static int i40e_vc_get_version_msg(struct i40e_vf *vf)
1141
1142
*
1142
1143
* called from the VF to request its resources
1143
1144
**/
1144
- static int i40e_vc_get_vf_resources_msg (struct i40e_vf * vf )
1145
+ static int i40e_vc_get_vf_resources_msg (struct i40e_vf * vf , u8 * msg )
1145
1146
{
1146
1147
struct i40e_virtchnl_vf_resource * vfres = NULL ;
1147
1148
struct i40e_pf * pf = vf -> pf ;
@@ -1165,11 +1166,18 @@ static int i40e_vc_get_vf_resources_msg(struct i40e_vf *vf)
1165
1166
len = 0 ;
1166
1167
goto err ;
1167
1168
}
1169
+ if (VF_IS_V11 (vf ))
1170
+ vf -> driver_caps = * (u32 * )msg ;
1171
+ else
1172
+ vf -> driver_caps = I40E_VIRTCHNL_VF_OFFLOAD_L2 |
1173
+ I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG |
1174
+ I40E_VIRTCHNL_VF_OFFLOAD_VLAN ;
1168
1175
1169
1176
vfres -> vf_offload_flags = I40E_VIRTCHNL_VF_OFFLOAD_L2 ;
1170
1177
vsi = pf -> vsi [vf -> lan_vsi_idx ];
1171
1178
if (!vsi -> info .pvid )
1172
- vfres -> vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_VLAN ;
1179
+ vfres -> vf_offload_flags |= I40E_VIRTCHNL_VF_OFFLOAD_VLAN |
1180
+ I40E_VIRTCHNL_VF_OFFLOAD_RSS_REG ;
1173
1181
1174
1182
vfres -> num_vsis = num_vsis ;
1175
1183
vfres -> num_queue_pairs = vf -> num_queue_pairs ;
@@ -1771,9 +1779,14 @@ static int i40e_vc_validate_vf_msg(struct i40e_vf *vf, u32 v_opcode,
1771
1779
valid_len = sizeof (struct i40e_virtchnl_version_info );
1772
1780
break ;
1773
1781
case I40E_VIRTCHNL_OP_RESET_VF :
1774
- case I40E_VIRTCHNL_OP_GET_VF_RESOURCES :
1775
1782
valid_len = 0 ;
1776
1783
break ;
1784
+ case I40E_VIRTCHNL_OP_GET_VF_RESOURCES :
1785
+ if (VF_IS_V11 (vf ))
1786
+ valid_len = sizeof (u32 );
1787
+ else
1788
+ valid_len = 0 ;
1789
+ break ;
1777
1790
case I40E_VIRTCHNL_OP_CONFIG_TX_QUEUE :
1778
1791
valid_len = sizeof (struct i40e_virtchnl_txq_info );
1779
1792
break ;
@@ -1886,10 +1899,10 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode,
1886
1899
1887
1900
switch (v_opcode ) {
1888
1901
case I40E_VIRTCHNL_OP_VERSION :
1889
- ret = i40e_vc_get_version_msg (vf );
1902
+ ret = i40e_vc_get_version_msg (vf , msg );
1890
1903
break ;
1891
1904
case I40E_VIRTCHNL_OP_GET_VF_RESOURCES :
1892
- ret = i40e_vc_get_vf_resources_msg (vf );
1905
+ ret = i40e_vc_get_vf_resources_msg (vf , msg );
1893
1906
break ;
1894
1907
case I40E_VIRTCHNL_OP_RESET_VF :
1895
1908
i40e_vc_reset_vf_msg (vf );
0 commit comments