Author: np
Date: Thu Jul 31 23:14:59 2014
New Revision: 269358
URL: http://svnweb.freebsd.org/changeset/base/269358

Log:
  MFC r268971:
  Simplify r267600, there's no need to distinguish between allocated and
  inlined mbufs.

Modified:
  stable/9/sys/dev/cxgbe/adapter.h
  stable/9/sys/dev/cxgbe/t4_sge.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/cxgbe/adapter.h
==============================================================================
--- stable/9/sys/dev/cxgbe/adapter.h    Thu Jul 31 23:09:22 2014        
(r269357)
+++ stable/9/sys/dev/cxgbe/adapter.h    Thu Jul 31 23:14:59 2014        
(r269358)
@@ -253,8 +253,7 @@ struct cluster_metadata {
 
 struct fl_sdesc {
        caddr_t cl;
-       uint8_t nimbuf;         /* # of inline mbufs with ref on the cluster */
-       uint8_t nembuf;         /* # of allocated mbufs with ref */
+       uint16_t nmbuf; /* # of driver originated mbufs with ref on cluster */
        struct cluster_layout cll;
 };
 

Modified: stable/9/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- stable/9/sys/dev/cxgbe/t4_sge.c     Thu Jul 31 23:09:22 2014        
(r269357)
+++ stable/9/sys/dev/cxgbe/t4_sge.c     Thu Jul 31 23:14:59 2014        
(r269358)
@@ -1469,7 +1469,7 @@ get_scatter_segment(struct adapter *sc, 
                /* copy data to mbuf */
                bcopy(payload, mtod(m, caddr_t), len);
 
-       } else if (sd->nimbuf * MSIZE < cll->region1) {
+       } else if (sd->nmbuf * MSIZE < cll->region1) {
 
                /*
                 * There's spare room in the cluster for an mbuf.  Create one
@@ -1477,14 +1477,14 @@ get_scatter_segment(struct adapter *sc, 
                 */
 
                MPASS(clm != NULL);
-               m = (struct mbuf *)(sd->cl + sd->nimbuf * MSIZE);
+               m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE);
                /* No bzero required */
                if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE))
                        return (NULL);
                fl->mbuf_inlined++;
                m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free,
                    swz->zone, sd->cl);
-               sd->nimbuf++;
+               sd->nmbuf++;
 
        } else {
 
@@ -1501,7 +1501,7 @@ get_scatter_segment(struct adapter *sc, 
                if (clm != NULL) {
                        m_extaddref(m, payload, padded_len, &clm->refcount,
                            rxb_free, swz->zone, sd->cl);
-                       sd->nembuf++;
+                       sd->nmbuf++;
                } else {
                        m_cljset(m, sd->cl, swz->type);
                        sd->cl = NULL;  /* consumed, not a recycle candidate */
@@ -3026,7 +3026,7 @@ refill_fl(struct adapter *sc, struct sge
 
                if (sd->cl != NULL) {
 
-                       if (sd->nimbuf + sd->nembuf == 0) {
+                       if (sd->nmbuf == 0) {
                                /*
                                 * Fast recycle without involving any atomics on
                                 * the cluster's metadata (if the cluster has
@@ -3085,8 +3085,7 @@ recycled:
 #endif
                        clm->refcount = 1;
                }
-               sd->nimbuf = 0;
-               sd->nembuf = 0;
+               sd->nmbuf = 0;
 recycled_fast:
                fl->pending++;
                fl->needed--;
@@ -3155,7 +3154,7 @@ free_fl_sdesc(struct adapter *sc, struct
 
                cll = &sd->cll;
                clm = cl_metadata(sc, fl, cll, sd->cl);
-               if (sd->nimbuf + sd->nembuf == 0 ||
+               if (sd->nmbuf == 0 ||
                    (clm && atomic_fetchadd_int(&clm->refcount, -1) == 1)) {
                        uma_zfree(sc->sge.sw_zone_info[cll->zidx].zone, sd->cl);
                }
_______________________________________________
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