-/* $OpenBSD: if_cpsw.c,v 1.52 2021/10/24 17:52:27 mpi Exp $ */
+/* $OpenBSD: if_cpsw.c,v 1.53 2023/11/10 15:51:19 bluhm Exp $ */
/* $NetBSD: if_cpsw.c,v 1.3 2013/04/17 14:36:34 bouyer Exp $ */
/*
ifp->if_start = cpsw_start;
ifp->if_ioctl = cpsw_ioctl;
ifp->if_watchdog = cpsw_watchdog;
- ifq_set_maxlen(&ifp->if_snd, CPSW_NTXDESCS - 1);
+ ifq_init_maxlen(&ifp->if_snd, CPSW_NTXDESCS - 1);
memcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
cpsw_stop(ifp);
-/* $OpenBSD: sxie.c,v 1.33 2021/10/24 17:52:28 mpi Exp $ */
+/* $OpenBSD: sxie.c,v 1.34 2023/11/10 15:51:19 bluhm Exp $ */
/*
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
* Copyright (c) 2013 Artturi Alm
ifp->if_watchdog = sxie_watchdog;
ifp->if_capabilities = IFCAP_VLAN_MTU; /* XXX status check in recv? */
- ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, IFQ_MAXLEN);
/* Initialize MII/media info. */
mii = &sc->sc_mii;
-/* $OpenBSD: if_cnmac.c,v 1.84 2022/12/28 01:39:21 yasuoka Exp $ */
+/* $OpenBSD: if_cnmac.c,v 1.85 2023/11/10 15:51:19 bluhm Exp $ */
/*
* Copyright (c) 2007 Internet Initiative Japan, Inc.
ifp->if_qstart = cnmac_start;
ifp->if_watchdog = cnmac_watchdog;
ifp->if_hardmtu = CNMAC_MAX_MTU;
- ifq_set_maxlen(&ifp->if_snd, max(GATHER_QUEUE_SIZE, IFQ_MAXLEN));
+ ifq_init_maxlen(&ifp->if_snd, max(GATHER_QUEUE_SIZE, IFQ_MAXLEN));
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_TCPv4 |
IFCAP_CSUM_UDPv4 | IFCAP_CSUM_TCPv6 | IFCAP_CSUM_UDPv6;
-/* $OpenBSD: if_dwge.c,v 1.19 2023/08/15 08:27:30 miod Exp $ */
+/* $OpenBSD: if_dwge.c,v 1.20 2023/11/10 15:51:19 bluhm Exp $ */
/*
* Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
ifp->if_ioctl = dwge_ioctl;
ifp->if_qstart = dwge_start;
ifp->if_watchdog = dwge_watchdog;
- ifq_set_maxlen(&ifp->if_snd, DWGE_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, DWGE_NTXDESC - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_dwxe.c,v 1.22 2023/08/15 08:27:30 miod Exp $ */
+/* $OpenBSD: if_dwxe.c,v 1.23 2023/11/10 15:51:19 bluhm Exp $ */
/*
* Copyright (c) 2008 Mark Kettenis
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
ifp->if_ioctl = dwxe_ioctl;
ifp->if_qstart = dwxe_start;
ifp->if_watchdog = dwxe_watchdog;
- ifq_set_maxlen(&ifp->if_snd, DWXE_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, DWXE_NTXDESC - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_mvneta.c,v 1.30 2023/04/13 02:19:05 jsg Exp $ */
+/* $OpenBSD: if_mvneta.c,v 1.31 2023/11/10 15:51:19 bluhm Exp $ */
/* $NetBSD: if_mvneta.c,v 1.41 2015/04/15 10:15:40 hsuenaga Exp $ */
/*
* Copyright (c) 2007, 2008, 2013 KIYOHARA Takashi
ifp->if_capabilities &= ~IFCAP_CSUM_TCPv4;
#endif
- ifq_set_maxlen(&ifp->if_snd, max(MVNETA_TX_RING_CNT - 1, IFQ_MAXLEN));
+ ifq_init_maxlen(&ifp->if_snd, max(MVNETA_TX_RING_CNT - 1, IFQ_MAXLEN));
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, sizeof(ifp->if_xname));
/*
-/* $OpenBSD: if_mvpp.c,v 1.50 2023/04/08 05:38:25 jsg Exp $ */
+/* $OpenBSD: if_mvpp.c,v 1.51 2023/11/10 15:51:19 bluhm Exp $ */
/*
* Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2017, 2020 Patrick Wildt <patrick@blueri.se>
ifp->if_ioctl = mvpp2_ioctl;
ifp->if_start = mvpp2_start;
ifp->if_watchdog = mvpp2_watchdog;
- ifq_set_maxlen(&ifp->if_snd, MVPP2_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, MVPP2_NTXDESC - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: acx.c,v 1.127 2022/04/21 21:03:02 stsp Exp $ */
+/* $OpenBSD: acx.c,v 1.128 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2006 Jonathan Gray <jsg@openbsd.org>
ifp->if_watchdog = acx_watchdog;
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, IFQ_MAXLEN);
/* Set channels */
for (i = 1; i <= 14; ++i) {
-/* $OpenBSD: aic6915.c,v 1.24 2022/01/09 05:42:38 jsg Exp $ */
+/* $OpenBSD: aic6915.c,v 1.25 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: aic6915.c,v 1.15 2005/12/24 20:27:29 perry Exp $ */
/*-
ifp->if_ioctl = sf_ioctl;
ifp->if_start = sf_start;
ifp->if_watchdog = sf_watchdog;
- ifq_set_maxlen(&ifp->if_snd, SF_NTXDESC_MASK);
+ ifq_init_maxlen(&ifp->if_snd, SF_NTXDESC_MASK);
/*
* Attach the interface.
-/* $OpenBSD: ath.c,v 1.124 2023/03/26 08:45:27 jsg Exp $ */
+/* $OpenBSD: ath.c,v 1.125 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: ath.c,v 1.37 2004/08/18 21:59:39 dyoung Exp $ */
/*-
ifp->if_start = ath_start;
ifp->if_watchdog = ath_watchdog;
ifp->if_ioctl = ath_ioctl;
- ifq_set_maxlen(&ifp->if_snd, ATH_TXBUF * ATH_TXDESC);
+ ifq_init_maxlen(&ifp->if_snd, ATH_TXBUF * ATH_TXDESC);
ic->ic_softc = sc;
ic->ic_newassoc = ath_newassoc;
-/* $OpenBSD: bcmgenet.c,v 1.6 2022/05/02 06:30:45 anton Exp $ */
+/* $OpenBSD: bcmgenet.c,v 1.7 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: bcmgenet.c,v 1.3 2020/02/27 17:30:07 jmcneill Exp $ */
/*-
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_start = genet_start;
ifp->if_ioctl = genet_ioctl;
- ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, IFQ_MAXLEN);
/* 802.1Q VLAN-sized frames are supported */
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: bwi.c,v 1.133 2022/04/21 21:03:02 stsp Exp $ */
+/* $OpenBSD: bwi.c,v 1.134 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
ifp->if_watchdog = bwi_watchdog;
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, IFQ_MAXLEN);
/* Get locale */
sc->sc_locale = __SHIFTOUT(bwi_read_sprom(sc, BWI_SPROM_CARD_INFO),
-/* $OpenBSD: dc.c,v 1.155 2022/02/22 01:15:01 guenther Exp $ */
+/* $OpenBSD: dc.c,v 1.156 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
ifp->if_ioctl = dc_ioctl;
ifp->if_start = dc_start;
ifp->if_watchdog = dc_watchdog;
- ifq_set_maxlen(&ifp->if_snd, DC_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, DC_TX_LIST_CNT - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: dwqe.c,v 1.14 2023/10/11 12:52:00 stsp Exp $ */
+/* $OpenBSD: dwqe.c,v 1.15 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org>
* Copyright (c) 2017, 2022 Patrick Wildt <patrick@blueri.se>
ifp->if_ioctl = dwqe_ioctl;
ifp->if_qstart = dwqe_start;
ifp->if_watchdog = dwqe_watchdog;
- ifq_set_maxlen(&ifp->if_snd, DWQE_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, DWQE_NTXDESC - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: elink3.c,v 1.100 2023/09/11 08:41:26 mvs Exp $ */
+/* $OpenBSD: elink3.c,v 1.101 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */
/*
ifp->if_flags =
IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
/* 64 packets are around 100ms on 10Mbps */
- ifq_set_maxlen(&ifp->if_snd, 64);
+ ifq_init_maxlen(&ifp->if_snd, 64);
if_attach(ifp);
ether_ifattach(ifp);
-/* $OpenBSD: fxp.c,v 1.132 2020/07/10 13:26:37 patrick Exp $ */
+/* $OpenBSD: fxp.c,v 1.133 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
ifp->if_ioctl = fxp_ioctl;
ifp->if_start = fxp_start;
ifp->if_watchdog = fxp_watchdog;
- ifq_set_maxlen(&ifp->if_snd, FXP_NTXCB - 1);
+ ifq_init_maxlen(&ifp->if_snd, FXP_NTXCB - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: gem.c,v 1.127 2022/07/12 22:08:17 bluhm Exp $ */
+/* $OpenBSD: gem.c,v 1.128 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: gem.c,v 1.1 2001/09/16 00:11:43 eeh Exp $ */
/*
ifp->if_qstart = gem_start;
ifp->if_ioctl = gem_ioctl;
ifp->if_watchdog = gem_watchdog;
- ifq_set_maxlen(&ifp->if_snd, GEM_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, GEM_NTXDESC - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: malo.c,v 1.124 2023/04/11 00:45:08 jsg Exp $ */
+/* $OpenBSD: malo.c,v 1.125 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
ifp->if_watchdog = malo_watchdog;
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, IFQ_MAXLEN);
/* set supported rates */
ic->ic_sup_rates[IEEE80211_MODE_11B] = ieee80211_std_rateset_11b;
-/* $OpenBSD: pgt.c,v 1.103 2022/04/21 21:03:02 stsp Exp $ */
+/* $OpenBSD: pgt.c,v 1.104 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST;
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, IFQ_MAXLEN);
/*
* Set channels
-/* $OpenBSD: re.c,v 1.215 2022/11/17 01:30:57 dlg Exp $ */
+/* $OpenBSD: re.c,v 1.216 2023/11/10 15:51:20 bluhm Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
ifp->if_qstart = re_start;
ifp->if_watchdog = re_watchdog;
ifp->if_hardmtu = sc->rl_max_mtu;
- ifq_set_maxlen(&ifp->if_snd, sc->rl_ldata.rl_tx_desc_cnt);
+ ifq_init_maxlen(&ifp->if_snd, sc->rl_ldata.rl_tx_desc_cnt);
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_TCPv4 |
IFCAP_CSUM_UDPv4;
-/* $OpenBSD: smc83c170.c,v 1.30 2022/01/09 05:42:42 jsg Exp $ */
+/* $OpenBSD: smc83c170.c,v 1.31 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: smc83c170.c,v 1.59 2005/02/27 00:27:02 perry Exp $ */
/*-
ifp->if_ioctl = epic_ioctl;
ifp->if_start = epic_start;
ifp->if_watchdog = epic_watchdog;
- ifq_set_maxlen(&ifp->if_snd, EPIC_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, EPIC_NTXDESC - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: ti.c,v 1.29 2022/01/09 05:42:42 jsg Exp $ */
+/* $OpenBSD: ti.c,v 1.30 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
ifp->if_start = ti_start;
ifp->if_watchdog = ti_watchdog;
ifp->if_hardmtu = TI_JUMBO_FRAMELEN - ETHER_HDR_LEN;
- ifq_set_maxlen(&ifp->if_snd, TI_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, TI_TX_RING_CNT - 1);
bcopy(sc->sc_dv.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: xl.c,v 1.138 2022/02/22 01:15:01 guenther Exp $ */
+/* $OpenBSD: xl.c,v 1.139 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
ifp->if_start = xl_start;
ifp->if_watchdog = xl_watchdog;
ifp->if_baudrate = 10000000;
- ifq_set_maxlen(&ifp->if_snd, XL_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, XL_TX_LIST_CNT - 1);
memcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_age.c,v 1.38 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_age.c,v 1.39 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
ifp->if_ioctl = age_ioctl;
ifp->if_start = age_start;
ifp->if_watchdog = age_watchdog;
- ifq_set_maxlen(&ifp->if_snd, AGE_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, AGE_TX_RING_CNT - 1);
bcopy(sc->age_eaddr, sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_alc.c,v 1.56 2022/05/19 00:52:37 kevlo Exp $ */
+/* $OpenBSD: if_alc.c,v 1.57 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Copyright (c) 2009, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
ifp->if_ioctl = alc_ioctl;
ifp->if_start = alc_start;
ifp->if_watchdog = alc_watchdog;
- ifq_set_maxlen(&ifp->if_snd, ALC_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, ALC_TX_RING_CNT - 1);
bcopy(sc->alc_eaddr, sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_ale.c,v 1.49 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_ale.c,v 1.50 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
ifp->if_ioctl = ale_ioctl;
ifp->if_start = ale_start;
ifp->if_watchdog = ale_watchdog;
- ifq_set_maxlen(&ifp->if_snd, ALE_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, ALE_TX_RING_CNT - 1);
bcopy(sc->ale_eaddr, sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_aq_pci.c,v 1.25 2023/10/01 09:03:14 kettenis Exp $ */
+/* $OpenBSD: if_aq_pci.c,v 1.26 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: if_aq.c,v 1.27 2021/06/16 00:21:18 riastradh Exp $ */
/*
#if NVLAN > 0
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
#endif
- ifq_set_maxlen(&ifp->if_snd, AQ_TXD_NUM);
+ ifq_init_maxlen(&ifp->if_snd, AQ_TXD_NUM);
ifmedia_init(&sc->sc_media, IFM_IMASK, aq_ifmedia_change,
aq_ifmedia_status);
-/* $OpenBSD: if_bge.c,v 1.401 2023/07/04 10:22:39 jmatthew Exp $ */
+/* $OpenBSD: if_bge.c,v 1.402 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
ifp->if_ioctl = bge_ioctl;
ifp->if_qstart = bge_start;
ifp->if_watchdog = bge_watchdog;
- ifq_set_maxlen(&ifp->if_snd, BGE_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, BGE_TX_RING_CNT - 1);
DPRINTFN(5, ("bcopy\n"));
bcopy(sc->bge_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_bnx.c,v 1.132 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_bnx.c,v 1.133 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Copyright (c) 2006 Broadcom Corporation
ifp->if_watchdog = bnx_watchdog;
ifp->if_hardmtu = BNX_MAX_JUMBO_ETHER_MTU_VLAN -
sizeof(struct ether_header);
- ifq_set_maxlen(&ifp->if_snd, USABLE_TX_BD - 1);
+ ifq_init_maxlen(&ifp->if_snd, USABLE_TX_BD - 1);
bcopy(sc->eaddr, sc->arpcom.ac_enaddr, ETHER_ADDR_LEN);
bcopy(sc->bnx_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_bnxt.c,v 1.38 2023/03/22 17:01:07 denis Exp $ */
+/* $OpenBSD: if_bnxt.c,v 1.39 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Broadcom NetXtreme-C/E network driver.
*
#if NVLAN > 0
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
#endif
- ifq_set_maxlen(&ifp->if_snd, 1024); /* ? */
+ ifq_init_maxlen(&ifp->if_snd, 1024); /* ? */
ifmedia_init(&sc->sc_media, IFM_IMASK, bnxt_media_change,
bnxt_media_status);
-/* $OpenBSD: if_cas.c,v 1.54 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_cas.c,v 1.55 2023/11/10 15:51:20 bluhm Exp $ */
/*
*
ifp->if_start = cas_start;
ifp->if_ioctl = cas_ioctl;
ifp->if_watchdog = cas_watchdog;
- ifq_set_maxlen(&ifp->if_snd, CAS_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, CAS_NTXDESC - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
***************************************************************************/
-/* $OpenBSD: if_em.c,v 1.366 2023/09/05 13:06:42 naddy Exp $ */
+/* $OpenBSD: if_em.c,v 1.367 2023/11/10 15:51:20 bluhm Exp $ */
/* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */
#include <dev/pci/if_em.h>
ifp->if_watchdog = em_watchdog;
ifp->if_hardmtu =
sc->hw.max_frame_size - ETHER_HDR_LEN - ETHER_CRC_LEN;
- ifq_set_maxlen(&ifp->if_snd, sc->sc_tx_slots - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->sc_tx_slots - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_et.c,v 1.42 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_et.c,v 1.43 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2007 The DragonFly Project. All rights reserved.
*
ifp->if_ioctl = et_ioctl;
ifp->if_start = et_start;
ifp->if_watchdog = et_watchdog;
- ifq_set_maxlen(&ifp->if_snd, ET_TX_NDESC);
+ ifq_init_maxlen(&ifp->if_snd, ET_TX_NDESC);
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_iavf.c,v 1.11 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_iavf.c,v 1.12 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
if (ifp->if_hardmtu == 0)
ifp->if_hardmtu = IAVF_HARDMTU;
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, sc->sc_tx_ring_ndescs);
+ ifq_init_maxlen(&ifp->if_snd, sc->sc_tx_ring_ndescs);
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
#if 0
-/* $OpenBSD: if_igc.c,v 1.13 2023/04/28 10:18:57 bluhm Exp $ */
+/* $OpenBSD: if_igc.c,v 1.14 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
ifp->if_watchdog = igc_watchdog;
ifp->if_hardmtu = sc->hw.mac.max_frame_size - ETHER_HDR_LEN -
ETHER_CRC_LEN;
- ifq_set_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_ix.c,v 1.205 2023/10/20 07:31:12 jan Exp $ */
+/* $OpenBSD: if_ix.c,v 1.206 2023/11/10 15:51:20 bluhm Exp $ */
/******************************************************************************
ifp->if_watchdog = ixgbe_watchdog;
ifp->if_hardmtu = IXGBE_MAX_FRAME_SIZE -
ETHER_HDR_LEN - ETHER_CRC_LEN;
- ifq_set_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
***************************************************************************/
-/* $OpenBSD: if_ixgb.c,v 1.75 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_ixgb.c,v 1.76 2023/11/10 15:51:20 bluhm Exp $ */
#include <dev/pci/if_ixgb.h>
ifp->if_watchdog = ixgb_watchdog;
ifp->if_hardmtu =
IXGB_MAX_JUMBO_FRAME_SIZE - ETHER_HDR_LEN - ETHER_CRC_LEN;
- ifq_set_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_ixl.c,v 1.92 2023/10/20 13:21:15 jan Exp $ */
+/* $OpenBSD: if_ixl.c,v 1.93 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2013-2015, Intel Corporation
ifp->if_watchdog = ixl_watchdog;
ifp->if_hardmtu = IXL_HARDMTU;
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, sc->sc_tx_ring_ndescs);
+ ifq_init_maxlen(&ifp->if_snd, sc->sc_tx_ring_ndescs);
ifp->if_capabilities = IFCAP_VLAN_HWTAGGING;
ifp->if_capabilities |= IFCAP_CSUM_IPv4 |
-/* $OpenBSD: if_jme.c,v 1.56 2022/03/11 18:00:45 mpi Exp $ */
+/* $OpenBSD: if_jme.c,v 1.57 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
ifp->if_ioctl = jme_ioctl;
ifp->if_start = jme_start;
ifp->if_watchdog = jme_watchdog;
- ifq_set_maxlen(&ifp->if_snd, JME_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, JME_TX_RING_CNT - 1);
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 |
-/* $OpenBSD: if_lge.c,v 1.79 2022/10/09 02:32:02 kevlo Exp $ */
+/* $OpenBSD: if_lge.c,v 1.80 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
ifp->if_start = lge_start;
ifp->if_watchdog = lge_watchdog;
ifp->if_hardmtu = LGE_JUMBO_MTU;
- ifq_set_maxlen(&ifp->if_snd, LGE_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, LGE_TX_LIST_CNT - 1);
DPRINTFN(5, ("bcopy\n"));
bcopy(sc->sc_dv.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_mcx.c,v 1.110 2023/09/18 06:47:21 jmatthew Exp $ */
+/* $OpenBSD: if_mcx.c,v 1.111 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2017 David Gwynne <dlg@openbsd.org>
#if NVLAN > 0
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
#endif
- ifq_set_maxlen(&ifp->if_snd, 1024);
+ ifq_init_maxlen(&ifp->if_snd, 1024);
ifmedia_init(&sc->sc_media, IFM_IMASK, mcx_media_change,
mcx_media_status);
-/* $OpenBSD: if_msk.c,v 1.142 2022/03/11 18:00:46 mpi Exp $ */
+/* $OpenBSD: if_msk.c,v 1.143 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
if (sc->sk_type != SK_YUKON_FE &&
sc->sk_type != SK_YUKON_FE_P)
ifp->if_hardmtu = SK_JUMBO_MTU;
- ifq_set_maxlen(&ifp->if_snd, MSK_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, MSK_TX_RING_CNT - 1);
bcopy(sc_if->sk_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_myx.c,v 1.118 2023/07/14 07:07:08 claudio Exp $ */
+/* $OpenBSD: if_myx.c,v 1.119 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@openbsd.org>
ifp->if_watchdog = myx_watchdog;
ifp->if_hardmtu = MYX_RXBIG_SIZE;
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, 1);
+ ifq_init_maxlen(&ifp->if_snd, 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
#if 0
sc->sc_tx_ring_count = r / sizeof(struct myx_tx_desc);
sc->sc_tx_nsegs = min(16, sc->sc_tx_ring_count / 4); /* magic */
sc->sc_tx_count = 0;
- ifq_set_maxlen(&ifp->if_snd, sc->sc_tx_ring_count - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->sc_tx_ring_count - 1);
/* Allocate Interrupt Queue */
-/* $OpenBSD: if_nfe.c,v 1.124 2022/03/11 18:00:48 mpi Exp $ */
+/* $OpenBSD: if_nfe.c,v 1.125 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Copyright (c) 2006, 2007 Damien Bergamini <damien.bergamini@free.fr>
ifp->if_ioctl = nfe_ioctl;
ifp->if_start = nfe_start;
ifp->if_watchdog = nfe_watchdog;
- ifq_set_maxlen(&ifp->if_snd, NFE_IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, NFE_IFQ_MAXLEN);
strlcpy(ifp->if_xname, sc->sc_dev.dv_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_ngbe.c,v 1.1 2023/03/31 08:19:41 kevlo Exp $ */
+/* $OpenBSD: if_ngbe.c,v 1.2 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2015-2017 Beijing WangXun Technology Co., Ltd.
ifp->if_watchdog = ngbe_watchdog;
ifp->if_hardmtu = NGBE_MAX_JUMBO_FRAME_SIZE - ETHER_HDR_LEN -
ETHER_CRC_LEN;
- ifq_set_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->num_tx_desc - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_nge.c,v 1.97 2022/10/09 02:32:02 kevlo Exp $ */
+/* $OpenBSD: if_nge.c,v 1.98 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
* Copyright (c) 1997, 1998, 1999, 2000, 2001
ifp->if_start = nge_start;
ifp->if_watchdog = nge_watchdog;
ifp->if_hardmtu = NGE_JUMBO_MTU;
- ifq_set_maxlen(&ifp->if_snd, NGE_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, NGE_TX_LIST_CNT - 1);
DPRINTFN(5, ("%s: bcopy\n", sc->sc_dv.dv_xname));
bcopy(sc->sc_dv.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_nxe.c,v 1.79 2022/03/11 18:00:48 mpi Exp $ */
+/* $OpenBSD: if_nxe.c,v 1.80 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
ifp->if_watchdog = nxe_watchdog;
ifp->if_hardmtu = MCLBYTES - ETHER_HDR_LEN - ETHER_CRC_LEN;
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, 512); /* XXX */
+ ifq_init_maxlen(&ifp->if_snd, 512); /* XXX */
ifmedia_init(&sc->sc_media, 0, nxe_media_change, nxe_media_status);
ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_AUTO, 0, NULL);
-/* $OpenBSD: if_oce.c,v 1.107 2023/04/28 10:18:58 bluhm Exp $ */
+/* $OpenBSD: if_oce.c,v 1.108 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2012 Mike Belopuhov
ifp->if_watchdog = oce_watchdog;
ifp->if_hardmtu = OCE_MAX_MTU;
ifp->if_softc = sc;
- ifq_set_maxlen(&ifp->if_snd, sc->sc_tx_ring_size - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->sc_tx_ring_size - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 |
IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
-/* $OpenBSD: if_pcn.c,v 1.48 2022/07/10 21:13:41 bluhm Exp $ */
+/* $OpenBSD: if_pcn.c,v 1.49 2023/11/10 15:51:20 bluhm Exp $ */
/* $NetBSD: if_pcn.c,v 1.26 2005/05/07 09:15:44 is Exp $ */
/*
ifp->if_ioctl = pcn_ioctl;
ifp->if_start = pcn_start;
ifp->if_watchdog = pcn_watchdog;
- ifq_set_maxlen(&ifp->if_snd, PCN_NTXDESC -1);
+ ifq_init_maxlen(&ifp->if_snd, PCN_NTXDESC -1);
/* Attach the interface. */
if_attach(ifp);
-/* $OpenBSD: if_rge.c,v 1.21 2022/12/21 02:31:09 kevlo Exp $ */
+/* $OpenBSD: if_rge.c,v 1.22 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 2019, 2020 Kevin Lo <kevlo@openbsd.org>
ifp->if_ioctl = rge_ioctl;
ifp->if_qstart = rge_start;
ifp->if_watchdog = rge_watchdog;
- ifq_set_maxlen(&ifp->if_snd, RGE_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, RGE_TX_LIST_CNT - 1);
ifp->if_hardmtu = RGE_JUMBO_MTU;
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 |
-/* $OpenBSD: if_se.c,v 1.23 2022/01/09 05:42:54 jsg Exp $ */
+/* $OpenBSD: if_se.c,v 1.24 2023/11/10 15:51:20 bluhm Exp $ */
/*-
* Copyright (c) 2009, 2010 Christopher Zimmermann <madroach@zakweb.de>
ifp->if_ioctl = se_ioctl;
ifp->if_start = se_start;
ifp->if_watchdog = se_watchdog;
- ifq_set_maxlen(&ifp->if_snd, SE_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, SE_TX_RING_CNT - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_sis.c,v 1.142 2022/03/11 18:00:48 mpi Exp $ */
+/* $OpenBSD: if_sis.c,v 1.143 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
ifp->if_ioctl = sis_ioctl;
ifp->if_start = sis_start;
ifp->if_watchdog = sis_watchdog;
- ifq_set_maxlen(&ifp->if_snd, SIS_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, SIS_TX_LIST_CNT - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_hardmtu = 1518; /* determined experimentally on DP83815 */
-/* $OpenBSD: if_sk.c,v 1.194 2022/03/11 18:00:48 mpi Exp $ */
+/* $OpenBSD: if_sk.c,v 1.195 2023/11/10 15:51:20 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
ifp->if_start = sk_start;
ifp->if_watchdog = sk_watchdog;
ifp->if_hardmtu = SK_JUMBO_MTU;
- ifq_set_maxlen(&ifp->if_snd, SK_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, SK_TX_RING_CNT - 1);
bcopy(sc_if->sk_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_ste.c,v 1.69 2022/03/11 18:00:48 mpi Exp $ */
+/* $OpenBSD: if_ste.c,v 1.70 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
ifp->if_ioctl = ste_ioctl;
ifp->if_start = ste_start;
ifp->if_watchdog = ste_watchdog;
- ifq_set_maxlen(&ifp->if_snd, STE_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, STE_TX_LIST_CNT - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_stge.c,v 1.72 2022/03/11 18:00:48 mpi Exp $ */
+/* $OpenBSD: if_stge.c,v 1.73 2023/11/10 15:51:24 bluhm Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
#ifdef STGE_JUMBO
ifp->if_hardmtu = STGE_JUMBO_MTU;
#endif
- ifq_set_maxlen(&ifp->if_snd, STGE_NTXDESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, STGE_NTXDESC - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_tht.c,v 1.146 2022/08/29 06:08:04 jsg Exp $ */
+/* $OpenBSD: if_tht.c,v 1.147 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
ifp->if_watchdog = tht_watchdog;
ifp->if_hardmtu = MCLBYTES - ETHER_HDR_LEN - ETHER_CRC_LEN; /* XXX */
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, 400);
+ ifq_init_maxlen(&ifp->if_snd, 400);
ifmedia_init(&sc->sc_media, 0, tht_media_change, tht_media_status);
ifmedia_add(&sc->sc_media, IFM_ETHER|IFM_AUTO, 0, NULL);
-/* $OpenBSD: if_tl.c,v 1.77 2023/04/11 00:45:08 jsg Exp $ */
+/* $OpenBSD: if_tl.c,v 1.78 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998
ifp->if_ioctl = tl_ioctl;
ifp->if_start = tl_start;
ifp->if_watchdog = tl_watchdog;
- ifq_set_maxlen(&ifp->if_snd, TL_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, TL_TX_LIST_CNT - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_txp.c,v 1.129 2022/03/11 18:00:50 mpi Exp $ */
+/* $OpenBSD: if_txp.c,v 1.130 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2001
ifp->if_start = txp_start;
ifp->if_watchdog = txp_watchdog;
ifp->if_baudrate = IF_Mbps(10);
- ifq_set_maxlen(&ifp->if_snd, TX_ENTRIES);
+ ifq_init_maxlen(&ifp->if_snd, TX_ENTRIES);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
txp_capabilities(sc);
-/* $OpenBSD: if_vge.c,v 1.76 2022/03/11 18:00:50 mpi Exp $ */
+/* $OpenBSD: if_vge.c,v 1.77 2023/11/10 15:51:24 bluhm Exp $ */
/* $FreeBSD: if_vge.c,v 1.3 2004/09/11 22:13:25 wpaul Exp $ */
/*
* Copyright (c) 2004
#ifdef VGE_JUMBO
ifp->if_hardmtu = VGE_JUMBO_MTU;
#endif
- ifq_set_maxlen(&ifp->if_snd, VGE_IFQ_MAXLEN);
+ ifq_init_maxlen(&ifp->if_snd, VGE_IFQ_MAXLEN);
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 |
IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
-/* $OpenBSD: if_vic.c,v 1.104 2022/03/11 18:00:50 mpi Exp $ */
+/* $OpenBSD: if_vic.c,v 1.105 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2006 Reyk Floeter <reyk@openbsd.org>
ifp->if_watchdog = vic_watchdog;
ifp->if_hardmtu = VIC_JUMBO_MTU;
strlcpy(ifp->if_xname, DEVNAME(sc), IFNAMSIZ);
- ifq_set_maxlen(&ifp->if_snd, sc->sc_ntxbuf - 1);
+ ifq_init_maxlen(&ifp->if_snd, sc->sc_ntxbuf - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU;
-/* $OpenBSD: if_vmx.c,v 1.78 2023/07/30 04:27:01 dlg Exp $ */
+/* $OpenBSD: if_vmx.c,v 1.79 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
if (sc->sc_ds->upt_features & UPT1_F_VLAN)
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
- ifq_set_maxlen(&ifp->if_snd, NTXDESC);
+ ifq_init_maxlen(&ifp->if_snd, NTXDESC);
ifmedia_init(&sc->sc_media, IFM_IMASK, vmxnet3_media_change,
vmxnet3_media_status);
-/* $OpenBSD: if_vte.c,v 1.26 2022/04/19 03:25:46 kevlo Exp $ */
+/* $OpenBSD: if_vte.c,v 1.27 2023/11/10 15:51:24 bluhm Exp $ */
/*-
* Copyright (c) 2010, Pyun YongHyeon <yongari@FreeBSD.org>
* All rights reserved.
ifp->if_ioctl = vte_ioctl;
ifp->if_start = vte_start;
ifp->if_watchdog = vte_watchdog;
- ifq_set_maxlen(&ifp->if_snd, VTE_TX_RING_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, VTE_TX_RING_CNT - 1);
bcopy(sc->vte_eaddr, sc->sc_arpcom.ac_enaddr, ETHER_ADDR_LEN);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_wb.c,v 1.74 2022/03/11 18:00:50 mpi Exp $ */
+/* $OpenBSD: if_wb.c,v 1.75 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 1997, 1998
ifp->if_ioctl = wb_ioctl;
ifp->if_start = wb_start;
ifp->if_watchdog = wb_watchdog;
- ifq_set_maxlen(&ifp->if_snd, WB_TX_LIST_CNT - 1);
+ ifq_init_maxlen(&ifp->if_snd, WB_TX_LIST_CNT - 1);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
-/* $OpenBSD: if_xge.c,v 1.82 2022/03/11 18:00:50 mpi Exp $ */
+/* $OpenBSD: if_xge.c,v 1.83 2023/11/10 15:51:24 bluhm Exp $ */
/* $NetBSD: if_xge.c,v 1.1 2005/09/09 10:30:27 ragge Exp $ */
/*
ifp->if_ioctl = xge_ioctl;
ifp->if_start = xge_start;
ifp->if_hardmtu = XGE_MAX_MTU;
- ifq_set_maxlen(&ifp->if_snd, NTXDESCS - 1);
+ ifq_init_maxlen(&ifp->if_snd, NTXDESCS - 1);
ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_CSUM_IPv4 |
IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
#endif
}
- ifq_set_maxlen(&ifp->if_snd, HVN_TX_DESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, HVN_TX_DESC - 1);
ifmedia_init(&sc->sc_media, IFM_IMASK, hvn_media_change,
hvn_media_status);
-/* $OpenBSD: if_vio.c,v 1.25 2023/07/28 16:54:48 dv Exp $ */
+/* $OpenBSD: if_vio.c,v 1.26 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg.
ifp->if_capabilities = IFCAP_VLAN_MTU;
if (virtio_has_feature(vsc, VIRTIO_NET_F_CSUM))
ifp->if_capabilities |= IFCAP_CSUM_TCPv4|IFCAP_CSUM_UDPv4;
- ifq_set_maxlen(&ifp->if_snd, vsc->sc_vqs[1].vq_num - 1);
+ ifq_init_maxlen(&ifp->if_snd, vsc->sc_vqs[1].vq_num - 1);
ifmedia_init(&sc->sc_media, 0, vio_media_change, vio_media_status);
ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_AUTO, 0, NULL);
ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_AUTO);
-/* $OpenBSD: if_xnf.c,v 1.68 2022/03/23 13:03:36 jsg Exp $ */
+/* $OpenBSD: if_xnf.c,v 1.69 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2015, 2016 Mike Belopuhov
if (sc->sc_caps & XNF_CAP_CSUM6)
ifp->if_capabilities |= IFCAP_CSUM_TCPv6 | IFCAP_CSUM_UDPv6;
- ifq_set_maxlen(&ifp->if_snd, XNF_TX_DESC - 1);
+ ifq_init_maxlen(&ifp->if_snd, XNF_TX_DESC - 1);
ifmedia_init(&sc->sc_media, IFM_IMASK, xnf_media_change,
xnf_media_status);
-/* $OpenBSD: if.c,v 1.709 2023/10/27 20:56:47 jan Exp $ */
+/* $OpenBSD: if.c,v 1.710 2023/11/10 15:51:24 bluhm Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
for (i = 1; i < nqs; i++) {
ifq = malloc(sizeof(*ifq), M_DEVBUF, M_WAITOK|M_ZERO);
- ifq_set_maxlen(ifq, ifp->if_snd.ifq_maxlen);
+ ifq_init_maxlen(ifq, ifp->if_snd.ifq_maxlen);
ifq_init(ifq, ifp, i);
map[i] = ifq;
}
-/* $OpenBSD: if_spppsubr.c,v 1.191 2022/01/02 22:36:03 jsg Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.192 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Synchronous PPP link level subroutines.
*
sp->pp_if.if_type = IFT_PPP;
sp->pp_if.if_output = sppp_output;
sp->pp_if.if_rtrequest = sppp_rtrequest;
- ifq_set_maxlen(&sp->pp_if.if_snd, 50);
+ ifq_init_maxlen(&sp->pp_if.if_snd, 50);
mq_init(&sp->pp_cpq, 50, IPL_NET);
sp->pp_loopcnt = 0;
sp->pp_alivecnt = 0;
-/* $OpenBSD: ifq.c,v 1.52 2023/10/08 07:44:52 claudio Exp $ */
+/* $OpenBSD: ifq.c,v 1.53 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
task_set(&ifq->ifq_restart, ifq_restart_task, ifq);
if (ifq->ifq_maxlen == 0)
- ifq_set_maxlen(ifq, IFQ_MAXLEN);
+ ifq_init_maxlen(ifq, IFQ_MAXLEN);
ifq->ifq_idx = idx;
return (len);
}
+void
+ifq_init_maxlen(struct ifqueue *ifq, unsigned int maxlen)
+{
+ /* this is not MP safe, use only during attach */
+ ifq->ifq_maxlen = maxlen;
+}
+
unsigned int
ifq_purge(struct ifqueue *ifq)
{
-/* $OpenBSD: ifq.h,v 1.40 2023/10/08 07:44:52 claudio Exp $ */
+/* $OpenBSD: ifq.h,v 1.41 2023/11/10 15:51:24 bluhm Exp $ */
/*
* Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
void ifq_deq_rollback(struct ifqueue *, struct mbuf *);
struct mbuf *ifq_dequeue(struct ifqueue *);
int ifq_hdatalen(struct ifqueue *);
+void ifq_init_maxlen(struct ifqueue *, unsigned int);
void ifq_mfreem(struct ifqueue *, struct mbuf *);
void ifq_mfreeml(struct ifqueue *, struct mbuf_list *);
unsigned int ifq_purge(struct ifqueue *);
const char *, volatile unsigned int *,
volatile unsigned int *);
-#define ifq_len(_ifq) ((_ifq)->ifq_len)
-#define ifq_empty(_ifq) (ifq_len(_ifq) == 0)
-#define ifq_set_maxlen(_ifq, _l) ((_ifq)->ifq_maxlen = (_l))
+#define ifq_len(_ifq) READ_ONCE((_ifq)->ifq_len)
+#define ifq_empty(_ifq) (ifq_len(_ifq) == 0)
static inline int
ifq_is_priq(struct ifqueue *ifq)
int ifiq_enqueue(struct ifiqueue *, struct mbuf *);
void ifiq_add_data(struct ifiqueue *, struct if_data *);
-#define ifiq_len(_ifiq) ml_len(&(_ifiq)->ifiq_ml)
-#define ifiq_empty(_ifiq) ml_empty(&(_ifiq)->ifiq_ml)
+#define ifiq_len(_ifiq) READ_ONCE(ml_len(&(_ifiq)->ifiq_ml))
+#define ifiq_empty(_ifiq) (ifiq_len(_ifiq) == 0)
#endif /* _KERNEL */