ifq: Add ifq_set_hw_serialize
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 22 Sep 2013 12:14:22 +0000 (20:14 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sun, 22 Sep 2013 12:14:22 +0000 (20:14 +0800)
This eases the drivers which use splitted serializers but only have one
transmit queue.

sys/dev/netif/jme/if_jme.c
sys/net/ifq_var.h

index 3dbd80c..824c7fa 100644 (file)
@@ -1092,7 +1092,7 @@ jme_attach(device_t dev)
 
        /* Setup the TX ring's CPUID */
        ifq_set_cpuid(&ifp->if_snd, sc->jme_tx_cpuid);
-       ifsq_set_hw_serialize(ifq_get_subq_default(&ifp->if_snd),
+       ifq_set_hw_serialize(&ifp->if_snd,
            &sc->jme_cdata.jme_tx_data.jme_tx_serialize);
 
        error = jme_intr_setup(dev);
index dfedbeb..dca0f59 100644 (file)
@@ -620,4 +620,13 @@ ifq_set_cpuid(struct ifaltq *_ifq, int _cpuid)
        ifsq_set_cpuid(ifq_get_subq_default(_ifq), _cpuid);
 }
 
+/* COMPAT */
+static __inline void
+ifq_set_hw_serialize(struct ifaltq *_ifq, struct lwkt_serialize *_hwslz)
+{
+       KASSERT(_ifq->altq_subq_cnt == 1,
+           ("invalid subqueue count %d", _ifq->altq_subq_cnt));
+       ifsq_set_hw_serialize(ifq_get_subq_default(_ifq), _hwslz);
+}
+
 #endif /* _NET_IFQ_VAR_H_ */