ixgbevf: Add support for new mailbox communication between PF and VF

Provide improved mailbox communication, between PF and VF,
which is defined as API version 1.5.

Signed-off-by: Radoslaw Tyl <radoslawx.tyl@intel.com>
Tested-by: Tony Brelinski <tony.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
Radoslaw Tyl 2021-06-30 10:15:32 +02:00 committed by Tony Nguyen
parent c869259881
commit 339f289641
4 changed files with 23 additions and 2 deletions

View File

@ -623,6 +623,7 @@ void ixgbevf_init_ipsec_offload(struct ixgbevf_adapter *adapter)
switch (adapter->hw.api_version) { switch (adapter->hw.api_version) {
case ixgbe_mbox_api_14: case ixgbe_mbox_api_14:
case ixgbe_mbox_api_15:
break; break;
default: default:
return; return;

View File

@ -2266,6 +2266,7 @@ static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter)
{ {
struct ixgbe_hw *hw = &adapter->hw; struct ixgbe_hw *hw = &adapter->hw;
static const int api[] = { static const int api[] = {
ixgbe_mbox_api_15,
ixgbe_mbox_api_14, ixgbe_mbox_api_14,
ixgbe_mbox_api_13, ixgbe_mbox_api_13,
ixgbe_mbox_api_12, ixgbe_mbox_api_12,
@ -2284,6 +2285,12 @@ static void ixgbevf_negotiate_api(struct ixgbevf_adapter *adapter)
idx++; idx++;
} }
if (hw->api_version >= ixgbe_mbox_api_15) {
hw->mbx.ops.init_params(hw);
memcpy(&hw->mbx.ops, &ixgbevf_mbx_ops,
sizeof(struct ixgbe_mbx_operations));
}
spin_unlock_bh(&adapter->mbx_lock); spin_unlock_bh(&adapter->mbx_lock);
} }
@ -2627,6 +2634,7 @@ static void ixgbevf_set_num_queues(struct ixgbevf_adapter *adapter)
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13: case ixgbe_mbox_api_13:
case ixgbe_mbox_api_14: case ixgbe_mbox_api_14:
case ixgbe_mbox_api_15:
if (adapter->xdp_prog && if (adapter->xdp_prog &&
hw->mac.max_tx_queues == rss) hw->mac.max_tx_queues == rss)
rss = rss > 3 ? 2 : 1; rss = rss > 3 ? 2 : 1;
@ -4625,6 +4633,7 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13: case ixgbe_mbox_api_13:
case ixgbe_mbox_api_14: case ixgbe_mbox_api_14:
case ixgbe_mbox_api_15:
netdev->max_mtu = IXGBE_MAX_JUMBO_FRAME_SIZE - netdev->max_mtu = IXGBE_MAX_JUMBO_FRAME_SIZE -
(ETH_HLEN + ETH_FCS_LEN); (ETH_HLEN + ETH_FCS_LEN);
break; break;

View File

@ -65,6 +65,7 @@ enum ixgbe_pfvf_api_rev {
ixgbe_mbox_api_12, /* API version 1.2, linux/freebsd VF driver */ ixgbe_mbox_api_12, /* API version 1.2, linux/freebsd VF driver */
ixgbe_mbox_api_13, /* API version 1.3, linux/freebsd VF driver */ ixgbe_mbox_api_13, /* API version 1.3, linux/freebsd VF driver */
ixgbe_mbox_api_14, /* API version 1.4, linux/freebsd VF driver */ ixgbe_mbox_api_14, /* API version 1.4, linux/freebsd VF driver */
ixgbe_mbox_api_15, /* API version 1.5, linux/freebsd VF driver */
/* This value should always be last */ /* This value should always be last */
ixgbe_mbox_api_unknown, /* indicates that API version is not known */ ixgbe_mbox_api_unknown, /* indicates that API version is not known */
}; };

View File

@ -74,6 +74,9 @@ static s32 ixgbevf_reset_hw_vf(struct ixgbe_hw *hw)
/* reset the api version */ /* reset the api version */
hw->api_version = ixgbe_mbox_api_10; hw->api_version = ixgbe_mbox_api_10;
hw->mbx.ops.init_params(hw);
memcpy(&hw->mbx.ops, &ixgbevf_mbx_ops_legacy,
sizeof(struct ixgbe_mbx_operations));
IXGBE_WRITE_REG(hw, IXGBE_VFCTRL, IXGBE_CTRL_RST); IXGBE_WRITE_REG(hw, IXGBE_VFCTRL, IXGBE_CTRL_RST);
IXGBE_WRITE_FLUSH(hw); IXGBE_WRITE_FLUSH(hw);
@ -310,6 +313,7 @@ int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues)
* is not supported for this device type. * is not supported for this device type.
*/ */
switch (hw->api_version) { switch (hw->api_version) {
case ixgbe_mbox_api_15:
case ixgbe_mbox_api_14: case ixgbe_mbox_api_14:
case ixgbe_mbox_api_13: case ixgbe_mbox_api_13:
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
@ -378,6 +382,7 @@ int ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key)
* or if the operation is not supported for this device type. * or if the operation is not supported for this device type.
*/ */
switch (hw->api_version) { switch (hw->api_version) {
case ixgbe_mbox_api_15:
case ixgbe_mbox_api_14: case ixgbe_mbox_api_14:
case ixgbe_mbox_api_13: case ixgbe_mbox_api_13:
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
@ -544,8 +549,9 @@ static s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode)
if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC) if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC)
return -EOPNOTSUPP; return -EOPNOTSUPP;
fallthrough; fallthrough;
case ixgbe_mbox_api_14:
case ixgbe_mbox_api_13: case ixgbe_mbox_api_13:
case ixgbe_mbox_api_14:
case ixgbe_mbox_api_15:
break; break;
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
@ -704,8 +710,11 @@ static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
/* if the read failed it could just be a mailbox collision, best wait /* if the read failed it could just be a mailbox collision, best wait
* until we are called again and don't report an error * until we are called again and don't report an error
*/ */
if (mbx->ops.read(hw, &in_msg, 1)) if (mbx->ops.read(hw, &in_msg, 1)) {
if (hw->api_version >= ixgbe_mbox_api_15)
mac->get_link_status = false;
goto out; goto out;
}
if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) { if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) {
/* msg is not CTS and is NACK we must have lost CTS status */ /* msg is not CTS and is NACK we must have lost CTS status */
@ -901,6 +910,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs,
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13: case ixgbe_mbox_api_13:
case ixgbe_mbox_api_14: case ixgbe_mbox_api_14:
case ixgbe_mbox_api_15:
break; break;
default: default:
return 0; return 0;