Date: Fri, 25 Mar 2016 17:26:14 +0900
   From: Kengo NAKAHARA <[email protected]>

   I rebase and modify a little(use container_of). Here is the patch.
       
http://www.netbsd.org/~knakahara/ifq-enqueue-refactor/ifq-enqueue-refactor.patch

   Does anyone have Any comments? Any comments are welcome.

Minor nit in altq_m_tag_get: KNF style is `return foo;', not `return
(foo);'.

altq_get_pattr should use container_of too, not pointer arithmetic:

        mtag = m_tag_find(m, PACKET_TAG_ALTQ_PATTR, NULL);
        if (mtag != NULL) {
                struct altq_pktattr_tag *apt =
                    container_of(mtag, struct altq_pktattr_tag, apt_tag);
                return &apt->apt_pktattr;
        }

Either or altq_get_pattr or IFQ_ENQUEUE should KASSERT(pattr != NULL)
or similar.

Why add struct ifnet::if_altq_classify?  Why not just teach
altq_etherclassify to call altq_set_pattr?  From the comments above
altq_etherclassify, it sounds like it's meant to be a temporary
workaround for a deficiency in altq.  Especially the just-in-time
assignment of ifp->if_altq_classify in ieee80211_deliver_data seems
wrong to me.

Otherwise, I think this looks good to me.

Reply via email to