| 1918 | } |
| 1919 | |
| 1920 | static void |
| 1921 | port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads, |
| 1922 | uint8_t hw_reassembly) |
| 1923 | { |
| 1924 | struct rte_eth_dev_info dev_info; |
| 1925 | struct rte_eth_txconf *txconf; |
| 1926 | uint16_t nb_tx_queue, nb_rx_queue; |
| 1927 | uint16_t tx_queueid, rx_queueid, queue; |
| 1928 | uint32_t lcore_id; |
| 1929 | int32_t ret, socket_id; |
| 1930 | struct lcore_conf *qconf; |
| 1931 | struct rte_ether_addr ethaddr; |
| 1932 | struct rte_eth_conf local_port_conf = port_conf; |
| 1933 | struct rte_eth_ip_reassembly_params reass_capa = {0}; |
| 1934 | int ptype_supported; |
| 1935 | |
| 1936 | ret = rte_eth_dev_info_get(portid, &dev_info); |
| 1937 | if (ret != 0) |
| 1938 | rte_exit(EXIT_FAILURE, |
| 1939 | "Error during getting device (port %u) info: %s\n", |
| 1940 | portid, strerror(-ret)); |
| 1941 | |
| 1942 | /* limit allowed HW offloads, as user requested */ |
| 1943 | dev_info.rx_offload_capa &= dev_rx_offload; |
| 1944 | dev_info.tx_offload_capa &= dev_tx_offload; |
| 1945 | |
| 1946 | printf("Configuring device port %u:\n", portid); |
| 1947 | |
| 1948 | ret = rte_eth_macaddr_get(portid, ðaddr); |
| 1949 | if (ret != 0) |
| 1950 | rte_exit(EXIT_FAILURE, |
| 1951 | "Error getting MAC address (port %u): %s\n", |
| 1952 | portid, rte_strerror(-ret)); |
| 1953 | |
| 1954 | rte_ether_addr_copy(ðaddr, ðaddr_tbl[portid].src); |
| 1955 | |
| 1956 | rte_ether_addr_copy(ðaddr_tbl[portid].dst, |
| 1957 | (struct rte_ether_addr *)(val_eth + portid)); |
| 1958 | |
| 1959 | rte_ether_addr_copy(ðaddr_tbl[portid].src, |
| 1960 | (struct rte_ether_addr *)(val_eth + portid) + 1); |
| 1961 | |
| 1962 | print_ethaddr("Address: ", ðaddr); |
| 1963 | printf("\n"); |
| 1964 | |
| 1965 | nb_rx_queue = get_port_nb_rx_queues(portid); |
| 1966 | nb_tx_queue = nb_lcores; |
| 1967 | |
| 1968 | if (nb_rx_queue > dev_info.max_rx_queues) |
| 1969 | rte_exit(EXIT_FAILURE, "Error: queue %u not available " |
| 1970 | "(max rx queue is %u)\n", |
| 1971 | nb_rx_queue, dev_info.max_rx_queues); |
| 1972 | |
| 1973 | if (nb_tx_queue > dev_info.max_tx_queues) |
| 1974 | rte_exit(EXIT_FAILURE, "Error: queue %u not available " |
| 1975 | "(max tx queue is %u)\n", |
| 1976 | nb_tx_queue, dev_info.max_tx_queues); |
| 1977 |
no test coverage detected