From nobody Tue Feb 7 19:18:12 2023 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 4PBCZr2Yxqz3nbcN; Tue, 7 Feb 2023 19:18:12 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PBCZr1hnsz4VGj; Tue, 7 Feb 2023 19:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675797492; 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=RMUC9M79un+5ACqoysyR2opn6rXmz05+ciY6QbAYhRk=; b=k+BAW48w3IJfWl0QapGpDSPBxKaRVFoklpS9nJVo9bPnHuftVZBs0Z/NuI2N2ZvIU7epDh RJTnCUSCTOhmFKpKpPrO6z2+g3QmpKPpfItUHV2oP64qBfaMM3XwjFlWEKqJdvIBIqpFm9 I9y5XMwiGNhOZq1s1rHZoBYVNiDqBX+dEzFG0d20USQEDOowivWYmTEC9Uihsw0cn3AXrB XgiQ7CxPDfSun2d6RaqHxtsKKRSVNTmlQmTRlkHWvkSf9HzcqYUyTBM1AXnlghCSjkoQ3X g0pce1MgdJGOTcfCXUAGmtn93JuwmWFUzr8BijLidHIrlJGcIXNm7mkxQaUajA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675797492; 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=RMUC9M79un+5ACqoysyR2opn6rXmz05+ciY6QbAYhRk=; b=L0bqDor4eaT+i49Jz94IIJGGielYm0JvzSTaRpQaURoVmyhIFnmy40aJiA5MFvk9olwZ6o g998P2MCiYfo8OXSgvGcvNpzE3H2qqFkTsAOBw6ruSZo74ib0sR4u7vD/0fp+whPPPWP4/ p5g/qPJ671vLRFegE64RJCdLAQBk7T+K1Uuvg+zMF1v+fmi7pNBuJRTTI+cTHvpFoE6Lts CvveKJq+OXXi/9Fdne1KKBLwuYP0eIuL7eJdfL6LiI3j0xI8v/BGtifh0qpJCeOGY+S5r/ g7ApIc21uSc6vySAkP2KsJUeJWAAVd68ox7DgwlvDV2S+5V7lYWC8Y/LFE4AxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675797492; a=rsa-sha256; cv=none; b=vrrqeNeTbcnt0jS7drOeGUm5wIqvVvfk5fcLotWaTk6QtUXpy9oGpDGSKDv3few3ugMasQ Xl9onX2W3T/yHhAJ3DjhFcoFYQM6ewwPrQsZt8orpK9dNgFlwmS6jJoJx9wyCCuip50UCM XzS5rAadFUSi/U9m/frTIZ9XjcAqWvqmJB4E4cZFaOBTRAzXj7bHxiY8gUR2q1hzzqgYWa UMN3n4tJZ6cNc9Q5IEFOxfzQcvb0/eqWhsmLWOrWMBo134/fjcvP6eVrw23p0LBqjGU6ss b/WMqiUc5dHhvMpaOoQ6N6WZunIte2EteuP9zrTG1VGwTR1wcV5RUkI/viWQfA== 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 4PBCZr0XmQzSdk; Tue, 7 Feb 2023 19:18:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 317JIC1P049813; Tue, 7 Feb 2023 19:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 317JIC15049812; Tue, 7 Feb 2023 19:18:12 GMT (envelope-from git) Date: Tue, 7 Feb 2023 19:18:12 GMT Message-Id: <202302071918.317JIC15049812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: b9545c579415 - main - Mechanically convert vnic to IfAPI 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9545c57941598857677c31b90c707123d8f4976 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=b9545c57941598857677c31b90c707123d8f4976 commit b9545c57941598857677c31b90c707123d8f4976 Author: Justin Hibbits AuthorDate: 2022-08-17 20:42:35 +0000 Commit: Justin Hibbits CommitDate: 2023-02-07 19:16:17 +0000 Mechanically convert vnic to IfAPI Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37827 --- sys/dev/vnic/nic.h | 2 +- sys/dev/vnic/nicvf_main.c | 30 +++++++++++++++--------------- sys/dev/vnic/nicvf_queues.c | 10 +++++----- sys/dev/vnic/thunder_mdio.c | 8 ++++---- sys/dev/vnic/thunder_mdio_fdt.c | 3 +++ sys/dev/vnic/thunder_mdio_var.h | 2 +- 6 files changed, 29 insertions(+), 26 deletions(-) diff --git a/sys/dev/vnic/nic.h b/sys/dev/vnic/nic.h index dba91af666d6..2dcaffe1628c 100644 --- a/sys/dev/vnic/nic.h +++ b/sys/dev/vnic/nic.h @@ -292,7 +292,7 @@ struct nicvf { struct nicvf *pnicvf; device_t dev; - struct ifnet * ifp; + if_t ifp; struct sx core_sx; struct ifmedia if_media; uint32_t if_flags; diff --git a/sys/dev/vnic/nicvf_main.c b/sys/dev/vnic/nicvf_main.c index 54efc58fee22..b135c745b902 100644 --- a/sys/dev/vnic/nicvf_main.c +++ b/sys/dev/vnic/nicvf_main.c @@ -147,17 +147,17 @@ static int nicvf_setup_ifnet(struct nicvf *); static int nicvf_setup_ifmedia(struct nicvf *); static void nicvf_hw_addr_random(uint8_t *); -static int nicvf_if_ioctl(struct ifnet *, u_long, caddr_t); +static int nicvf_if_ioctl(if_t, u_long, caddr_t); static void nicvf_if_init(void *); static void nicvf_if_init_locked(struct nicvf *); -static int nicvf_if_transmit(struct ifnet *, struct mbuf *); -static void nicvf_if_qflush(struct ifnet *); -static uint64_t nicvf_if_getcounter(struct ifnet *, ift_counter); +static int nicvf_if_transmit(if_t, struct mbuf *); +static void nicvf_if_qflush(if_t); +static uint64_t nicvf_if_getcounter(if_t, ift_counter); static int nicvf_stop_locked(struct nicvf *); -static void nicvf_media_status(struct ifnet *, struct ifmediareq *); -static int nicvf_media_change(struct ifnet *); +static void nicvf_media_status(if_t, struct ifmediareq *); +static int nicvf_media_change(if_t); static void nicvf_tick_stats(void *); @@ -336,7 +336,7 @@ nicvf_hw_addr_random(uint8_t *hwaddr) static int nicvf_setup_ifnet(struct nicvf *nic) { - struct ifnet *ifp; + if_t ifp; ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { @@ -418,7 +418,7 @@ nicvf_setup_ifmedia(struct nicvf *nic) } static int -nicvf_if_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +nicvf_if_ioctl(if_t ifp, u_long cmd, caddr_t data) { struct nicvf *nic; struct rcv_queue *rq; @@ -571,7 +571,7 @@ static void nicvf_if_init_locked(struct nicvf *nic) { struct queue_set *qs = nic->qs; - struct ifnet *ifp; + if_t ifp; int qidx; int err; caddr_t if_addr; @@ -643,7 +643,7 @@ nicvf_if_init(void *if_softc) } static int -nicvf_if_transmit(struct ifnet *ifp, struct mbuf *mbuf) +nicvf_if_transmit(if_t ifp, struct mbuf *mbuf) { struct nicvf *nic = if_getsoftc(ifp); struct queue_set *qs = nic->qs; @@ -699,7 +699,7 @@ nicvf_if_transmit(struct ifnet *ifp, struct mbuf *mbuf) } static void -nicvf_if_qflush(struct ifnet *ifp) +nicvf_if_qflush(if_t ifp) { struct nicvf *nic; struct queue_set *qs; @@ -721,7 +721,7 @@ nicvf_if_qflush(struct ifnet *ifp) } static uint64_t -nicvf_if_getcounter(struct ifnet *ifp, ift_counter cnt) +nicvf_if_getcounter(if_t ifp, ift_counter cnt) { struct nicvf *nic; struct nicvf_hw_stats *hw_stats; @@ -755,7 +755,7 @@ nicvf_if_getcounter(struct ifnet *ifp, ift_counter cnt) } static void -nicvf_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +nicvf_media_status(if_t ifp, struct ifmediareq *ifmr) { struct nicvf *nic = if_getsoftc(ifp); @@ -799,7 +799,7 @@ nicvf_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) } static int -nicvf_media_change(struct ifnet *ifp __unused) +nicvf_media_change(if_t ifp __unused) { return (0); @@ -1523,7 +1523,7 @@ error: static int nicvf_stop_locked(struct nicvf *nic) { - struct ifnet *ifp; + if_t ifp; int qidx; struct queue_set *qs = nic->qs; union nic_mbx mbx = {}; diff --git a/sys/dev/vnic/nicvf_queues.c b/sys/dev/vnic/nicvf_queues.c index d2a6f8532b37..017d1c6e3e1c 100644 --- a/sys/dev/vnic/nicvf_queues.c +++ b/sys/dev/vnic/nicvf_queues.c @@ -732,7 +732,7 @@ static int nicvf_cq_intr_handler(struct nicvf *nic, uint8_t cq_idx) { struct mbuf *mbuf; - struct ifnet *ifp; + if_t ifp; int processed_cqe, tx_done = 0; #ifdef DEBUG int work_done = 0; @@ -831,7 +831,7 @@ out: while (!buf_ring_empty(cq->rx_br)) { mbuf = buf_ring_dequeue_mc(cq->rx_br); if (__predict_true(mbuf != NULL)) - (*ifp->if_input)(ifp, mbuf); + if_input(ifp, mbuf); } return (cmp_err); @@ -987,7 +987,7 @@ int nicvf_xmit_locked(struct snd_queue *sq) { struct nicvf *nic; - struct ifnet *ifp; + if_t ifp; struct mbuf *next; int err; @@ -1020,7 +1020,7 @@ nicvf_snd_task(void *arg, int pending) { struct snd_queue *sq = (struct snd_queue *)arg; struct nicvf *nic; - struct ifnet *ifp; + if_t ifp; int err; nic = sq->nic; @@ -1296,7 +1296,7 @@ nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs, union nic_mbx mbx = {}; struct rcv_queue *rq; struct rq_cfg rq_cfg; - struct ifnet *ifp; + if_t ifp; struct lro_ctrl *lro; ifp = nic->ifp; diff --git a/sys/dev/vnic/thunder_mdio.c b/sys/dev/vnic/thunder_mdio.c index d07b17b56a2e..3e9a8f74e673 100644 --- a/sys/dev/vnic/thunder_mdio.c +++ b/sys/dev/vnic/thunder_mdio.c @@ -93,8 +93,8 @@ static int thunder_mdio_detach(device_t); static int thunder_mdio_read(device_t, int, int); static int thunder_mdio_write(device_t, int, int, int); -static int thunder_ifmedia_change_stub(struct ifnet *); -static void thunder_ifmedia_status_stub(struct ifnet *, struct ifmediareq *); +static int thunder_ifmedia_change_stub(if_t); +static void thunder_ifmedia_status_stub(if_t, struct ifmediareq *); static int thunder_mdio_media_status(device_t, int, int *, int *, int *); static int thunder_mdio_media_change(device_t, int, int, int, int); @@ -351,14 +351,14 @@ thunder_mdio_write(device_t dev, int phy, int reg, int data) } static int -thunder_ifmedia_change_stub(struct ifnet *ifp __unused) +thunder_ifmedia_change_stub(if_t ifp __unused) { /* Will never be called by if_media */ return (0); } static void -thunder_ifmedia_status_stub(struct ifnet *ifp __unused, struct ifmediareq +thunder_ifmedia_status_stub(if_t ifp __unused, struct ifmediareq *ifmr __unused) { /* Will never be called by if_media */ diff --git a/sys/dev/vnic/thunder_mdio_fdt.c b/sys/dev/vnic/thunder_mdio_fdt.c index fd3905453008..d6d46b04a17f 100644 --- a/sys/dev/vnic/thunder_mdio_fdt.c +++ b/sys/dev/vnic/thunder_mdio_fdt.c @@ -34,11 +34,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include + #include #include diff --git a/sys/dev/vnic/thunder_mdio_var.h b/sys/dev/vnic/thunder_mdio_var.h index acebec0dbcc0..c66c5e9683df 100644 --- a/sys/dev/vnic/thunder_mdio_var.h +++ b/sys/dev/vnic/thunder_mdio_var.h @@ -44,7 +44,7 @@ enum thunder_mdio_mode { struct phy_desc { device_t miibus; /* One miibus per LMAC */ - struct ifnet * ifp; /* Fake ifp to satisfy miibus */ + if_t ifp; /* Fake ifp to satisfy miibus */ int lmacid; /* ID number of LMAC connected */ TAILQ_ENTRY(phy_desc) phy_desc_list; };