From nobody Fri Sep 27 03:36:26 2024 X-Original-To: dev-commits-src-all@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 4XFGNB6yZ3z5XQ3m; Fri, 27 Sep 2024 03:36:26 +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 4XFGNB5dFdz4nb4; Fri, 27 Sep 2024 03:36:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408186; 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=HqG1IgzZ+d+YxVIzm9RgOGZP29qhxe/0GVrquvunU6M=; b=nU8vzXLh2Hup16MOGYx7M/QI31K1Ied6GIMeNXoD+x42eNB1TQX94NU2Az9R5ehsCiJf/i VhkrWaYoPWMoLHUPS99Lk71y9GCO/boJat+F6px30YPt5/MfdxnI6FVsf/hfcrw0PdhY9t de07KqautUh6Lx53roGyjmXDxSGzoOJ8M+6faHJ6fFzbSge8vqRzFtNzaRMk35TQ8eyf9R 1YxgSPMNqXJGC8UC8JLRgL+U/jVuRozJktBXY4EECBqYyNniRcjGMOvsOba9vsLdAEwWNu mEO2Q358Tcsupdk/idg0Fbp3XHDXQYLC7/wushzhf/9n2F6H4FECOxfyS0xpdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408186; 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=HqG1IgzZ+d+YxVIzm9RgOGZP29qhxe/0GVrquvunU6M=; b=h4GYG9lmB1Hz3j3auk/XG0O2fFdX3n2IBDaNlnGmEf5Xgpr8Ib9fGaepYZ3JceGV+gbV5t swkEO2BuT6i9QRxW5LzbR2/Z4uMao5mvWk7b8N251zDwg5bS/k0RGsbNknrLBWQ5VFUP3T IihWudXrc3Gh/m96sbu0W0WtE5lYVlMrqC/YDbzczIoOgVc8gael4BdLYXF4lmtGUPi8cP VmZZD8uGX6nxc0aA/8Ax20JHWBt8VTfeEmzlJS6ehowqTaQtAGU83+xEZqVcyPbnKMwZMC Pqa1oInokjwVK+h8tpxWPQ5OLoMvRfvWYUF0YnNJn88/k8pVnDI2WwUFFfhpwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727408186; a=rsa-sha256; cv=none; b=ND37+c0/W6kKjs41J3vE8ytLyGX/zeQo8md+mAlDeC33cDx96ZAcejWCzkpv+GG+ALHZes 9EboXqubcWxfdFq3a1YnilOxJTfFaSXI+zeE/qtGRPXldGt8bUamFB7L+AIFZ813QsLRnD YqoXryt3raW+isuqaNHsQP5zrKGIeo7u5DMWWI4RVa4A+WVyNMi4ZaCtFgZOg8BVVW4v/F Sk5qXvR+FGS7SRoCCBTw0GVvKKXOG4kGvy6KmLWcz7EhzduzOM7NY3XxNxH8P3wI++zZpC gwXzWWVeMY0ETc4rx5Rl2oRLL7CgRtzePEA5gCuRWR2q3cVcoNgMK5Apgk0fvw== 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 4XFGNB56DDzNx5; Fri, 27 Sep 2024 03:36:26 +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 48R3aQZi039400; Fri, 27 Sep 2024 03:36:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48R3aQ6k039396; Fri, 27 Sep 2024 03:36:26 GMT (envelope-from git) Date: Fri, 27 Sep 2024 03:36:26 GMT Message-Id: <202409270336.48R3aQ6k039396@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: 6828020a6b9a - stable/14 - ixgbe: update if_sriov to use the new mailbox apis List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 6828020a6b9a869ccc15c02fa9571357b3bcc2a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=6828020a6b9a869ccc15c02fa9571357b3bcc2a6 commit 6828020a6b9a869ccc15c02fa9571357b3bcc2a6 Author: Kevin Bowling AuthorDate: 2024-09-21 03:26:42 +0000 Commit: Kevin Bowling CommitDate: 2024-09-27 03:35:24 +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. (cherry picked from commit 36c516b31136f645472c12d8597534656272acd6) --- 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 */