MCPcopy Create free account
hub / github.com/F-Stack/f-stack / dpaa2_eth_dev_configure

Function dpaa2_eth_dev_configure

dpdk/drivers/net/dpaa2/dpaa2_ethdev.c:537–702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

535}
536
537static int
538dpaa2_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;

Callers

nothing calls this directly

Calls 8

dpaa2_setup_flow_distFunction · 0.85
dpni_set_offloadFunction · 0.85
dpaa2_vlan_offload_setFunction · 0.85
dpaa2_dev_recycle_configFunction · 0.85
dpaa2_tm_initFunction · 0.85

Tested by

no test coverage detected