From nobody Sat Sep 21 03:31:43 2024 X-Original-To: dev-commits-src-main@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 4X9ZYW6V0Bz5X53F; Sat, 21 Sep 2024 03:31:43 +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 4X9ZYW5wTsz4qwS; Sat, 21 Sep 2024 03:31:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726889503; 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=WtWFWnl/BfQqEn4KkYFdUiPY5aHviW925WKkYLYgx3A=; b=aYjPEprxvvhNfBq25/emB/EdicqbnlmqAG3qn8JGek9Si2r/VLjkBbxZFjTSKsQUbx85UN KX1UhsjyONmib3fOL5E2d+tJPu9GBuQ8XKallQy4HleBJ+vRev1UeJ5mw/Ko7hP8mvBlcg vSTKwBhp0QVjNI5GGD3sxytknMSK92LOxlkuZmapLCdp43SKz7Otg1GPaiHVkiLGjOOT1q 1OevU1ovyExgTXBUptzn0MltoVTJKpkpLCOxqq5WluUBUk/BKSvNNbViU3FvuCuxp+v21a UT0Y19G73R2Z1Mr/NMEmpSoUnoycGYYxTDOGVG1Klhbb85jd4KpT3wUq/kz/Lw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726889503; a=rsa-sha256; cv=none; b=yvi8ENXhH9XpW58CTdtcMLcSu8sEko6blyvQVp1V+guwJI73MWLBHIMDmvnaWlNAwB+iEK WuaC0222vx7ndVtlqQIyjf75tLACZtHFGkuGYLRdbgSBb28a+oLLt0HXP3+jxCe55D84M/ ZxBQoW2N7A6MQPUkFDFnlqAVP7LXyyJhx9RwQh7MZJ/6CUN3WNiUynMOE5WT141wLLuGfi KP3NYSbOiqxyoCzoWL8Y6pGghpUwIrUHELfrwlrwOtDq62kftCOpBl/hScsrHvZFRqZ205 xo6jpyPpikUJY6cweyni7h7gLn3QbZSdyf6YP4t7e7AtMLXDTytyr/SCweYzxQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726889503; 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=WtWFWnl/BfQqEn4KkYFdUiPY5aHviW925WKkYLYgx3A=; b=YE1kWqhCOzpAHU8u7+Crlz5PKMGC+9XjhBS4lF6a8G3MfUKmtK0Ba8EX991njyiz7CS03b MM7q4gQX/AZFG6pa9BTFinLNawOecrGVWmvfqZsfNeZO7YPhq8cXQrTFE9NRgmfArSXdzk gti/XOX3rMA8Zsj9CMXCFO/eYnfC9vDPs8HkYKL0kxrxZCzZbpTUCeBzyOYC/FA3FehjZa ztdKKuIgN/r4srw2q2vZFg73e91Y81vBna290b1Q9ljGbuv0R/Em5LItaRsFlOpe8/OeFD 0zoCBwEXedlo/CnRBOc1KMFxpu6i+Q+FbCTVVW7z3vfsPCtCg/T/wczRYeIt5Q== 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 4X9ZYW5CMDzHBM; Sat, 21 Sep 2024 03:31:43 +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 48L3VhtB036355; Sat, 21 Sep 2024 03:31:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48L3Vhqf036352; Sat, 21 Sep 2024 03:31:43 GMT (envelope-from git) Date: Sat, 21 Sep 2024 03:31:43 GMT Message-Id: <202409210331.48L3Vhqf036352@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 36c516b31136 - main - ixgbe: update if_sriov to use the new mailbox apis List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 36c516b31136f645472c12d8597534656272acd6 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=36c516b31136f645472c12d8597534656272acd6 commit 36c516b31136f645472c12d8597534656272acd6 Author: Kevin Bowling AuthorDate: 2024-09-21 03:26:42 +0000 Commit: Kevin Bowling CommitDate: 2024-09-21 03:26:42 +0000 ixgbe: update if_sriov to use the new mailbox apis This fixes a page fault when creating VFs and updates to the new mailbox API and naming conventions. The functionality works to the same level that it did before my recent changes. In particular on my 82599 it creates both passthru and ixv interfaces. In either case, the PF seems to lose the ability to pass traffic. The ixv driver fails to attach. These issues are present with or without my updates. If you use SR-IOV on ixgbe I would be interested in hearing what does or does not work for you. MFC after: 6 days --- sys/dev/ixgbe/if_sriov.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 112c34849e65..eab5ff8f5da0 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -100,18 +100,18 @@ ixgbe_send_vf_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) if (vf->flags & IXGBE_VF_CTS) msg |= IXGBE_VT_MSGTYPE_CTS; - sc->hw.mbx.ops[0].write(&sc->hw, &msg, 1, vf->pool); + ixgbe_write_mbx(&sc->hw, &msg, 1, vf->pool); } static inline void -ixgbe_send_vf_ack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) +ixgbe_send_vf_success(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_SUCCESS); } static inline void -ixgbe_send_vf_nack(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 msg) +ixgbe_send_vf_failure(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_FAILURE); @@ -121,7 +121,7 @@ static inline void ixgbe_process_vf_ack(struct ixgbe_softc *sc, struct ixgbe_vf *vf) { if (!(vf->flags & IXGBE_VF_CTS)) - ixgbe_send_vf_nack(sc, vf, 0); + ixgbe_send_vf_failure(sc, vf, 0); } static inline boolean_t @@ -374,7 +374,7 @@ ixgbe_vf_reset_msg(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) resp[0] = IXGBE_VF_RESET | ack | IXGBE_VT_MSGTYPE_CTS; bcopy(vf->ether_addr, &resp[1], ETHER_ADDR_LEN); resp[3] = hw->mac.mc_filter_type; - hw->mbx.ops[0].write(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool); + ixgbe_write_mbx(hw, resp, IXGBE_VF_PERMADDR_MSG_LEN, vf->pool); } /* ixgbe_vf_reset_msg */ @@ -387,12 +387,12 @@ ixgbe_vf_set_mac(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) /* Check that the VF has permission to change the MAC address. */ if (!(vf->flags & IXGBE_VF_CAP_MAC) && ixgbe_vf_mac_changed(vf, mac)) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } if (ixgbe_validate_mac_addr(mac) != 0) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } @@ -401,7 +401,7 @@ ixgbe_vf_set_mac(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) ixgbe_set_rar(&sc->hw, vf->rar_index, vf->ether_addr, vf->pool, true); - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_mac */ @@ -435,7 +435,7 @@ ixgbe_vf_set_mc_addr(struct ixgbe_softc *sc, struct ixgbe_vf *vf, u32 *msg) vmolr |= IXGBE_VMOLR_ROMPE; IXGBE_WRITE_REG(&sc->hw, IXGBE_VMOLR(vf->pool), vmolr); - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_mc_addr */ @@ -451,18 +451,18 @@ ixgbe_vf_set_vlan(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) tag = msg[1] & IXGBE_VLVF_VLANID_MASK; if (!(vf->flags & IXGBE_VF_CAP_VLAN)) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } /* It is illegal to enable vlan tag 0. */ if (tag == 0 && enable != 0) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } ixgbe_set_vfta(hw, tag, vf->pool, enable, false); - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_vlan */ @@ -477,7 +477,7 @@ ixgbe_vf_set_lpe(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) if (vf_max_size < ETHER_CRC_LEN) { /* We intentionally ACK invalid LPE requests. */ - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); return; } @@ -485,7 +485,7 @@ ixgbe_vf_set_lpe(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) if (vf_max_size > IXGBE_MAX_FRAME_SIZE) { /* We intentionally ACK invalid LPE requests. */ - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); return; } @@ -507,7 +507,7 @@ ixgbe_vf_set_lpe(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) IXGBE_WRITE_REG(hw, IXGBE_MHADD, mhadd); } - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); } /* ixgbe_vf_set_lpe */ @@ -516,7 +516,7 @@ ixgbe_vf_set_macvlan(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) { //XXX implement this - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); } /* ixgbe_vf_set_macvlan */ @@ -529,11 +529,11 @@ ixgbe_vf_api_negotiate(struct ixgbe_softc *sc, struct ixgbe_vf *vf, case IXGBE_API_VER_1_0: case IXGBE_API_VER_1_1: vf->api_ver = msg[1]; - ixgbe_send_vf_ack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); break; default: vf->api_ver = IXGBE_API_VER_UNKNOWN; - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); break; } } /* ixgbe_vf_api_negotiate */ @@ -552,7 +552,7 @@ ixgbe_vf_get_queues(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) switch (msg[0]) { case IXGBE_API_VER_1_0: case IXGBE_API_VER_UNKNOWN: - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); return; } @@ -565,7 +565,7 @@ ixgbe_vf_get_queues(struct ixgbe_softc *sc, struct ixgbe_vf *vf, uint32_t *msg) resp[IXGBE_VF_TRANS_VLAN] = (vf->default_vlan != 0); resp[IXGBE_VF_DEF_QUEUE] = 0; - hw->mbx.ops[0].write(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, vf->pool); + ixgbe_write_mbx(hw, resp, IXGBE_VF_GET_QUEUES_RESP_LEN, vf->pool); } /* ixgbe_vf_get_queues */ @@ -582,7 +582,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) hw = &sc->hw; - error = hw->mbx.ops[0].read(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); + error = ixgbe_read_mbx(hw, msg, IXGBE_VFMAILBOX_SIZE, vf->pool); if (error != 0) return; @@ -595,7 +595,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) } if (!(vf->flags & IXGBE_VF_CTS)) { - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_success(sc, vf, msg[0]); return; } @@ -622,7 +622,7 @@ ixgbe_process_vf_msg(if_ctx_t ctx, struct ixgbe_vf *vf) ixgbe_vf_get_queues(sc, vf, msg); break; default: - ixgbe_send_vf_nack(sc, vf, msg[0]); + ixgbe_send_vf_failure(sc, vf, msg[0]); } } /* ixgbe_process_vf_msg */