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

Function cpfl_dev_start

dpdk/drivers/net/cpfl/cpfl_ethdev.c:997–1057  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

995}
996
997static int
998cpfl_dev_start(struct rte_eth_dev *dev)
999{
1000 struct cpfl_vport *cpfl_vport = dev->data->dev_private;
1001 struct idpf_vport *vport = &cpfl_vport->base;
1002 struct idpf_adapter *base = vport->adapter;
1003 struct cpfl_adapter_ext *adapter = CPFL_ADAPTER_TO_EXT(base);
1004 uint16_t num_allocated_vectors = base->caps.num_allocated_vectors;
1005 uint16_t req_vecs_num;
1006 int ret;
1007
1008 req_vecs_num = CPFL_DFLT_Q_VEC_NUM;
1009 if (req_vecs_num + adapter->used_vecs_num > num_allocated_vectors) {
1010 PMD_DRV_LOG(ERR, "The accumulated request vectors' number should be less than %d",
1011 num_allocated_vectors);
1012 ret = -EINVAL;
1013 goto err_vec;
1014 }
1015
1016 ret = idpf_vc_vectors_alloc(vport, req_vecs_num);
1017 if (ret != 0) {
1018 PMD_DRV_LOG(ERR, "Failed to allocate interrupt vectors");
1019 goto err_vec;
1020 }
1021 adapter->used_vecs_num += req_vecs_num;
1022
1023 ret = cpfl_config_rx_queues_irqs(dev);
1024 if (ret != 0) {
1025 PMD_DRV_LOG(ERR, "Failed to configure irqs");
1026 goto err_irq;
1027 }
1028
1029 ret = cpfl_start_queues(dev);
1030 if (ret != 0) {
1031 PMD_DRV_LOG(ERR, "Failed to start queues");
1032 goto err_startq;
1033 }
1034
1035 cpfl_set_rx_function(dev);
1036 cpfl_set_tx_function(dev);
1037
1038 ret = idpf_vc_vport_ena_dis(vport, true);
1039 if (ret != 0) {
1040 PMD_DRV_LOG(ERR, "Failed to enable vport");
1041 goto err_vport;
1042 }
1043
1044 if (cpfl_dev_stats_reset(dev))
1045 PMD_DRV_LOG(ERR, "Failed to reset stats");
1046
1047 return 0;
1048
1049err_vport:
1050 cpfl_stop_queues(dev);
1051err_startq:
1052 idpf_vport_irq_unmap_config(vport, dev->data->nb_rx_queues);
1053err_irq:
1054 idpf_vc_vectors_dealloc(vport);

Callers

nothing calls this directly

Calls 10

idpf_vc_vectors_allocFunction · 0.85
cpfl_start_queuesFunction · 0.85
cpfl_set_rx_functionFunction · 0.85
cpfl_set_tx_functionFunction · 0.85
idpf_vc_vport_ena_disFunction · 0.85
cpfl_dev_stats_resetFunction · 0.85
cpfl_stop_queuesFunction · 0.85
idpf_vc_vectors_deallocFunction · 0.85

Tested by

no test coverage detected