svn commit: r322338 - head/sys/net

Gleb Smirnoff glebius at FreeBSD.org
Wed Aug 16 20:54:47 UTC 2017


On Wed, Aug 16, 2017 at 01:43:27PM -0700, Gleb Smirnoff wrote:
T> S>  				MPASS(m->m_nextpkt == NULL);
T> S> -
T> S> -				m_free(m);
T> S> +				/* if the number of clusters exceeds the number of segments
T> S> +				 * there won't be space on the ring to save a pointer to each
T> S> +				 * cluster so we simply free the list here
T> S> +				 */
T> S> +				if (m->m_flags & M_TOOBIG) {
T> S> +					m_freem(m);
T> S> +				} else {
T> S> +					m_free(m);
T> S> +				}
T> S>  				ifsd_m[cidx] = NULL;
T> S>  #if MEMORY_LOGGING
T> S>  				txq->ift_dequeued++;
T> 
T> Can you please explain the goal of the change? AFAIK, the problem
T> could be fixed with one liner:
T> 
T> -	m_free(m);
T> +	m_freem(m);
T> 
T> n the iflib_tx_desc_free().

I'm probably wrong on one liner, but still I don't see reason to have flag.
Since we clear m_next in normal case, doing m_freem() always is fine.

Suggested patch attached.

-- 
Totus tuus, Glebius.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iflib.c.diff
Type: text/x-diff
Size: 1280 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20170816/5b781430/attachment.diff>


More information about the svn-src-head mailing list