Module Name: src Committed By: msaitoh Date: Fri Dec 24 04:59:23 UTC 2021
Modified Files: src/sys/dev/pci/ixgbe: if_sriov.c ixgbe_mbx.h ixgbe_vf.c Log Message: Rename IXGBE_VT_MSGTYPE_{ACK,NACK} to IXGBE_VT_MSGTYPE_{SUCCESS,FAILURE}. - Sync with FreeBSD ix-3.3.18. - No functional change. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/dev/pci/ixgbe/if_sriov.c cvs rdiff -u -r1.15 -r1.16 src/sys/dev/pci/ixgbe/ixgbe_mbx.h cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/ixgbe/ixgbe_vf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ixgbe/if_sriov.c diff -u src/sys/dev/pci/ixgbe/if_sriov.c:1.14 src/sys/dev/pci/ixgbe/if_sriov.c:1.15 --- src/sys/dev/pci/ixgbe/if_sriov.c:1.14 Fri Dec 10 11:39:48 2021 +++ src/sys/dev/pci/ixgbe/if_sriov.c Fri Dec 24 04:59:23 2021 @@ -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 *adapt 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 *adap 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); Index: src/sys/dev/pci/ixgbe/ixgbe_mbx.h diff -u src/sys/dev/pci/ixgbe/ixgbe_mbx.h:1.15 src/sys/dev/pci/ixgbe/ixgbe_mbx.h:1.16 --- src/sys/dev/pci/ixgbe/ixgbe_mbx.h:1.15 Fri Dec 24 04:56:34 2021 +++ src/sys/dev/pci/ixgbe/ixgbe_mbx.h Fri Dec 24 04:59:23 2021 @@ -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) Index: src/sys/dev/pci/ixgbe/ixgbe_vf.c diff -u src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.27 src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.28 --- src/sys/dev/pci/ixgbe/ixgbe_vf.c:1.27 Fri Apr 30 06:55:32 2021 +++ src/sys/dev/pci/ixgbe/ixgbe_vf.c Fri Dec 24 04:59:23 2021 @@ -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 *h 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 /* 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 ixg 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 *h 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_ 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 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 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 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 * * 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 */