Re: remove compat macros IFQ_ENQUEUE, IFQ_DEQUEUE and IFQ_LEN

2020-07-10 Thread Vitaliy Makkoveev



> On 10 Jul 2020, at 12:13, Patrick Wildt  wrote:
> 
> Hi,
> 
> this is a rather mechanical diff, done using vim and some regex,
> to remove and replace IFQ_ENQUEUE, IFQ_DEQUEUE and IFQ_LEN.
> 
> There are more, but I didn't want the diff to get too big.  I'll
> do that after this one is committed.
> 
> ok?
> 
> Patrick

I guess ifq_enqueue(9) should also have “.Dt ifq_enqueue 9” instead
of “.Dt IFQ_ENQUEUE 9”.

> 
> diff --git a/sys/arch/armv7/omap/if_cpsw.c b/sys/arch/armv7/omap/if_cpsw.c
> index 3b380457e3f..7aee2730989 100644
> --- a/sys/arch/armv7/omap/if_cpsw.c
> +++ b/sys/arch/armv7/omap/if_cpsw.c
> @@ -534,7 +534,7 @@ cpsw_start(struct ifnet *ifp)
>   break;
>   }
> 
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL)
>   break;
> 
> diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c
> index 348d97400cc..d65dcb879a1 100644
> --- a/sys/arch/macppc/dev/if_bm.c
> +++ b/sys/arch/macppc/dev/if_bm.c
> @@ -615,7 +615,7 @@ bmac_start(struct ifnet *ifp)
>   if (ifq_is_oactive(>if_snd))
>   return;
> 
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL)
>   break;
> #if NBPFILTER > 0
> diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c
> index 4fd36fb5748..00b2cb0aa88 100644
> --- a/sys/arch/macppc/dev/if_mc.c
> +++ b/sys/arch/macppc/dev/if_mc.c
> @@ -552,7 +552,7 @@ mc_start(struct ifnet *ifp)
>   if (ifq_is_oactive(>if_snd))
>   return;
> 
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL)
>   return;
> 
> diff --git a/sys/arch/sparc64/dev/vnet.c b/sys/arch/sparc64/dev/vnet.c
> index 147caf1f2ec..a30b45dd2b6 100644
> --- a/sys/arch/sparc64/dev/vnet.c
> +++ b/sys/arch/sparc64/dev/vnet.c
> @@ -1132,7 +1132,7 @@ vnet_start(struct ifnet *ifp)
>   break;
>   }
> 
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL) {
>   pool_put(>sc_pool, buf);
>   break;
> @@ -1209,7 +1209,7 @@ vnet_start_desc(struct ifnet *ifp)
>   return;
>   }
> 
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL) {
>   pool_put(>sc_pool, buf);
>   return;
> diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
> index d758d837a0b..8643dddee4e 100644
> --- a/sys/dev/ic/acx.c
> +++ b/sys/dev/ic/acx.c
> @@ -950,7 +950,7 @@ acx_start(struct ifnet *ifp)
>   ni = m->m_pkthdr.ph_cookie;
>   goto encapped;
>   } else {
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL)
>   break;
>   }
> diff --git a/sys/dev/ic/am7990.c b/sys/dev/ic/am7990.c
> index ce092ebf5ac..08c10ada528 100644
> --- a/sys/dev/ic/am7990.c
> +++ b/sys/dev/ic/am7990.c
> @@ -483,7 +483,7 @@ am7990_start(struct ifnet *ifp)
>   sc->sc_no_td, sc->sc_last_td);
>   }
> 
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL)
>   break;
> 
> diff --git a/sys/dev/ic/am79900.c b/sys/dev/ic/am79900.c
> index 79e1c9e28cc..9af592e2f73 100644
> --- a/sys/dev/ic/am79900.c
> +++ b/sys/dev/ic/am79900.c
> @@ -506,7 +506,7 @@ am79900_start(struct ifnet *ifp)
>   sc->sc_no_td, sc->sc_last_td);
>   }
> 
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL)
>   break;
> 
> diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
> index aae0b2a87ff..c469269eb4e 100644
> --- a/sys/dev/ic/ath.c
> +++ b/sys/dev/ic/ath.c
> @@ -845,7 +845,7 @@ ath_start(struct ifnet *ifp)
>   splx(s);
>   break;
>   }
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   if (m == NULL) {
>   s = splnet();
>   TAILQ_INSERT_TAIL(>sc_txbuf, bf, bf_list);
> diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
> index 5f84db0b1ea..8384f583934 100644
> --- a/sys/dev/ic/athn.c
> +++ b/sys/dev/ic/athn.c
> @@ -2873,7 +2873,7 @@ athn_start(struct ifnet *ifp)
>   break;
> 
>   /* Encapsulate and send data frames. */
> - IFQ_DEQUEUE(>if_snd, m);
> + m = ifq_dequeue(>if_snd);
>   

Re: remove compat macros IFQ_ENQUEUE, IFQ_DEQUEUE and IFQ_LEN

2020-07-10 Thread Patrick Wildt
On Fri, Jul 10, 2020 at 12:20:53PM +0300, Vitaliy Makkoveev wrote:
> 
> 
> > On 10 Jul 2020, at 12:13, Patrick Wildt  wrote:
> > 
> > Hi,
> > 
> > this is a rather mechanical diff, done using vim and some regex,
> > to remove and replace IFQ_ENQUEUE, IFQ_DEQUEUE and IFQ_LEN.
> > 
> > There are more, but I didn't want the diff to get too big.  I'll
> > do that after this one is committed.
> > 
> > ok?
> > 
> > Patrick
> 
> I guess ifq_enqueue(9) should also have ???.Dt ifq_enqueue 9??? instead
> of ???.Dt IFQ_ENQUEUE 9???.

No.  .Dt is always uppercase.  Look at printf(9), it has .Dt PRINTF but
there is no PRINTF().

> > 
> > diff --git a/sys/arch/armv7/omap/if_cpsw.c b/sys/arch/armv7/omap/if_cpsw.c
> > index 3b380457e3f..7aee2730989 100644
> > --- a/sys/arch/armv7/omap/if_cpsw.c
> > +++ b/sys/arch/armv7/omap/if_cpsw.c
> > @@ -534,7 +534,7 @@ cpsw_start(struct ifnet *ifp)
> > break;
> > }
> > 
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL)
> > break;
> > 
> > diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c
> > index 348d97400cc..d65dcb879a1 100644
> > --- a/sys/arch/macppc/dev/if_bm.c
> > +++ b/sys/arch/macppc/dev/if_bm.c
> > @@ -615,7 +615,7 @@ bmac_start(struct ifnet *ifp)
> > if (ifq_is_oactive(>if_snd))
> > return;
> > 
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL)
> > break;
> > #if NBPFILTER > 0
> > diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c
> > index 4fd36fb5748..00b2cb0aa88 100644
> > --- a/sys/arch/macppc/dev/if_mc.c
> > +++ b/sys/arch/macppc/dev/if_mc.c
> > @@ -552,7 +552,7 @@ mc_start(struct ifnet *ifp)
> > if (ifq_is_oactive(>if_snd))
> > return;
> > 
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL)
> > return;
> > 
> > diff --git a/sys/arch/sparc64/dev/vnet.c b/sys/arch/sparc64/dev/vnet.c
> > index 147caf1f2ec..a30b45dd2b6 100644
> > --- a/sys/arch/sparc64/dev/vnet.c
> > +++ b/sys/arch/sparc64/dev/vnet.c
> > @@ -1132,7 +1132,7 @@ vnet_start(struct ifnet *ifp)
> > break;
> > }
> > 
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL) {
> > pool_put(>sc_pool, buf);
> > break;
> > @@ -1209,7 +1209,7 @@ vnet_start_desc(struct ifnet *ifp)
> > return;
> > }
> > 
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL) {
> > pool_put(>sc_pool, buf);
> > return;
> > diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
> > index d758d837a0b..8643dddee4e 100644
> > --- a/sys/dev/ic/acx.c
> > +++ b/sys/dev/ic/acx.c
> > @@ -950,7 +950,7 @@ acx_start(struct ifnet *ifp)
> > ni = m->m_pkthdr.ph_cookie;
> > goto encapped;
> > } else {
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL)
> > break;
> > }
> > diff --git a/sys/dev/ic/am7990.c b/sys/dev/ic/am7990.c
> > index ce092ebf5ac..08c10ada528 100644
> > --- a/sys/dev/ic/am7990.c
> > +++ b/sys/dev/ic/am7990.c
> > @@ -483,7 +483,7 @@ am7990_start(struct ifnet *ifp)
> > sc->sc_no_td, sc->sc_last_td);
> > }
> > 
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL)
> > break;
> > 
> > diff --git a/sys/dev/ic/am79900.c b/sys/dev/ic/am79900.c
> > index 79e1c9e28cc..9af592e2f73 100644
> > --- a/sys/dev/ic/am79900.c
> > +++ b/sys/dev/ic/am79900.c
> > @@ -506,7 +506,7 @@ am79900_start(struct ifnet *ifp)
> > sc->sc_no_td, sc->sc_last_td);
> > }
> > 
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL)
> > break;
> > 
> > diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
> > index aae0b2a87ff..c469269eb4e 100644
> > --- a/sys/dev/ic/ath.c
> > +++ b/sys/dev/ic/ath.c
> > @@ -845,7 +845,7 @@ ath_start(struct ifnet *ifp)
> > splx(s);
> > break;
> > }
> > -   IFQ_DEQUEUE(>if_snd, m);
> > +   m = ifq_dequeue(>if_snd);
> > if (m == NULL) {
> > s = splnet();
> > TAILQ_INSERT_TAIL(>sc_txbuf, bf, bf_list);
> > diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
> > index 

remove compat macros IFQ_ENQUEUE, IFQ_DEQUEUE and IFQ_LEN

2020-07-10 Thread Patrick Wildt
Hi,

this is a rather mechanical diff, done using vim and some regex,
to remove and replace IFQ_ENQUEUE, IFQ_DEQUEUE and IFQ_LEN.

There are more, but I didn't want the diff to get too big.  I'll
do that after this one is committed.

ok?

Patrick

diff --git a/sys/arch/armv7/omap/if_cpsw.c b/sys/arch/armv7/omap/if_cpsw.c
index 3b380457e3f..7aee2730989 100644
--- a/sys/arch/armv7/omap/if_cpsw.c
+++ b/sys/arch/armv7/omap/if_cpsw.c
@@ -534,7 +534,7 @@ cpsw_start(struct ifnet *ifp)
break;
}
 
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL)
break;
 
diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c
index 348d97400cc..d65dcb879a1 100644
--- a/sys/arch/macppc/dev/if_bm.c
+++ b/sys/arch/macppc/dev/if_bm.c
@@ -615,7 +615,7 @@ bmac_start(struct ifnet *ifp)
if (ifq_is_oactive(>if_snd))
return;
 
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL)
break;
 #if NBPFILTER > 0
diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c
index 4fd36fb5748..00b2cb0aa88 100644
--- a/sys/arch/macppc/dev/if_mc.c
+++ b/sys/arch/macppc/dev/if_mc.c
@@ -552,7 +552,7 @@ mc_start(struct ifnet *ifp)
if (ifq_is_oactive(>if_snd))
return;
 
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL)
return;
 
diff --git a/sys/arch/sparc64/dev/vnet.c b/sys/arch/sparc64/dev/vnet.c
index 147caf1f2ec..a30b45dd2b6 100644
--- a/sys/arch/sparc64/dev/vnet.c
+++ b/sys/arch/sparc64/dev/vnet.c
@@ -1132,7 +1132,7 @@ vnet_start(struct ifnet *ifp)
break;
}
 
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL) {
pool_put(>sc_pool, buf);
break;
@@ -1209,7 +1209,7 @@ vnet_start_desc(struct ifnet *ifp)
return;
}
 
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL) {
pool_put(>sc_pool, buf);
return;
diff --git a/sys/dev/ic/acx.c b/sys/dev/ic/acx.c
index d758d837a0b..8643dddee4e 100644
--- a/sys/dev/ic/acx.c
+++ b/sys/dev/ic/acx.c
@@ -950,7 +950,7 @@ acx_start(struct ifnet *ifp)
ni = m->m_pkthdr.ph_cookie;
goto encapped;
} else {
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL)
break;
}
diff --git a/sys/dev/ic/am7990.c b/sys/dev/ic/am7990.c
index ce092ebf5ac..08c10ada528 100644
--- a/sys/dev/ic/am7990.c
+++ b/sys/dev/ic/am7990.c
@@ -483,7 +483,7 @@ am7990_start(struct ifnet *ifp)
sc->sc_no_td, sc->sc_last_td);
}
 
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL)
break;
 
diff --git a/sys/dev/ic/am79900.c b/sys/dev/ic/am79900.c
index 79e1c9e28cc..9af592e2f73 100644
--- a/sys/dev/ic/am79900.c
+++ b/sys/dev/ic/am79900.c
@@ -506,7 +506,7 @@ am79900_start(struct ifnet *ifp)
sc->sc_no_td, sc->sc_last_td);
}
 
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL)
break;
 
diff --git a/sys/dev/ic/ath.c b/sys/dev/ic/ath.c
index aae0b2a87ff..c469269eb4e 100644
--- a/sys/dev/ic/ath.c
+++ b/sys/dev/ic/ath.c
@@ -845,7 +845,7 @@ ath_start(struct ifnet *ifp)
splx(s);
break;
}
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL) {
s = splnet();
TAILQ_INSERT_TAIL(>sc_txbuf, bf, bf_list);
diff --git a/sys/dev/ic/athn.c b/sys/dev/ic/athn.c
index 5f84db0b1ea..8384f583934 100644
--- a/sys/dev/ic/athn.c
+++ b/sys/dev/ic/athn.c
@@ -2873,7 +2873,7 @@ athn_start(struct ifnet *ifp)
break;
 
/* Encapsulate and send data frames. */
-   IFQ_DEQUEUE(>if_snd, m);
+   m = ifq_dequeue(>if_snd);
if (m == NULL)
break;
 #if NBPFILTER > 0
diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c
index cf80921d5d4..a6b676479ba 100644
--- a/sys/dev/ic/atw.c
+++ b/sys/dev/ic/atw.c
@@ -3603,7 +3603,7 @@ atw_start(struct ifnet *ifp)
/*