freebsd-dev/sys/dev/cxgbe/common
Robert Watson 7524f39b9f Add new a M_START() mbuf macro that returns a pointer to the start of
an mbuf's storage (internal or external).

Add a new M_SIZE() mbuf macro that returns the size of an mbuf's
storage (internal or external).

These contrast with m_data and m_len, which are with respect to data
in the buffer, rather than the buffer itself.

Rewrite M_LEADINGSPACE() and M_TRAILINGSPACE() in terms of M_START()
and M_SIZE().

This is done as we currently have many instances of using mbuf flags
to generate pointers or lengths for internal storage in header and
regular mbufs, as well as to external storage. Rather than replicate
this logic throughout the network stack, centralising the
implementation will make it easier for us to refine mbuf storage.
This should also help reduce bugs by limiting the amount of
mbuf-type-specific pointer arithmetic.  Followup changes will
propagate use of the macros throughout the stack.

M_SIZE() conflicts with one macro in the Chelsio driver; rename that
macro in a slightly unsatisfying way to eliminate the collision.

MFC after:	3 days
Obtained from:	jeff (with enhancements)
Sponsored by:	EMC / Isilon Storage Division
Reviewed by:	bz, glebius, np
Differential Revision:	https://reviews.freebsd.org/D753
2014-09-11 07:16:15 +00:00
..
common.h cxgbe(4): Let caller specify whether it's ok to sleep in 2014-08-06 19:38:03 +00:00
t4_hw.c cxgbe(4): Do not poke T4-only registers on a T5 (and vice versa). 2014-08-08 18:36:53 +00:00
t4_hw.h cxgbe(4): significant rx rework. 2014-03-18 20:14:13 +00:00
t4_msg.h The T5 allows the driver to specify the ISS. Do so; use the ISS picked 2013-07-04 18:41:21 +00:00
t4_regs_values.h - Read all TP parameters in one place. 2013-07-04 17:55:52 +00:00
t4_regs.h Add new a M_START() mbuf macro that returns a pointer to the start of 2014-09-11 07:16:15 +00:00
t4_tcb.h