Stephen,
On Tue, Aug 20, 2019 at 01:06:43AM +0000, Stephen J. Kiernan wrote:
S> Author: stevek
S> Date: Tue Aug 20 01:06:43 2019
S> New Revision: 351244
S> URL: https://svnweb.freebsd.org/changeset/base/351244
S>
S> Log:
S> usb_ethernet.h includes a number of mii headers, but only does so in
S> order to have struct mii_data available. However, it only really needs
S> a forward declaration of struct mii_data for use in pointer form for
S> the return type of a function prototype.
S>
S> Custom kernel configuration that have usb and fdt enabled, but no miibus,
S> end up with compilation failures because miibus_if.h will not get
S> generated.
S>
S> Due to the above, the following changes have been made to usb_ethernet.h:
S> * remove the inclusion of mii headers
S> * forward-declare struct mii_data
S> * include net/ifq.h to satify the need for complete struct ifqueue
This is a header (and structure) that is on a kill list :) Polluting another
header moves us a bit backwards.
Can you please take a look at the attached patch? It substitutes it for mbufq,
as already done for many other drivers.
--
Gleb Smirnoff
Index: sys/dev/usb/net/if_axe.c
===================================================================
--- sys/dev/usb/net/if_axe.c (revision 351411)
+++ sys/dev/usb/net/if_axe.c (working copy)
@@ -1149,7 +1149,7 @@ axe_rxeof(struct usb_ether *ue, struct usb_page_ca
}
}
- _IF_ENQUEUE(&ue->ue_rxq, m);
+ (void)mbufq_enqueue(&ue->ue_rxq, m);
return (0);
}
Index: sys/dev/usb/net/if_axge.c
===================================================================
--- sys/dev/usb/net/if_axge.c (revision 351411)
+++ sys/dev/usb/net/if_axge.c (working copy)
@@ -1041,7 +1041,7 @@ axge_rxeof(struct usb_ether *ue, struct usb_page_c
}
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
- _IF_ENQUEUE(&ue->ue_rxq, m);
+ (void)mbufq_enqueue(&ue->ue_rxq, m);
}
static void
Index: sys/dev/usb/net/usb_ethernet.c
===================================================================
--- sys/dev/usb/net/usb_ethernet.c (revision 351411)
+++ sys/dev/usb/net/usb_ethernet.c (working copy)
@@ -598,7 +598,7 @@ uether_rxmbuf(struct usb_ether *ue, struct mbuf *m
m->m_pkthdr.len = m->m_len = len;
/* enqueue for later when the lock can be released */
- _IF_ENQUEUE(&ue->ue_rxq, m);
+ (void)mbufq_enqueue(&ue->ue_rxq, m);
return (0);
}
@@ -628,7 +628,7 @@ uether_rxbuf(struct usb_ether *ue, struct usb_page
m->m_pkthdr.len = m->m_len = len;
/* enqueue for later when the lock can be released */
- _IF_ENQUEUE(&ue->ue_rxq, m);
+ (void)mbufq_enqueue(&ue->ue_rxq, m);
return (0);
}
@@ -641,7 +641,7 @@ uether_rxflush(struct usb_ether *ue)
UE_LOCK_ASSERT(ue, MA_OWNED);
for (;;) {
- _IF_DEQUEUE(&ue->ue_rxq, m);
+ m = mbufq_dequeue(&ue->ue_rxq);
if (m == NULL)
break;
Index: sys/dev/usb/net/usb_ethernet.h
===================================================================
--- sys/dev/usb/net/usb_ethernet.h (revision 351411)
+++ sys/dev/usb/net/usb_ethernet.h (working copy)
@@ -46,7 +46,6 @@
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
-#include <net/ifq.h>
#include <net/bpf.h>
#include <net/ethernet.h>
@@ -89,7 +88,7 @@ struct usb_ether {
struct usb_process ue_tq;
struct sysctl_ctx_list ue_sysctl_ctx;
- struct ifqueue ue_rxq;
+ struct mbufq ue_rxq;
struct usb_callout ue_watchdog;
struct usb_ether_cfg_task ue_sync_task[2];
struct usb_ether_cfg_task ue_media_task[2];
Index: sys/sys/mbuf.h
===================================================================
--- sys/sys/mbuf.h (revision 351411)
+++ sys/sys/mbuf.h (working copy)
@@ -1432,7 +1432,7 @@ static inline int
mbufq_full(const struct mbufq *mq)
{
- return (mq->mq_len >= mq->mq_maxlen);
+ return (mq->mq_maxlen > 0 && mq->mq_len >= mq->mq_maxlen);
}
static inline int
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"