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

Function idpf_dev_start

dpdk/drivers/net/idpf/idpf_ethdev.c:739–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739static int
740idpf_dev_start(struct rte_eth_dev *dev)
741{
742 struct idpf_vport *vport = dev->data->dev_private;
743 struct idpf_adapter *base = vport->adapter;
744 struct idpf_adapter_ext *adapter = IDPF_ADAPTER_TO_EXT(base);
745 uint16_t num_allocated_vectors = base->caps.num_allocated_vectors;
746 uint16_t req_vecs_num;
747 int ret;
748
749 req_vecs_num = IDPF_DFLT_Q_VEC_NUM;
750 if (req_vecs_num + adapter->used_vecs_num > num_allocated_vectors) {
751 PMD_DRV_LOG(ERR, "The accumulated request vectors' number should be less than %d",
752 num_allocated_vectors);
753 ret = -EINVAL;
754 goto err_vec;
755 }
756
757 ret = idpf_vc_vectors_alloc(vport, req_vecs_num);
758 if (ret != 0) {
759 PMD_DRV_LOG(ERR, "Failed to allocate interrupt vectors");
760 goto err_vec;
761 }
762 adapter->used_vecs_num += req_vecs_num;
763
764 ret = idpf_config_rx_queues_irqs(dev);
765 if (ret != 0) {
766 PMD_DRV_LOG(ERR, "Failed to configure irqs");
767 goto err_irq;
768 }
769
770 ret = idpf_start_queues(dev);
771 if (ret != 0) {
772 PMD_DRV_LOG(ERR, "Failed to start queues");
773 goto err_startq;
774 }
775
776 idpf_set_rx_function(dev);
777 idpf_set_tx_function(dev);
778
779 ret = idpf_vc_vport_ena_dis(vport, true);
780 if (ret != 0) {
781 PMD_DRV_LOG(ERR, "Failed to enable vport");
782 goto err_vport;
783 }
784
785 if (idpf_dev_stats_reset(dev))
786 PMD_DRV_LOG(ERR, "Failed to reset stats");
787
788 return 0;
789
790err_vport:
791 idpf_stop_queues(dev);
792err_startq:
793 idpf_vport_irq_unmap_config(vport, dev->data->nb_rx_queues);
794err_irq:
795 idpf_vc_vectors_dealloc(vport);
796err_vec:

Callers

nothing calls this directly

Calls 10

idpf_vc_vectors_allocFunction · 0.85
idpf_start_queuesFunction · 0.85
idpf_set_rx_functionFunction · 0.85
idpf_set_tx_functionFunction · 0.85
idpf_vc_vport_ena_disFunction · 0.85
idpf_dev_stats_resetFunction · 0.85
idpf_stop_queuesFunction · 0.85
idpf_vc_vectors_deallocFunction · 0.85

Tested by

no test coverage detected