svn commit: r277071 - projects/ifnet/sys/sys
Andrew Thompson
thompsa at FreeBSD.org
Mon Jan 12 21:25:13 UTC 2015
On 13 January 2015 at 02:53, Gleb Smirnoff <glebius at freebsd.org> wrote:
> Author: glebius
> Date: Mon Jan 12 13:53:40 2015
> New Revision: 277071
> URL: https://svnweb.freebsd.org/changeset/base/277071
>
> Log:
> Provide struct mbufq, a STAILQ of mbufs, with counter for packets
> and maximum limit set. The structure is supposed to have external
> locking. The aim of new structure is to substitute struct ifqueue
> in several places in the kernel, where struct ifqueue is used
> outside of ifnet code itself.
>
> Modified:
> projects/ifnet/sys/sys/mbuf.h
>
> Modified: projects/ifnet/sys/sys/mbuf.h
>
> ==============================================================================
>
> +static inline int
> +mbufq_enqueue(struct mbufq *mq, struct mbuf *m)
> +{
> +
> + if (mbufq_full(mq))
> + return (ENOBUFS);
> + STAILQ_INSERT_TAIL(&mq->mq_head, m, m_stailqpkt);
> + mq->mq_len++;
> + return (0);
> +}
>
>
> +static inline void
> +mbufq_prepend(struct mbufq *mq, struct mbuf *m)
> +{
> +
> + STAILQ_INSERT_HEAD(&mq->mq_head, m, m_stailqpkt);
> + mq->mq_len++;
> +}
>
Should this have a full check like mbufq_enqueue?
Andrew
More information about the svn-src-projects
mailing list