@@ -27,10 +27,18 @@ static void octep_pfvf_validate_version(struct octep_device *oct, u32 vf_id,
2727{
2828 u32 vf_version = (u32 )cmd .s_version .version ;
2929
30- if (vf_version <= OCTEP_PFVF_MBOX_VERSION_V1 )
31- rsp -> s_version .type = OCTEP_PFVF_MBOX_TYPE_RSP_ACK ;
30+ dev_dbg (& oct -> pdev -> dev , "VF id:%d VF version:%d PF version:%d\n" ,
31+ vf_id , vf_version , OCTEP_PFVF_MBOX_VERSION_CURRENT );
32+ if (vf_version < OCTEP_PFVF_MBOX_VERSION_CURRENT )
33+ rsp -> s_version .version = vf_version ;
3234 else
33- rsp -> s_version .type = OCTEP_PFVF_MBOX_TYPE_RSP_NACK ;
35+ rsp -> s_version .version = OCTEP_PFVF_MBOX_VERSION_CURRENT ;
36+
37+ oct -> vf_info [vf_id ].mbox_version = rsp -> s_version .version ;
38+ dev_dbg (& oct -> pdev -> dev , "VF id:%d negotiated VF version:%d\n" ,
39+ vf_id , oct -> vf_info [vf_id ].mbox_version );
40+
41+ rsp -> s_version .type = OCTEP_PFVF_MBOX_TYPE_RSP_ACK ;
3442}
3543
3644static void octep_pfvf_get_link_status (struct octep_device * oct , u32 vf_id ,
@@ -166,6 +174,7 @@ int octep_setup_pfvf_mbox(struct octep_device *oct)
166174 goto free_mbox ;
167175
168176 memset (oct -> mbox [ring ], 0 , sizeof (struct octep_mbox ));
177+ memset (& oct -> vf_info [i ], 0 , sizeof (struct octep_pfvf_info ));
169178 mutex_init (& oct -> mbox [ring ]-> lock );
170179 INIT_WORK (& oct -> mbox [ring ]-> wk .work , octep_pfvf_mbox_work );
171180 oct -> mbox [ring ]-> wk .ctxptr = oct -> mbox [ring ];
0 commit comments