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

Function cpfl_vc_create_ctrl_vport

dpdk/drivers/net/cpfl/cpfl_vchnl.c:74–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74int
75cpfl_vc_create_ctrl_vport(struct cpfl_adapter_ext *adapter)
76{
77 struct virtchnl2_create_vport vport_msg;
78 struct idpf_cmd_info args;
79 int err = -1;
80
81 memset(&vport_msg, 0, sizeof(struct virtchnl2_create_vport));
82 vport_msg.vport_type = rte_cpu_to_le_16(VIRTCHNL2_VPORT_TYPE_DEFAULT);
83 vport_msg.txq_model = rte_cpu_to_le_16(VIRTCHNL2_QUEUE_MODEL_SINGLE);
84 vport_msg.rxq_model = rte_cpu_to_le_16(VIRTCHNL2_QUEUE_MODEL_SINGLE);
85 vport_msg.num_tx_q = CPFL_TX_CFGQ_NUM;
86 vport_msg.num_tx_complq = 0;
87 vport_msg.num_rx_q = CPFL_RX_CFGQ_NUM;
88 vport_msg.num_rx_bufq = 0;
89
90 memset(&args, 0, sizeof(args));
91 args.ops = VIRTCHNL2_OP_CREATE_VPORT;
92 args.in_args = (uint8_t *)&vport_msg;
93 args.in_args_size = sizeof(vport_msg);
94 args.out_buffer = adapter->base.mbx_resp;
95 args.out_size = IDPF_DFLT_MBX_BUF_SIZE;
96
97 err = idpf_vc_cmd_execute(&adapter->base, &args);
98 if (err) {
99 PMD_DRV_LOG(ERR,
100 "Failed to execute command of VIRTCHNL2_OP_CREATE_VPORT");
101 return err;
102 }
103
104 memcpy(adapter->ctrl_vport_recv_info, args.out_buffer,
105 IDPF_DFLT_MBX_BUF_SIZE);
106 return err;
107}
108
109int
110cpfl_config_ctlq_rx(struct cpfl_adapter_ext *adapter)

Callers 1

cpfl_ctrl_path_openFunction · 0.85

Calls 3

memsetFunction · 0.85
idpf_vc_cmd_executeFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected