Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Mar 2016 05:23:46 +0000 (UTC)
From:      Zbigniew Bodek <zbb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r296601 - head/sys/dev/vnic
Message-ID:  <201603100523.u2A5Nk5c016111@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zbb
Date: Thu Mar 10 05:23:46 2016
New Revision: 296601
URL: https://svnweb.freebsd.org/changeset/base/296601

Log:
  Fix "received NULL mbuf" bug in VNIC
  
  Do not modify NIC_QSET_CQ_0_7_HEAD manually, especially
  in non-atomic context.
  It doesn't seem to be necessary to recreate CQ head after
  interrupt clearing too.
  
  Reviewed by:   wma
  Obtained from: Semihalf
  Sponsored by:  Cavium
  Differential Revision: https://reviews.freebsd.org/D5533

Modified:
  head/sys/dev/vnic/nicvf_queues.c

Modified: head/sys/dev/vnic/nicvf_queues.c
==============================================================================
--- head/sys/dev/vnic/nicvf_queues.c	Thu Mar 10 04:21:00 2016	(r296600)
+++ head/sys/dev/vnic/nicvf_queues.c	Thu Mar 10 05:23:46 2016	(r296601)
@@ -889,7 +889,6 @@ nicvf_qs_err_task(void *arg, int pending
 static void
 nicvf_cmp_task(void *arg, int pending)
 {
-	uint64_t cq_head;
 	struct cmp_queue *cq;
 	struct nicvf *nic;
 	int cmp_err;
@@ -899,11 +898,6 @@ nicvf_cmp_task(void *arg, int pending)
 
 	/* Handle CQ descriptors */
 	cmp_err = nicvf_cq_intr_handler(nic, cq->idx);
-	/* Re-enable interrupts */
-	cq_head = nicvf_queue_reg_read(nic, NIC_QSET_CQ_0_7_HEAD, cq->idx);
-	nicvf_clear_intr(nic, NICVF_INTR_CQ, cq->idx);
-	nicvf_queue_reg_write(nic, NIC_QSET_CQ_0_7_HEAD, cq->idx, cq_head);
-
 	if (__predict_false(cmp_err != 0)) {
 		/*
 		 * Schedule another thread here since we did not
@@ -913,6 +907,7 @@ nicvf_cmp_task(void *arg, int pending)
 
 	}
 
+	nicvf_clear_intr(nic, NICVF_INTR_CQ, cq->idx);
 	/* Reenable interrupt (previously disabled in nicvf_intr_handler() */
 	nicvf_enable_intr(nic, NICVF_INTR_CQ, cq->idx);
 



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