| 1934 | }; |
| 1935 | |
| 1936 | static int |
| 1937 | ice_dcf_dev_init(struct rte_eth_dev *eth_dev) |
| 1938 | { |
| 1939 | struct ice_dcf_adapter *adapter = eth_dev->data->dev_private; |
| 1940 | struct ice_adapter *parent_adapter = &adapter->parent; |
| 1941 | |
| 1942 | eth_dev->dev_ops = &ice_dcf_eth_dev_ops; |
| 1943 | eth_dev->rx_pkt_burst = ice_dcf_recv_pkts; |
| 1944 | eth_dev->tx_pkt_burst = ice_dcf_xmit_pkts; |
| 1945 | |
| 1946 | if (rte_eal_process_type() != RTE_PROC_PRIMARY) |
| 1947 | return 0; |
| 1948 | |
| 1949 | adapter->real_hw.vc_event_msg_cb = ice_dcf_handle_pf_event_msg; |
| 1950 | if (ice_dcf_init_hw(eth_dev, &adapter->real_hw) != 0) { |
| 1951 | PMD_INIT_LOG(ERR, "Failed to init DCF hardware"); |
| 1952 | __atomic_store_n(&parent_adapter->dcf_state_on, false, |
| 1953 | __ATOMIC_RELAXED); |
| 1954 | return -1; |
| 1955 | } |
| 1956 | |
| 1957 | __atomic_store_n(&parent_adapter->dcf_state_on, true, __ATOMIC_RELAXED); |
| 1958 | |
| 1959 | if (ice_dcf_init_parent_adapter(eth_dev) != 0) { |
| 1960 | PMD_INIT_LOG(ERR, "Failed to init DCF parent adapter"); |
| 1961 | ice_dcf_uninit_hw(eth_dev, &adapter->real_hw); |
| 1962 | return -1; |
| 1963 | } |
| 1964 | |
| 1965 | ice_dcf_stats_reset(eth_dev); |
| 1966 | |
| 1967 | dcf_config_promisc(adapter, false, false); |
| 1968 | ice_dcf_vf_repr_notify_all(adapter, true); |
| 1969 | |
| 1970 | return 0; |
| 1971 | } |
| 1972 | |
| 1973 | static int |
| 1974 | ice_dcf_dev_uninit(struct rte_eth_dev *eth_dev) |
no test coverage detected