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

Function cpfl_start_queues

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

Source from the content-addressed store, hash-verified

854}
855
856static int
857cpfl_start_queues(struct rte_eth_dev *dev)
858{
859 struct cpfl_vport *cpfl_vport = dev->data->dev_private;
860 struct idpf_vport *vport = &cpfl_vport->base;
861 struct cpfl_rx_queue *cpfl_rxq;
862 struct cpfl_tx_queue *cpfl_txq;
863 int update_flag = 0;
864 int err = 0;
865 int i;
866
867 /* For normal data queues, configure, init and enale Txq.
868 * For non-manual bind hairpin queues, configure Txq.
869 */
870 for (i = 0; i < dev->data->nb_tx_queues; i++) {
871 cpfl_txq = dev->data->tx_queues[i];
872 if (cpfl_txq == NULL || cpfl_txq->base.tx_deferred_start)
873 continue;
874 if (!cpfl_txq->hairpin_info.hairpin_q) {
875 err = cpfl_tx_queue_start(dev, i);
876 if (err != 0) {
877 PMD_DRV_LOG(ERR, "Fail to start Tx queue %u", i);
878 return err;
879 }
880 } else if (!cpfl_vport->p2p_manual_bind) {
881 if (update_flag == 0) {
882 err = cpfl_txq_hairpin_info_update(dev,
883 cpfl_txq->hairpin_info.peer_rxp);
884 if (err != 0) {
885 PMD_DRV_LOG(ERR, "Fail to update Tx hairpin queue info");
886 return err;
887 }
888 update_flag = 1;
889 }
890 err = cpfl_hairpin_txq_config(vport, cpfl_txq);
891 if (err != 0) {
892 PMD_DRV_LOG(ERR, "Fail to configure hairpin Tx queue %u", i);
893 return err;
894 }
895 }
896 }
897
898 /* For non-manual bind hairpin queues, configure Tx completion queue first.*/
899 if (!cpfl_vport->p2p_manual_bind && cpfl_vport->p2p_tx_complq != NULL) {
900 err = cpfl_hairpin_tx_complq_config(cpfl_vport);
901 if (err != 0) {
902 PMD_DRV_LOG(ERR, "Fail to config Tx completion queue");
903 return err;
904 }
905 }
906
907 /* For non-manual bind hairpin queues, configure Rx buffer queue.*/
908 if (!cpfl_vport->p2p_manual_bind && cpfl_vport->p2p_rx_bufq != NULL) {
909 cpfl_rxq_hairpin_mz_bind(dev);
910 err = cpfl_hairpin_rx_bufq_config(cpfl_vport);
911 if (err != 0) {
912 PMD_DRV_LOG(ERR, "Fail to config Rx buffer queue");
913 return err;

Callers 1

cpfl_dev_startFunction · 0.85

Calls 13

cpfl_tx_queue_startFunction · 0.85
cpfl_hairpin_txq_configFunction · 0.85
cpfl_rxq_hairpin_mz_bindFunction · 0.85
cpfl_rx_queue_startFunction · 0.85
cpfl_hairpin_rxq_configFunction · 0.85
cpfl_rx_queue_initFunction · 0.85
cpfl_switch_hairpin_bufqFunction · 0.85

Tested by

no test coverage detected