| 1863 | } |
| 1864 | |
| 1865 | static int |
| 1866 | i40e_dev_configure(struct rte_eth_dev *dev) |
| 1867 | { |
| 1868 | struct i40e_adapter *ad = |
| 1869 | I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); |
| 1870 | struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private); |
| 1871 | struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); |
| 1872 | enum rte_eth_rx_mq_mode mq_mode = dev->data->dev_conf.rxmode.mq_mode; |
| 1873 | int i, ret; |
| 1874 | |
| 1875 | ret = i40e_dev_sync_phy_type(hw); |
| 1876 | if (ret) |
| 1877 | return ret; |
| 1878 | |
| 1879 | /* Initialize to TRUE. If any of Rx queues doesn't meet the |
| 1880 | * bulk allocation or vector Rx preconditions we will reset it. |
| 1881 | */ |
| 1882 | ad->rx_bulk_alloc_allowed = true; |
| 1883 | ad->rx_vec_allowed = true; |
| 1884 | ad->tx_simple_allowed = true; |
| 1885 | ad->tx_vec_allowed = true; |
| 1886 | |
| 1887 | if (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG) |
| 1888 | dev->data->dev_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH; |
| 1889 | |
| 1890 | ret = i40e_dev_init_vlan(dev); |
| 1891 | if (ret < 0) |
| 1892 | goto err; |
| 1893 | |
| 1894 | /* VMDQ setup. |
| 1895 | * General PMD call sequence are NIC init, configure, |
| 1896 | * rx/tx_queue_setup and dev_start. In rx/tx_queue_setup() function, it |
| 1897 | * will try to lookup the VSI that specific queue belongs to if VMDQ |
| 1898 | * applicable. So, VMDQ setting has to be done before |
| 1899 | * rx/tx_queue_setup(). This function is good to place vmdq_setup. |
| 1900 | * For RSS setting, it will try to calculate actual configured RX queue |
| 1901 | * number, which will be available after rx_queue_setup(). dev_start() |
| 1902 | * function is good to place RSS setup. |
| 1903 | */ |
| 1904 | if (mq_mode & RTE_ETH_MQ_RX_VMDQ_FLAG) { |
| 1905 | ret = i40e_vmdq_setup(dev); |
| 1906 | if (ret) |
| 1907 | goto err; |
| 1908 | } |
| 1909 | |
| 1910 | if (mq_mode & RTE_ETH_MQ_RX_DCB_FLAG) { |
| 1911 | ret = i40e_dcb_setup(dev); |
| 1912 | if (ret) { |
| 1913 | PMD_DRV_LOG(ERR, "failed to configure DCB."); |
| 1914 | goto err_dcb; |
| 1915 | } |
| 1916 | } |
| 1917 | |
| 1918 | TAILQ_INIT(&pf->flow_list); |
| 1919 | |
| 1920 | return 0; |
| 1921 | |
| 1922 | err_dcb: |
nothing calls this directly
no test coverage detected