| 535 | } |
| 536 | |
| 537 | static int |
| 538 | dpaa2_eth_dev_configure(struct rte_eth_dev *dev) |
| 539 | { |
| 540 | struct dpaa2_dev_priv *priv = dev->data->dev_private; |
| 541 | struct fsl_mc_io *dpni = dev->process_private; |
| 542 | struct rte_eth_conf *eth_conf = &dev->data->dev_conf; |
| 543 | uint64_t rx_offloads = eth_conf->rxmode.offloads; |
| 544 | uint64_t tx_offloads = eth_conf->txmode.offloads; |
| 545 | int rx_l3_csum_offload = false; |
| 546 | int rx_l4_csum_offload = false; |
| 547 | int tx_l3_csum_offload = false; |
| 548 | int tx_l4_csum_offload = false; |
| 549 | int ret, tc_index; |
| 550 | uint32_t max_rx_pktlen; |
| 551 | |
| 552 | PMD_INIT_FUNC_TRACE(); |
| 553 | |
| 554 | /* Rx offloads which are enabled by default */ |
| 555 | if (dev_rx_offloads_nodis & ~rx_offloads) { |
| 556 | DPAA2_PMD_INFO( |
| 557 | "Some of rx offloads enabled by default - requested 0x%" PRIx64 |
| 558 | " fixed are 0x%" PRIx64, |
| 559 | rx_offloads, dev_rx_offloads_nodis); |
| 560 | } |
| 561 | |
| 562 | /* Tx offloads which are enabled by default */ |
| 563 | if (dev_tx_offloads_nodis & ~tx_offloads) { |
| 564 | DPAA2_PMD_INFO( |
| 565 | "Some of tx offloads enabled by default - requested 0x%" PRIx64 |
| 566 | " fixed are 0x%" PRIx64, |
| 567 | tx_offloads, dev_tx_offloads_nodis); |
| 568 | } |
| 569 | |
| 570 | max_rx_pktlen = eth_conf->rxmode.mtu + RTE_ETHER_HDR_LEN + |
| 571 | RTE_ETHER_CRC_LEN + VLAN_TAG_SIZE; |
| 572 | if (max_rx_pktlen <= DPAA2_MAX_RX_PKT_LEN) { |
| 573 | ret = dpni_set_max_frame_length(dpni, CMD_PRI_LOW, |
| 574 | priv->token, max_rx_pktlen - RTE_ETHER_CRC_LEN); |
| 575 | if (ret != 0) { |
| 576 | DPAA2_PMD_ERR("Unable to set mtu. check config"); |
| 577 | return ret; |
| 578 | } |
| 579 | DPAA2_PMD_INFO("MTU configured for the device: %d", |
| 580 | dev->data->mtu); |
| 581 | } else { |
| 582 | return -1; |
| 583 | } |
| 584 | |
| 585 | if (eth_conf->rxmode.mq_mode == RTE_ETH_MQ_RX_RSS) { |
| 586 | for (tc_index = 0; tc_index < priv->num_rx_tc; tc_index++) { |
| 587 | ret = dpaa2_setup_flow_dist(dev, |
| 588 | eth_conf->rx_adv_conf.rss_conf.rss_hf, |
| 589 | tc_index); |
| 590 | if (ret) { |
| 591 | DPAA2_PMD_ERR( |
| 592 | "Unable to set flow distribution on tc%d." |
| 593 | "Check queue config", tc_index); |
| 594 | return ret; |
nothing calls this directly
no test coverage detected