From nobody Thu Sep 26 03:29:53 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XDfH55jSkz5Y6b5; Thu, 26 Sep 2024 03:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XDfH532MNz4W4b; Thu, 26 Sep 2024 03:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727321393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OL4E1Gn9uNNxa7WlF2QlCeUEWLcpVO1DvKqsKlaC4eM=; b=wQ2/FeMr70+RGW90qtrmCkhItpLg0sLWmz9Kj+52N11JHwC+v5l9/p0LkosDr9zPgieYM+ lkvjNmvILzxf6A7+KewCRfPuMRpymJbncOq2eyMhacwZV7EyBtQD7HCob9u0rwXTrK6i1O Yg/gz0gyI4k8+3M6hoSygUyW4Tidxtobgbo5Fi2QeUQlhKzwroyyjZ2cl/cM9wsz7pCfSL ZvuDtos6vWdkrTc+wRglr8WfVDi6aZNr0B5bs3n3yfD8Bsih9x57DN3kqvo+XRUuDc3j8Z aTObBvqNdQH12gvKmi7kUafEjjJ3Iw7Xgk/qo/KRQyl6EOJ+F8m1shNVu/lJUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727321393; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OL4E1Gn9uNNxa7WlF2QlCeUEWLcpVO1DvKqsKlaC4eM=; b=Vgkwud8NONtVQ+WCvsyoR9KC2K949efJFpqjUM8yOJ5/sZj0dZhAAjz0IOpAHdQRi4Zed9 UHC7IL8hIlNt0ZKJRAW8qe8LpNDLr50VaE3+Bo8EW5AbQ8vtnMKmAryO/89qaMt2d5f2yK 20geLYQ0K55KorLebKC1P2xpkqRZCTODt/lhlaW8DgykNAH6ZpF3NjpzGvyHHL0MaDDIk3 O7KAPanG5IaAdNObxUwDYacH3D2WH9JhxmkrQBIjtb7cu7jrDWE9EnLBSUa9pHWU2F/7l2 NKUwYy3G0KK+w00ZV3iPfJ0Wy91wceh/0vOP4Qnq8xKs2SdUnCUJuqDtXbD/Ng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727321393; a=rsa-sha256; cv=none; b=WOF1+PyEw2Tkms46JaZXxUM/f1rU/LhVpykG4QqnSBu41oWu9nUByWmsJLjxPoBy822BB+ YVweFnFjmV+B4Mh57soYzLY6zOr9/9OXh0HvuYFMm8/xEAmISds2gvf0lutm2xFq628AYS eAGHvAjv3rVw9YKxx+w5z5/vpS1RHTe4zpr8PK9uaxibje1E/Pu/JQse4T+BF1GDoumM2z n8/u2t5rXj7E7DLECcrjukvvta+Ibd7AGMRGzyaOTwFCsD5DDT26zvYDRroLYyKFLU9Es6 tM676qT5DQH14s0kIMuIKRid6Tjhi89k63arRj3pIQDMGMNIEDSur2bylhJHpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XDfH524VMzg6x; Thu, 26 Sep 2024 03:29:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48Q3Trk9082800; Thu, 26 Sep 2024 03:29:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48Q3Tr6s082797; Thu, 26 Sep 2024 03:29:53 GMT (envelope-from git) Date: Thu, 26 Sep 2024 03:29:53 GMT Message-Id: <202409260329.48Q3Tr6s082797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: d7364cb43fa3 - stable/14 - ixgbe: rename VF message type macros List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d7364cb43fa34cc2d8d9741a1ef760a20227d3d2 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=d7364cb43fa34cc2d8d9741a1ef760a20227d3d2 commit d7364cb43fa34cc2d8d9741a1ef760a20227d3d2 Author: Jakub Chylkowski AuthorDate: 2024-09-19 21:02:06 +0000 Commit: Kevin Bowling CommitDate: 2024-09-26 03:29:02 +0000 ixgbe: rename VF message type macros DPDK commit message There is name similarity within IXGBE_VT_MSGTYPE_ACK and PFMAILBOX.ACK / VFMAILBOX.ACK which may cause confusion. Rename MSGTYPE macros to SUCCESS and FAILURE as they are not specified in datasheet and now will be easily distinguishable. Signed-off-by: Jakub Chylkowski Reviewed-by: Marek Zalfresso-jundzillo Reviewed-by: Alice Michael Reviewed-by: Piotr Skajewski Reviewed-by: Slawomir Mrozowicz Tested-by: Piotr Skajewski Tested-by: Alice Michael Obtained from: DPDK (4f675c9) (cherry picked from commit 10746040820ee5186caf4d4d61cf88196ec213ba) --- sys/dev/ixgbe/if_sriov.c | 10 +++++----- sys/dev/ixgbe/ixgbe_mbx.h | 14 +++++++------- sys/dev/ixgbe/ixgbe_vf.c | 34 ++++++++++++++++++---------------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 7cdd287b85bf..a16092c9f688 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -107,14 +107,14 @@ static inline void ixgbe_send_vf_ack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_ACK); + ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_SUCCESS); } static inline void ixgbe_send_vf_nack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) { msg &= IXGBE_VT_MSG_MASK; - ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_NACK); + ixgbe_send_vf_msg(sc, vf, msg | IXGBE_VT_MSGTYPE_FAILURE); } static inline void @@ -362,9 +362,9 @@ ixgbe_vf_reset_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&sc->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(sc, vf); ixgbe_vf_enable_receive(sc, vf); @@ -556,7 +556,7 @@ ixgbe_vf_get_queues(struct ixgbe_softc *sc, 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(sc->iov_mode); diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 47b9327bb896..fa407c4969d1 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -68,14 +68,14 @@ /* 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/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index beef259de339..4624c2b5c0a3 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -223,11 +223,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]; @@ -356,9 +356,9 @@ s32 ixgbe_set_rar_vf(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq, msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; - /* if nacked the address was rejected, use "perm_addr" */ + /* if we had failure, 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; } @@ -447,7 +447,7 @@ s32 ixgbevf_update_xcast_mode(struct ixgbe_hw *hw, int xcast_mode) return err; msgbuf[0] &= ~IXGBE_VT_MSGTYPE_CTS; - if (msgbuf[0] == (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_NACK)) + if (msgbuf[0] == (IXGBE_VF_UPDATE_XCAST_MODE | IXGBE_VT_MSGTYPE_FAILURE)) return IXGBE_ERR_FEATURE_NOT_SUPPORTED; return IXGBE_SUCCESS; } @@ -470,7 +470,7 @@ s32 ixgbe_get_link_state_vf(struct ixgbe_hw *hw, bool *link_state) err = ixgbevf_write_msg_read_ack(hw, msgbuf, msgbuf, 2); - if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_NACK)) { + if (err || (msgbuf[0] & IXGBE_VT_MSGTYPE_FAILURE)) { ret_val = IXGBE_ERR_MBX; } else { ret_val = IXGBE_SUCCESS; @@ -503,10 +503,10 @@ s32 ixgbe_set_vfta_vf(struct ixgbe_hw *hw, u32 vlan, u32 vind, msgbuf[0] |= 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); } /** @@ -571,7 +571,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; } @@ -674,8 +674,10 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed, goto out; 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) + /* msg is not CTS and is FAILURE, + * we must have lost CTS status. + */ + if (in_msg & IXGBE_VT_MSGTYPE_FAILURE) ret_val = -1; goto out; } @@ -713,7 +715,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; @@ -739,7 +741,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; } @@ -775,11 +777,11 @@ int ixgbevf_get_queues(struct ixgbe_hw *hw, unsigned int *num_tcs, msg[0] &= ~IXGBE_VT_MSGTYPE_CTS; /* - * if we we didn't get an ACK there must have been + * if we we didn't get a SUCCESS there must have been * 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 */