On Thu, May 16, 2013 at 04:20:18PM +0000, Julian Elischer wrote:
J> Modified: head/sys/sys/mbuf.h
J> 
==============================================================================
J> --- head/sys/sys/mbuf.h      Thu May 16 15:28:38 2013        (r250699)
J> +++ head/sys/sys/mbuf.h      Thu May 16 16:20:17 2013        (r250700)
J> @@ -129,6 +129,8 @@ struct pkthdr {
J>              u_int16_t vt_vtag;      /* Ethernet 802.1p+q vlan tag */
J>              u_int16_t vt_nrecs;     /* # of IGMPv3 records in this chain */
J>      } PH_vt;
J> +    u_int16_t        fibnum;        /* this packet should use this fib */
J> +    u_int16_t        pad2;          /* align to 32 bits */
J>      SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */
J>  };
J>  #define ether_vtag  PH_vt.vt_vtag
J> @@ -171,6 +173,7 @@ struct mbuf {
J>  #define     m_type          m_hdr.mh_type
J>  #define     m_flags         m_hdr.mh_flags
J>  #define     m_nextpkt       m_hdr.mh_nextpkt
J> +#define     m_fibnum        m_hdr.mh_nextpkt
J>  #define     m_act           m_nextpkt
J>  #define     m_pkthdr        M_dat.MH.MH_pkthdr
J>  #define     m_ext           M_dat.MH.MH_dat.MH_ext

The define definitely looks incorrect.

J> +static int inline
J> +rt_m_getfib(struct mbuf *m)
J> +{
J> +    KASSERT(m->m_flags & M_EXT , ("attempt to set FIB on non header mbuf"));
J> +    return (m->m_pkthdr.fibnum);
J> +}

The KASSERT looks incorrect. Text doesn't match the test. IMO, text is
correct, but the test is not.

J>  #define M_SETFIB(_m, _fib) do {                                             
\
J> -    _m->m_flags &= ~M_FIB;                                          \
J> -    _m->m_flags |= (((_fib) << M_FIBSHIFT) & M_FIB);  \
J> +        KASSERT((_m)->m_flags & M_EXT, ("No FIB on non header mbuf"));      
\
J> +    ((_m)->m_pkthdr.fibnum) = (_fib);                               \
J>  } while (0)

Same for this KASSERT.

IMO, any change to struct mbuf should be announced and posted for review
prior to committing.

-- 
Totus tuus, Glebius.
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to