MCPcopy Create free account
hub / github.com/F-Stack/f-stack / idpf_vc_cmd_execute

Function idpf_vc_cmd_execute

dpdk/drivers/common/idpf/idpf_common_virtchnl.c:185–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185int
186idpf_vc_cmd_execute(struct idpf_adapter *adapter, struct idpf_cmd_info *args)
187{
188 int err = 0;
189 int i = 0;
190 int ret;
191
192 if (atomic_set_cmd(adapter, args->ops))
193 return -EINVAL;
194
195 ret = idpf_send_vc_msg(adapter, args->ops, args->in_args_size, args->in_args);
196 if (ret != 0) {
197 DRV_LOG(ERR, "fail to send cmd %d", args->ops);
198 clear_cmd(adapter);
199 return ret;
200 }
201
202 switch (args->ops) {
203 case VIRTCHNL_OP_VERSION:
204 case VIRTCHNL2_OP_GET_CAPS:
205 /* for init virtchnl ops, need to poll the response */
206 err = idpf_vc_one_msg_read(adapter, args->ops, args->out_size, args->out_buffer);
207 clear_cmd(adapter);
208 break;
209 case VIRTCHNL2_OP_GET_PTYPE_INFO:
210 /* for multuple response message,
211 * do not handle the response here.
212 */
213 break;
214 default:
215 /* For other virtchnl ops in running time,
216 * wait for the cmd done flag.
217 */
218 do {
219 if (adapter->pend_cmd == VIRTCHNL_OP_UNKNOWN)
220 break;
221 rte_delay_ms(ASQ_DELAY_MS);
222 /* If don't read msg or read sys event, continue */
223 } while (i++ < MAX_TRY_TIMES);
224 /* If there's no response is received, clear command */
225 if (i >= MAX_TRY_TIMES ||
226 adapter->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {
227 err = -EBUSY;
228 DRV_LOG(ERR, "No response or return failure (%d) for cmd %d",
229 adapter->cmd_retval, args->ops);
230 clear_cmd(adapter);
231 }
232 break;
233 }
234
235 return err;
236}
237
238int
239idpf_vc_api_version_check(struct idpf_adapter *adapter)

Callers 15

cpfl_cc_vport_list_getFunction · 0.85
cpfl_cc_vport_info_getFunction · 0.85
cpfl_config_ctlq_rxFunction · 0.85
cpfl_config_ctlq_txFunction · 0.85
idpf_vc_caps_getFunction · 0.85
idpf_vc_vport_createFunction · 0.85
idpf_vc_vport_destroyFunction · 0.85
idpf_vc_queue_grps_addFunction · 0.85
idpf_vc_queue_grps_delFunction · 0.85
idpf_vc_rss_key_setFunction · 0.85

Calls 5

atomic_set_cmdFunction · 0.85
idpf_send_vc_msgFunction · 0.85
clear_cmdFunction · 0.85
idpf_vc_one_msg_readFunction · 0.85
rte_delay_msFunction · 0.85

Tested by

no test coverage detected