diff options
| author | msaitoh <msaitoh@NetBSD.org> | 2021-12-24 04:59:23 +0000 |
|---|---|---|
| committer | msaitoh <msaitoh@NetBSD.org> | 2021-12-24 04:59:23 +0000 |
| commit | 58699f35eeed52fd3cf157e4d52dfd52ab421c56 (patch) | |
| tree | 2f460fb604cb5b0874cbe0143d8669dcc1475393 /sys | |
| parent | ee120c463e7823f03cf254462b851557de0c54da (diff) | |
Rename IXGBE_VT_MSGTYPE_{ACK,NACK} to IXGBE_VT_MSGTYPE_{SUCCESS,FAILURE}.
- Sync with FreeBSD ix-3.3.18.
- No functional change.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/pci/ixgbe/if_sriov.c | 14 | ||||
| -rw-r--r-- | sys/dev/pci/ixgbe/ixgbe_mbx.h | 19 | ||||
| -rw-r--r-- | sys/dev/pci/ixgbe/ixgbe_vf.c | 28 |
3 files changed, 32 insertions, 29 deletions
diff --git a/sys/dev/pci/ixgbe/if_sriov.c b/sys/dev/pci/ixgbe/if_sriov.c index 34acc67dcc7..f5d6417ca13 100644 --- a/sys/dev/pci/ixgbe/if_sriov.c +++ b/sys/dev/pci/ixgbe/if_sriov.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sriov.c,v 1.14 2021/12/10 11:39:48 msaitoh Exp $ */ +/* $NetBSD: if_sriov.c,v 1.15 2021/12/24 04:59:23 msaitoh Exp $ */ /****************************************************************************** Copyright (c) 2001-2017, Intel Corporation @@ -34,7 +34,7 @@ /*$FreeBSD: head/sys/dev/ixgbe/if_sriov.c 327031 2017-12-20 18:15:06Z erj $*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.14 2021/12/10 11:39:48 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sriov.c,v 1.15 2021/12/24 04:59:23 msaitoh Exp $"); #include "ixgbe.h" #include "ixgbe_sriov.h" @@ -106,14 +106,14 @@ static inline void ixgbe_send_vf_ack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_ACK); + ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_SUCCESS); } static inline void ixgbe_send_vf_nack(struct adapter *adapter, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_NACK); + ixgbe_send_vf_msg(adapter, vf, msg | IXGBE_VT_MSGTYPE_FAILURE); } static inline void @@ -378,9 +378,9 @@ ixgbe_vf_reset_msg(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr, vf->pool, TRUE); - ack = IXGBE_VT_MSGTYPE_ACK; + ack = IXGBE_VT_MSGTYPE_SUCCESS; } else - ack = IXGBE_VT_MSGTYPE_NACK; + ack = IXGBE_VT_MSGTYPE_FAILURE; ixgbe_vf_enable_transmit(adapter, vf); ixgbe_vf_enable_receive(adapter, vf); @@ -572,7 +572,7 @@ ixgbe_vf_get_queues(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) return; } - resp[0] = IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_ACK | + resp[0] = IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_SUCCESS | IXGBE_VT_MSGTYPE_CTS; num_queues = ixgbe_vf_queues(adapter->iov_mode); diff --git a/sys/dev/pci/ixgbe/ixgbe_mbx.h b/sys/dev/pci/ixgbe/ixgbe_mbx.h index fe30e9c4e18..bd1928b3918 100644 --- a/sys/dev/pci/ixgbe/ixgbe_mbx.h +++ b/sys/dev/pci/ixgbe/ixgbe_mbx.h @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_mbx.h,v 1.15 2021/12/24 04:56:34 msaitoh Exp $ */ +/* $NetBSD: ixgbe_mbx.h,v 1.16 2021/12/24 04:59:23 msaitoh Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -100,14 +100,17 @@ struct ixgbe_mbx_info { /* If it's a IXGBE_VF_* msg then it originates in the VF and is sent to the * PF. The reverse is TRUE if it is IXGBE_PF_*. - * Message ACK's are the value or'd with 0xF0000000 + * Message results are the value or'd with 0xF0000000 */ -#define IXGBE_VT_MSGTYPE_ACK 0x80000000 /* Messages below or'd with - * this are the ACK */ -#define IXGBE_VT_MSGTYPE_NACK 0x40000000 /* Messages below or'd with - * this are the NACK */ -#define IXGBE_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still - * clear to send requests */ +#define IXGBE_VT_MSGTYPE_SUCCESS 0x80000000 /* Messages or'd with this + * have succeeded + */ +#define IXGBE_VT_MSGTYPE_FAILURE 0x40000000 /* Messages or'd with this + * have failed + */ +#define IXGBE_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still + * clear to send requests + */ #define IXGBE_VT_MSGINFO_SHIFT 16 /* bits 23:16 are used for extra info for certain messages */ #define IXGBE_VT_MSGINFO_MASK (0xFF << IXGBE_VT_MSGINFO_SHIFT) diff --git a/sys/dev/pci/ixgbe/ixgbe_vf.c b/sys/dev/pci/ixgbe/ixgbe_vf.c index abb92b248b3..2d769ccd7f9 100644 --- a/sys/dev/pci/ixgbe/ixgbe_vf.c +++ b/sys/dev/pci/ixgbe/ixgbe_vf.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_vf.c,v 1.27 2021/04/30 06:55:32 msaitoh Exp $ */ +/* $NetBSD: ixgbe_vf.c,v 1.28 2021/12/24 04:59:23 msaitoh Exp $ */ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause @@ -36,7 +36,7 @@ /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_vf.c 331224 2018-03-19 20:55:05Z erj $*/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ixgbe_vf.c,v 1.27 2021/04/30 06:55:32 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixgbe_vf.c,v 1.28 2021/12/24 04:59:23 msaitoh Exp $"); #include "ixgbe_api.h" #include "ixgbe_type.h" @@ -234,11 +234,11 @@ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) if (ret_val) return ret_val; - if (msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK) && - msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_NACK)) + if (msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS) && + msgbuf[0] != (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_INVALID_MAC_ADDR; - if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_ACK)) + if (msgbuf[0] == (IXGBE_VF_RESET | IXGBE_VT_MSGTYPE_SUCCESS)) memcpy(hw->mac.perm_addr, addr, IXGBE_ETH_LENGTH_OF_ADDRESS); hw->mac.mc_filter_type = msgbuf[IXGBE_VF_MC_TYPE_WORD]; @@ -369,7 +369,7 @@ s32 ixgbe_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, /* if nacked the address was rejected, use "perm_addr" */ if (!ret_val && - (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_NACK))) { + (msgbuf[0] == (IXGBE_VF_SET_MAC_ADDR | IXGBE_VT_MSGTYPE_FAILURE))) { ixgbe_get_mac_addr_vf(hw, hw->mac.addr); return IXGBE_ERR_MBX; } @@ -464,7 +464,7 @@ s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; if (msgbuf[0] == - (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_NACK)) { + (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_FAILURE)) { if (xcast_mode == IXGBEVF_XCAST_MODE_PROMISC) { /* * If the API version matched and the reply was NACK, @@ -515,10 +515,10 @@ s32 ixgbe_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, msgbuf[0] |= (u32)vlan_on << IXGBE_VT_MSGINFO_SHIFT; ret_val = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2); - if (!ret_val && (msgbuf[0] & IXGBE_VT_MSGTYPE_ACK)) + if (!ret_val && (msgbuf[0] & IXGBE_VT_MSGTYPE_SUCCESS)) return IXGBE_SUCCESS; - return ret_val | (msgbuf[0] & IXGBE_VT_MSGTYPE_NACK); + return ret_val | (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE); } /** @@ -583,7 +583,7 @@ s32 ixgbevf_set_uc_addr_vf(struct ixgbe_hw *hw, u32 index, u8 *addr) if (!ret_val) { msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; - if (msgbuf[0] == (msgbuf_chk | IXGBE_VT_MSGTYPE_NACK)) + if (msgbuf[0] == (msgbuf_chk | IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_OUT_OF_MEM; } @@ -687,7 +687,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed, if (!(in_msg & IXGBE_VT_MSGTYPE_CTS)) { /* msg is not CTS and is NACK we must have lost CTS status */ - if (in_msg & IXGBE_VT_MSGTYPE_NACK) + if (in_msg & IXGBE_VT_MSGTYPE_FAILURE) ret_val = -1; goto out; } @@ -725,7 +725,7 @@ s32 ixgbevf_rlpml_set_vf(struct ixgbe_hw *hw, u16 max_size) if (retval) return retval; if ((msgbuf[0] & IXGBE_VF_SET_LPE) && - (msgbuf[0] & IXGBE_VT_MSGTYPE_NACK)) + (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_MBX; return 0; @@ -751,7 +751,7 @@ int ixgbevf_negotiate_api_version(struct ixgbe_hw *hw, int api) msg[0] &= ~IXGBE_VT_MSGTYPE_CTS; /* Store value and return 0 on success */ - if (msg[0] == (IXGBE_VF_API_NEGOTIATE | IXGBE_VT_MSGTYPE_ACK)) { + if (msg[0] == (IXGBE_VF_API_NEGOTIATE | IXGBE_VT_MSGTYPE_SUCCESS)) { hw->api_version = api; return 0; } @@ -791,7 +791,7 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs, * some sort of mailbox error so we should treat it * as such */ - if (msg[0] != (IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_ACK)) + if (msg[0] != (IXGBE_VF_GET_QUEUES | IXGBE_VT_MSGTYPE_SUCCESS)) return IXGBE_ERR_MBX; /* record and validate values from message */ |
