| 1833 | } |
| 1834 | |
| 1835 | void |
| 1836 | ionic_lif_configure(struct ionic_lif *lif) |
| 1837 | { |
| 1838 | struct rte_eth_rxmode *rxmode = &lif->eth_dev->data->dev_conf.rxmode; |
| 1839 | struct rte_eth_txmode *txmode = &lif->eth_dev->data->dev_conf.txmode; |
| 1840 | struct ionic_identity *ident = &lif->adapter->ident; |
| 1841 | union ionic_lif_config *cfg = &ident->lif.eth.config; |
| 1842 | uint32_t ntxqs_per_lif = |
| 1843 | rte_le_to_cpu_32(cfg->queue_count[IONIC_QTYPE_TXQ]); |
| 1844 | uint32_t nrxqs_per_lif = |
| 1845 | rte_le_to_cpu_32(cfg->queue_count[IONIC_QTYPE_RXQ]); |
| 1846 | uint32_t nrxqs = lif->eth_dev->data->nb_rx_queues; |
| 1847 | uint32_t ntxqs = lif->eth_dev->data->nb_tx_queues; |
| 1848 | |
| 1849 | lif->port_id = lif->eth_dev->data->port_id; |
| 1850 | |
| 1851 | IONIC_PRINT(DEBUG, "Configuring LIF on port %u", |
| 1852 | lif->port_id); |
| 1853 | |
| 1854 | if (nrxqs > 0) |
| 1855 | nrxqs_per_lif = RTE_MIN(nrxqs_per_lif, nrxqs); |
| 1856 | |
| 1857 | if (ntxqs > 0) |
| 1858 | ntxqs_per_lif = RTE_MIN(ntxqs_per_lif, ntxqs); |
| 1859 | |
| 1860 | lif->nrxqcqs = nrxqs_per_lif; |
| 1861 | lif->ntxqcqs = ntxqs_per_lif; |
| 1862 | |
| 1863 | /* Update the LIF configuration based on the eth_dev */ |
| 1864 | |
| 1865 | /* |
| 1866 | * NB: While it is true that RSS_HASH is always enabled on ionic, |
| 1867 | * setting this flag unconditionally causes problems in DTS. |
| 1868 | * rxmode->offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH; |
| 1869 | */ |
| 1870 | |
| 1871 | /* RX per-port */ |
| 1872 | |
| 1873 | if (rxmode->offloads & RTE_ETH_RX_OFFLOAD_IPV4_CKSUM || |
| 1874 | rxmode->offloads & RTE_ETH_RX_OFFLOAD_UDP_CKSUM || |
| 1875 | rxmode->offloads & RTE_ETH_RX_OFFLOAD_TCP_CKSUM) |
| 1876 | lif->features |= IONIC_ETH_HW_RX_CSUM; |
| 1877 | else |
| 1878 | lif->features &= ~IONIC_ETH_HW_RX_CSUM; |
| 1879 | |
| 1880 | /* |
| 1881 | * NB: RX_SG may be enabled later during rx_queue_setup() if |
| 1882 | * required by the mbuf/mtu configuration |
| 1883 | */ |
| 1884 | ionic_lif_configure_rx_sg_offload(lif); |
| 1885 | |
| 1886 | /* Covers VLAN_STRIP */ |
| 1887 | ionic_lif_configure_vlan_offload(lif, RTE_ETH_VLAN_STRIP_MASK); |
| 1888 | |
| 1889 | /* TX per-port */ |
| 1890 | |
| 1891 | if (txmode->offloads & RTE_ETH_TX_OFFLOAD_IPV4_CKSUM || |
| 1892 | txmode->offloads & RTE_ETH_TX_OFFLOAD_UDP_CKSUM || |
no test coverage detected