Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jan 2011 23:51:03 +0000 (UTC)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r217665 - head/sys/mips/cavium/octe
Message-ID:  <201101202351.p0KNp3Pr031871@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmallett
Date: Thu Jan 20 23:51:03 2011
New Revision: 217665
URL: http://svn.freebsd.org/changeset/base/217665

Log:
  If there is no WQE available for a packet that needs segmentation, drop it
  and return.

Modified:
  head/sys/mips/cavium/octe/ethernet-tx.c

Modified: head/sys/mips/cavium/octe/ethernet-tx.c
==============================================================================
--- head/sys/mips/cavium/octe/ethernet-tx.c	Thu Jan 20 23:34:59 2011	(r217664)
+++ head/sys/mips/cavium/octe/ethernet-tx.c	Thu Jan 20 23:51:03 2011	(r217665)
@@ -142,9 +142,14 @@ int cvm_oct_xmit(struct mbuf *m, struct 
 		 * in memory we borrow from the WQE pool.
 		 */
 		work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
-		gp = (uint64_t *)work;
+		if (work == NULL) {
+			m_freem(m);
+			ifp->if_oerrors++;
+			return 1;
+		}
 
 		segs = 0;
+		gp = (uint64_t *)work;
 		for (n = m; n != NULL; n = n->m_next) {
 			if (segs == CVMX_FPA_WQE_POOL_SIZE / sizeof (uint64_t))
 				panic("%s: too many segments in packet; call m_collapse().", __func__);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101202351.p0KNp3Pr031871>