This paves the way for the multiple transmission queues support.
ifq_purge_all() is used when ALTQ packet scheduler is changed,
interface routing is changed and pseudo devices are closed.
callout_init(&cbqp->cbq_callout);
cbqp->cbq_qlen = 0;
cbqp->ifnp.ifq_ = &ifp->if_snd; /* keep the ifq */
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
/* keep the state in pf_altq */
a->altq_disc = cbqp;
pif->pif_bandwidth = a->ifbandwidth;
pif->pif_maxpri = -1;
pif->pif_ifq = &ifp->if_snd;
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
/* keep the state in pf_altq */
a->altq_disc = pif;
hif->hif_eligible = ellist_alloc();
hif->hif_ifq = &ifp->if_snd;
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
/* keep the state in pf_altq */
a->altq_disc = hif;
pif->pif_bandwidth = a->ifbandwidth;
pif->pif_maxpri = -1;
pif->pif_ifq = &ifp->if_snd;
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
/* keep the state in pf_altq */
a->altq_disc = pif;
if (ifq_is_enabled(ifq))
return 0;
- ifq_purge_locked(ifq);
+ ifq_purge_all_locked(ifq);
KKASSERT(ifq->ifq_len == 0);
ifq->altq_flags |= ALTQF_ENABLED;
if (!ifq_is_enabled(ifq))
return 0;
- ifq_purge_locked(ifq);
+ ifq_purge_all_locked(ifq);
KKASSERT(ifq->ifq_len == 0);
ifq->altq_flags &= ~(ALTQF_ENABLED|ALTQF_CLASSIFY);
return 0;
if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family))
kpfctlinput(PRC_IFDOWN, ifa->ifa_addr);
}
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
rt_ifmsg(ifp);
}
{
struct ifaddr_container *ifac;
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
ifp->if_flags |= flag;
getmicrotime(&ifp->if_lastchange);
TAILQ_FOREACH(ifac, &ifp->if_addrheads[mycpuid], ifa_link) {
* WARNING: Should only be called in an MPSAFE manner.
*/
static __inline void
+ifq_purge_all_locked(struct ifaltq *_ifq)
+{
+ /* XXX temporary */
+ ifq_purge_locked(_ifq);
+}
+
+static __inline void
+ifq_purge_all(struct ifaltq *_ifq)
+{
+ ALTQ_LOCK(_ifq);
+ ifq_purge_all_locked(_ifq);
+ ALTQ_UNLOCK(_ifq);
+}
+
+/*
+ * WARNING: Should only be called in an MPSAFE manner.
+ */
+static __inline void
ifq_classify(struct ifaltq *_ifq, struct mbuf *_m, uint8_t _af,
struct altq_pktattr *_pa)
{
{
struct sppp *sp = (struct sppp*) ifp;
- ifq_purge(&sp->pp_if.if_snd);
+ ifq_purge_all(&sp->pp_if.if_snd);
IF_DRAIN(&sp->pp_fastq);
IF_DRAIN(&sp->pp_cpq);
}
get_mplock();
/* Junk all pending output */
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
/*
* Do not bring the interface down, and do not anything with
tp->tun_pid = 0;
/* Junk all pending output. */
- ifq_purge(&ifp->if_snd);
+ ifq_purge_all(&ifp->if_snd);
if (ifp->if_flags & IFF_UP)
if_down(ifp);