git: d8096b2df282 - main - Mechanically convert iavf(4) to IfAPI
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Jan 2023 20:48:19 UTC
The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=d8096b2df282d7a50e56eddba523bcdda1676106 commit d8096b2df282d7a50e56eddba523bcdda1676106 Author: Justin Hibbits <jhibbits@FreeBSD.org> AuthorDate: 2022-08-19 15:55:36 +0000 Commit: Justin Hibbits <jhibbits@FreeBSD.org> CommitDate: 2023-01-24 19:36:29 +0000 Mechanically convert iavf(4) to IfAPI Reviewed by: erj Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37858 --- sys/dev/iavf/iavf_iflib.h | 2 +- sys/dev/iavf/iavf_lib.c | 6 +++--- sys/dev/iavf/iavf_lib.h | 4 ++-- sys/dev/iavf/if_iavf_iflib.c | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/iavf/iavf_iflib.h b/sys/dev/iavf/iavf_iflib.h index 33d5243496c8..f670cb901ba4 100644 --- a/sys/dev/iavf/iavf_iflib.h +++ b/sys/dev/iavf/iavf_iflib.h @@ -238,7 +238,7 @@ struct iavf_rx_queue { struct iavf_vsi { if_ctx_t ctx; if_softc_ctx_t shared; - struct ifnet *ifp; + if_t ifp; struct iavf_sc *back; device_t dev; struct iavf_hw *hw; diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index 9b4ec425f1a9..61de2a438c12 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -968,7 +968,7 @@ iavf_media_status_common(struct iavf_sc *sc, struct ifmediareq *ifmr) * @returns ENODEV because changing the media and speed is not supported. */ int -iavf_media_change_common(struct ifnet *ifp) +iavf_media_change_common(if_t ifp) { if_printf(ifp, "Changing speed is not supported\n"); @@ -984,7 +984,7 @@ iavf_media_change_common(struct ifnet *ifp) * reports speed to us over the virtchnl interface. */ void -iavf_set_initial_baudrate(struct ifnet *ifp) +iavf_set_initial_baudrate(if_t ifp) { #if __FreeBSD_version >= 1100000 if_setbaudrate(ifp, IF_Gbps(40)); @@ -1210,7 +1210,7 @@ iavf_config_rss(struct iavf_sc *sc) int iavf_config_promisc(struct iavf_sc *sc, int flags) { - struct ifnet *ifp = sc->vsi.ifp; + if_t ifp = sc->vsi.ifp; sc->promisc_flags = 0; diff --git a/sys/dev/iavf/iavf_lib.h b/sys/dev/iavf/iavf_lib.h index b57299a4eaa6..d0e1d6e53c2d 100644 --- a/sys/dev/iavf/iavf_lib.h +++ b/sys/dev/iavf/iavf_lib.h @@ -487,8 +487,8 @@ void iavf_add_sysctls_eth_stats(struct sysctl_ctx_list *ctx, struct sysctl_oid_list *child, struct iavf_eth_stats *eth_stats); void iavf_media_status_common(struct iavf_sc *sc, struct ifmediareq *ifmr); -int iavf_media_change_common(struct ifnet *ifp); -void iavf_set_initial_baudrate(struct ifnet *ifp); +int iavf_media_change_common(if_t ifp); +void iavf_set_initial_baudrate(if_t ifp); u64 iavf_max_vc_speed_to_value(u8 link_speeds); void iavf_config_rss_reg(struct iavf_sc *sc); void iavf_config_rss_pf(struct iavf_sc *sc); diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index 848ad682ef0b..71d14ca7b701 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -761,7 +761,7 @@ iavf_if_init(if_ctx_t ctx) /* Make sure queues are disabled */ iavf_disable_queues_with_retries(sc); - bcopy(IF_LLADDR(ifp), tmpaddr, ETHER_ADDR_LEN); + bcopy(if_getlladdr(ifp), tmpaddr, ETHER_ADDR_LEN); if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && (iavf_validate_mac_addr(tmpaddr) == IAVF_SUCCESS)) { error = iavf_del_mac_filter(sc, hw->mac.addr); @@ -1540,12 +1540,12 @@ iavf_setup_interface(struct iavf_sc *sc) { struct iavf_vsi *vsi = &sc->vsi; if_ctx_t ctx = vsi->ctx; - struct ifnet *ifp = iflib_get_ifp(ctx); + if_t ifp = iflib_get_ifp(ctx); iavf_dbg_init(sc, "begin\n"); vsi->shared->isc_max_frame_size = - ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; iavf_set_initial_baudrate(ifp);