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

Function ice_dev_start

dpdk/drivers/net/ice/ice_ethdev.c:3709–3826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3707}
3708
3709static int
3710ice_dev_start(struct rte_eth_dev *dev)
3711{
3712 struct rte_eth_dev_data *data = dev->data;
3713 struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
3714 struct ice_pf *pf = ICE_DEV_PRIVATE_TO_PF(dev->data->dev_private);
3715 struct ice_vsi *vsi = pf->main_vsi;
3716 struct ice_adapter *ad =
3717 ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
3718 uint16_t nb_rxq = 0;
3719 uint16_t nb_txq, i;
3720 uint16_t max_frame_size;
3721 int mask, ret;
3722 uint8_t timer = hw->func_caps.ts_func_info.tmr_index_owned;
3723 uint32_t pin_idx = ad->devargs.pin_idx;
3724
3725 /* program Tx queues' context in hardware */
3726 for (nb_txq = 0; nb_txq < data->nb_tx_queues; nb_txq++) {
3727 ret = ice_tx_queue_start(dev, nb_txq);
3728 if (ret) {
3729 PMD_DRV_LOG(ERR, "fail to start Tx queue %u", nb_txq);
3730 goto tx_err;
3731 }
3732 }
3733
3734 if (dev->data->dev_conf.rxmode.offloads & RTE_ETH_RX_OFFLOAD_TIMESTAMP) {
3735 /* Register mbuf field and flag for Rx timestamp */
3736 ret = rte_mbuf_dyn_rx_timestamp_register(&ice_timestamp_dynfield_offset,
3737 &ice_timestamp_dynflag);
3738 if (ret) {
3739 PMD_DRV_LOG(ERR, "Cannot register mbuf field/flag for timestamp");
3740 goto tx_err;
3741 }
3742 }
3743
3744 /* program Rx queues' context in hardware*/
3745 for (nb_rxq = 0; nb_rxq < data->nb_rx_queues; nb_rxq++) {
3746 ret = ice_rx_queue_start(dev, nb_rxq);
3747 if (ret) {
3748 PMD_DRV_LOG(ERR, "fail to start Rx queue %u", nb_rxq);
3749 goto rx_err;
3750 }
3751 }
3752
3753 ice_set_rx_function(dev);
3754 ice_set_tx_function(dev);
3755
3756 mask = RTE_ETH_VLAN_STRIP_MASK | RTE_ETH_VLAN_FILTER_MASK |
3757 RTE_ETH_VLAN_EXTEND_MASK;
3758 if (ice_is_dvm_ena(hw))
3759 mask |= RTE_ETH_QINQ_STRIP_MASK;
3760
3761 ret = ice_vlan_offload_set(dev, mask);
3762 if (ret) {
3763 PMD_INIT_LOG(ERR, "Unable to set VLAN offload");
3764 goto rx_err;
3765 }
3766

Callers

nothing calls this directly

Calls 15

ice_tx_queue_startFunction · 0.85
ice_rx_queue_startFunction · 0.85
ice_set_rx_functionFunction · 0.85
ice_set_tx_functionFunction · 0.85
ice_is_dvm_enaFunction · 0.85
ice_vlan_offload_setFunction · 0.85
ice_rxq_intr_setupFunction · 0.85
ice_set_vsi_promiscFunction · 0.85
ice_aq_set_event_maskFunction · 0.85
ice_get_init_link_statusFunction · 0.85
ice_dev_set_link_upFunction · 0.85

Tested by

no test coverage detected