Author: np
Date: Sat Aug  2 01:48:25 2014
New Revision: 269413
URL: http://svnweb.freebsd.org/changeset/base/269413

Log:
  cxgbe(4):  Fix an off by one error when looking for the BAR2 doorbell
  address of an egress queue.
  
  MFC after:    2 weeks

Modified:
  head/sys/dev/cxgbe/t4_netmap.c
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_netmap.c
==============================================================================
--- head/sys/dev/cxgbe/t4_netmap.c      Sat Aug  2 01:28:01 2014        
(r269412)
+++ head/sys/dev/cxgbe/t4_netmap.c      Sat Aug  2 01:48:25 2014        
(r269413)
@@ -390,7 +390,7 @@ alloc_nm_txq_hwq(struct port_info *pi, s
                udb = sc->udbs_base + UDBS_DB_OFFSET;
                udb += (nm_txq->cntxt_id >> s_qpp) << PAGE_SHIFT;
                nm_txq->udb_qid = nm_txq->cntxt_id & mask;
-               if (nm_txq->udb_qid > PAGE_SIZE / UDBS_SEG_SIZE)
+               if (nm_txq->udb_qid >= PAGE_SIZE / UDBS_SEG_SIZE)
                        clrbit(&nm_txq->doorbells, DOORBELL_WCWR);
                else {
                        udb += nm_txq->udb_qid << UDBS_SEG_SHIFT;

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c Sat Aug  2 01:28:01 2014        (r269412)
+++ head/sys/dev/cxgbe/t4_sge.c Sat Aug  2 01:48:25 2014        (r269413)
@@ -2985,7 +2985,7 @@ alloc_eq(struct adapter *sc, struct port
                udb = sc->udbs_base + UDBS_DB_OFFSET;
                udb += (eq->cntxt_id >> s_qpp) << PAGE_SHIFT;   /* pg offset */
                eq->udb_qid = eq->cntxt_id & mask;              /* id in page */
-               if (eq->udb_qid > PAGE_SIZE / UDBS_SEG_SIZE)
+               if (eq->udb_qid >= PAGE_SIZE / UDBS_SEG_SIZE)
                        clrbit(&eq->doorbells, DOORBELL_WCWR);
                else {
                        udb += eq->udb_qid << UDBS_SEG_SHIFT;   /* seg offset */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to