[dpdk-dev] [PATCH v2 06/17] net/txgbe: get link status of VF device

Ferruh Yigit ferruh.yigit at intel.com
Wed Feb 24 12:40:48 CET 2021


On 2/5/2021 3:34 AM, Jiawen Wu wrote:
> Add support to get link speed, duplex mode and state of VF device.
> 
> Signed-off-by: Jiawen Wu <jiawenwu at trustnetic.com>

<...>

> +/**
> + *  txgbe_check_mac_link_vf - Get link/speed status
> + *  @hw: pointer to hardware structure
> + *  @speed: pointer to link speed
> + *  @link_up: true is link is up, false otherwise
> + *  @autoneg_wait_to_complete: true when waiting for completion is needed
> + *
> + *  Reads the links register to determine if link is up and the current speed
> + **/
> +s32 txgbe_check_mac_link_vf(struct txgbe_hw *hw, u32 *speed,
> +			    bool *link_up, bool wait_to_complete)
> +{
> +	/**
> +	 * for a quick link status checking, wait_to_compelet == 0,
> +	 * skip PF link status checking
> +	 */
> +	bool no_pflink_check = wait_to_complete == 0;
> +	struct txgbe_mbx_info *mbx = &hw->mbx;
> +	struct txgbe_mac_info *mac = &hw->mac;
> +	s32 ret_val = 0;
> +	u32 links_reg;
> +	u32 in_msg = 0;
> +	UNREFERENCED_PARAMETER(wait_to_complete);

'wait_to_complete' is used.


More information about the dev mailing list