diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 79 | 
1 files changed, 79 insertions, 0 deletions
| diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c index 32ac1e020d91..ee133d6749b3 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c @@ -510,6 +510,8 @@ static int ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 max_frame, u32 vf  		case ixgbe_mbox_api_12:  		case ixgbe_mbox_api_13:  		case ixgbe_mbox_api_14: +		case ixgbe_mbox_api_16: +		case ixgbe_mbox_api_17:  			/* Version 1.1 supports jumbo frames on VFs if PF has  			 * jumbo frames enabled which means legacy VFs are  			 * disabled @@ -1046,6 +1048,8 @@ static int ixgbe_negotiate_vf_api(struct ixgbe_adapter *adapter,  	case ixgbe_mbox_api_12:  	case ixgbe_mbox_api_13:  	case ixgbe_mbox_api_14: +	case ixgbe_mbox_api_16: +	case ixgbe_mbox_api_17:  		adapter->vfinfo[vf].vf_api = api;  		return 0;  	default: @@ -1072,6 +1076,8 @@ static int ixgbe_get_vf_queues(struct ixgbe_adapter *adapter,  	case ixgbe_mbox_api_12:  	case ixgbe_mbox_api_13:  	case ixgbe_mbox_api_14: +	case ixgbe_mbox_api_16: +	case ixgbe_mbox_api_17:  		break;  	default:  		return -1; @@ -1112,6 +1118,8 @@ static int ixgbe_get_vf_reta(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)  	/* verify the PF is supporting the correct API */  	switch (adapter->vfinfo[vf].vf_api) { +	case ixgbe_mbox_api_17: +	case ixgbe_mbox_api_16:  	case ixgbe_mbox_api_14:  	case ixgbe_mbox_api_13:  	case ixgbe_mbox_api_12: @@ -1145,6 +1153,8 @@ static int ixgbe_get_vf_rss_key(struct ixgbe_adapter *adapter,  	/* verify the PF is supporting the correct API */  	switch (adapter->vfinfo[vf].vf_api) { +	case ixgbe_mbox_api_17: +	case ixgbe_mbox_api_16:  	case ixgbe_mbox_api_14:  	case ixgbe_mbox_api_13:  	case ixgbe_mbox_api_12: @@ -1174,6 +1184,8 @@ static int ixgbe_update_vf_xcast_mode(struct ixgbe_adapter *adapter,  		fallthrough;  	case ixgbe_mbox_api_13:  	case ixgbe_mbox_api_14: +	case ixgbe_mbox_api_16: +	case ixgbe_mbox_api_17:  		break;  	default:  		return -EOPNOTSUPP; @@ -1244,6 +1256,8 @@ static int ixgbe_get_vf_link_state(struct ixgbe_adapter *adapter,  	case ixgbe_mbox_api_12:  	case ixgbe_mbox_api_13:  	case ixgbe_mbox_api_14: +	case ixgbe_mbox_api_16: +	case ixgbe_mbox_api_17:  		break;  	default:  		return -EOPNOTSUPP; @@ -1254,6 +1268,65 @@ static int ixgbe_get_vf_link_state(struct ixgbe_adapter *adapter,  	return 0;  } +/** + * ixgbe_send_vf_link_status - send link status data to VF + * @adapter: pointer to adapter struct + * @msgbuf: pointer to message buffers + * @vf: VF identifier + * + * Reply for IXGBE_VF_GET_PF_LINK_STATE mbox command sending link status data. + * + * Return: 0 on success or -EOPNOTSUPP when operation is not supported. + */ +static int ixgbe_send_vf_link_status(struct ixgbe_adapter *adapter, +				     u32 *msgbuf, u32 vf) +{ +	struct ixgbe_hw *hw = &adapter->hw; + +	switch (adapter->vfinfo[vf].vf_api) { +	case ixgbe_mbox_api_16: +	case ixgbe_mbox_api_17: +		if (hw->mac.type != ixgbe_mac_e610) +			return -EOPNOTSUPP; +		break; +	default: +		return -EOPNOTSUPP; +	} +	/* Simply provide stored values as watchdog & link status events take +	 * care of its freshness. +	 */ +	msgbuf[1] = adapter->link_speed; +	msgbuf[2] = adapter->link_up; + +	return 0; +} + +/** + * ixgbe_negotiate_vf_features -  negotiate supported features with VF driver + * @adapter: pointer to adapter struct + * @msgbuf: pointer to message buffers + * @vf: VF identifier + * + * Return: 0 on success or -EOPNOTSUPP when operation is not supported. + */ +static int ixgbe_negotiate_vf_features(struct ixgbe_adapter *adapter, +				       u32 *msgbuf, u32 vf) +{ +	u32 features = msgbuf[1]; + +	switch (adapter->vfinfo[vf].vf_api) { +	case ixgbe_mbox_api_17: +		break; +	default: +		return -EOPNOTSUPP; +	} + +	features &= IXGBE_SUPPORTED_FEATURES; +	msgbuf[1] = features; + +	return 0; +} +  static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)  {  	u32 mbx_size = IXGBE_VFMAILBOX_SIZE; @@ -1328,6 +1401,12 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)  	case IXGBE_VF_IPSEC_DEL:  		retval = ixgbe_ipsec_vf_del_sa(adapter, msgbuf, vf);  		break; +	case IXGBE_VF_GET_PF_LINK_STATE: +		retval = ixgbe_send_vf_link_status(adapter, msgbuf, vf); +		break; +	case IXGBE_VF_FEATURES_NEGOTIATE: +		retval = ixgbe_negotiate_vf_features(adapter, msgbuf, vf); +		break;  	default:  		e_err(drv, "Unhandled Msg %8.8x\n", msgbuf[0]);  		retval = -EIO; | 
