| 300 | } |
| 301 | |
| 302 | int |
| 303 | idpf_vc_vport_create(struct idpf_vport *vport, |
| 304 | struct virtchnl2_create_vport *create_vport_info) |
| 305 | { |
| 306 | struct idpf_adapter *adapter = vport->adapter; |
| 307 | struct virtchnl2_create_vport vport_msg; |
| 308 | struct idpf_cmd_info args; |
| 309 | int err = -1; |
| 310 | |
| 311 | memset(&vport_msg, 0, sizeof(struct virtchnl2_create_vport)); |
| 312 | vport_msg.vport_type = create_vport_info->vport_type; |
| 313 | vport_msg.txq_model = create_vport_info->txq_model; |
| 314 | vport_msg.rxq_model = create_vport_info->rxq_model; |
| 315 | vport_msg.num_tx_q = create_vport_info->num_tx_q; |
| 316 | vport_msg.num_tx_complq = create_vport_info->num_tx_complq; |
| 317 | vport_msg.num_rx_q = create_vport_info->num_rx_q; |
| 318 | vport_msg.num_rx_bufq = create_vport_info->num_rx_bufq; |
| 319 | |
| 320 | memset(&args, 0, sizeof(args)); |
| 321 | args.ops = VIRTCHNL2_OP_CREATE_VPORT; |
| 322 | args.in_args = (uint8_t *)&vport_msg; |
| 323 | args.in_args_size = sizeof(vport_msg); |
| 324 | args.out_buffer = adapter->mbx_resp; |
| 325 | args.out_size = IDPF_DFLT_MBX_BUF_SIZE; |
| 326 | |
| 327 | err = idpf_vc_cmd_execute(adapter, &args); |
| 328 | if (err != 0) { |
| 329 | DRV_LOG(ERR, |
| 330 | "Failed to execute command of VIRTCHNL2_OP_CREATE_VPORT"); |
| 331 | return err; |
| 332 | } |
| 333 | |
| 334 | rte_memcpy(&(vport->vport_info.info), args.out_buffer, IDPF_DFLT_MBX_BUF_SIZE); |
| 335 | return 0; |
| 336 | } |
| 337 | |
| 338 | int |
| 339 | idpf_vc_vport_destroy(struct idpf_vport *vport) |
no test coverage detected