src/dpdk/drivers/net/cxgbe/cxgbe_main.c
int cxgbe_link_start(struct port_info *pi)
{
	struct adapter *adapter = pi->adapter;
	u64 conf_offloads;
	unsigned int mtu;
	int ret;

	mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
	      (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN);

	conf_offloads = pi->eth_dev->data->dev_conf.rxmode.offloads;

	/*
	 * We do not set address filters and promiscuity here, the stack does
	 * that step explicitly.
	 */
	ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, mtu, -1, -1, -1,
			    !!(conf_offloads & DEV_RX_OFFLOAD_VLAN_STRIP),
			    true);
	if (ret == 0) {
		ret = cxgbe_mpstcam_modify(pi, (int)pi->xact_addr_filt,
				(u8 *)&pi->eth_dev->data->mac_addrs[0]);
		if (ret >= 0) {
			pi->xact_addr_filt = ret;
			ret = 0;
		}
	}
	if (ret == 0 && is_pf4(adapter))
		ret = t4_link_l1cfg(pi, pi->link_cfg.admin_caps);
	if (ret == 0) {
		/*
		 * Enabling a Virtual Interface can result in an interrupt
		 * during the processing of the VI Enable command and, in some
		 * paths, result in an attempt to issue another command in the
		 * interrupt context.  Thus, we disable interrupts during the
		 * course of the VI Enable command ...
		 */
		ret = t4_enable_vi_params(adapter, adapter->mbox, pi->viid,
					  true, true, false);
	}

	if (ret == 0 && cxgbe_force_linkup(adapter))
		pi->eth_dev->data->dev_link.link_status = ETH_LINK_UP;
	return ret;
}
/**
 * link_start - enable a port
 * @dev: the port to enable
 *
 * Performs the MAC and PHY actions needed to enable a port.
 */
enable a port
@dev: the port to enable

Performs the MAC and PHY actions needed to enable a port.
enable a port @dev : the port to enable Performs the MAC and PHY actions needed to enable a port .
int cxgbe_link_start(struct port_info *pi)
{
	struct adapter *adapter = pi->adapter;
	u64 conf_offloads;
	unsigned int mtu;
	int ret;
	mtu = pi->eth_dev->data->dev_conf.rxmode.max_rx_pkt_len -
	      (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN);
	conf_offloads = pi->eth_dev->data->dev_conf.rxmode.offloads;
	ret = t4_set_rxmode(adapter, adapter->mbox, pi->viid, mtu, -1, -1, -1,
			    !!(conf_offloads & DEV_RX_OFFLOAD_VLAN_STRIP),
			    true);
	if (ret == 0) {
		ret = cxgbe_mpstcam_modify(pi, (int)pi->xact_addr_filt,
				(u8 *)&pi->eth_dev->data->mac_addrs[0]);
		if (ret >= 0) {
			pi->xact_addr_filt = ret;
			ret = 0;
		}
	}
	if (ret == 0 && is_pf4(adapter))
		ret = t4_link_l1cfg(pi, pi->link_cfg.admin_caps);
	if (ret == 0) {
		ret = t4_enable_vi_params(adapter, adapter->mbox, pi->viid,
					  true, true, false);
	}
	if (ret == 0 && cxgbe_force_linkup(adapter))
		pi->eth_dev->data->dev_link.link_status = ETH_LINK_UP;
	return ret;
}
int cxgbe_link_start ( struct port_info * pi ) { struct adapter * adapter = pi -> adapter ; u64 conf_offloads ; unsigned int mtu ; int ret ; mtu = pi -> eth_dev -> data -> dev_conf . rxmode . max_rx_pkt_len - ( RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN ) ; conf_offloads = pi -> eth_dev -> data -> dev_conf . rxmode . offloads ; ret = t4_set_rxmode ( adapter , adapter -> mbox , pi -> viid , mtu , -1 , -1 , -1 , ! ! ( conf_offloads & DEV_RX_OFFLOAD_VLAN_STRIP ) , true ) ; if ( ret == 0 ) { ret = cxgbe_mpstcam_modify ( pi , ( int ) pi -> xact_addr_filt , ( u8 * ) & pi -> eth_dev -> data -> mac_addrs [ 0 ] ) ; if ( ret >= 0 ) { pi -> xact_addr_filt = ret ; ret = 0 ; } } if ( ret == 0 && is_pf4 ( adapter ) ) ret = t4_link_l1cfg ( pi , pi -> link_cfg . admin_caps ) ; if ( ret == 0 ) { ret = t4_enable_vi_params ( adapter , adapter -> mbox , pi -> viid , true , true , false ) ; } if ( ret == 0 && cxgbe_force_linkup ( adapter ) ) pi -> eth_dev -> data -> dev_link . link_status = ETH_LINK_UP ; return ret ; }
link_start - enable a port
 @dev: the port to enable
link_start - enable a port @dev : the port to enable
/*
	 * We do not set address filters and promiscuity here, the stack does
	 * that step explicitly.
	 */ /*
		 * Enabling a Virtual Interface can result in an interrupt
		 * during the processing of the VI Enable command and, in some
		 * paths, result in an attempt to issue another command in the
		 * interrupt context.  Thus, we disable interrupts during the
		 * course of the VI Enable command ...
		 */